getAllBlocks(limit?, offset?, reverse?)

Feature

Get the information for all blocks. Note: If query parameter is not provided, get oldest 10 blocks

Parameters

number | undefined limit, // limit the number of items to import number | undefined offset, // offset for block number true | undefined reverse

data of SuccessResponse

array of block information

example

// Note: an asynchronous request.
const blocksInfo = async () => {
  const info = await mitum.block.getAllBlocks();
  console.log(info.data);
};
blocksInfo();

// output
[
  {
    _hint: 'mitum-currency-hal-v0.0.1',
    _embedded: {
      Manifest: [Object],
      operations: 0,
      confirmed_at: '2024-02-23 05:14:26.268180295 +0000 UTC',
      proposer: 'node0sas',
      round: 0
    },
    _links: {
      block: [Object],
      'block:{hash}': [Object],
      'block:{height}': [Object],
      'manifest:{hash}': [Object],
      'manifest:{height}': [Object],
      next: [Object],
      self: [Object]
    }
  },
  ...
]

Last updated