Get native token balance

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
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.
+
'''$get native token balance''' is a function that retrieves the balance of the native token on the specified blockchain chain (Avalanche, BinanceSmartChain etc).
  
 
== 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 name of the chain from which you want to get the balance.
  
 
== Return Value ==
 
== Return Value ==
  
This function returns a string value representing the balance of the native token on the specified blockchain.
+
This function returns the balance of the native token on the specified chain.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
ui console view
+
config defi wallet("your private key")
config defi wallet("your private key here")
+
log("Avalanche Balance: {$get native token balance("Avalanche")}")
log("Native token balance: {$native token balance("Avalanche")}")
+
log("BinanceSmartChain Balance: {$get native token balance("BinanceSmartChain")}")
 
</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.
+
Please replace "your private key" with your actual DeFi wallet's private key.
  
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:
+
Be mindful when you are handling your private key. It's a sensitive piece of data that allows full control over your funds in your DeFi wallet. Therefore, never share this key publicly or with anyone.
 +
 
 +
This example fetches the balance of the native token on both Avalanche (AVAX) and Binance Smart Chain (BNB). Replace "Avalanche" or "BinanceSmartChain" with the chain you're interested in.  
 +
 
 +
The output will display your balance of the native token for the selected chain.
 +
 
 +
Example Output:
 
<blockquote>
 
<blockquote>
Native token balance: 100 AVAX
+
<p>Avalanche Balance: 10.2</p>
 +
<p>BinanceSmartChain Balance: 5.3</p>
 
</blockquote>
 
</blockquote>
 +
 +
This information can be useful when you want to check how much native token (like AVAX or BNB) you have before making a transaction, because these tokens are often used for transaction fees.

Latest revision as of 19:48, 4 July 2023

$get native token balance is a function that retrieves the balance of the native token on the specified blockchain chain (Avalanche, BinanceSmartChain etc).

[edit] Parameters

Chain: The name of the chain from which you want to get the balance.

[edit] Return Value

This function returns the balance of the native token on the specified chain.

[edit] Example

config defi wallet("your private key")
log("Avalanche Balance: {$get native token balance("Avalanche")}")
log("BinanceSmartChain Balance: {$get native token balance("BinanceSmartChain")}")

Please replace "your private key" with your actual DeFi wallet's private key.

Be mindful when you are handling your private key. It's a sensitive piece of data that allows full control over your funds in your DeFi wallet. Therefore, never share this key publicly or with anyone.

This example fetches the balance of the native token on both Avalanche (AVAX) and Binance Smart Chain (BNB). Replace "Avalanche" or "BinanceSmartChain" with the chain you're interested in.

The output will display your balance of the native token for the selected chain.

Example Output:

Avalanche Balance: 10.2

BinanceSmartChain Balance: 5.3

This information can be useful when you want to check how much native token (like AVAX or BNB) you have before making a transaction, because these tokens are often used for transaction fees.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox