-
Notifications
You must be signed in to change notification settings - Fork 64
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
How to check asset amount in wallet? #22
Comments
You can use BTW, |
🎁 WALLET = {}
def get_wallet_asset_amount(asset, fetch=True):
global WALLET
if (fetch):
WALLET = client.algod.account_info(client.user_address)
try:
return asset((next(
item for item in WALLET['assets'] if item['asset-id'] == asset.id
) if asset.id else WALLET)['amount'])
except:
return asset(0) |
Thank you for the question and answers. The issue looks like resolved. I will close this issue, feel free to reopen it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thinking i may have to use algod for this? i want to keep purchasing an asset until I spend all ALGO, I don't want to purchase it all at once because slippage will be too high
The text was updated successfully, but these errors were encountered: