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

Add tokenBalance api endpoint #496

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open

Add tokenBalance api endpoint #496

wants to merge 4 commits into from

Conversation

7i7o
Copy link
Contributor

@7i7o 7i7o commented Oct 15, 2024

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:

src/tokens/aoTokens/ao.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@pawanpaudel93 pawanpaudel93 left a comment

Choose a reason for hiding this comment

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

tACK

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

Successfully merging this pull request may close these issues.

2 participants