Blocks

Get blocks by version

This endpoint allows you to get the transactions in a block and the corresponding block information given a version in the block.

If the block has been pruned, it will return a 410

get/blocks/by_version/{version}

Request

  • Base URL
    aptos-mainnet.nodereal.io/v1/{api_key}/v1 (relative, and the document’s source URL is not known)
  • URL
    aptos-mainnet.nodereal.io/v1/{api_key}/v1/blocks/by_version/{version}
  • Auth
    none declared

Path parameters

versioninteger required

Ledger version to lookup block information for.

Query parameters

with_transactionsboolean

If set to true, include all transactions in the block

If not provided, no transactions will be retrieved

Response

block_heightstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

block_hashstring required
block_timestampstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

first_versionstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

last_versionstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Example response

{
  "block_height": "32425224034",
  "block_timestamp": "32425224034",
  "first_version": "32425224034",
  "last_version": "32425224034",
  "transactions": [
    {
      "type": "pending_transaction",
      "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
      "sequence_number": "32425224034",
      "max_gas_amount": "32425224034",
      "gas_unit_price": "32425224034",
      "expiration_timestamp_secs": "32425224034",
      "payload": {
        "type": "entry_function_payload",
        "function": "0x1::aptos_coin::transfer"
      },
      "signature": {
        "type": "ed25519_signature",
        "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
        "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.