Get native token balance

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
'''$native token balance''' is a function that retrieves the balance of the native token on a specific blockchain. The command is particularly designed for enterprise users who are managing blockchain wallets and need to reference the native token balance regularly.
+
'''$native balance''' is a function that retrieves the balance of the native token on a specified blockchain.
 +
 
 +
This function provides you the balance of the native token corresponding to the specified blockchain chain in your DeFi wallet.
  
 
== Parameters ==
 
== Parameters ==
  
'''Chain:''' This is the blockchain network that the wallet belongs to. The chains that can be selected from the dropdown menu include Avalanche and Binance Smart Chain.
+
'''Chain:''' The specific blockchain chain on which the native token balance is to be checked. It can be either "Avalanche" or "BinanceSmartChain".
  
 
== Return Value ==
 
== Return Value ==
 
+
This function returns a string which represents the balance of the native token in your DeFi wallet.
This function returns a string value representing the balance of the native token on the specified blockchain.
+
  
 
== Example ==
 
== Example ==
 
 
<pre>
 
<pre>
ui console view
+
log("Native Balance on BinanceSmartChain: {$native balance("BinanceSmartChain")}")
config defi wallet("your private key here")
+
log("Native Balance on Avalanche: {$native balance("Avalanche")}")
log("Native token balance: {$native token balance("Avalanche")}")
+
 
</pre>
 
</pre>
  
Do ensure to replace "your private key here" with your actual private key. Always handle private keys securely as they are highly sensitive information.
+
The output of this function will be the amount of the native token you have on the specified chain.
  
The output of this script will display the balance of the native token on the specified chain (in this case, Avalanche) linked to your DeFi wallet. A potential output might look like:
+
Example Output:
 
<blockquote>
 
<blockquote>
Native token balance: 100 AVAX
+
<p>Native Balance on BinanceSmartChain: 10.00 BNB</p>
 +
<p>Native Balance on Avalanche: 20.00 AVAX</p>
 
</blockquote>
 
</blockquote>
 +
 +
Remember, the balances will be different depending on the amount you hold in your wallet.

Revision as of 19:06, 4 July 2023

$native balance is a function that retrieves the balance of the native token on a specified blockchain.

This function provides you the balance of the native token corresponding to the specified blockchain chain in your DeFi wallet.

Parameters

Chain: The specific blockchain chain on which the native token balance is to be checked. It can be either "Avalanche" or "BinanceSmartChain".

Return Value

This function returns a string which represents the balance of the native token in your DeFi wallet.

Example

log("Native Balance on BinanceSmartChain: {$native balance("BinanceSmartChain")}")
log("Native Balance on Avalanche: {$native balance("Avalanche")}")

The output of this function will be the amount of the native token you have on the specified chain.

Example Output:

Native Balance on BinanceSmartChain: 10.00 BNB

Native Balance on Avalanche: 20.00 AVAX

Remember, the balances will be different depending on the amount you hold in your wallet.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox