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 — State, Wallet (1/3)

API reference for Filecoin. All methods ->

Part 1 of 3: 1 · 2 · 3

Filecoin.StateCompute

Applies the given messages on the given tipset.

The messages are run as though the VM were at the provided height.

When called, StateCompute will:

  • Load the provided tipset, or use the current chain head if not provided
  • Compute the tipset state of the provided tipset on top of the parent state
    • (note that this step runs before vmheight is applied to the execution)
    • Execute state upgrade if any were scheduled at the epoch, or in null blocks preceding the tipset
    • Call the cron actor on null blocks preceding the tipset
    • For each block in the tipset
      • Apply messages in blocks in the specified
      • Award block reward by calling the reward actor
    • Call the cron actor for the current epoch
  • If the specified vmheight is higher than the current epoch, apply any needed state upgrades to the state
  • Apply the specified messages to the state

The vmheight parameter sets VM execution epoch, and can be used to simulate message execution in different network versions. If the specified vmheight epoch is higher than the epoch of the specified tipset, any state upgrades until the vmheight will be executed on the state before applying messages specified by the user.

Note that the initial tipset state computation is not affected by the vmheight parameter — only the messages in the apply set are

If the caller wants to simply compute the state, vmheight should be set to the epoch of the specified tipset.

Messages in the apply parameter must have the correct nonces, and gas values set.

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.StateCompute",
"params": [
10101,
[
{
"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": {
"Root": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Trace": [
{
"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.StateDealProviderCollateralBounds

Returns the min and max collateral a storage provider can issue.

It takes the deal size and verified status as parameters.

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

Response example

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

Filecoin.StateDecodeParams

Attempts to decode the provided params, based on the recipient actor address and method number.

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

Response example

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

Filecoin.StateGetActor

Returns the indicated actor’s nonce and balance.

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

Response example

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

Filecoin.StateGetReceipt

Returns the message receipt for the given message or for a matching gas-repriced replacing message.

tip

If the requested message was replaced, this method will return the receipt for the replacing message — if the caller needs the receipt for exactly the requested message, use StateSearchMsg().Receipt, and check that MsgLookup.Message is matching the requested CID.

warning

DEPRECATED: Use StateSearchMsg, this method won’t be supported in v1 API

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

Response example

{
"jsonrpc": "2.0",
"result": {
"ExitCode": 0,
"Return": "Ynl0ZSBhcnJheQ==",
"GasUsed": 9
},
"id": 1
}

Filecoin.StateListActors

Returns the addresses of every actor in the state.

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

Response example

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

Filecoin.StateListMessages

Looks back and returns all messages with a matching to or from address, stopping at the given height.

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

Response example

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

Filecoin.StateListMiners

Returns the addresses of every miner that has claimed power in the Power Actor.

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

Response example

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

Filecoin.StateLookupID

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

Response example

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

Filecoin.StateMarketBalance

Looks up the Escrow and Locked balances of the given address in the Storage Market.

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

Response example

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

Filecoin.StateMarketDeals

Returns information about every deal in the Storage Market.

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

Response example

{
"jsonrpc": "2.0",
"result": {
"t026363": {
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "string value",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"State": {
"SectorStartEpoch": 10101,
"LastUpdatedEpoch": 10101,
"SlashEpoch": 10101
}
}
},
"id": 1
}

Filecoin.StateMarketParticipants

Returns the Escrow and Locked balances of every participant in the Storage Market.

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

Response example

{
"jsonrpc": "2.0",
"result": {
"t026363": {
"Escrow": "0",
"Locked": "0"
}
},
"id": 1
}

Filecoin.StateMarketStorageDeal

Returns information about the indicated deal.

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

Response example

{
"jsonrpc": "2.0",
"result": {
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "string value",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"State": {
"SectorStartEpoch": 10101,
"LastUpdatedEpoch": 10101,
"SlashEpoch": 10101
}
},
"id": 1
}