check_icp_balance function

Future<IcpTokens> check_icp_balance(
  1. String icp_id, {
  2. CallType? calltype,
})

Implementation

Future<IcpTokens> check_icp_balance(String icp_id, {CallType? calltype}) async {
    Uint8List sponse_bytes = await SYSTEM_CANISTERS.ledger.call(
        calltype: calltype ?? CallType.call,
        method_name: 'account_balance',
        put_bytes: c_forwards([
            Record.of_the_map({
                'account': Blob(hexstringasthebytes(icp_id))
            })
        ])
    );
    return IcpTokens.of_the_record(c_backwards(sponse_bytes)[0] as Record);
}