getBlockTransactions

Get the contents of all transactions in a block.

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 *

string

Indicate the block height or block hash

Returns

FieldTypeDescription

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(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

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!

Get the contents of all transactions in a block.

GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getBlockTransactions?

Query Parameters

NameTypeDescription

blockNumberOrHash=*

String

501652

{
"count":118
"transactions":[
[
0:{
"transactionHash":"0x07a4aaf34b5a57656713327046c8416062e22a6f6fed854a…"
"transactionIndex":0
"blockHash":"0x05623571ff137d26b2dd9fd925f4e02cd88ec26bd45ac4e6…"
"blockNumber":501652
"blockTimestamp":"2024-01-10T12:21:47.000Z"
"executionStatus":"SUCCEEDED"
"finalityStatus":"ACCEPTED_ON_L2"
"type":"INVOKE"
"version":1
"actualFee":"42230901717312"
"maxFee":"94602797709231"
"senderAddress":"0x191815cd356ed71074ccbd32cd9657a0ed348254203174ac…"
"signature":[]
"nonce":41
"calldata":[]
"events":[]
"messagesSent":[]
"executionResources":{}
}
1:{
"transactionHash":"0x07fc6e396b92d736f2ac50c228bdb8d4e0af2d0295310724…"
"transactionIndex":1
"blockHash":"0x05623571ff137d26b2dd9fd925f4e02cd88ec26bd45ac4e6…"
"blockNumber":501652
"blockTimestamp":"2024-01-10T12:21:47.000Z"
"executionStatus":"SUCCEEDED"
"finalityStatus":"ACCEPTED_ON_L2"
"type":"INVOKE"
"version":1
"actualFee":"315344068951296"
"maxFee":"591000000000000"
"senderAddress":"0x62a4cc01f08f7d8b43b17919d1270030576c2e6cc898a3b5…"
"signature":[]
"nonce":59
"calldata":[]
"events":[]
"messagesSent":[]
"executionResources":{}
}
...

Curl request example

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

Last updated