# 2.8 Check an account balance

Now that you received your free Tokens, let's learn how to check your account balance.

# Use cases

Get the account balance.

# Tools

The CommercioSDK, our own open source tool to format transactions to Commercio.network

# Functions and APIs

  • Network queryChain.

# Step by step sequence

  1. Generate the wallet;
  2. Execute the Network queryChain function to get the account balance.

# Code Examples

Here's an example of the implementation in all the available languages.

# Dart

final wallet = Wallet.derive(mnemonic, networkInfo);

final balanceURL = '${wallet.networkInfo.lcdUrl}/bank/balances/${wallet.bech32Address}';

final balance = await Network.queryChain(balanceURL);
1
2
3
4
5

# Kotlin

val wallet = Wallet.derive(mnemonic = mnemonic, networkInfo = networkInfo)

val balanceURL = "${wallet.networkInfo.lcdUrl}/bank/balances/${wallet.bech32Address}"

val balance = Network.queryChain<List<QueryResult<StdCoin>>>(url = balanceURL)
1
2
3
4
5

# C#

var wallet = commercio.sacco.lib.Wallet.derive(mnemonic, networkInfo);

String balanceURL = $"{wallet.networkInfo.lcdUrl}/bank/balances/{wallet.bech32Address}";

var balance = commercio.sdk.Network.queryChain(balanceURL);
1
2
3
4
5