getOperationsByHeight(height)

Feature
Get the operation information contained in a block from a specific block number.

Parameters

int | string block height

data of SuccessResponse

object operation information || if operation does not exist, status error 500 occurs.

example

// Note: an asynchronous request.
const operationInfo = async () => {
  const blockNumber = 158;
  const info = await mitum.block.getOperationsByHeight(blockNumber);
  console.log(info.data);
};
operationInfo();

// output
[
  {
    _hint: 'mitum-currency-hal-v0.0.1',
    _embedded: {
      _hint: 'mitum-currency-operation-value-v0.0.1',
      hash: 'BCm1D8nDcDB1pvc7dRhxHrg4z3jcb5QJCZSnZG2GdPih',
      operation: [Object],
      height: 0,
      confirmed_at: '2024-06-25T04:56:26.967Z',
      reason: '',
      in_state: true,
      index: 0
    },
    _links: { block: [Object], self: [Object] }
  },
  {
    _hint: 'mitum-currency-hal-v0.0.1',
    _embedded: {
      _hint: 'mitum-currency-operation-value-v0.0.1',
      hash: 'GsbNvn8G1CK6fJ4jDBgDqvyEPWCUePMBUtSwapbtuHat',
      operation: [Object],
      height: 0,
      confirmed_at: '2024-06-25T04:56:26.967Z',
      reason: '',
      in_state: true,
      index: 1
    },
    _links: { block: [Object], self: [Object] }
  },
]

Last updated