waves-transactions icon indicating copy to clipboard operation
waves-transactions copied to clipboard

Cannot get Balance of a list of addresses

Open pshaddel opened this issue 3 years ago • 1 comments

I know that we can get balance of one address using this:

import { nodeInteractions } from '@waves/waves-transactions'
const data = await balance(
      address,
      'node1.sample.com'
)

Is there a way to get balance of a list of addresses? I can do this directly with node api:

const balances = await fetch(`addresses/balance?${addresses.map((n) => `address=${n}`).join('&')}`)

I saw the implementation of balance function:

function fetchBalance(base, address, options) {
    if (options === void 0) { options = Object.create(null); }
    return request_1.default({
        base: base,
        url: "/addresses/balance/" + address,
        options: options
    });
}

If there is no way to do this please let me know if I can send a pull request for this.

pshaddel avatar Apr 19 '22 14:04 pshaddel