getTransactions

Get all transactions in a given block range

The getTransactions method provides developers with a powerful tool to efficiently access and retrieve the count and detailed information about transactions within the specified range. The response items are thoughtfully sorted in descending order according to their block numbers and transaction index for your convenience.

How to use getTransactions method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getTransactions Builder API method effectively using Blast.

Parameters

Below, you can find the query parameters accepted by the method.

FieldTypeDescription

fromBlock

string

Starting block for the query

toBlock

string

Ending block for the query

contractAddress

string

The address of the contract

pageSize

number

Number of records to be retrieved on one page

pageKey

string

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

Returns

Discover an insightful explanation of the returned parameters here, offering a deep understanding of their significance and implications.

FieldTypeDescription

count

number

Number of records returned in the current page

nextPageKey

string

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

transaction

array<object>

Array of Transaction objects

Example Request and Result for getTransactions

Explore an example of a request made using the getTransactions method, allowing you to retrieve all transactions within the specified range fromBlock to toBlock that match the specified contractAddress. The response provides a comprehensive overview of the transactions, including block details, events,messages, gas-related data, and more. This example showcases the powerful capabilities of the getTransactions method for accessing and analyzing transaction details within your specified criteria.

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 https://starknet-mainnet.blastapi.io/<project-id>/builder/getTransactions?

Query Parameters

NameTypeDescription

fromBlock

String

284739

toBlock

String

313696

contractAddress

String

0x05c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2

{
  "count": 2,
  "transactions": [
    {
      "transactionHash": "0x059d334c093f54552086a902ec50667a67fa2007a13fd4c072f65d6ff92ad16f",
      "transactionIndex": 52,
      "blockHash": "0x03802986e3525f2465b5f3317441d876f704855846a7be202dd319cf14a4e647",
      "blockNumber": 313696,
      "blockTimestamp": "2023-10-11T13:02:03.000Z",
      "executionStatus": "SUCCEEDED",
      "finalityStatus": "ACCEPTED_ON_L1",
      "type": "INVOKE",
      "version": 1,
      "actualFee": "145512683850352",
      "maxFee": "217709288047152",
      "senderAddress": "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
      "signature": [
        "0x6ac7372aaf87ccae5f3c6a0cc80fcbb9e75a6f40905ab53e58ad7c920e0fc4d",
        "0x71fa99562c1cd917acfff68a6dbde3a6ea659f0f78236dfab391234330b2860"
      ],
      "nonce": 1,
      "calldata": [
        "0x1",
        "0x7c70ffb1cb97ed5bb2d7b87c18a79032ac75f3848f885b3882b4c2832ca0c4b",
        "0x2dc76685007a5fdefad28a9f02290695fc71147336168018752f5f9b3cff6ea",
        "0x5",
        "0xb7e7f9b2284453453d027b4c448e51b475c8fb8d",
        "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
        "0x8",
        "0x2b1d269316ef043f06aee5521538c633bd5e12c91f68bb9b375ccd1947c7bdb",
        "0x6456a51b03502e209a5450ec55f84d17348b06edd99d5b58575c38c0a212667"
      ],
      "events": [
        {
          "fromAddress": "0x04cc93a15b246e727b762fca79cdeb84e7508939090425b27eb988374e2edec3",
          "keys": [
            "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9",
            "0x7c70ffb1cb97ed5bb2d7b87c18a79032ac75f3848f885b3882b4c2832ca0c4b",
            "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
            "0x1451",
            "0x0"
          ],
          "data": []
        },
        {
          "fromAddress": "0x07c70ffb1cb97ed5bb2d7b87c18a79032ac75f3848f885b3882b4c2832ca0c4b",
          "keys": [
            "0x35cc0235f835cc84da50813dc84eb10a75e24a21d74d6d86278c0f037cb7429",
            "0xb7e7f9b2284453453d027b4c448e51b475c8fb8d",
            "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2"
          ],
          "data": [
            "0x8",
            "0x1451",
            "0x0"
          ]
        },
        {
          "fromAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
          "keys": [
            "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
          ],
          "data": [
            "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
            "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
            "0x8457cfd4ca70",
            "0x0"
          ]
        }
      ],
      "messagesSent": [],
      "executionResources": {
        "steps": 4314,
        "memory_holes": 262,
        "ec_op_builtin_applications": 3,
        "ecdsa_builtin_applications": 0,
        "keccak_builtin_applications": 0,
        "bitwise_builtin_applications": 0,
        "pedersen_builtin_applications": 27,
        "poseidon_builtin_applications": 0,
        "range_check_builtin_applications": 135
      }
    },
    {
      "transactionHash": "0x0139393b5aaf001c46b0c74e25924e2220b268e69daf76cf2fe2b8feee8aeb9b",
      "transactionIndex": 78,
      "blockHash": "0x07baa9f8a50a94b7b38257a6e911308fbe69c7467ca4e32545f93a2ae8991a5c",
      "blockNumber": 284739,
      "blockTimestamp": "2023-10-02T21:33:57.000Z",
      "executionStatus": "SUCCEEDED",
      "finalityStatus": "ACCEPTED_ON_L1",
      "type": "INVOKE",
      "version": 1,
      "actualFee": "145636343834718",
      "maxFee": "218896565819382",
      "senderAddress": "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
      "signature": [
        "0x5fd25fc8e5350da751bafa3c09502af5fd5876224270b83cb1368b172ff10a0",
        "0x5d1fa7f766cb6d0b40479f6f4d653468acdc06347e93a958c4cc95aba19f17f"
      ],
      "nonce": 0,
      "calldata": [
        "0x1",
        "0x77c8566f0cd5c99b9d4b0443ff2ad595ad842c90e598f76dcb58e6509ec858d",
        "0x37e8cae6946ecb25fd00d9df897c4f27e43c4667b534e8b54f3d27f37c71c80",
        "0x6",
        "0xb7e7f9b2284453453d027b4c448e51b475c8fb8d",
        "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
        "0xf9ccd8a1c5080000",
        "0x0",
        "0x272c330a75874ace87b91c1b0a13b35ab5013731ed3020c3d43dd33301c46b2",
        "0x4fedcf2b6db35ae6816fcec3acba1ae545a9f98b623b18611605938585195e6"
      ],
      "events": [
        {
          "fromAddress": "0x077c8566f0cd5c99b9d4b0443ff2ad595ad842c90e598f76dcb58e6509ec858d",
          "keys": [
            "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
          ],
          "data": [
            "0x0",
            "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
            "0xf9ccd8a1c5080000",
            "0x0"
          ]
        },
        {
          "fromAddress": "0x077c8566f0cd5c99b9d4b0443ff2ad595ad842c90e598f76dcb58e6509ec858d",
          "keys": [
            "0x3fb7926d81fdd796588df95e47590b4d9b2604ee11994401f1ad88e39cb95cb"
          ],
          "data": [
            "0xb7e7f9b2284453453d027b4c448e51b475c8fb8d",
            "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
            "0xf9ccd8a1c5080000",
            "0x0"
          ]
        },
        {
          "fromAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
          "keys": [
            "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
          ],
          "data": [
            "0x5c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2",
            "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
            "0x84749a8a685e",
            "0x0"
          ]
        }
      ],
      "messagesSent": [],
      "executionResources": {
        "steps": 2923,
        "memory_holes": 118,
        "ec_op_builtin_applications": 3,
        "ecdsa_builtin_applications": 0,
        "keccak_builtin_applications": 0,
        "bitwise_builtin_applications": 0,
        "pedersen_builtin_applications": 10,
        "poseidon_builtin_applications": 0,
        "range_check_builtin_applications": 65
      }
    }
  ]
}

Curl request example

curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getTransactions?fromBlock=284739&toBlock=313696&contractAddress=0x05c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2 -H 'Content-Type: application/json'

Last updated