Skip to main content

getBlockTransactions

Easily retrieve a complete list of transactions within a block and access comprehensive transaction details by simply specifying either the block height or block hash as a query parameter. This allows you to explore the contents of all transactions , providing valuable insights into the blockchain's transaction history. This versatile API offers pagination for seamless data retrieval, and it ensures that response items are ordered by their transactionIndex.

How to use getBlockTransactions method ?

Below, you'll find an extensive guide on effectively leveraging the capabilities of the getBlockTransactions method.

Parameters

FieldTypeDescription

blockNumberOrHash *

stringIndicate the block height or block hash

Returns

FieldTypeDescription
count numberThe number of transactions
transactions object<array>Array of Transaction objects
transactionHashstringThe hash of the transaction
transactionIndexnumberThe index of the transaction
blockHash stringThe hash of the block containing the transaction
blockNumber numberThe height of the block containing the transaction
blockTimestamp stringThe timestamp of the block in which the transfer
executionStatus string

The status of the transaction execution(SUCCEEDED, REVERTED)

finalitySatus string

Indicates where the transaction is in the finality lifecycle ( ACCEPTED_ON_L2, ACCEPTED_ON_L1)

type string

The type of the transaction (DECLARE, DEPLOY, DEPLOY_ACCOUNT, INVOKE, L1_HANDLER)

version stringIndicates the version of the transaction
actualFee stringIndicates the actual gas fee the transaction paid
maxFee numberDECLARE, DEPLOY_ACCOUNT, INVOKE
senderAddress stringThe address executing the transaction (DECLARE, INVOKE_v1)
signature array<string>The address executing the transaction (DECLARE, INVOKE_v1)
nonce number

The number of transactions sent from the sender address(DECLARE_v1_v2, DEPLOY_ACCOUNT, INVOKE_v1, L1_HANDLER)

calldata array<string>INVOKE, L1_HANDLER
events array<object>Array of Events objects
fromAddress stringThe contract address that emitted the event
keys arrayThe event's keys
data arrayAdditional data of the event
messagesSent array<object>Array of Message objects
executionResources object A summary of the consumed execution resources
bitwiseBuiltinApplicationsnumberThe number of BITWISE builtin instances
ecOpBuiltinApplicationsnumberThe number of EC_OP builtin instances
ecdsaBuiltinApplicationsnumberThe number of ECDSA builtin instances
keccakBuiltinApplicationsnumberThe number of KECCAK builtin instances
memoryHolesnumber
pedersenBuiltinApplicationsnumberThe number of Pedersen builtin instances
poseidonBuiltinApplicationsnumberThe number of Poseidon builtin instances
rangeCheckBuiltinApplicationsnumberThe number of RANGE_CHECK builtin instances
stepsnumber The number of Cairo builtin instances

Example Request and Result for getBlockTransactions

info

The example in this section uses a non-existing project id.

Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Curl request example

curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getBlockTransactions?blockNumberOrHash=501652 -H 'Content-Type: application/json'