---
title: "Get blocks by version"
method: GET
path: "/blocks/by_version/{version}"
tags: ["Blocks"]
---

# Get blocks by version

`GET /blocks/by_version/{version}`

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

Transactions are limited by max default transactions size.  If not all transactions
are present, the user will need to query for the rest of the transactions via the
get transactions API.

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

## Path parameters

- `version` integer, required

## Query parameters

- `with_transactions` boolean

## Response `200`

- Block — A Block with or without transactions This contains the information about a transactions along with associated transactions if requested
  - `block_height` string, 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_hash` string, required
  - `block_timestamp` string, 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_version` string, 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_version` string, 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.
  - `transactions` Transaction[] — The transactions in the block in sequential order
    - union — Enum of the different types of transactions in Aptos
      - object — A transaction waiting in mempool
        - `type` string, required
        - `hash` string, required
        - `sender` string, hex, required — A hex encoded 32 byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
        - `sequence_number` string, 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.
        - `max_gas_amount` string, 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.
        - `gas_unit_price` string, 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.
        - `expiration_timestamp_secs` string, 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.
        - `payload` union, required — An enum of the possible transaction payloads
          - object — Payload which runs a single entry function
            - `type` string, required
            - `function` string, required — Entry function id is string representation of a entry function defined on-chain. Format: `{address}::{module name}::{function name}` Both `module name` and `function name` are case-sensitive.
            - `type_arguments` MoveType[], required — Type arguments of the function
            - `arguments` unknown[], required — Arguments of the function
              - …
          - object — Payload which runs a script that can run multiple functions
            - `type` string, required
            - `code` MoveScriptBytecode, required — Move script bytecode
              - …
            - `type_arguments` MoveType[], required — Type arguments of the function
            - `arguments` unknown[], required — Arguments of the function
              - …
          - object
            - `type` string, required
            - `modules` MoveModuleBytecode[], required
              - …
          - object — A multisig transaction that allows an owner of a multisig account to execute a pre-approved transaction as the multisig account.
            - `type` string, required
            - `multisig_address` string, hex, required — A hex encoded 32 byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
            - `transaction_payload` MultisigTransactionPayload — Payload which runs a single entry function
              - …
        - `signature` union — An enum representing the different transaction signatures available
          - object — A single Ed25519 signature
            - `type` string, required
            - `public_key` string, hex, required — All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte. Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
            - `signature` string, hex, required — All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte. Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
          - object — A Ed25519 multi-sig signature This allows k-of-n signing for a transaction
            - `type` string, required
            - `public_keys` HexEncodedBytes[], required — The public keys for the Ed25519 signature
            - `signatures` HexEncodedBytes[], required — Signature associated with the public keys in the same order
            - `threshold` integer, required — The number of signatures required for a successful transaction
            - `bitmap` string, hex, required — All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte. Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
          - object — Multi agent signature for multi agent transactions This allows you to have transactions across multiple accounts
            - `type` string, required
            - `sender` union, required — Account signature scheme The account signature scheme allows you to have two types of accounts: 1. A single Ed25519 key account, one private key 2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.
              - …
            - `secondary_signer_addresses` Address[], required — The other involved parties' addresses
            - `secondary_signers` AccountSignature[], required — The associated signatures, in the same order as the secondary addresses
              - …
      - object — A transaction submitted by a user to change the state of the blockchain
        - `type` string, required
        - `version` string, 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.
        - `hash` string, required
        - `state_change_hash` string, required
        - `event_root_hash` string, required
        - `state_checkpoint_hash` string
        - `gas_used` string, 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.
        - `success` boolean, required — Whether the transaction was successful
        - `vm_status` string, required — The VM status of the transaction, can tell useful information in a failure
        - `accumulator_root_hash` string, required
        - `changes` WriteSetChange[], required — Final state of resources changed by the transaction
          - union — A final state change of a transaction on a resource or module
            - object — Delete a module
              - …
            - object — Delete a resource
              - …
            - object — Delete a table item
              - …
            - object — Write a new module or update an existing one
              - …
            - object — Write a resource or update an existing one
              - …
            - object — Change set to write a table item
              - …
        - `sender` string, hex, required — A hex encoded 32 byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
        - `sequence_number` string, 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.
        - `max_gas_amount` string, 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.
        - `gas_unit_price` string, 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.
        - `expiration_timestamp_secs` string, 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.
        - `payload` union, required — An enum of the possible transaction payloads
          - object — Payload which runs a single entry function
            - `type` string, required
            - `function` string, required — Entry function id is string representation of a entry function defined on-chain. Format: `{address}::{module name}::{function name}` Both `module name` and `function name` are case-sensitive.
            - `type_arguments` MoveType[], required — Type arguments of the function
            - `arguments` unknown[], required — Arguments of the function
              - …
          - object — Payload which runs a script that can run multiple functions
            - `type` string, required
            - `code` MoveScriptBytecode, required — Move script bytecode
              - …
            - `type_arguments` MoveType[], required — Type arguments of the function
            - `arguments` unknown[], required — Arguments of the function
              - …
          - object
            - `type` string, required
            - `modules` MoveModuleBytecode[], required
              - …
          - object — A multisig transaction that allows an owner of a multisig account to execute a pre-approved transaction as the multisig account.
            - `type` string, required
            - `multisig_address` string, hex, required — A hex encoded 32 byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
            - `transaction_payload` MultisigTransactionPayload — Payload which runs a single entry function
              - …
        - `signature` union — An enum representing the different transaction signatures available
          - object — A single Ed25519 signature
            - `type` string, required
            - `public_key` string, hex, required — All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte. Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
            - `signature` string, hex, required — All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte. Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
          - object — A Ed25519 multi-sig signature This allows k-of-n signing for a transaction
            - `type` string, required
            - `public_keys` HexEncodedBytes[], required — The public keys for the Ed25519 signature
            - `signatures` HexEncodedBytes[], required — Signature associated with the public keys in the same order
            - `threshold` integer, required — The number of signatures required for a successful transaction
            - `bitmap` string, hex, required — All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte. Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
          - object — Multi agent signature for multi agent transactions This allows you to have transactions across multiple accounts
            - `type` string, required
            - `sender` union, required — Account signature scheme The account signature scheme allows you to have two types of accounts: 1. A single Ed25519 key account, one private key 2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.
              - …
            - `secondary_signer_addresses` Address[], required — The other involved parties' addresses
            - `secondary_signers` AccountSignature[], required — The associated signatures, in the same order as the secondary addresses
              - …
        - `events` Event[], required — Events generated by the transaction
          - `guid` EventGuid, required
            - `creation_number` string, 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.
            - `account_address` string, hex, required — A hex encoded 32 byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
          - `sequence_number` string, 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.
          - `type` string, required — String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` Vector type value examples: - `vector<u8>` - `vector<vector<u64>>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
          - `data` unknown, required
        - `timestamp` string, 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.
      - object — The genesis transaction This only occurs at the genesis transaction (version 0)
        - `type` string, required
        - `version` string, 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.
        - `hash` string, required
        - `state_change_hash` string, required
        - `event_root_hash` string, required
        - `state_checkpoint_hash` string
        - `gas_used` string, 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.
        - `success` boolean, required — Whether the transaction was successful
        - `vm_status` string, required — The VM status of the transaction, can tell useful information in a failure
        - `accumulator_root_hash` string, required
        - `changes` WriteSetChange[], required — Final state of resources changed by the transaction
          - union — A final state change of a transaction on a resource or module
            - object — Delete a module
              - …
            - object — Delete a resource
              - …
            - object — Delete a table item
              - …
            - object — Write a new module or update an existing one
              - …
            - object — Write a resource or update an existing one
              - …
            - object — Change set to write a table item
              - …
        - `payload` GenesisPayload, required — A writeset payload, used only for genesis
          - `type` string, required
          - `write_set` union, required — The associated writeset with a payload
            - object
              - …
            - object
              - …
        - `events` Event[], required — Events emitted during genesis
          - `guid` EventGuid, required
            - `creation_number` string, 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.
            - `account_address` string, hex, required — A hex encoded 32 byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
          - `sequence_number` string, 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.
          - `type` string, required — String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` Vector type value examples: - `vector<u8>` - `vector<vector<u64>>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
          - `data` unknown, required
      - object — A block metadata transaction This signifies the beginning of a block, and contains information about the specific block
        - `type` string, required
        - `version` string, 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.
        - `hash` string, required
        - `state_change_hash` string, required
        - `event_root_hash` string, required
        - `state_checkpoint_hash` string
        - `gas_used` string, 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.
        - `success` boolean, required — Whether the transaction was successful
        - `vm_status` string, required — The VM status of the transaction, can tell useful information in a failure
        - `accumulator_root_hash` string, required
        - `changes` WriteSetChange[], required — Final state of resources changed by the transaction
          - union — A final state change of a transaction on a resource or module
            - object — Delete a module
              - …
            - object — Delete a resource
              - …
            - object — Delete a table item
              - …
            - object — Write a new module or update an existing one
              - …
            - object — Write a resource or update an existing one
              - …
            - object — Change set to write a table item
              - …
        - `id` string, required
        - `epoch` string, 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.
        - `round` string, 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.
        - `events` Event[], required — The events emitted at the block creation
          - `guid` EventGuid, required
            - `creation_number` string, 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.
            - `account_address` string, hex, required — A hex encoded 32 byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
          - `sequence_number` string, 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.
          - `type` string, required — String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` Vector type value examples: - `vector<u8>` - `vector<vector<u64>>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
          - `data` unknown, required
        - `previous_block_votes_bitvec` integer[], required — Previous block votes
        - `proposer` string, hex, required — A hex encoded 32 byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
        - `failed_proposer_indices` integer[], required — The indices of the proposers who failed to propose
        - `timestamp` string, 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.
      - object — A state checkpoint transaction
        - `type` string, required
        - `version` string, 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.
        - `hash` string, required
        - `state_change_hash` string, required
        - `event_root_hash` string, required
        - `state_checkpoint_hash` string
        - `gas_used` string, 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.
        - `success` boolean, required — Whether the transaction was successful
        - `vm_status` string, required — The VM status of the transaction, can tell useful information in a failure
        - `accumulator_root_hash` string, required
        - `changes` WriteSetChange[], required — Final state of resources changed by the transaction
          - union — A final state change of a transaction on a resource or module
            - object — Delete a module
              - …
            - object — Delete a resource
              - …
            - object — Delete a table item
              - …
            - object — Write a new module or update an existing one
              - …
            - object — Write a resource or update an existing one
              - …
            - object — Change set to write a table item
              - …
        - `timestamp` string, 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.

## Other responses

- `400`
- `403`
- `404`
- `410`
- `500`
- `503`

## Changes

- **2023-05-16** `28d6217d1579` — 6 warning
  - added the new `state_value_not_found` enum value to the `error_code` response property for the response status `400`
  - added the new `state_value_not_found` enum value to the `error_code` response property for the response status `403`
  - added the new `state_value_not_found` enum value to the `error_code` response property for the response status `404`
  - added the new `state_value_not_found` enum value to the `error_code` response property for the response status `410`
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/pontem-network/apis/lumio-node-api/changes/blocks/by_version/:version/get.md)

---

[API](https://skmtc.dev/pontem-network/apis/lumio-node-api.md) · [All operations](https://skmtc.dev/pontem-network/apis/lumio-node-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pontem-network/lumio-node-api/revisions/8bbeea86aa6b/schema)
