block

Queries the network and returns block information for the given block height or hash. To return the latest block information, the finality parameter shall be used.

📘

Supported on NEAR (mainnet) only.

Parameters

  • finality - string - The assurance that the transaction cannot be altered, reversed, or canceled after they are completed. For finality=final, it means that it has been validated on at least 66% of the nodes in the network and for finality=optimistic, it uses the latest block recorded on the node that responded to the query passed
  • block_id - int/string - The block id which could be either a block number or block hash

Note: You can only use one parameter, either finality or block_id. The block_id param can take either the block number or the block hash as an argument.

Returns

  • author- The author name
  • chunks- The information about the chunks
    • balance_burnt- The number of tokens burnt
    • chunk_hash- The hash of the chunk
    • encoded_length- The chunk length encoded in integer format
    • encoded_merkle_root- The merkle root encoded in hexadecimal form
    • gas_limit- The maximum gas allowed in this block
    • gas_used- The total used gas by all transactions in this block
    • height_created- The chunk height created
    • height_included- The included height of the chunk
    • outcome_root- The outcome root
    • outgoing_receipts_root- The root of the outgoing receipts of the block
    • prev_block_hash- The hash of the previous block corresponding to the current one
    • prev_state_root- The previous root state of the corresponding block
    • rent_paid- The number of tokens paid as rent
    • shard_id- The id of the multiple data grouped together
    • validator_reward- The reward sent to the validators
    • signature- The standard ed25519 signature type
    • tx_root- The transaction root
    • validator_proposals- An array of proposals provided by the validators
  • header- The header of the block
    • approvals- An array of signatures, encoded in the standard ed25519 signature type
    • block_merkle_root- The merkle root of the block
    • block_ordinal- The ordinal number of the block
    • challenges_result- An array of challenges outcome
    • challenges_root- The root challenges incurred
    • chunk_headers_root- The root of the headers trie of the block
    • chunk_mask- A boolean value
    • chunk_receipts_root- The root of the receipts trie of the block
    • chunk_tx_root- The root of the transaction trie of the block
    • chunks_included- The chunks included in the queried block
    • epoch_id- The corresponding epoch id
    • epoch_sync_data_hash- The epoch sync data hash
    • gas_price- Integer of the gasPrice used for each paid gas encoded as a hexadecimal
    • hash- The block hash
    • height- The block height or index
    • last_ds_final_block- The last ds final block
    • last_final_block- The address of the last final block
    • latest_protocol_version- The version of the latest protocol
    • next_bp_hash- The hash of the next bp node
    • next_epoch_id- The id next to the current epoch number
    • outcome_root- The root of the outcome trie of the block
    • prev_hash- The hash of the previous block
    • prev_height- The height of the previous block
    • prev_state_root- The previous state of the root of corresponding block
    • random_value- The random value generated to make the result deterministic
    • rent_paid- The number of tokens paid as rent
    • signature- The standard ed25519 signature type
    • timestamp- The unix timestamp for when the block was collated
    • timestamp_nanosec- The timestamp in nano second for when the block was collated
    • total_supply- The total number of tokens supplied
    • validator_proposals- The validator proposals
    • validator_reward- The reward sent to the validators

API Endpoint

The format of a Near API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/near/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/near/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/near/ \
--request POST \
--header "Content-Type: application/json" \
--data '{"method": "block","params": {"finality": "final"},"id":1,"jsonrpc":"2.0"}'

Result