getOperations(address, limit?, offset?, reverse?)

Feature

Get operations generated from the given address. Note: If no query parameters are provided, the 10 oldest data will be retrieved.

Parameters

string address, number | undefined limit, // limit the number of items to import [number, number] | undefined offset, // [block number, operation index] true | undefined reverse

data of SuccessResponse

array of operation information

example

// Note: an asynchronous request.
const operationByAddress = async () => {
  const address = "0x517ffA55D06AaEc6Fa9d27B54e21ebfeb58Ff692fca";
  // set query parameter limit as 2, offset as [150,0], reverse as true
  const info = await mitum.account.getOperations(address, 2, [150,0], true);
  console.log(info.data);
};
operationByAddress();

// output
[
  {
    _hint: 'mitum-currency-hal-v0.0.1',
    _embedded: {
      _hint: 'mitum-currency-operation-value-v0.0.1',
      hash: '2V3EZxAaDqxRziGZKLyKiyZjAfMpDGLorncYskEW2aTW',
      operation: [Object],
      height: 149,
      confirmed_at: '2024-02-23T05:25:45.311Z',
      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: '64VKUQqcsMtAErKMRqeN9jsGt1BVKFqe3YF9qZJTTCiz',
      operation: [Object],
      height: 148,
      confirmed_at: '2024-02-23T05:25:38.805Z',
      reason: '',
      in_state: true,
      index: 0
    },
    _links: { block: [Object], self: [Object] }
  }
]

Last updated