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

Wallet.updateBalanceX() #56

Open
dg314 opened this issue Jan 17, 2022 · 0 comments
Open

Wallet.updateBalanceX() #56

dg314 opened this issue Jan 17, 2022 · 0 comments

Comments

@dg314
Copy link

dg314 commented Jan 17, 2022

I would like to update the X-chain balance of a wallet so that I can access the wallet's balance of various ANT tokens. Since updateBalanceX() is private, the only way to do this seems to be calling updateUtxosX(). However, this function calls updateBalanceX() without awaiting its promise, so I'm not sure how I can tell when it has finished updating the X-chain balance. For my use case, I would prefer if the function did the following:

await this.updateUnknownAssetsX();
await this.updateBalanceX();

I understand that the function is probably written as it currently is because updateBalanceX() is a costly function. Maybe a solution could be to have a boolean parameter waitForBalance for the function updateBalanceX() with the following code:

if (waitForBalance) {
    await this.updateBalanceX();
else {
    this.updateBalanceX();
}

Apologies in advance if there is another solution to this issue that I'm missing.

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

1 participant