For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Filecoin — Chain, Client, Gas, Mpool, State (2/2)

API reference for Filecoin. All methods ->

Part 2 of 2: 1 · 2

Filecoin.ChainStatObj​

Returns statistics about the graph referenced by ‘obj’.

If ‘base’ is also specified, then the returned stat will be a diff between the two objects.

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.ChainStatObj",
"params": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"Size": 42,
"Links": 42
},
"id": 1
}

Filecoin.ChainTipSetWeight​

Computes weight for the specified tipset.

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.ChainTipSetWeight",
"params": [
[
{
"/": "bafy2bzacea5dwduzwi4n4wjvdw4s4dsablhnqp3kujrmgqgxnxwz3m4gght4s"
},
{
"/": "bafy2bzaceci4q5qljz5rzglddqrtipyrv6i72zbecv5xzpqy43ptreqyj3s3e"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": "63667007179",
"id": 1
}

Client​

The Client methods all have to do with interacting with the storage and retrieval markets as a client.

Filecoin.ClientQueryAsk​

Returns a signed StorageAsk from the specified miner.

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.ClientQueryAsk",
"params": [
"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"f01234"
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"Price": "0",
"VerifiedPrice": "0",
"MinPieceSize": 1032,
"MaxPieceSize": 1032,
"Miner": "f01234",
"Timestamp": 10101,
"Expiry": 10101,
"SeqNo": 42
},
"id": 1
}

Gas​

The Gas methods are used for gas estimation.

Filecoin.GasEstimateFeeCap​

Estimates gas fee cap.

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.GasEstimateFeeCap",
"params": [
{
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 0,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": "bafy2bzaceatjqvmrqlta7gouetgltx3ezw23xyh2ahy2h5zqvhcleo6rttmqw"
},
9,
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": "1269908302",
"id": 1
}

Filecoin.GasEstimateGasLimit​

Estimates gas used by the message and returns it.

It fails if message fails to execute.

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.GasEstimateGasLimit",
"params": [
{
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 0,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": "bafy2bzacediy5wtkxs46shn7d56hyzn6zl4mepfm3j4u25xtun5742u6de6h6"
},
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": "2392839",
"id": 1
}

Filecoin.GasEstimateGasPremium​

Estimates what gas price should be used for a message to have high likelihood of inclusion in nblocksincl epochs.

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.GasEstimateGasPremium",
"params": [
42,
"f01234",
9,
[
{
"/": "bafy2bzaceb5c256p6xkn4eaksxgmu3cszzeimrcs6643qwlxrwcnpehhzzdyo"
},
{
"/": "bafy2bzacebpan6qb7k2xgjdyp2fcnirwdc2xmvzh7em6ntvsxqa5l7ejpfw64"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": "3352604",
"id": 1
}

Filecoin.GasEstimateMessageGas​

Estimates gas values for unset message gas fields.

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.GasEstimateMessageGas",
"params": [
{
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzaceaele6zvcnuvzkwxvespae7qozzcs6brtgnvywnxqkxq2z67cgmyg"
}
},
{
"MaxFee": "0"
},
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "3023506976",
"GasPremium": "3352018",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacedxnoclckkyz3nrnf7xe2pnaojvtr4hzpdagbfxkkfr5o5ry5x57y"
}
},
"id": 1
}

Mpool​

The Mpool methods are used for interacting with the message pool. The message pool manages all incoming and outgoing ‘messages’ going over the network.

Filecoin.MpoolGetNonce​

Gets next nonce for the specified sender.

Note that this method may not be atomic. Use MpoolPushMessage instead.

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.MpoolGetNonce",
"params": [
"f01234"
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": 42,
"id": 1
}

Filecoin.MpoolPending​

Returns pending mempool messages.

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.MpoolPending",
"params": [
[
{
"/": "bafy2bzacect7cxrcmvbvbwwe2gxbjd4kwb5f4kmk34yecq5lzqzuntb3xlxve"
},
{
"/": "bafy2bzaceb7upir45mhrpwljphikxkg257pxat5e6mztrt4ywd6rkv5byd2vg"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": [
{
"Message": {
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
},
"Signature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
},
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
}
],
"id": 1
}

Filecoin.MpoolPush​

Pushes a signed message to mempool.

Permission: write

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.MpoolPush",
"params": [
{
"Message": {
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzaceclufzjmo6tm2h6v3zykdl7cabgynfbbdwsrmcwn5ef77qjbar5jg"
}
},
"Signature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
},
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
}
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"id": 1
}

Filecoin.MpoolSub​

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.MpoolSub",
"params": [],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"Type": 0,
"Message": {
"Message": {
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
},
"Signature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
},
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
}
},
"id": 1
}

State​

The State methods are used to query, inspect, and interact with chain state. Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset.

A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used.

Filecoin.StateAccountKey​

Returns the public key address of the given ID 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.StateAccountKey",
"params": [
"f01234",
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": "f01234",
"id": 1
}

Filecoin.StateAllMinerFaults​

Returns all non-expired Faults that occur within lookback epochs of the given tipset.

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.StateAllMinerFaults",
"params": [
10101,
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": [
{
"Miner": "f01234",
"Epoch": 10101
}
],
"id": 1
}

Filecoin.StateCall​

Runs the given message and returns its result without any persisted changes.

StateCall applies the message to the tipset’s parent state. The message is not applied on-top-of the messages in the passed-in tipset.

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.StateCall",
"params": [
{
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
},
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"MsgCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Msg": {
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
},
"MsgRct": {
"ExitCode": 0,
"Return": "Ynl0ZSBhcnJheQ==",
"GasUsed": 9
},
"GasCost": {
"Message": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"GasUsed": "0",
"BaseFeeBurn": "0",
"OverEstimationBurn": "0",
"MinerPenalty": "0",
"MinerTip": "0",
"Refund": "0",
"TotalCost": "0"
},
"ExecutionTrace": {
"Msg": {
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
},
"MsgRct": {
"ExitCode": 0,
"Return": "Ynl0ZSBhcnJheQ==",
"GasUsed": 9
},
"Error": "string value",
"Duration": 60000000000,
"GasCharges": [
{
"Name": "string value",
"loc": [
{
"File": "string value",
"Line": 123,
"Function": "string value"
}
],
"tg": 9,
"cg": 9,
"sg": 9,
"vtg": 9,
"vcg": 9,
"vsg": 9,
"tt": 60000000000,
"ex": {}
}
],
"Subcalls": [
{
"Msg": {
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
},
"MsgRct": {
"ExitCode": 0,
"Return": "Ynl0ZSBhcnJheQ==",
"GasUsed": 9
},
"Error": "string value",
"Duration": 60000000000,
"GasCharges": [
{
"Name": "string value",
"loc": [
{
"File": "string value",
"Line": 123,
"Function": "string value"
}
],
"tg": 9,
"cg": 9,
"sg": 9,
"vtg": 9,
"vcg": 9,
"vsg": 9,
"tt": 60000000000,
"ex": {}
}
],
"Subcalls": null
}
]
},
"Error": "string value",
"Duration": 60000000000
},
"id": 1
}

Filecoin.StateChangedActors​

Returns all the actors whose states change between the two given state CIDs.

Permission: read

Response example​

curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.StateChangedActors",
"params": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"t01236": {
"Code": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Head": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Nonce": 42,
"Balance": "0"
}
},
"id": 1
}

Filecoin.StateCirculatingSupply​

Returns the exact circulating supply of Filecoin at the given tipset.

This is not used anywhere in the protocol itself, and is only for external consumption.

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.StateCirculatingSupply",
"params": [
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
}
]
],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"result": "0",
"id": 1
}