SDK
Javascript
How to
Wallet Operation
Check Balance Coin

Check Balance Coin

This method allows you to check your native balance coin from a blockchain network.

Method Signature

async balanceCoin(network: Network): Promise<CheckBalanceResponse>

Parameters

  • network: Network - The network used for transactions. You can use the Network enum to specify the network.

Returns

Promise<CheckBalanceResponse> - An object containing the following properties:

  • balance: string - The balance of the native coin.
  • symbol: string - The symbol of the native coin.
  • address: string - The wallet address.

Example Usage

const balanceInfo = await sdk.wallet.balanceCoin(Network.ETHEREUM);
console.log(balanceInfo);

Response Example

{
  "balance": "0.02",
  "symbol": "ETH",
  "address": "0xBfE64B4b628E0998A03e2522B051Cf1B4661c964"
}
ℹ️

The response is an object containing the balance, symbol, and address of the native coin for the specified network.

Additional Information

  • This method requires a valid wallet token in the SDK configuration.
  • The balance is returned as a string to preserve precision for large numbers.
  • The network parameter determines which blockchain network's balance will be checked.

For more information, see the Xellar Check Balance Coin API Documentation (opens in a new tab).