ICRC-2 canister interface for Motoko.
Includes the ICRC-1 interface.
mops add icrc2-types
Get the token allowance that the spender account can transfer from the specified account on the ryjl3-tyaaa-aaaaa-aaaba-cai (ICP) canister.
import ICRC2 "mo:icrc2-types";
let icp = actor("ryjl3-tyaaa-aaaaa-aaaba-cai") : ICRC2.Service;
let allowance = await icp.icrc2_allowance({
account = targetAccount;
spender = spenderAccount;
});
Debug.print("Allowance amount: " # debug_show(allowance.allowance));
Debug.print("Allowance exires at: " # debug_show(allowance.expires_at));