Skip to main content

starknet_getBlockWithTxHashes RPC Method

Return block information, including transaction hashes, for the specified block ID.

Updated on
Mar 18, 2024

starknet_getBlockWithTxHashes 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)

Returns

result
string
The result object which can be one of the following object:
BLOCK_WITH_TX_HASHES
object
The block with transaction hashes object which have the following fields
status
string
The block status, which can be one of - 'PENDING', 'ACCEPTED_ON_L2', 'ACCEPTED_ON_L1', 'REJECTED'
block_hash
string
The block hash
parent_hash
string
The parent block hash
block_number
integer
The block number (its height)
new_root
string
The new global state root
timestamp
integer
The time in which the block was created, encoded in Unix time
sequencer_address
string
The StarkNet identity of the sequencer submitting this block
l1_gas_price
object
The price of l1 gas in the block
price_in_fri
string
The price of one unit of the given resource, denominated in fri (10^-18 strk)
price_in_wei
string
The price of one unit of the given resource, denominated in wei
l1_data_gas_price
object
The price of l1 data gas in the block. However, if the status field is marked as PENDING, this field will not be present
price_in_fri
string
The price of one unit of the given resource, denominated in fri (10^-18 strk)
price_in_wei
string
The price of one unit of the given resource, denominated in wei
l1_da_mode
string
It specifies whether the data of this block is published via blob data or calldata. It can be one of - 'BLOB' or 'CALLDATA'. This field will not be present if the status of the block is posted to L1
starknet_version
string
The semver of the current Starknet protocol
transactions
array
The hashes of the transactions included in this block
PENDING_BLOCK_WITH_TX_HASHES
object
The pending block with transaction hashes object which have the following fields. Note that this object will be deprecated upon decentralization
transactions
array
The hashes of the transactions included in this block
parent_hash
string
The parent block hash
timestamp
integer
The time in which the block was created, encoded in Unix time
sequencer_address
string
The StarkNet identity of the sequencer submitting this block
l1_gas_price
object
The price of l1 gas in the block
price_in_fri
string
The price of one unit of the given resource, denominated in fri (10^-18 strk)
price_in_wei
string
The price of one unit of the given resource, denominated in wei
l1_data_gas_price
object
The price of l1 data gas in the block
price_in_fri
string
The price of one unit of the given resource, denominated in fri (10^-18 strk)
price_in_wei
string
The price of one unit of the given resource, denominated in wei
l1_da_mode
string
It specifies whether the data of this block is published via blob data or calldata. It can be one of - 'BLOB' or 'CALLDATA'
starknet_version
string
The semver of the current Starknet protocol
status
string
The block status, which can be one of - 'PENDING', 'ACCEPTED_ON_L2', 'ACCEPTED_ON_L1', 'REJECTED'
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_getBlockWithTxHashes",
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