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
Field | Type | Description |
---|---|---|
blockNumberOrHash * | string | Indicate the block height or block hash |
Returns
Field | Type | Description |
---|---|---|
count | number | The number of transactions |
transactions | object<array> | Array of Transaction objects |
transactionHash | string | The hash of the transaction |
transactionIndex | number | The index of the transaction |
blockHash | string | The hash of the block containing the transaction |
blockNumber | number | The height of the block containing the transaction |
blockTimestamp | string | The timestamp of the block in which the transfer |
executionStatus | string | The status of the transaction execution( |
finalitySatus | string | Indicates where the transaction is in the finality lifecycle (
|
type | string | The type of the transaction ( |
version | string | Indicates the version of the transaction |
actualFee | string | Indicates the actual gas fee the transaction paid |
maxFee | number | DECLARE, DEPLOY_ACCOUNT, INVOKE |
senderAddress | string | The 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 | string | The contract address that emitted the event |
keys | array | The event's keys |
data | array | Additional data of the event |
messagesSent | array<object> | Array of Message objects |
executionResources | object | A summary of the consumed execution resources |
bitwiseBuiltinApplications | number | The number of BITWISE builtin instances |
ecOpBuiltinApplications | number | The number of EC_OP builtin instances |
ecdsaBuiltinApplications | number | The number of ECDSA builtin instances |
keccakBuiltinApplications | number | The number of KECCAK builtin instances |
memoryHoles | number | |
pedersenBuiltinApplications | number | The number of Pedersen builtin instances |
poseidonBuiltinApplications | number | The number of Poseidon builtin instances |
rangeCheckBuiltinApplications | number | The number of RANGE_CHECK builtin instances |
steps | number | The number of Cairo builtin instances |
Example Request and Result for getBlockTransactions
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'