Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get Balance of a list of addresses #99

Open
pshaddel opened this issue Apr 19, 2022 · 1 comment
Open

Cannot get Balance of a list of addresses #99

pshaddel opened this issue Apr 19, 2022 · 1 comment

Comments

@pshaddel
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@pshaddel and others