Skip to content

Add tokenBalance api endpoint#496

Merged
nicholaswma merged 4 commits into
developmentfrom
fix-token-promises
Oct 18, 2024
Merged

Add tokenBalance api endpoint#496
nicholaswma merged 4 commits into
developmentfrom
fix-token-promises

Conversation

@7i7o

@7i7o 7i7o commented Oct 15, 2024

Copy link
Copy Markdown
Contributor

Summary

This PR adds a new function to the api called tokenBalance that requires the "ACCESS_TOKENS" permissions

You can fetch the balance of a token by providing the token's id:

const tokenBalance = await window.arweaveWallet.tokenBalance("<AO_TOKEN_ID>");

It should return the token's balance in a string in the same format as userTokens returns the balances for each token

Tasks:

Comment thread src/tokens/aoTokens/ao.ts Outdated

@pawanpaudel93 pawanpaudel93 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

@nicholaswma
nicholaswma merged commit 64903ae into development Oct 18, 2024
@nicholaswma
nicholaswma deleted the fix-token-promises branch October 18, 2024 17:57
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.20.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants