Skip to main content

Filecoin JSON-RPC API

Access Filecoin JSON-RPC API methods at http://<HOST>:<PORT>/rpc/v1/filecoin, where:

The default location is http://127.0.0.1:9000/rpc/v1/filecoin.

Filecoin.WalletHas

Indicates whether an address exists in the wallet.

Parameters

String : Filecoin address

Returns

result : Boolean - true if the address exists in the wallet; otherwise false.

curl -X POST --data '{"jsonrpc": "2.0", "method": "Filecoin.WalletHas", "params": ["t1m...fvy"], "id": 1}' http://127.0.0.1:9000/rpc/v1/filecoin

Filecoin.WalletList

Lists all the addresses in the wallet.

Addresses can be based on secp256k1 or BLS12-381 signing keys.

Parameters

None

Returns

result: Array of Filecoin addresses.

curl -X POST --data '{"jsonrpc":"2.0","method":"Filecoin.WalletList","params":[],"id":1}' http://127.0.0.1:9000/rpc/v1/filecoin

Filecoin.WalletSign

Signs the provided data using the private key belonging to the supplied Filecoin address.

Parameters

String : Filecoin address

String : Data to sign

Returns

result: Object containing:

  • Type: Integer identifying the type of key used to sign the data; 1 is secp256k1 and 2 is BLS12-381.
  • Data: Signature.
curl -X POST --data '{"jsonrpc": "2.0", "method": "Filecoin.WalletSign", "params": ["t1m...fvy", "NDI="], "id": 1}' http://127.0.0.1:9000/rpc/v1/filecoin

Filecoin.WalletSignMessage

Signs a message using the private key belonging to the supplied Filecoin address.

Parameters

String : Filecoin address

Object: Unsigned message object

Returns

result: Object containing the sent unsigned Message object, and the Signature object.

curl -X POST --data '{"jsonrpc": "2.0", "method": "Filecoin.WalletSignMessage", "params": ["t1m...fvy", {"Version": 9, "To": "t01234", "From": "t01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ=="}], "id": 1}' http://127.0.0.1:9000/rpc/v1/filecoin

Filecoin.WalletVerify

Indicates whether a signature is valid.

The supplied address does not need to exist in the wallet.

Parameters

String : Filecoin address

String : Unsigned data

Object : Signature object containing:

  • Type: Integer identifying the type of key used to sign the data; 1 is secp256k1 and 2 is BLS12-381.
  • Data: Signature.

Returns

curl -X POST --data '{"jsonrpc": "2.0", "method": "Filecoin.WalletVerify", "params": ["t1m...fvy", "NDI=", {"Type":1,"Data":"5vEDqBPUTQA44p51Qaclwih+b2WVND7gp12yNXFBrtwsZFuwqQYc7A8CZjocrn6NVPjMLpqvJjGxWY2lXb6a3wE="}], "id": 1}' http://127.0.0.1:9000/rpc/v1/filecoin