starknet_getNonce

Get the nonce associated with the given address in the given block

Parameters

  • BLOCK PARAMETER
Object NameRequiredTypeDetail
BLOCK PARAMETERString"block_hash", "block_number", "latest", "pending"
CONTRACT ADDRESSStringThe address of the contract whose nonce we're seeking.
"params": [
  "latest",
  "0x044e5b3f0471a26bc749ffa1d8dd8e43640e05f1b33cf05cef6adee6f5b1b4cf"
]

Result

The last nonce used for the given contract.

Example

Request

curl <your-endpoint> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '
        {
            "id": 1,
            "jsonrpc": "2.0",
            "method": "starknet_getNonce",
            "params": [
                "latest",
                "0x044e5b3f0471a26bc749ffa1d8dd8e43640e05f1b33cf05cef6adee6f5b1b4cf"
            ]
        }
        '

Return

{
    "jsonrpc": "2.0",
    "result": "0x0",
    "id": 1
}
Language
Click Try It! to start a request and see the response here!