Skip to main content

starknet_getStateUpdate RPC Method

Get the information about the result of executing the requested block.

Updated on
Mar 18, 2024

starknet_getStateUpdate RPC Method

Parameters

block_id
string
REQUIRED
The hash of the requested block, or number (height) of the requested block, or a block tag(latest or pending)

Returns

result
string
The information about the state update of the requested block. It contains one of the following objects:
STATE_UPDATE
object
The state update object which contains the following fields:
block_hash
string
The block hash
old_root
string
The previous global state root
new_root
string
The new global state root
state_diff
object
The state diff object which contains the following objects:
storage_entries
array
The previous global state root
key
string
The key value
value
string
The value
deprecated_declared_classes
array
The hash of the declared class
class_hash
string
The hash of the contract code
address
string
The address of the contract
declared_classes
array
The declared class hash and compiled class hash
class_hash
string
The hash of the declared class
compiled_class_hash
string
The Cairo assembly hash corresponding to the declared class
deployed_contracts
array
The contract deployed as part of the state update
class_hash
string
The hash of the contract code
address
string
The address of the contract
replaced_classes
array
The list of contracts whose class was replaced
class_hash
string
The new class hash
contract_address
string
The address of the contract whose class was replaced
nonces
array
The updated nonce per contract address
nonce
string
The nonce for the given address at the end of the block
contract_address
string
The address of the contract
PENDING_STATE_UPDATE
object
The pending state update object which contains the following fields:
old_root
string
The previous global state root
state_diff
object
The state diff object which contains the following objects:
storage_entries
array
The previous global state root
key
string
The key value
value
string
The value
deprecated_declared_classes
array
The hash of the declared class
class_hash
string
The hash of the contract code
address
string
The address of the contract
declared_classes
array
The declared class hash and compiled class hash
class_hash
string
The hash of the declared class
compiled_class_hash
string
The Cairo assembly hash corresponding to the declared class
deployed_contracts
array
The contract deployed as part of the state update
class_hash
string
The hash of the contract code
address
string
The address of the contract
replaced_classes
array
The list of contracts whose class was replaced
class_hash
string
The new class hash
contract_address
string
The address of the contract whose class was replaced
nonces
array
The updated nonce per contract address
nonce
string
The nonce for the given address at the end of the block
contract_address
string
The address of the contract
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_getStateUpdate",
8
"params": [
9
"latest"
10
]
11
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free