check_icrc1_balance function

Future<BigInt> check_icrc1_balance({
  1. required Principal ledger_canister_id,
  2. required Icrc1Account account,
  3. required CallType calltype,
})

Implementation

Future<BigInt> check_icrc1_balance({required Principal ledger_canister_id, required Icrc1Account account, required CallType calltype}) async {
    BigInt balance = (c_backwards(await Canister(ledger_canister_id).call(
        method_name: 'icrc1_balance_of',
        put_bytes: c_forwards([account]),
        calltype: calltype
    )).first as Nat).value;
    return balance;
}