curl --request POST \
--url https://starknet-mainnet.core.chainstack.com/365cf697a3ad6d950b4c4a911e2e4f4d \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "starknet_getNonce",
"params": [
{
"block_number": 385940
},
"0x0569b13e8164bc8000c0bbcf4887856516643af123c5bc3b01e229e92f9cfd10"
]
}'
starknet_getNonce
curl --request POST \
--url https://starknet-mainnet.core.chainstack.com/365cf697a3ad6d950b4c4a911e2e4f4d \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "starknet_getNonce",
"params": [
{
"block_number": 385940
},
"0x0569b13e8164bc8000c0bbcf4887856516643af123c5bc3b01e229e92f9cfd10"
]
}'
address
— the string of the address of the account.result
— the nonce of the account, represented as a hexadecimal string.starknet_getNonce
is to retrieve the nonce for an account before sending a transaction. The nonce is an important factor in transactions, as it determines the order in which the network processes transactions from a given account. For example, if an account has a nonce of 10, the next transaction sent from that account should include a nonce of 11 to ensure that it is processed after all previous transactions.
curl 'https://alpha-mainnet.starknet.io/feeder_gateway/get_nonce?contractAddress=0x0569b13e8164bc8000c0bbcf4887856516643af123c5bc3b01e229e92f9cfd10'
Successful response