Skip to main content

starknet_getNonce RPC Method

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

Updated on
Mar 18, 2024

starknet_getNonce RPC Method

Parameters

block_id
string
REQUIRED
The hash of the requested block, the block number (height) of the requested block, or a block tag (latest or pending)
contract_address
string
REQUIRED
The address of the contract whose nonce we're seeking

Returns

result
string
The contract's nonce at the requested state
Request
1
curl --location 'https://docs-demo.strk-mainnet.quiknode.pro/' \
2
--header 'accept: application/json' \
3
--header 'content-type: application/json' \
4
--data '{
5
"id": 1,
6
"jsonrpc": "2.0",
7
"method": "starknet_getNonce",
8
"params": [
9
"latest",
10
"0x010884171baf1914edc28d7afb619b40a4051cfae78a094a55d230f19e944a28"
11
]
12
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free