Skip to content

QueryBlocksResponse

Defined in: packages/canisters/src/declarations/ledger-icp/ledger.d.ts:301

The result of a “query_blocks” call.

The structure of the result is somewhat complicated because the main ledger canister might not have all the blocks that the caller requested: One or more “archive” canisters might store some of the requested blocks.

Note: as of Q4 2021 when this interface is authored, the IC doesn’t support making nested query calls within a query call.

archived_blocks: ArchivedBlocksRange[]

Defined in: packages/canisters/src/declarations/ledger-icp/ledger.d.ts:334

Encoding of instructions for fetching archived blocks whose indices fall into the requested range.

For each entry e in [archived_blocks], [e.from, e.from + len) is a sub-range of the originally requested block range.


blocks: Block[]

Defined in: packages/canisters/src/declarations/ledger-icp/ledger.d.ts:316

List of blocks that were available in the ledger when it processed the call.

The blocks form a contiguous range, with the first block having index [first_block_index] (see below), and the last block having index [first_block_index] + len(blocks) - 1.

The block range can be an arbitrary sub-range of the originally requested range.


certificate: [] | [Uint8Array<ArrayBufferLike>]

Defined in: packages/canisters/src/declarations/ledger-icp/ledger.d.ts:306

System certificate for the hash of the latest block in the chain. Only present if query_blocks is called in a non-replicated query context.


chain_length: bigint

Defined in: packages/canisters/src/declarations/ledger-icp/ledger.d.ts:321

The total number of blocks in the chain. If the chain length is positive, the index of the last block is chain_len - 1.


first_block_index: bigint

Defined in: packages/canisters/src/declarations/ledger-icp/ledger.d.ts:326

The index of the first block in “blocks”. If the blocks vector is empty, the exact value of this field is not specified.