Filecoin — State, Wallet (3/3)
API reference for Filecoin. All methods ->
Filecoin.StateSearchMsg
Searches for a message in the chain, and returns its receipt and the tipset where it was executed.
NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message — the MsgLookup.Message will be a different CID than the one provided in the ‘cid’ param, MsgLookup.Receipt will contain the result of the execution of the replacing message.
If the caller wants to ensure that exactly the requested message was executed, they MUST check that MsgLookup.Message is equal to the provided ‘cid’. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend.
A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.)
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateSearchMsg",
"params": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"Message": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Receipt": {
"ExitCode": 0,
"Return": "Ynl0ZSBhcnJheQ==",
"GasUsed": 9
},
"ReturnDec": {},
"TipSet": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
],
"Height": 10101
},
"id": 1
}
Filecoin.StateSearchMsgLimited
Looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed.
NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message — the MsgLookup.Message will be a different CID than the one provided in the ‘cid’ param, MsgLookup.Receipt will contain the result of the execution of the replacing message.
If the caller wants to ensure that exactly the requested message was executed, they MUST check that MsgLookup.Message is equal to the provided ‘cid’. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend.
A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.)
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateSearchMsgLimited",
"params": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
10101
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"Message": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Receipt": {
"ExitCode": 0,
"Return": "Ynl0ZSBhcnJheQ==",
"GasUsed": 9
},
"ReturnDec": {},
"TipSet": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
],
"Height": 10101
},
"id": 1
}
Filecoin.StateSectorExpiration
Returns epoch at which given sector will expire
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateSectorExpiration",
"params": [
"f01234",
9,
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"OnTime": 10101,
"Early": 10101
},
"id": 1
}
Filecoin.StateSectorGetInfo
Returns the on-chain info for the specified miner’s sector.
Returns null in case the sector info isn’t found.
NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate expiration epoch.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateSectorGetInfo",
"params": [
"f01234",
9,
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"SectorNumber": 9,
"SealProof": 8,
"SealedCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"DealIDs": [
5432
],
"Activation": 10101,
"Expiration": 10101,
"DealWeight": "0",
"VerifiedDealWeight": "0",
"InitialPledge": "0",
"ExpectedDayReward": "0",
"ExpectedStoragePledge": "0",
"SectorKeyCID": null
},
"id": 1
}
Filecoin.StateSectorPartition
Finds deadline/partition with the specified sector.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateSectorPartition",
"params": [
"f01234",
9,
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"Deadline": 42,
"Partition": 42
},
"id": 1
}
Filecoin.StateSectorPreCommitInfo
Returns the PreCommit info for the specified miner’s sector.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateSectorPreCommitInfo",
"params": [
"f01234",
9,
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"Info": {
"SealProof": 8,
"SectorNumber": 9,
"SealedCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"SealRandEpoch": 10101,
"DealIDs": [
5432
],
"Expiration": 10101,
"ReplaceCapacity": true,
"ReplaceSectorDeadline": 42,
"ReplaceSectorPartition": 42,
"ReplaceSectorNumber": 9
},
"PreCommitDeposit": "0",
"PreCommitEpoch": 10101,
"DealWeight": "0",
"VerifiedDealWeight": "0"
},
"id": 1
}
Filecoin.StateVMCirculatingSupplyInternal
Returns an approximation of the circulating supply of Filecoin at the given tipset.
This is the value reported by the runtime interface to actors code.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateVMCirculatingSupplyInternal",
"params": [
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"FilVested": "0",
"FilMined": "0",
"FilBurnt": "0",
"FilLocked": "0",
"FilCirculating": "0",
"FilReserveDisbursed": "0"
},
"id": 1
}
Filecoin.StateVerifiedClientStatus
Returns the data cap for the given address.
Returns nil if there is no entry in the data cap table for the address.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateVerifiedClientStatus",
"params": [
"f01234",
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": "0",
"id": 1
}
Filecoin.StateVerifiedRegistryRootKey
Returns the address of the Verified Registry’s root key.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateVerifiedRegistryRootKey",
"params": [
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": "f01234",
"id": 1
}
Filecoin.StateVerifierStatus
Returns the data cap for the given address.
Returns nil if there is no entry in the data cap table for the address.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateVerifierStatus",
"params": [
"f01234",
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": "0",
"id": 1
}
Filecoin.StateWaitMsg
Looks back in the chain for a message.
If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth.
NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message — the MsgLookup.Message will be a different CID than the one provided in the ‘cid’ param, MsgLookup.Receipt will contain the result of the execution of the replacing message.
If the caller wants to ensure that exactly the requested message was executed, they MUST check that MsgLookup.Message is equal to the provided ‘cid’. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend.
A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.)
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateWaitMsg",
"params": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
42
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"Message": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Receipt": {
"ExitCode": 0,
"Return": "Ynl0ZSBhcnJheQ==",
"GasUsed": 9
},
"ReturnDec": {},
"TipSet": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
],
"Height": 10101
},
"id": 1
}
Filecoin.StateWaitMsgLimited
Looks back up to limit epochs in the chain for a message.
If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth.
NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message — the MsgLookup.Message will be a different CID than the one provided in the ‘cid’ param, MsgLookup.Receipt will contain the result of the execution of the replacing message.
If the caller wants to ensure that exactly the requested message was executed, they MUST check that MsgLookup.Message is equal to the provided ‘cid’. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend.
A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.)
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateWaitMsgLimited",
"params": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
42,
10101
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"Message": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Receipt": {
"ExitCode": 0,
"Return": "Ynl0ZSBhcnJheQ==",
"GasUsed": 9
},
"ReturnDec": {},
"TipSet": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
],
"Height": 10101
},
"id": 1
}
Wallet
The Wallet methods are used for wallet operations.
Filecoin.WalletBalance
Returns the balance of the given address at the current head of the chain.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.WalletBalance",
"params": [
"f01234"
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": "0",
"id": 1
}
Filecoin.WalletValidateAddress
Validates whether a given string can be decoded as a well-formed address.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.WalletValidateAddress",
"params": [
"string value"
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": "f01234",
"id": 1
}
Filecoin.WalletVerify
Takes an address, a signature, and some bytes, and indicates whether the signature is valid.
The address does not have to be in the wallet.
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.WalletVerify",
"params": [
"f01234",
"Ynl0ZSBhcnJheQ==",
{
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": true,
"id": 1
}