checkBalance method

Future<BigInt> checkBalance(
  1. String address, {
  2. String? coinType,
})

Implementation

Future<BigInt> checkBalance(String address, { String? coinType }) async {
  coinType ??= AptosClient.APTOS_COIN;
  String typeTag = "0x1::coin::CoinStore<$coinType>";
  final accountResource = await aptosClient.getAccountResource(address, typeTag);
  return BigInt.parse(accountResource["data"]["coin"]["value"]);
}