Message sending

WalletBalance

First, we check to make sure the wallet address that is attempting to send Filecoin has enough Filecoin to send the desired message.

Method: POST

https://fil.nownodes.io/rpc/v1

Example body (raw)

{
    "jsonrpc": "2.0",
    "method": "Filecoin.WalletBalance",
    "id": 1,
    "params": [
        "t1jdlfl73voaiblrvn2yfivvn5ifucwwv5f26nfza"
    ]
}

Example response: 200

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

MpoolGetNonce

Next, we get the address' nonce value.

Method: POST

https://fil.nownodes.io/rpc/v1

Example body (raw)

{
    "jsonrpc": "2.0",
    "method": "Filecoin.MpoolGetNonce",
    "id": 1,
    "params": [
        "t1jdlfl73voaiblrvn2yfivvn5ifucwwv5f26nfza"
    ]
}

Example response: 200

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": 1,
        "message": "resolution lookup failed (f1jdlfl73voaiblrvn2yfivvn5ifucwwv5f26nfza): resolve address f1jdlfl73voaiblrvn2yfivvn5ifucwwv5f26nfza: actor not found"
    }
}

StateCall

Used to estimate the gas used in an upcoming transaction.

Method: POST

https://fil.nownodes.io/rpc/v1

Example body (raw)

{
    "jsonrpc": "2.0",
    "method": "Filecoin.StateCall",
    "id": 1,
    "params": [
        {
            "To": "t1hvuzpfdycc6z6mjgbiyaiojikd6wk2vwy7muuei",
            "From": "t3wsspmzh7rbetvblpe6opqnz2bomubibuygg234xdpnb7eqdokrnhy4yto2cl4x5czezc3mz5xl4gz524vh7a",
            "Nonce": 0,
            "Value": "1000",
            "Method": 0,
            "GasPrice": "1",
            "GasLimit": 1000,
            "Params": []
        },
        null
    ]
}

Example response: 200

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": 1,
        "message": "call raw get actor: resolution lookup failed (f3wsspmzh7rbetvblpe6opqnz2bomubibuygg234xdpnb7eqdokrnhy4yto2cl4x5czezc3mz5xl4gz524vh7a): resolve address f3wsspmzh7rbetvblpe6opqnz2bomubibuygg234xdpnb7eqdokrnhy4yto2cl4x5czezc3mz5xl4gz524vh7a: actor not found"
    }
}

MpoolPush

The method used to send a message to the network for confirmation.

Method: POST

https://fil.nownodes.io/rpc/v1

Example body (raw)

{
    "jsonrpc": "2.0",
    "method": "Filecoin.MpoolPush",
    "id": 1,
    "params": [
        {
            "Message": {
                "Version": 0,
                "To": "t1hvuzpfdycc6z6mjgbiyaiojikd6wk2vwy7muuei",
                "From": "t3vey2tbp7rnwoljm6ra47vwhpmzxt5oebw6htxp3gggjadbj4qqjbvfsjfp5sz62b2znsubnmmnwd62yqlmsq",
                "Nonce": 7,
                "Value": "1000",
                "GasPrice": "000000003",
                "GasLimit": 30000,
                "Method": 0,
                "Params": ""
            },
            "Signature": {
                "Type": 2,
                "Data": "iW5wr5zMQWc+XQKQMv/yuZ1BBQzk7cLj8M4VBAt8aV8FfiyXGo+4FiGGQ3q3hvIJBNOzF3DZjrkeyOSJ3EaF7DSkgbmLHHkeomCEh2H1y8AXBZEiJLWgqkCb45MyHwIx"
            }
        }
    ]
}

Example response: 200

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": 1,
        "message": "message not valid for block inclusion: 'GasFeeCap' cannot be nil"
    }
}

Last updated