Skip to content

Latest commit

 

History

History
executable file
·
32 lines (25 loc) · 700 Bytes

README.md

File metadata and controls

executable file
·
32 lines (25 loc) · 700 Bytes

icrc2-batch

Install

mops add icrc2-batch

Usage

import ICRC2Batch "mo:icrc2-batch";
import ICRC2Interface "mo:icrc2-batch/IRCR2Interface"

// example...
let icpLedgerCanisterId = "ryjl3-tyaaa-aaaaa-aaaba-cai"; 

let icrc2Actor = ICRC2Batch.ICRC2BatchActor({
  icrc2LedgerCanisterId = icpLedgerCanisterId;
  batchSize = 100;
});

let allowanceArgs : [ICRC2Interface.AllowanceArgs] = [
  { 
    account = { owner = <ownerPrincipal>; subaccount = null };
    spender = { owner = <spenderPrincipal>; subaccount = null };
  },
  ...
];

await* icrc2Actor.icrc2_allowance_batch(allowanceArgs);

Similarly applies to icrc2_approve_batch and icrc2_transfer_from_batch APIs.