Get token balance
Line 1: | Line 1: | ||
− | '''$ | + | '''$wallet balance''' is a function that gets your wallet balance for a given token. If your desired token isn't in the dropdown, you can manually enter its contract address. |
− | This | + | This function provides you the balance of a specific token in your DeFi wallet. |
== Parameters == | == Parameters == | ||
− | '''Chain:''' The blockchain | + | '''Chain:''' The blockchain chain your wallet is on. It can be either "Avalanche" or "BinanceSmartChain". |
− | '''Token ID:''' The | + | '''Token ID:''' The token for which you're seeking to check the balance in your wallet. |
== Return Value == | == Return Value == | ||
− | This function returns a string | + | This function returns a string which is the balance of the specific token in your DeFi wallet. |
== Example == | == Example == | ||
<pre> | <pre> | ||
− | + | log("BinanceSmartChain BUSD Balance: {$wallet balance("BinanceSmartChain","BUSD")}") | |
− | + | log("Avalanche Pangolin Balance: {$wallet balance("Avalanche","Pangolin")}") | |
− | log(" | + | |
</pre> | </pre> | ||
− | + | The output of this function is the balance of the particular token in your DeFi wallet. | |
− | + | Example Output: | |
<blockquote> | <blockquote> | ||
− | + | <p>BinanceSmartChain BUSD Balance: 100 BUSD</p> | |
+ | <p>Avalanche Pangolin Balance: 50 Pangolin</p> | ||
</blockquote> | </blockquote> | ||
+ | |||
+ | Remember, the balances will differ depending on the amount of the token you hold in your wallet. |
Revision as of 19:05, 4 July 2023
$wallet balance is a function that gets your wallet balance for a given token. If your desired token isn't in the dropdown, you can manually enter its contract address.
This function provides you the balance of a specific token in your DeFi wallet.
Parameters
Chain: The blockchain chain your wallet is on. It can be either "Avalanche" or "BinanceSmartChain".
Token ID: The token for which you're seeking to check the balance in your wallet.
Return Value
This function returns a string which is the balance of the specific token in your DeFi wallet.
Example
log("BinanceSmartChain BUSD Balance: {$wallet balance("BinanceSmartChain","BUSD")}") log("Avalanche Pangolin Balance: {$wallet balance("Avalanche","Pangolin")}")
The output of this function is the balance of the particular token in your DeFi wallet.
Example Output:
BinanceSmartChain BUSD Balance: 100 BUSD
Avalanche Pangolin Balance: 50 Pangolin
Remember, the balances will differ depending on the amount of the token you hold in your wallet.