Get token balance

From UBot Studio
Revision as of 16:33, 4 July 2023 by LillyT (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

$get wallet balance is a function that returns the balance of a given token in your wallet. This function is useful when you need to check your DeFi wallet's token balances on different blockchain networks.

Parameters

Chain: The blockchain network (e.g., Avalanche, BinanceSmartChain) where the token resides.

Token ID: The token whose balance you want to check. This could be any token that resides within the specified blockchain network. You can select from the dropdown options or manually enter the contract address if your desired token isn't listed.

Return Value

This function returns a string that represents the balance of the specified token.

Example

log("My balance of AVAX on Avalanche Chain: {$get wallet balance("Avalanche", "AVAX")}")
log("My balance of BNB on Binance Smart Chain: {$get wallet balance("BinanceSmartChain", "BNB")}")

The above script example writes the balance of AVAX in the wallet on the Avalanche chain, and the balance of BNB on the Binance Smart Chain to the log.

    • Please note:**

It's essential to make sure that the wallet is connected (using the connect defi wallet command) to your desired blockchain network before running the $get wallet balance function. Otherwise, the function will not be able to fetch and return the balance.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox