@dfinity/ledger-icrc 2.3.1 → 2.3.2-next-2024-06-05

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,14 @@
1
1
  /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */
2
2
  export const idlFactory = ({ IDL }) => {
3
3
  const Value = IDL.Rec();
4
- const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });
5
- const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });
4
+ const UpgradeArg = IDL.Record({
5
+ 'ledger_id' : IDL.Opt(IDL.Principal),
6
+ 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
7
+ });
8
+ const InitArg = IDL.Record({
9
+ 'ledger_id' : IDL.Principal,
10
+ 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
11
+ });
6
12
  const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });
7
13
  const BlockIndex = IDL.Nat;
8
14
  const SubAccount = IDL.Vec(IDL.Nat8);
@@ -120,8 +126,14 @@ export const idlFactory = ({ IDL }) => {
120
126
  });
121
127
  };
122
128
  export const init = ({ IDL }) => {
123
- const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });
124
- const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });
129
+ const UpgradeArg = IDL.Record({
130
+ 'ledger_id' : IDL.Opt(IDL.Principal),
131
+ 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
132
+ });
133
+ const InitArg = IDL.Record({
134
+ 'ledger_id' : IDL.Principal,
135
+ 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
136
+ });
125
137
  const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });
126
138
  return [IDL.Opt(IndexArg)];
127
139
  };
@@ -55,6 +55,7 @@ export type GetTransactionsResult =
55
55
  export type IndexArg = { Upgrade: UpgradeArg } | { Init: InitArg };
56
56
  export interface InitArg {
57
57
  ledger_id: Principal;
58
+ retrieve_blocks_from_ledger_interval_seconds: [] | [bigint];
58
59
  }
59
60
  export interface ListSubaccountsArgs {
60
61
  owner: Principal;
@@ -95,6 +96,7 @@ export interface Transfer {
95
96
  }
96
97
  export interface UpgradeArg {
97
98
  ledger_id: [] | [Principal];
99
+ retrieve_blocks_from_ledger_interval_seconds: [] | [bigint];
98
100
  }
99
101
  export type Value =
100
102
  | { Int: bigint }
@@ -1,12 +1,20 @@
1
- // Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
1
+ // Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
2
2
  type Tokens = nat;
3
3
 
4
4
  type InitArg = record {
5
5
  ledger_id: principal;
6
+ // The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
7
+ // responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
8
+ // A higher values means that it takes longer for new blocks to show up in the index.
9
+ retrieve_blocks_from_ledger_interval_seconds : opt nat64;
6
10
  };
7
11
 
8
12
  type UpgradeArg = record {
9
13
  ledger_id: opt principal;
14
+ // The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
15
+ // responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
16
+ // A higher values means that it takes longer for new blocks to show up in the index.
17
+ retrieve_blocks_from_ledger_interval_seconds : opt nat64;
10
18
  };
11
19
 
12
20
  type IndexArg = variant {
@@ -1,8 +1,14 @@
1
1
  /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */
2
2
  export const idlFactory = ({ IDL }) => {
3
3
  const Value = IDL.Rec();
4
- const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });
5
- const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });
4
+ const UpgradeArg = IDL.Record({
5
+ 'ledger_id' : IDL.Opt(IDL.Principal),
6
+ 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
7
+ });
8
+ const InitArg = IDL.Record({
9
+ 'ledger_id' : IDL.Principal,
10
+ 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
11
+ });
6
12
  const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });
7
13
  const BlockIndex = IDL.Nat;
8
14
  const SubAccount = IDL.Vec(IDL.Nat8);
@@ -120,8 +126,14 @@ export const idlFactory = ({ IDL }) => {
120
126
  });
121
127
  };
122
128
  export const init = ({ IDL }) => {
123
- const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });
124
- const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });
129
+ const UpgradeArg = IDL.Record({
130
+ 'ledger_id' : IDL.Opt(IDL.Principal),
131
+ 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
132
+ });
133
+ const InitArg = IDL.Record({
134
+ 'ledger_id' : IDL.Principal,
135
+ 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
136
+ });
125
137
  const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });
126
138
  return [IDL.Opt(IndexArg)];
127
139
  };
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
1
+ // Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
2
2
  type TxId = nat;
3
3
 
4
4
  type Account = record { owner : principal; subaccount : opt blob };
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
1
+ // Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
2
2
  type BlockIndex = nat;
3
3
  type Subaccount = blob;
4
4
  // Number of nanoseconds since the UNIX epoch in UTC timezone.
@@ -1,2 +1,2 @@
1
- "use strict";var it=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var bt=Object.getOwnPropertyNames;var At=Object.prototype.hasOwnProperty;var ht=(t,a)=>{for(var e in a)it(t,e,{get:a[e],enumerable:!0})},Ft=(t,a,e,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of bt(a))!At.call(t,n)&&n!==e&&it(t,n,{get:()=>a[n],enumerable:!(r=Vt(a,n))||r.enumerable});return t};var vt=t=>Ft(it({},"__esModule",{value:!0}),t);var Et={};ht(Et,{IcrcIndexCanister:()=>q,IcrcIndexNgCanister:()=>C,IcrcLedgerCanister:()=>M,IcrcMetadataResponseEntries:()=>Rt,IcrcTransferError:()=>P,IndexError:()=>k,decodeIcrcAccount:()=>Bt,decodePayment:()=>St,encodeIcrcAccount:()=>wt});module.exports=vt(Et);var k=class extends Error{};var P=class extends Error{constructor({msg:a,errorType:e}){super(a),this.errorType=e}};var mt=require("@dfinity/utils");var dt=({IDL:t})=>{let a=t.Rec(),e=t.Record({ledger_id:t.Opt(t.Principal)}),r=t.Record({ledger_id:t.Principal}),n=t.Variant({Upgrade:e,Init:r}),o=t.Nat,l=t.Vec(t.Nat8),c=t.Record({owner:t.Principal,subaccount:t.Opt(l)}),f=t.Record({max_results:t.Nat,start:t.Opt(o),account:c}),_=t.Nat,O=t.Record({from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(c)}),g=t.Record({to:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),T=t.Record({fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:c}),i=t.Record({to:c,fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(c)}),u=t.Record({burn:t.Opt(O),kind:t.Text,mint:t.Opt(g),approve:t.Opt(T),timestamp:t.Nat64,transfer:t.Opt(i)}),d=t.Record({id:o,transaction:u}),V=t.Record({balance:_,transactions:t.Vec(d),oldest_tx_id:t.Opt(o)}),R=t.Record({message:t.Text}),b=t.Variant({Ok:V,Err:R}),A=t.Record({start:t.Nat,length:t.Nat}),h=t.Vec(t.Tuple(t.Text,a));a.fill(t.Variant({Int:t.Int,Map:h,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(a)}));let F=a,x=t.Record({blocks:t.Vec(F),chain_length:t.Nat64}),y=t.Record({ranges:t.Vec(t.Tuple(c,t.Vec(t.Tuple(o,o))))}),s=t.Record({owner:t.Principal,start:t.Opt(l)}),v=t.Record({num_blocks_synced:o});return t.Service({get_account_transactions:t.Func([f],[b],[]),get_blocks:t.Func([A],[x],[]),get_fee_collectors_ranges:t.Func([],[y],[]),icrc1_balance_of:t.Func([c],[_],[]),ledger_id:t.Func([],[t.Principal],[]),list_subaccounts:t.Func([s],[t.Vec(l)],[]),status:t.Func([],[v],[])})};var _t=({IDL:t})=>{let a=t.Rec(),e=t.Record({ledger_id:t.Opt(t.Principal)}),r=t.Record({ledger_id:t.Principal}),n=t.Variant({Upgrade:e,Init:r}),o=t.Nat,l=t.Vec(t.Nat8),c=t.Record({owner:t.Principal,subaccount:t.Opt(l)}),f=t.Record({max_results:t.Nat,start:t.Opt(o),account:c}),_=t.Nat,O=t.Record({from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(c)}),g=t.Record({to:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),T=t.Record({fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:c}),i=t.Record({to:c,fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(c)}),u=t.Record({burn:t.Opt(O),kind:t.Text,mint:t.Opt(g),approve:t.Opt(T),timestamp:t.Nat64,transfer:t.Opt(i)}),d=t.Record({id:o,transaction:u}),V=t.Record({balance:_,transactions:t.Vec(d),oldest_tx_id:t.Opt(o)}),R=t.Record({message:t.Text}),b=t.Variant({Ok:V,Err:R}),A=t.Record({start:t.Nat,length:t.Nat}),h=t.Vec(t.Tuple(t.Text,a));a.fill(t.Variant({Int:t.Int,Map:h,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(a)}));let F=a,x=t.Record({blocks:t.Vec(F),chain_length:t.Nat64}),y=t.Record({ranges:t.Vec(t.Tuple(c,t.Vec(t.Tuple(o,o))))}),s=t.Record({owner:t.Principal,start:t.Opt(l)}),v=t.Record({num_blocks_synced:o});return t.Service({get_account_transactions:t.Func([f],[b],["query"]),get_blocks:t.Func([A],[x],["query"]),get_fee_collectors_ranges:t.Func([],[y],["query"]),icrc1_balance_of:t.Func([c],[_],["query"]),ledger_id:t.Func([],[t.Principal],["query"]),list_subaccounts:t.Func([s],[t.Vec(l)],["query"]),status:t.Func([],[v],["query"])})};var E=require("@dfinity/utils"),S=class extends E.Canister{constructor(){super(...arguments);this.balance=e=>this.caller({certified:e.certified}).icrc1_balance_of({owner:e.owner,subaccount:(0,E.toNullable)(e.subaccount)})}};var pt=require("@dfinity/utils"),kt=({owner:t,subaccount:a})=>({owner:t,subaccount:(0,pt.toNullable)(a)}),G=({account:t,max_results:a,start:e})=>({account:kt(t),max_results:a,start:(0,pt.toNullable)(e)});var C=class t extends S{constructor(){super(...arguments);this.getTransactions=async({certified:e,...r})=>{let n=await this.caller({certified:e}).get_account_transactions(G(r));if("Err"in n)throw new k(n.Err.message);return n.Ok};this.ledgerId=e=>{let{ledger_id:r}=this.caller(e);return r()}}static create(e){let{service:r,certifiedService:n,canisterId:o}=(0,mt.createServices)({options:e,idlFactory:_t,certifiedIdlFactory:dt});return new t(o,r,n)}};var U=require("@dfinity/utils");var ut=({IDL:t})=>{let a=t.Record({ledger_id:t.Principal}),e=t.Nat,r=t.Record({owner:t.Principal,subaccount:t.Opt(t.Vec(t.Nat8))}),n=t.Record({max_results:t.Nat,start:t.Opt(e),account:r}),o=t.Record({from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(r)}),l=t.Record({to:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),c=t.Record({fee:t.Opt(t.Nat),from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:r}),f=t.Record({to:r,fee:t.Opt(t.Nat),from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(r)}),_=t.Record({burn:t.Opt(o),kind:t.Text,mint:t.Opt(l),approve:t.Opt(c),timestamp:t.Nat64,transfer:t.Opt(f)}),O=t.Record({id:e,transaction:_}),g=t.Record({transactions:t.Vec(O),oldest_tx_id:t.Opt(e)}),T=t.Record({message:t.Text}),i=t.Variant({Ok:g,Err:T}),u=t.Vec(t.Nat8),d=t.Record({owner:t.Principal,start:t.Opt(u)});return t.Service({get_account_transactions:t.Func([n],[i],[]),ledger_id:t.Func([],[t.Principal],[]),list_subaccounts:t.Func([d],[t.Vec(u)],[])})};var Nt=({IDL:t})=>{let a=t.Record({ledger_id:t.Principal}),e=t.Nat,r=t.Record({owner:t.Principal,subaccount:t.Opt(t.Vec(t.Nat8))}),n=t.Record({max_results:t.Nat,start:t.Opt(e),account:r}),o=t.Record({from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(r)}),l=t.Record({to:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),c=t.Record({fee:t.Opt(t.Nat),from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:r}),f=t.Record({to:r,fee:t.Opt(t.Nat),from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(r)}),_=t.Record({burn:t.Opt(o),kind:t.Text,mint:t.Opt(l),approve:t.Opt(c),timestamp:t.Nat64,transfer:t.Opt(f)}),O=t.Record({id:e,transaction:_}),g=t.Record({transactions:t.Vec(O),oldest_tx_id:t.Opt(e)}),T=t.Record({message:t.Text}),i=t.Variant({Ok:g,Err:T}),u=t.Vec(t.Nat8),d=t.Record({owner:t.Principal,start:t.Opt(u)});return t.Service({get_account_transactions:t.Func([n],[i],[]),ledger_id:t.Func([],[t.Principal],["query"]),list_subaccounts:t.Func([d],[t.Vec(u)],["query"])})};var q=class t extends U.Canister{constructor(){super(...arguments);this.getTransactions=async e=>{let r=await this.caller({certified:!0}).get_account_transactions(G(e));if("Err"in r)throw new k(r.Err.message);return r.Ok}}static create(e){let{service:r,certifiedService:n,canisterId:o}=(0,U.createServices)({options:e,idlFactory:Nt,certifiedIdlFactory:ut});return new t(o,r,n)}};var w=require("@dfinity/utils");var ft=({IDL:t})=>{let a=t.Rec(),e=t.Rec(),r=t.Rec(),n=t.Record({num_blocks_to_archive:t.Opt(t.Nat64),max_transactions_per_response:t.Opt(t.Nat64),trigger_threshold:t.Opt(t.Nat64),more_controller_ids:t.Opt(t.Vec(t.Principal)),max_message_size_bytes:t.Opt(t.Nat64),cycles_for_archive_creation:t.Opt(t.Nat64),node_max_memory_size_bytes:t.Opt(t.Nat64),controller_id:t.Opt(t.Principal)}),o=t.Variant({Int:t.Int,Nat:t.Nat,Blob:t.Vec(t.Nat8),Text:t.Text}),l=t.Vec(t.Nat8),c=t.Record({owner:t.Principal,subaccount:t.Opt(l)}),f=t.Variant({SetTo:c,Unset:t.Null}),_=t.Record({icrc2:t.Bool}),O=t.Record({change_archive_options:t.Opt(n),token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat),metadata:t.Opt(t.Vec(t.Tuple(t.Text,o))),maximum_number_of_accounts:t.Opt(t.Nat64),accounts_overflow_trim_quantity:t.Opt(t.Nat64),change_fee_collector:t.Opt(f),max_memo_length:t.Opt(t.Nat16),token_name:t.Opt(t.Text),feature_flags:t.Opt(_)}),g=t.Record({decimals:t.Opt(t.Nat8),token_symbol:t.Text,transfer_fee:t.Nat,metadata:t.Vec(t.Tuple(t.Text,o)),minting_account:c,initial_balances:t.Vec(t.Tuple(c,t.Nat)),maximum_number_of_accounts:t.Opt(t.Nat64),accounts_overflow_trim_quantity:t.Opt(t.Nat64),fee_collector_account:t.Opt(c),archive_options:t.Record({num_blocks_to_archive:t.Nat64,max_transactions_per_response:t.Opt(t.Nat64),trigger_threshold:t.Nat64,more_controller_ids:t.Opt(t.Vec(t.Principal)),max_message_size_bytes:t.Opt(t.Nat64),cycles_for_archive_creation:t.Opt(t.Nat64),node_max_memory_size_bytes:t.Opt(t.Nat64),controller_id:t.Principal}),max_memo_length:t.Opt(t.Nat16),token_name:t.Text,feature_flags:t.Opt(_)}),T=t.Variant({Upgrade:t.Opt(O),Init:g}),i=t.Nat,u=t.Record({block_range_end:i,canister_id:t.Principal,block_range_start:i}),d=t.Record({start:i,length:t.Nat}),V=t.Vec(t.Tuple(t.Text,r));r.fill(t.Variant({Int:t.Int,Map:V,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(r)}));let R=r,b=t.Record({blocks:t.Vec(R)}),A=t.Func([d],[b],[]),h=t.Record({certificate:t.Opt(t.Vec(t.Nat8)),first_index:i,blocks:t.Vec(R),chain_length:t.Nat64,archived_blocks:t.Vec(t.Record({callback:A,start:i,length:t.Nat}))}),F=t.Record({certificate:t.Opt(t.Vec(t.Nat8)),hash_tree:t.Vec(t.Nat8)}),x=t.Nat,y=t.Record({start:x,length:t.Nat}),s=t.Nat64,v=t.Record({from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,spender:t.Opt(c)}),Q=t.Record({to:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat}),H=t.Record({fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(s),spender:c}),W=t.Record({to:c,fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,spender:t.Opt(c)}),B=t.Record({burn:t.Opt(v),kind:t.Text,mint:t.Opt(Q),approve:t.Opt(H),timestamp:s,transfer:t.Opt(W)}),Z=t.Record({transactions:t.Vec(B)}),$=t.Func([y],[Z],[]),X=t.Record({first_index:x,log_length:t.Nat,transactions:t.Vec(B),archived_transactions:t.Vec(t.Record({callback:$,start:x,length:t.Nat}))}),p=t.Nat,j=t.Record({url:t.Text,name:t.Text}),Y=t.Record({to:c,fee:t.Opt(p),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(l),created_at_time:t.Opt(s),amount:p}),J=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,BadBurn:t.Record({min_burn_amount:p}),Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:p}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,InsufficientFunds:t.Record({balance:p})}),K=t.Variant({Ok:i,Err:J}),I=t.Record({account:c,spender:c}),L=t.Record({allowance:t.Nat,expires_at:t.Opt(s)}),D=t.Record({fee:t.Opt(t.Nat),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(s),spender:c}),tt=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:t.Nat}),AllowanceChanged:t.Record({current_allowance:t.Nat}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,Expired:t.Record({ledger_time:s}),InsufficientFunds:t.Record({balance:t.Nat})}),et=t.Variant({Ok:i,Err:tt}),rt=t.Record({to:c,fee:t.Opt(p),spender_subaccount:t.Opt(l),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:p}),ct=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,InsufficientAllowance:t.Record({allowance:p}),BadBurn:t.Record({min_burn_amount:p}),Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:p}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,InsufficientFunds:t.Record({balance:p})}),at=t.Variant({Ok:i,Err:ct}),ot=t.Record({from:t.Opt(t.Principal)}),nt=t.Vec(t.Record({end:t.Nat,canister_id:t.Principal,start:t.Nat}));e.fill(t.Variant({Int:t.Int,Map:t.Vec(t.Tuple(t.Text,e)),Nat:t.Nat,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(e)})),a.fill(t.Record({log_length:t.Nat,blocks:t.Vec(t.Record({id:t.Nat,block:e})),archived_blocks:t.Vec(t.Record({args:t.Vec(d),callback:t.Func([t.Vec(d)],[a],[])}))}));let st=t.Record({certificate:t.Vec(t.Nat8),hash_tree:t.Vec(t.Nat8)});return t.Service({archives:t.Func([],[t.Vec(u)],[]),get_blocks:t.Func([d],[h],[]),get_data_certificate:t.Func([],[F],[]),get_transactions:t.Func([y],[X],[]),icrc1_balance_of:t.Func([c],[p],[]),icrc1_decimals:t.Func([],[t.Nat8],[]),icrc1_fee:t.Func([],[p],[]),icrc1_metadata:t.Func([],[t.Vec(t.Tuple(t.Text,o))],[]),icrc1_minting_account:t.Func([],[t.Opt(c)],[]),icrc1_name:t.Func([],[t.Text],[]),icrc1_supported_standards:t.Func([],[t.Vec(j)],[]),icrc1_symbol:t.Func([],[t.Text],[]),icrc1_total_supply:t.Func([],[p],[]),icrc1_transfer:t.Func([Y],[K],[]),icrc2_allowance:t.Func([I],[L],[]),icrc2_approve:t.Func([D],[et],[]),icrc2_transfer_from:t.Func([rt],[at],[]),icrc3_get_archives:t.Func([ot],[nt],[]),icrc3_get_blocks:t.Func([t.Vec(d)],[a],[]),icrc3_get_tip_certificate:t.Func([],[t.Opt(st)],[]),icrc3_supported_block_types:t.Func([],[t.Vec(t.Record({url:t.Text,block_type:t.Text}))],[])})};var Ot=({IDL:t})=>{let a=t.Rec(),e=t.Rec(),r=t.Rec(),n=t.Record({num_blocks_to_archive:t.Opt(t.Nat64),max_transactions_per_response:t.Opt(t.Nat64),trigger_threshold:t.Opt(t.Nat64),more_controller_ids:t.Opt(t.Vec(t.Principal)),max_message_size_bytes:t.Opt(t.Nat64),cycles_for_archive_creation:t.Opt(t.Nat64),node_max_memory_size_bytes:t.Opt(t.Nat64),controller_id:t.Opt(t.Principal)}),o=t.Variant({Int:t.Int,Nat:t.Nat,Blob:t.Vec(t.Nat8),Text:t.Text}),l=t.Vec(t.Nat8),c=t.Record({owner:t.Principal,subaccount:t.Opt(l)}),f=t.Variant({SetTo:c,Unset:t.Null}),_=t.Record({icrc2:t.Bool}),O=t.Record({change_archive_options:t.Opt(n),token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat),metadata:t.Opt(t.Vec(t.Tuple(t.Text,o))),maximum_number_of_accounts:t.Opt(t.Nat64),accounts_overflow_trim_quantity:t.Opt(t.Nat64),change_fee_collector:t.Opt(f),max_memo_length:t.Opt(t.Nat16),token_name:t.Opt(t.Text),feature_flags:t.Opt(_)}),g=t.Record({decimals:t.Opt(t.Nat8),token_symbol:t.Text,transfer_fee:t.Nat,metadata:t.Vec(t.Tuple(t.Text,o)),minting_account:c,initial_balances:t.Vec(t.Tuple(c,t.Nat)),maximum_number_of_accounts:t.Opt(t.Nat64),accounts_overflow_trim_quantity:t.Opt(t.Nat64),fee_collector_account:t.Opt(c),archive_options:t.Record({num_blocks_to_archive:t.Nat64,max_transactions_per_response:t.Opt(t.Nat64),trigger_threshold:t.Nat64,more_controller_ids:t.Opt(t.Vec(t.Principal)),max_message_size_bytes:t.Opt(t.Nat64),cycles_for_archive_creation:t.Opt(t.Nat64),node_max_memory_size_bytes:t.Opt(t.Nat64),controller_id:t.Principal}),max_memo_length:t.Opt(t.Nat16),token_name:t.Text,feature_flags:t.Opt(_)}),T=t.Variant({Upgrade:t.Opt(O),Init:g}),i=t.Nat,u=t.Record({block_range_end:i,canister_id:t.Principal,block_range_start:i}),d=t.Record({start:i,length:t.Nat}),V=t.Vec(t.Tuple(t.Text,r));r.fill(t.Variant({Int:t.Int,Map:V,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(r)}));let R=r,b=t.Record({blocks:t.Vec(R)}),A=t.Func([d],[b],["query"]),h=t.Record({certificate:t.Opt(t.Vec(t.Nat8)),first_index:i,blocks:t.Vec(R),chain_length:t.Nat64,archived_blocks:t.Vec(t.Record({callback:A,start:i,length:t.Nat}))}),F=t.Record({certificate:t.Opt(t.Vec(t.Nat8)),hash_tree:t.Vec(t.Nat8)}),x=t.Nat,y=t.Record({start:x,length:t.Nat}),s=t.Nat64,v=t.Record({from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,spender:t.Opt(c)}),Q=t.Record({to:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat}),H=t.Record({fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(s),spender:c}),W=t.Record({to:c,fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,spender:t.Opt(c)}),B=t.Record({burn:t.Opt(v),kind:t.Text,mint:t.Opt(Q),approve:t.Opt(H),timestamp:s,transfer:t.Opt(W)}),Z=t.Record({transactions:t.Vec(B)}),$=t.Func([y],[Z],["query"]),X=t.Record({first_index:x,log_length:t.Nat,transactions:t.Vec(B),archived_transactions:t.Vec(t.Record({callback:$,start:x,length:t.Nat}))}),p=t.Nat,j=t.Record({url:t.Text,name:t.Text}),Y=t.Record({to:c,fee:t.Opt(p),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(l),created_at_time:t.Opt(s),amount:p}),J=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,BadBurn:t.Record({min_burn_amount:p}),Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:p}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,InsufficientFunds:t.Record({balance:p})}),K=t.Variant({Ok:i,Err:J}),I=t.Record({account:c,spender:c}),L=t.Record({allowance:t.Nat,expires_at:t.Opt(s)}),D=t.Record({fee:t.Opt(t.Nat),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(s),spender:c}),tt=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:t.Nat}),AllowanceChanged:t.Record({current_allowance:t.Nat}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,Expired:t.Record({ledger_time:s}),InsufficientFunds:t.Record({balance:t.Nat})}),et=t.Variant({Ok:i,Err:tt}),rt=t.Record({to:c,fee:t.Opt(p),spender_subaccount:t.Opt(l),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:p}),ct=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,InsufficientAllowance:t.Record({allowance:p}),BadBurn:t.Record({min_burn_amount:p}),Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:p}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,InsufficientFunds:t.Record({balance:p})}),at=t.Variant({Ok:i,Err:ct}),ot=t.Record({from:t.Opt(t.Principal)}),nt=t.Vec(t.Record({end:t.Nat,canister_id:t.Principal,start:t.Nat}));e.fill(t.Variant({Int:t.Int,Map:t.Vec(t.Tuple(t.Text,e)),Nat:t.Nat,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(e)})),a.fill(t.Record({log_length:t.Nat,blocks:t.Vec(t.Record({id:t.Nat,block:e})),archived_blocks:t.Vec(t.Record({args:t.Vec(d),callback:t.Func([t.Vec(d)],[a],["query"])}))}));let st=t.Record({certificate:t.Vec(t.Nat8),hash_tree:t.Vec(t.Nat8)});return t.Service({archives:t.Func([],[t.Vec(u)],["query"]),get_blocks:t.Func([d],[h],["query"]),get_data_certificate:t.Func([],[F],["query"]),get_transactions:t.Func([y],[X],["query"]),icrc1_balance_of:t.Func([c],[p],["query"]),icrc1_decimals:t.Func([],[t.Nat8],["query"]),icrc1_fee:t.Func([],[p],["query"]),icrc1_metadata:t.Func([],[t.Vec(t.Tuple(t.Text,o))],["query"]),icrc1_minting_account:t.Func([],[t.Opt(c)],["query"]),icrc1_name:t.Func([],[t.Text],["query"]),icrc1_supported_standards:t.Func([],[t.Vec(j)],["query"]),icrc1_symbol:t.Func([],[t.Text],["query"]),icrc1_total_supply:t.Func([],[p],["query"]),icrc1_transfer:t.Func([Y],[K],[]),icrc2_allowance:t.Func([I],[L],["query"]),icrc2_approve:t.Func([D],[et],[]),icrc2_transfer_from:t.Func([rt],[at],[]),icrc3_get_archives:t.Func([ot],[nt],["query"]),icrc3_get_blocks:t.Func([t.Vec(d)],[a],["query"]),icrc3_get_tip_certificate:t.Func([],[t.Opt(st)],["query"]),icrc3_supported_block_types:t.Func([],[t.Vec(t.Record({url:t.Text,block_type:t.Text}))],["query"])})};var m=require("@dfinity/utils"),gt=({from_subaccount:t,fee:a,created_at_time:e,memo:r,...n})=>({...n,fee:(0,m.toNullable)(a),memo:(0,m.toNullable)(r),from_subaccount:(0,m.toNullable)(t),created_at_time:(0,m.toNullable)(e)}),xt=({spender_subaccount:t,fee:a,created_at_time:e,memo:r,...n})=>({...n,fee:(0,m.toNullable)(a),memo:(0,m.toNullable)(r),spender_subaccount:(0,m.toNullable)(t),created_at_time:(0,m.toNullable)(e)}),Tt=({fee:t,created_at_time:a,memo:e,from_subaccount:r,expected_allowance:n,expires_at:o,...l})=>({...l,fee:(0,m.toNullable)(t),memo:(0,m.toNullable)(e),from_subaccount:(0,m.toNullable)(r),created_at_time:(0,m.toNullable)(a),expected_allowance:(0,m.toNullable)(n),expires_at:(0,m.toNullable)(o)});var M=class t extends w.Canister{constructor(){super(...arguments);this.metadata=e=>this.caller(e).icrc1_metadata();this.transactionFee=e=>this.caller(e).icrc1_fee();this.balance=e=>this.caller({certified:e.certified}).icrc1_balance_of({owner:e.owner,subaccount:(0,w.toNullable)(e.subaccount)});this.transfer=async e=>{let r=await this.caller({certified:!0}).icrc1_transfer(gt(e));if("Err"in r)throw new P({errorType:r.Err,msg:"Failed to transfer"});return r.Ok};this.totalTokensSupply=e=>this.caller(e).icrc1_total_supply();this.transferFrom=async e=>{let r=await this.caller({certified:!0}).icrc2_transfer_from(xt(e));if("Err"in r)throw new P({errorType:r.Err,msg:"Failed to transfer from"});return r.Ok};this.approve=async e=>{let r=await this.caller({certified:!0}).icrc2_approve(Tt(e));if("Err"in r)throw new P({errorType:r.Err,msg:"Failed to entitle the spender to transfer the amount"});return r.Ok};this.allowance=async e=>{let{certified:r,...n}=e;return this.caller({certified:r}).icrc2_allowance({...n})}}static create(e){let{service:r,certifiedService:n,canisterId:o}=(0,w.createServices)({options:e,idlFactory:Ot,certifiedIdlFactory:ft});return new t(o,r,n)}};var Rt=(o=>(o.SYMBOL="icrc1:symbol",o.NAME="icrc1:name",o.DECIMALS="icrc1:decimals",o.FEE="icrc1:fee",o.LOGO="icrc1:logo",o))(Rt||{});var lt=require("@dfinity/principal"),N=require("@dfinity/utils"),Pt=64,wt=({owner:t,subaccount:a})=>{if((0,N.isNullish)(a))return t.toText();let r=(n=>n.replace(/^0+/,""))((0,N.uint8ArrayToHexString)(Uint8Array.from(a)));return r.length===0?t.toText():`${t.toText()}-${yt({owner:t,subaccount:a})}.${r}`},yt=({owner:t,subaccount:a})=>{let e=(0,N.bigEndianCrc32)(Uint8Array.from([...t.toUint8Array(),...a]));return(0,N.encodeBase32)(e)},Bt=t=>{let[a,e]=t.split(".");if(!(0,N.notEmptyString)(a))throw new Error("Invalid account. No string provided.");if((0,N.isNullish)(e))return{owner:lt.Principal.fromText(t)};let[r,...n]=a.split("-").reverse(),o=n.reverse().join("-"),l={owner:lt.Principal.fromText(o),subaccount:(0,N.hexStringToUint8Array)(e.padStart(Pt,"0"))};if(yt(l)!==r)throw new Error("Invalid account. Invalid checksum.");return l};var z=require("@dfinity/utils"),St=t=>{let a=/^([a-zA-Z]+):([A-Za-z0-9:\-.]+).*?(?:[?&](?:amount|value)=(\d+(?:\.\d+)?))?$/,e=t.match(a);if((0,z.isNullish)(e))return;let[r,n,o,l]=e;return{token:n,identifier:o,...(0,z.nonNullish)(l)&&!isNaN(parseFloat(l))&&{amount:parseFloat(l)}}};0&&(module.exports={IcrcIndexCanister,IcrcIndexNgCanister,IcrcLedgerCanister,IcrcMetadataResponseEntries,IcrcTransferError,IndexError,decodeIcrcAccount,decodePayment,encodeIcrcAccount});
1
+ "use strict";var it=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var bt=Object.getOwnPropertyNames;var At=Object.prototype.hasOwnProperty;var ht=(t,a)=>{for(var e in a)it(t,e,{get:a[e],enumerable:!0})},vt=(t,a,e,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of bt(a))!At.call(t,n)&&n!==e&&it(t,n,{get:()=>a[n],enumerable:!(r=Vt(a,n))||r.enumerable});return t};var Ft=t=>vt(it({},"__esModule",{value:!0}),t);var Et={};ht(Et,{IcrcIndexCanister:()=>q,IcrcIndexNgCanister:()=>C,IcrcLedgerCanister:()=>M,IcrcMetadataResponseEntries:()=>Rt,IcrcTransferError:()=>P,IndexError:()=>k,decodeIcrcAccount:()=>Bt,decodePayment:()=>St,encodeIcrcAccount:()=>wt});module.exports=Ft(Et);var k=class extends Error{};var P=class extends Error{constructor({msg:a,errorType:e}){super(a),this.errorType=e}};var mt=require("@dfinity/utils");var dt=({IDL:t})=>{let a=t.Rec(),e=t.Record({ledger_id:t.Opt(t.Principal),retrieve_blocks_from_ledger_interval_seconds:t.Opt(t.Nat64)}),r=t.Record({ledger_id:t.Principal,retrieve_blocks_from_ledger_interval_seconds:t.Opt(t.Nat64)}),n=t.Variant({Upgrade:e,Init:r}),o=t.Nat,l=t.Vec(t.Nat8),c=t.Record({owner:t.Principal,subaccount:t.Opt(l)}),f=t.Record({max_results:t.Nat,start:t.Opt(o),account:c}),_=t.Nat,O=t.Record({from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(c)}),g=t.Record({to:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),T=t.Record({fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:c}),i=t.Record({to:c,fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(c)}),u=t.Record({burn:t.Opt(O),kind:t.Text,mint:t.Opt(g),approve:t.Opt(T),timestamp:t.Nat64,transfer:t.Opt(i)}),d=t.Record({id:o,transaction:u}),V=t.Record({balance:_,transactions:t.Vec(d),oldest_tx_id:t.Opt(o)}),R=t.Record({message:t.Text}),b=t.Variant({Ok:V,Err:R}),A=t.Record({start:t.Nat,length:t.Nat}),h=t.Vec(t.Tuple(t.Text,a));a.fill(t.Variant({Int:t.Int,Map:h,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(a)}));let v=a,x=t.Record({blocks:t.Vec(v),chain_length:t.Nat64}),y=t.Record({ranges:t.Vec(t.Tuple(c,t.Vec(t.Tuple(o,o))))}),s=t.Record({owner:t.Principal,start:t.Opt(l)}),F=t.Record({num_blocks_synced:o});return t.Service({get_account_transactions:t.Func([f],[b],[]),get_blocks:t.Func([A],[x],[]),get_fee_collectors_ranges:t.Func([],[y],[]),icrc1_balance_of:t.Func([c],[_],[]),ledger_id:t.Func([],[t.Principal],[]),list_subaccounts:t.Func([s],[t.Vec(l)],[]),status:t.Func([],[F],[])})};var _t=({IDL:t})=>{let a=t.Rec(),e=t.Record({ledger_id:t.Opt(t.Principal),retrieve_blocks_from_ledger_interval_seconds:t.Opt(t.Nat64)}),r=t.Record({ledger_id:t.Principal,retrieve_blocks_from_ledger_interval_seconds:t.Opt(t.Nat64)}),n=t.Variant({Upgrade:e,Init:r}),o=t.Nat,l=t.Vec(t.Nat8),c=t.Record({owner:t.Principal,subaccount:t.Opt(l)}),f=t.Record({max_results:t.Nat,start:t.Opt(o),account:c}),_=t.Nat,O=t.Record({from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(c)}),g=t.Record({to:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),T=t.Record({fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:c}),i=t.Record({to:c,fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(c)}),u=t.Record({burn:t.Opt(O),kind:t.Text,mint:t.Opt(g),approve:t.Opt(T),timestamp:t.Nat64,transfer:t.Opt(i)}),d=t.Record({id:o,transaction:u}),V=t.Record({balance:_,transactions:t.Vec(d),oldest_tx_id:t.Opt(o)}),R=t.Record({message:t.Text}),b=t.Variant({Ok:V,Err:R}),A=t.Record({start:t.Nat,length:t.Nat}),h=t.Vec(t.Tuple(t.Text,a));a.fill(t.Variant({Int:t.Int,Map:h,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(a)}));let v=a,x=t.Record({blocks:t.Vec(v),chain_length:t.Nat64}),y=t.Record({ranges:t.Vec(t.Tuple(c,t.Vec(t.Tuple(o,o))))}),s=t.Record({owner:t.Principal,start:t.Opt(l)}),F=t.Record({num_blocks_synced:o});return t.Service({get_account_transactions:t.Func([f],[b],["query"]),get_blocks:t.Func([A],[x],["query"]),get_fee_collectors_ranges:t.Func([],[y],["query"]),icrc1_balance_of:t.Func([c],[_],["query"]),ledger_id:t.Func([],[t.Principal],["query"]),list_subaccounts:t.Func([s],[t.Vec(l)],["query"]),status:t.Func([],[F],["query"])})};var E=require("@dfinity/utils"),S=class extends E.Canister{constructor(){super(...arguments);this.balance=e=>this.caller({certified:e.certified}).icrc1_balance_of({owner:e.owner,subaccount:(0,E.toNullable)(e.subaccount)})}};var pt=require("@dfinity/utils"),kt=({owner:t,subaccount:a})=>({owner:t,subaccount:(0,pt.toNullable)(a)}),G=({account:t,max_results:a,start:e})=>({account:kt(t),max_results:a,start:(0,pt.toNullable)(e)});var C=class t extends S{constructor(){super(...arguments);this.getTransactions=async({certified:e,...r})=>{let n=await this.caller({certified:e}).get_account_transactions(G(r));if("Err"in n)throw new k(n.Err.message);return n.Ok};this.ledgerId=e=>{let{ledger_id:r}=this.caller(e);return r()}}static create(e){let{service:r,certifiedService:n,canisterId:o}=(0,mt.createServices)({options:e,idlFactory:_t,certifiedIdlFactory:dt});return new t(o,r,n)}};var U=require("@dfinity/utils");var ut=({IDL:t})=>{let a=t.Record({ledger_id:t.Principal}),e=t.Nat,r=t.Record({owner:t.Principal,subaccount:t.Opt(t.Vec(t.Nat8))}),n=t.Record({max_results:t.Nat,start:t.Opt(e),account:r}),o=t.Record({from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(r)}),l=t.Record({to:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),c=t.Record({fee:t.Opt(t.Nat),from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:r}),f=t.Record({to:r,fee:t.Opt(t.Nat),from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(r)}),_=t.Record({burn:t.Opt(o),kind:t.Text,mint:t.Opt(l),approve:t.Opt(c),timestamp:t.Nat64,transfer:t.Opt(f)}),O=t.Record({id:e,transaction:_}),g=t.Record({transactions:t.Vec(O),oldest_tx_id:t.Opt(e)}),T=t.Record({message:t.Text}),i=t.Variant({Ok:g,Err:T}),u=t.Vec(t.Nat8),d=t.Record({owner:t.Principal,start:t.Opt(u)});return t.Service({get_account_transactions:t.Func([n],[i],[]),ledger_id:t.Func([],[t.Principal],[]),list_subaccounts:t.Func([d],[t.Vec(u)],[])})};var Nt=({IDL:t})=>{let a=t.Record({ledger_id:t.Principal}),e=t.Nat,r=t.Record({owner:t.Principal,subaccount:t.Opt(t.Vec(t.Nat8))}),n=t.Record({max_results:t.Nat,start:t.Opt(e),account:r}),o=t.Record({from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(r)}),l=t.Record({to:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),c=t.Record({fee:t.Opt(t.Nat),from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:r}),f=t.Record({to:r,fee:t.Opt(t.Nat),from:r,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(r)}),_=t.Record({burn:t.Opt(o),kind:t.Text,mint:t.Opt(l),approve:t.Opt(c),timestamp:t.Nat64,transfer:t.Opt(f)}),O=t.Record({id:e,transaction:_}),g=t.Record({transactions:t.Vec(O),oldest_tx_id:t.Opt(e)}),T=t.Record({message:t.Text}),i=t.Variant({Ok:g,Err:T}),u=t.Vec(t.Nat8),d=t.Record({owner:t.Principal,start:t.Opt(u)});return t.Service({get_account_transactions:t.Func([n],[i],[]),ledger_id:t.Func([],[t.Principal],["query"]),list_subaccounts:t.Func([d],[t.Vec(u)],["query"])})};var q=class t extends U.Canister{constructor(){super(...arguments);this.getTransactions=async e=>{let r=await this.caller({certified:!0}).get_account_transactions(G(e));if("Err"in r)throw new k(r.Err.message);return r.Ok}}static create(e){let{service:r,certifiedService:n,canisterId:o}=(0,U.createServices)({options:e,idlFactory:Nt,certifiedIdlFactory:ut});return new t(o,r,n)}};var w=require("@dfinity/utils");var ft=({IDL:t})=>{let a=t.Rec(),e=t.Rec(),r=t.Rec(),n=t.Record({num_blocks_to_archive:t.Opt(t.Nat64),max_transactions_per_response:t.Opt(t.Nat64),trigger_threshold:t.Opt(t.Nat64),more_controller_ids:t.Opt(t.Vec(t.Principal)),max_message_size_bytes:t.Opt(t.Nat64),cycles_for_archive_creation:t.Opt(t.Nat64),node_max_memory_size_bytes:t.Opt(t.Nat64),controller_id:t.Opt(t.Principal)}),o=t.Variant({Int:t.Int,Nat:t.Nat,Blob:t.Vec(t.Nat8),Text:t.Text}),l=t.Vec(t.Nat8),c=t.Record({owner:t.Principal,subaccount:t.Opt(l)}),f=t.Variant({SetTo:c,Unset:t.Null}),_=t.Record({icrc2:t.Bool}),O=t.Record({change_archive_options:t.Opt(n),token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat),metadata:t.Opt(t.Vec(t.Tuple(t.Text,o))),maximum_number_of_accounts:t.Opt(t.Nat64),accounts_overflow_trim_quantity:t.Opt(t.Nat64),change_fee_collector:t.Opt(f),max_memo_length:t.Opt(t.Nat16),token_name:t.Opt(t.Text),feature_flags:t.Opt(_)}),g=t.Record({decimals:t.Opt(t.Nat8),token_symbol:t.Text,transfer_fee:t.Nat,metadata:t.Vec(t.Tuple(t.Text,o)),minting_account:c,initial_balances:t.Vec(t.Tuple(c,t.Nat)),maximum_number_of_accounts:t.Opt(t.Nat64),accounts_overflow_trim_quantity:t.Opt(t.Nat64),fee_collector_account:t.Opt(c),archive_options:t.Record({num_blocks_to_archive:t.Nat64,max_transactions_per_response:t.Opt(t.Nat64),trigger_threshold:t.Nat64,more_controller_ids:t.Opt(t.Vec(t.Principal)),max_message_size_bytes:t.Opt(t.Nat64),cycles_for_archive_creation:t.Opt(t.Nat64),node_max_memory_size_bytes:t.Opt(t.Nat64),controller_id:t.Principal}),max_memo_length:t.Opt(t.Nat16),token_name:t.Text,feature_flags:t.Opt(_)}),T=t.Variant({Upgrade:t.Opt(O),Init:g}),i=t.Nat,u=t.Record({block_range_end:i,canister_id:t.Principal,block_range_start:i}),d=t.Record({start:i,length:t.Nat}),V=t.Vec(t.Tuple(t.Text,r));r.fill(t.Variant({Int:t.Int,Map:V,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(r)}));let R=r,b=t.Record({blocks:t.Vec(R)}),A=t.Func([d],[b],[]),h=t.Record({certificate:t.Opt(t.Vec(t.Nat8)),first_index:i,blocks:t.Vec(R),chain_length:t.Nat64,archived_blocks:t.Vec(t.Record({callback:A,start:i,length:t.Nat}))}),v=t.Record({certificate:t.Opt(t.Vec(t.Nat8)),hash_tree:t.Vec(t.Nat8)}),x=t.Nat,y=t.Record({start:x,length:t.Nat}),s=t.Nat64,F=t.Record({from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,spender:t.Opt(c)}),Q=t.Record({to:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat}),H=t.Record({fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(s),spender:c}),W=t.Record({to:c,fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,spender:t.Opt(c)}),B=t.Record({burn:t.Opt(F),kind:t.Text,mint:t.Opt(Q),approve:t.Opt(H),timestamp:s,transfer:t.Opt(W)}),Z=t.Record({transactions:t.Vec(B)}),$=t.Func([y],[Z],[]),X=t.Record({first_index:x,log_length:t.Nat,transactions:t.Vec(B),archived_transactions:t.Vec(t.Record({callback:$,start:x,length:t.Nat}))}),p=t.Nat,j=t.Record({url:t.Text,name:t.Text}),Y=t.Record({to:c,fee:t.Opt(p),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(l),created_at_time:t.Opt(s),amount:p}),J=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,BadBurn:t.Record({min_burn_amount:p}),Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:p}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,InsufficientFunds:t.Record({balance:p})}),K=t.Variant({Ok:i,Err:J}),I=t.Record({account:c,spender:c}),L=t.Record({allowance:t.Nat,expires_at:t.Opt(s)}),D=t.Record({fee:t.Opt(t.Nat),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(s),spender:c}),tt=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:t.Nat}),AllowanceChanged:t.Record({current_allowance:t.Nat}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,Expired:t.Record({ledger_time:s}),InsufficientFunds:t.Record({balance:t.Nat})}),et=t.Variant({Ok:i,Err:tt}),rt=t.Record({to:c,fee:t.Opt(p),spender_subaccount:t.Opt(l),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:p}),ct=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,InsufficientAllowance:t.Record({allowance:p}),BadBurn:t.Record({min_burn_amount:p}),Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:p}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,InsufficientFunds:t.Record({balance:p})}),at=t.Variant({Ok:i,Err:ct}),ot=t.Record({from:t.Opt(t.Principal)}),nt=t.Vec(t.Record({end:t.Nat,canister_id:t.Principal,start:t.Nat}));e.fill(t.Variant({Int:t.Int,Map:t.Vec(t.Tuple(t.Text,e)),Nat:t.Nat,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(e)})),a.fill(t.Record({log_length:t.Nat,blocks:t.Vec(t.Record({id:t.Nat,block:e})),archived_blocks:t.Vec(t.Record({args:t.Vec(d),callback:t.Func([t.Vec(d)],[a],[])}))}));let st=t.Record({certificate:t.Vec(t.Nat8),hash_tree:t.Vec(t.Nat8)});return t.Service({archives:t.Func([],[t.Vec(u)],[]),get_blocks:t.Func([d],[h],[]),get_data_certificate:t.Func([],[v],[]),get_transactions:t.Func([y],[X],[]),icrc1_balance_of:t.Func([c],[p],[]),icrc1_decimals:t.Func([],[t.Nat8],[]),icrc1_fee:t.Func([],[p],[]),icrc1_metadata:t.Func([],[t.Vec(t.Tuple(t.Text,o))],[]),icrc1_minting_account:t.Func([],[t.Opt(c)],[]),icrc1_name:t.Func([],[t.Text],[]),icrc1_supported_standards:t.Func([],[t.Vec(j)],[]),icrc1_symbol:t.Func([],[t.Text],[]),icrc1_total_supply:t.Func([],[p],[]),icrc1_transfer:t.Func([Y],[K],[]),icrc2_allowance:t.Func([I],[L],[]),icrc2_approve:t.Func([D],[et],[]),icrc2_transfer_from:t.Func([rt],[at],[]),icrc3_get_archives:t.Func([ot],[nt],[]),icrc3_get_blocks:t.Func([t.Vec(d)],[a],[]),icrc3_get_tip_certificate:t.Func([],[t.Opt(st)],[]),icrc3_supported_block_types:t.Func([],[t.Vec(t.Record({url:t.Text,block_type:t.Text}))],[])})};var Ot=({IDL:t})=>{let a=t.Rec(),e=t.Rec(),r=t.Rec(),n=t.Record({num_blocks_to_archive:t.Opt(t.Nat64),max_transactions_per_response:t.Opt(t.Nat64),trigger_threshold:t.Opt(t.Nat64),more_controller_ids:t.Opt(t.Vec(t.Principal)),max_message_size_bytes:t.Opt(t.Nat64),cycles_for_archive_creation:t.Opt(t.Nat64),node_max_memory_size_bytes:t.Opt(t.Nat64),controller_id:t.Opt(t.Principal)}),o=t.Variant({Int:t.Int,Nat:t.Nat,Blob:t.Vec(t.Nat8),Text:t.Text}),l=t.Vec(t.Nat8),c=t.Record({owner:t.Principal,subaccount:t.Opt(l)}),f=t.Variant({SetTo:c,Unset:t.Null}),_=t.Record({icrc2:t.Bool}),O=t.Record({change_archive_options:t.Opt(n),token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat),metadata:t.Opt(t.Vec(t.Tuple(t.Text,o))),maximum_number_of_accounts:t.Opt(t.Nat64),accounts_overflow_trim_quantity:t.Opt(t.Nat64),change_fee_collector:t.Opt(f),max_memo_length:t.Opt(t.Nat16),token_name:t.Opt(t.Text),feature_flags:t.Opt(_)}),g=t.Record({decimals:t.Opt(t.Nat8),token_symbol:t.Text,transfer_fee:t.Nat,metadata:t.Vec(t.Tuple(t.Text,o)),minting_account:c,initial_balances:t.Vec(t.Tuple(c,t.Nat)),maximum_number_of_accounts:t.Opt(t.Nat64),accounts_overflow_trim_quantity:t.Opt(t.Nat64),fee_collector_account:t.Opt(c),archive_options:t.Record({num_blocks_to_archive:t.Nat64,max_transactions_per_response:t.Opt(t.Nat64),trigger_threshold:t.Nat64,more_controller_ids:t.Opt(t.Vec(t.Principal)),max_message_size_bytes:t.Opt(t.Nat64),cycles_for_archive_creation:t.Opt(t.Nat64),node_max_memory_size_bytes:t.Opt(t.Nat64),controller_id:t.Principal}),max_memo_length:t.Opt(t.Nat16),token_name:t.Text,feature_flags:t.Opt(_)}),T=t.Variant({Upgrade:t.Opt(O),Init:g}),i=t.Nat,u=t.Record({block_range_end:i,canister_id:t.Principal,block_range_start:i}),d=t.Record({start:i,length:t.Nat}),V=t.Vec(t.Tuple(t.Text,r));r.fill(t.Variant({Int:t.Int,Map:V,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(r)}));let R=r,b=t.Record({blocks:t.Vec(R)}),A=t.Func([d],[b],["query"]),h=t.Record({certificate:t.Opt(t.Vec(t.Nat8)),first_index:i,blocks:t.Vec(R),chain_length:t.Nat64,archived_blocks:t.Vec(t.Record({callback:A,start:i,length:t.Nat}))}),v=t.Record({certificate:t.Opt(t.Vec(t.Nat8)),hash_tree:t.Vec(t.Nat8)}),x=t.Nat,y=t.Record({start:x,length:t.Nat}),s=t.Nat64,F=t.Record({from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,spender:t.Opt(c)}),Q=t.Record({to:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat}),H=t.Record({fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(s),spender:c}),W=t.Record({to:c,fee:t.Opt(t.Nat),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,spender:t.Opt(c)}),B=t.Record({burn:t.Opt(F),kind:t.Text,mint:t.Opt(Q),approve:t.Opt(H),timestamp:s,transfer:t.Opt(W)}),Z=t.Record({transactions:t.Vec(B)}),$=t.Func([y],[Z],["query"]),X=t.Record({first_index:x,log_length:t.Nat,transactions:t.Vec(B),archived_transactions:t.Vec(t.Record({callback:$,start:x,length:t.Nat}))}),p=t.Nat,j=t.Record({url:t.Text,name:t.Text}),Y=t.Record({to:c,fee:t.Opt(p),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(l),created_at_time:t.Opt(s),amount:p}),J=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,BadBurn:t.Record({min_burn_amount:p}),Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:p}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,InsufficientFunds:t.Record({balance:p})}),K=t.Variant({Ok:i,Err:J}),I=t.Record({account:c,spender:c}),L=t.Record({allowance:t.Nat,expires_at:t.Opt(s)}),D=t.Record({fee:t.Opt(t.Nat),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(s),spender:c}),tt=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:t.Nat}),AllowanceChanged:t.Record({current_allowance:t.Nat}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,Expired:t.Record({ledger_time:s}),InsufficientFunds:t.Record({balance:t.Nat})}),et=t.Variant({Ok:i,Err:tt}),rt=t.Record({to:c,fee:t.Opt(p),spender_subaccount:t.Opt(l),from:c,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(s),amount:p}),ct=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,InsufficientAllowance:t.Record({allowance:p}),BadBurn:t.Record({min_burn_amount:p}),Duplicate:t.Record({duplicate_of:i}),BadFee:t.Record({expected_fee:p}),CreatedInFuture:t.Record({ledger_time:s}),TooOld:t.Null,InsufficientFunds:t.Record({balance:p})}),at=t.Variant({Ok:i,Err:ct}),ot=t.Record({from:t.Opt(t.Principal)}),nt=t.Vec(t.Record({end:t.Nat,canister_id:t.Principal,start:t.Nat}));e.fill(t.Variant({Int:t.Int,Map:t.Vec(t.Tuple(t.Text,e)),Nat:t.Nat,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(e)})),a.fill(t.Record({log_length:t.Nat,blocks:t.Vec(t.Record({id:t.Nat,block:e})),archived_blocks:t.Vec(t.Record({args:t.Vec(d),callback:t.Func([t.Vec(d)],[a],["query"])}))}));let st=t.Record({certificate:t.Vec(t.Nat8),hash_tree:t.Vec(t.Nat8)});return t.Service({archives:t.Func([],[t.Vec(u)],["query"]),get_blocks:t.Func([d],[h],["query"]),get_data_certificate:t.Func([],[v],["query"]),get_transactions:t.Func([y],[X],["query"]),icrc1_balance_of:t.Func([c],[p],["query"]),icrc1_decimals:t.Func([],[t.Nat8],["query"]),icrc1_fee:t.Func([],[p],["query"]),icrc1_metadata:t.Func([],[t.Vec(t.Tuple(t.Text,o))],["query"]),icrc1_minting_account:t.Func([],[t.Opt(c)],["query"]),icrc1_name:t.Func([],[t.Text],["query"]),icrc1_supported_standards:t.Func([],[t.Vec(j)],["query"]),icrc1_symbol:t.Func([],[t.Text],["query"]),icrc1_total_supply:t.Func([],[p],["query"]),icrc1_transfer:t.Func([Y],[K],[]),icrc2_allowance:t.Func([I],[L],["query"]),icrc2_approve:t.Func([D],[et],[]),icrc2_transfer_from:t.Func([rt],[at],[]),icrc3_get_archives:t.Func([ot],[nt],["query"]),icrc3_get_blocks:t.Func([t.Vec(d)],[a],["query"]),icrc3_get_tip_certificate:t.Func([],[t.Opt(st)],["query"]),icrc3_supported_block_types:t.Func([],[t.Vec(t.Record({url:t.Text,block_type:t.Text}))],["query"])})};var m=require("@dfinity/utils"),gt=({from_subaccount:t,fee:a,created_at_time:e,memo:r,...n})=>({...n,fee:(0,m.toNullable)(a),memo:(0,m.toNullable)(r),from_subaccount:(0,m.toNullable)(t),created_at_time:(0,m.toNullable)(e)}),xt=({spender_subaccount:t,fee:a,created_at_time:e,memo:r,...n})=>({...n,fee:(0,m.toNullable)(a),memo:(0,m.toNullable)(r),spender_subaccount:(0,m.toNullable)(t),created_at_time:(0,m.toNullable)(e)}),Tt=({fee:t,created_at_time:a,memo:e,from_subaccount:r,expected_allowance:n,expires_at:o,...l})=>({...l,fee:(0,m.toNullable)(t),memo:(0,m.toNullable)(e),from_subaccount:(0,m.toNullable)(r),created_at_time:(0,m.toNullable)(a),expected_allowance:(0,m.toNullable)(n),expires_at:(0,m.toNullable)(o)});var M=class t extends w.Canister{constructor(){super(...arguments);this.metadata=e=>this.caller(e).icrc1_metadata();this.transactionFee=e=>this.caller(e).icrc1_fee();this.balance=e=>this.caller({certified:e.certified}).icrc1_balance_of({owner:e.owner,subaccount:(0,w.toNullable)(e.subaccount)});this.transfer=async e=>{let r=await this.caller({certified:!0}).icrc1_transfer(gt(e));if("Err"in r)throw new P({errorType:r.Err,msg:"Failed to transfer"});return r.Ok};this.totalTokensSupply=e=>this.caller(e).icrc1_total_supply();this.transferFrom=async e=>{let r=await this.caller({certified:!0}).icrc2_transfer_from(xt(e));if("Err"in r)throw new P({errorType:r.Err,msg:"Failed to transfer from"});return r.Ok};this.approve=async e=>{let r=await this.caller({certified:!0}).icrc2_approve(Tt(e));if("Err"in r)throw new P({errorType:r.Err,msg:"Failed to entitle the spender to transfer the amount"});return r.Ok};this.allowance=async e=>{let{certified:r,...n}=e;return this.caller({certified:r}).icrc2_allowance({...n})}}static create(e){let{service:r,certifiedService:n,canisterId:o}=(0,w.createServices)({options:e,idlFactory:Ot,certifiedIdlFactory:ft});return new t(o,r,n)}};var Rt=(o=>(o.SYMBOL="icrc1:symbol",o.NAME="icrc1:name",o.DECIMALS="icrc1:decimals",o.FEE="icrc1:fee",o.LOGO="icrc1:logo",o))(Rt||{});var lt=require("@dfinity/principal"),N=require("@dfinity/utils"),Pt=64,wt=({owner:t,subaccount:a})=>{if((0,N.isNullish)(a))return t.toText();let r=(n=>n.replace(/^0+/,""))((0,N.uint8ArrayToHexString)(Uint8Array.from(a)));return r.length===0?t.toText():`${t.toText()}-${yt({owner:t,subaccount:a})}.${r}`},yt=({owner:t,subaccount:a})=>{let e=(0,N.bigEndianCrc32)(Uint8Array.from([...t.toUint8Array(),...a]));return(0,N.encodeBase32)(e)},Bt=t=>{let[a,e]=t.split(".");if(!(0,N.notEmptyString)(a))throw new Error("Invalid account. No string provided.");if((0,N.isNullish)(e))return{owner:lt.Principal.fromText(t)};let[r,...n]=a.split("-").reverse(),o=n.reverse().join("-"),l={owner:lt.Principal.fromText(o),subaccount:(0,N.hexStringToUint8Array)(e.padStart(Pt,"0"))};if(yt(l)!==r)throw new Error("Invalid account. Invalid checksum.");return l};var z=require("@dfinity/utils"),St=t=>{let a=/^([a-zA-Z]+):([A-Za-z0-9:\-.]+).*?(?:[?&](?:amount|value)=(\d+(?:\.\d+)?))?$/,e=t.match(a);if((0,z.isNullish)(e))return;let[r,n,o,l]=e;return{token:n,identifier:o,...(0,z.nonNullish)(l)&&!isNaN(parseFloat(l))&&{amount:parseFloat(l)}}};0&&(module.exports={IcrcIndexCanister,IcrcIndexNgCanister,IcrcLedgerCanister,IcrcMetadataResponseEntries,IcrcTransferError,IndexError,decodeIcrcAccount,decodePayment,encodeIcrcAccount});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts", "../../src/errors/index.errors.ts", "../../src/errors/ledger.errors.ts", "../../src/index-ng.canister.ts", "../../candid/icrc_index-ng.certified.idl.js", "../../candid/icrc_index-ng.idl.js", "../../src/canister.ts", "../../src/converters/index.converters.ts", "../../src/index.canister.ts", "../../candid/icrc_index.certified.idl.js", "../../candid/icrc_index.idl.js", "../../src/ledger.canister.ts", "../../candid/icrc_ledger.certified.idl.js", "../../candid/icrc_ledger.idl.js", "../../src/converters/ledger.converters.ts", "../../src/types/ledger.responses.ts", "../../src/utils/ledger.utils.ts", "../../src/utils/payment.utils.ts"],
4
- "sourcesContent": ["export type {\n BlockIndex as IcrcBlockIndex,\n Subaccount as IcrcSubaccount,\n Tokens as IcrcTokens,\n TransferArg as IcrcTransferArg,\n TransferError as IcrcTransferVariatError,\n Value as IcrcValue,\n} from \"../candid/icrc_ledger\";\nexport * from \"./errors/index.errors\";\nexport * from \"./errors/ledger.errors\";\nexport { IcrcIndexNgCanister } from \"./index-ng.canister\";\nexport { IcrcIndexCanister } from \"./index.canister\";\nexport { IcrcLedgerCanister } from \"./ledger.canister\";\nexport type * from \"./types/index-ng.params\";\nexport type * from \"./types/index-ng.types\";\nexport type * from \"./types/index.params\";\nexport type * from \"./types/index.types\";\nexport * from \"./types/ledger.params\";\nexport * from \"./types/ledger.responses\";\nexport * from \"./utils/ledger.utils\";\nexport * from \"./utils/payment.utils\";\n", "export class IndexError extends Error {}\n", "export class IcrcTransferError<T> extends Error {\n public errorType: T;\n constructor({ msg, errorType }: { msg?: string; errorType: T }) {\n super(msg);\n this.errorType = errorType;\n }\n}\n", "import type { Principal } from \"@dfinity/principal\";\nimport { createServices, type QueryParams } from \"@dfinity/utils\";\nimport type {\n GetTransactions,\n _SERVICE as IcrcIndexNgService,\n} from \"../candid/icrc_index-ng\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc_index-ng.certified.idl\";\nimport { idlFactory } from \"../candid/icrc_index-ng.idl\";\nimport { IcrcCanister } from \"./canister\";\nimport { toGetTransactionsArgs } from \"./converters/index.converters\";\nimport { IndexError } from \"./errors/index.errors\";\nimport type { IcrcLedgerCanisterOptions } from \"./types/canister.options\";\nimport type { GetIndexNgAccountTransactionsParams } from \"./types/index-ng.params\";\n\nexport class IcrcIndexNgCanister extends IcrcCanister<IcrcIndexNgService> {\n static create(options: IcrcLedgerCanisterOptions<IcrcIndexNgService>) {\n const { service, certifiedService, canisterId } =\n createServices<IcrcIndexNgService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new IcrcIndexNgCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the transactions of an account\n *\n * Always certified.\n * `get_account_transactions` needs to be called with an update\n * because the index canisters makes a call to the ledger canister to get the transaction data.\n * Index Canister only holds the transactions ids in state, not the whole transaction data.\n */\n /**\n * Get the transactions of an account.\n *\n * @param {GetAccountTransactionsParams} params The parameters to get the transactions of an account.\n * @returns {Promise<GetTransactions>} The list of transactions and further related information of the given account.\n */\n getTransactions = async ({\n certified,\n ...rest\n }: GetIndexNgAccountTransactionsParams): Promise<GetTransactions> => {\n const response = await this.caller({\n certified,\n }).get_account_transactions(toGetTransactionsArgs(rest));\n\n if (\"Err\" in response) {\n throw new IndexError(response.Err.message);\n }\n\n return response.Ok;\n };\n\n /**\n * Returns the ledger canister ID related to the index canister.\n */\n ledgerId = (params: QueryParams): Promise<Principal> => {\n const { ledger_id } = this.caller(params);\n return ledger_id();\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Rec();\n const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });\n const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n const BlockIndex = IDL.Nat;\n const SubAccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(SubAccount),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(BlockIndex),\n 'account' : Account,\n });\n const Tokens = IDL.Nat;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : BlockIndex,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'balance' : Tokens,\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(BlockIndex),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const GetBlocksRequest = IDL.Record({\n 'start' : IDL.Nat,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const GetBlocksResponse = IDL.Record({\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n });\n const FeeCollectorRanges = IDL.Record({\n 'ranges' : IDL.Vec(\n IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))\n ),\n });\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n [],\n ),\n 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], []),\n 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], []),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),\n 'ledger_id' : IDL.Func([], [IDL.Principal], []),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n [],\n ),\n 'status' : IDL.Func([], [Status], []),\n });\n};\nexport const init = ({ IDL }) => {\n const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });\n const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n return [IDL.Opt(IndexArg)];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Rec();\n const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });\n const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n const BlockIndex = IDL.Nat;\n const SubAccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(SubAccount),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(BlockIndex),\n 'account' : Account,\n });\n const Tokens = IDL.Nat;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : BlockIndex,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'balance' : Tokens,\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(BlockIndex),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const GetBlocksRequest = IDL.Record({\n 'start' : IDL.Nat,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const GetBlocksResponse = IDL.Record({\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n });\n const FeeCollectorRanges = IDL.Record({\n 'ranges' : IDL.Vec(\n IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))\n ),\n });\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n ['query'],\n ),\n 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),\n 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], ['query']),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),\n 'ledger_id' : IDL.Func([], [IDL.Principal], ['query']),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n ['query'],\n ),\n 'status' : IDL.Func([], [Status], ['query']),\n });\n};\nexport const init = ({ IDL }) => {\n const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });\n const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n return [IDL.Opt(IndexArg)];\n};\n", "import { Canister, toNullable } from \"@dfinity/utils\";\nimport type { _SERVICE as IcrcIndexNgService } from \"../candid/icrc_index-ng\";\nimport type {\n _SERVICE as IcrcLedgerService,\n Tokens,\n} from \"../candid/icrc_ledger\";\nimport type { BalanceParams } from \"./types/ledger.params\";\n\nexport abstract class IcrcCanister<\n T extends IcrcLedgerService | IcrcIndexNgService,\n> extends Canister<T> {\n /**\n * Returns the balance for a given account provided as owner and with optional subaccount.\n *\n * @param {BalanceParams} params The parameters to get the balance of an account.\n * @returns {Promise<Tokens>} The balance of the given account.\n */\n balance = (params: BalanceParams): Promise<Tokens> =>\n this.caller({ certified: params.certified }).icrc1_balance_of({\n owner: params.owner,\n subaccount: toNullable(params.subaccount),\n });\n}\n", "import { toNullable } from \"@dfinity/utils\";\nimport type {\n Account,\n GetAccountTransactionsArgs,\n} from \"../../candid/icrc_index\";\nimport type { GetAccountTransactionsParams } from \"../types/index.params\";\nimport type { IcrcAccount } from \"../types/ledger.responses\";\n\nconst toCandidAccount = ({ owner, subaccount }: IcrcAccount): Account => ({\n owner,\n subaccount: toNullable(subaccount),\n});\n\nexport const toGetTransactionsArgs = ({\n account,\n max_results,\n start,\n}: GetAccountTransactionsParams): GetAccountTransactionsArgs => ({\n account: toCandidAccount(account),\n max_results,\n start: toNullable(start),\n});\n", "import { Canister, createServices } from \"@dfinity/utils\";\nimport type {\n GetTransactions,\n _SERVICE as IcrcIndexService,\n} from \"../candid/icrc_index\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc_index.certified.idl\";\nimport { idlFactory } from \"../candid/icrc_index.idl\";\nimport { toGetTransactionsArgs } from \"./converters/index.converters\";\nimport { IndexError } from \"./errors/index.errors\";\nimport type { IcrcLedgerCanisterOptions } from \"./types/canister.options\";\nimport type { GetAccountTransactionsParams } from \"./types/index.params\";\n\nexport class IcrcIndexCanister extends Canister<IcrcIndexService> {\n static create(options: IcrcLedgerCanisterOptions<IcrcIndexService>) {\n const { service, certifiedService, canisterId } =\n createServices<IcrcIndexService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new IcrcIndexCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the transactions of an account\n *\n * Always certified.\n * `get_account_transactions` needs to be called with an update\n * because the index canisters makes a call to the ledger canister to get the transaction data.\n * Index Canister only holds the transactions ids in state, not the whole transaction data.\n */\n getTransactions = async (\n params: GetAccountTransactionsParams,\n ): Promise<GetTransactions> => {\n const response = await this.caller({\n certified: true,\n }).get_account_transactions(toGetTransactionsArgs(params));\n\n if (\"Err\" in response) {\n throw new IndexError(response.Err.message);\n }\n\n return response.Ok;\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index.did */\nexport const idlFactory = ({ IDL }) => {\n const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });\n const TxId = IDL.Nat;\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(TxId),\n 'account' : Account,\n });\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : TxId,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(TxId),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const SubAccount = IDL.Vec(IDL.Nat8);\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n [],\n ),\n 'ledger_id' : IDL.Func([], [IDL.Principal], []),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });\n return [InitArgs];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index.did */\nexport const idlFactory = ({ IDL }) => {\n const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });\n const TxId = IDL.Nat;\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(TxId),\n 'account' : Account,\n });\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : TxId,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(TxId),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const SubAccount = IDL.Vec(IDL.Nat8);\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n [],\n ),\n 'ledger_id' : IDL.Func([], [IDL.Principal], ['query']),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n ['query'],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });\n return [InitArgs];\n};\n", "import type { QueryParams } from \"@dfinity/utils\";\nimport { Canister, createServices, toNullable } from \"@dfinity/utils\";\nimport type {\n Allowance,\n BlockIndex,\n _SERVICE as IcrcLedgerService,\n Tokens,\n} from \"../candid/icrc_ledger\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc_ledger.certified.idl\";\nimport { idlFactory } from \"../candid/icrc_ledger.idl\";\nimport {\n toApproveArgs,\n toTransferArg,\n toTransferFromArgs,\n} from \"./converters/ledger.converters\";\nimport { IcrcTransferError } from \"./errors/ledger.errors\";\nimport type { IcrcLedgerCanisterOptions } from \"./types/canister.options\";\nimport type {\n AllowanceParams,\n ApproveParams,\n BalanceParams,\n TransferFromParams,\n TransferParams,\n} from \"./types/ledger.params\";\nimport type { IcrcTokenMetadataResponse } from \"./types/ledger.responses\";\n\nexport class IcrcLedgerCanister extends Canister<IcrcLedgerService> {\n static create(options: IcrcLedgerCanisterOptions<IcrcLedgerService>) {\n const { service, certifiedService, canisterId } =\n createServices<IcrcLedgerService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new IcrcLedgerCanister(canisterId, service, certifiedService);\n }\n\n /**\n * The token metadata (name, symbol, etc.).\n */\n metadata = (params: QueryParams): Promise<IcrcTokenMetadataResponse> =>\n this.caller(params).icrc1_metadata();\n\n /**\n * The ledger transaction fees.\n *\n * @returns {Tokens} The ledger transaction fees in Tokens\n */\n transactionFee = (params: QueryParams): Promise<Tokens> =>\n this.caller(params).icrc1_fee();\n\n /**\n * Returns the balance for a given account provided as owner and with optional subaccount.\n *\n * @param {BalanceParams} params The parameters to get the balance of an account.\n * @returns {Promise<Tokens>} The balance of the given account.\n */\n balance = (params: BalanceParams): Promise<Tokens> =>\n this.caller({ certified: params.certified }).icrc1_balance_of({\n owner: params.owner,\n subaccount: toNullable(params.subaccount),\n });\n\n /**\n * Transfers tokens from the sender to the given account.\n *\n * @param {TransferArg} params The parameters to transfer tokens.\n *\n * @throws {IcrcTransferError} If the transfer fails.\n */\n transfer = async (params: TransferParams): Promise<BlockIndex> => {\n const response = await this.caller({ certified: true }).icrc1_transfer(\n toTransferArg(params),\n );\n if (\"Err\" in response) {\n throw new IcrcTransferError({\n errorType: response.Err,\n msg: \"Failed to transfer\",\n });\n }\n return response.Ok;\n };\n\n /**\n * Returns the total supply of tokens.\n */\n totalTokensSupply = (params: QueryParams): Promise<Tokens> => {\n return this.caller(params).icrc1_total_supply();\n };\n\n /**\n * Transfers a token amount from the `from` account to the `to` account using the allowance of the spender's account (`SpenderAccount = { owner = caller; subaccount = spender_subaccount }`). The ledger draws the fees from the `from` account.\n *\n * Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_transfer_from\n *\n * @param {TransferFromParams} params The parameters to transfer tokens from to.\n *\n * @throws {IcrcTransferError} If the transfer from fails.\n */\n transferFrom = async (params: TransferFromParams): Promise<BlockIndex> => {\n const response = await this.caller({ certified: true }).icrc2_transfer_from(\n toTransferFromArgs(params),\n );\n if (\"Err\" in response) {\n throw new IcrcTransferError({\n errorType: response.Err,\n msg: \"Failed to transfer from\",\n });\n }\n return response.Ok;\n };\n\n /**\n * This method entitles the `spender` to transfer token `amount` on behalf of the caller from account `{ owner = caller; subaccount = from_subaccount }`.\n *\n * Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_approve\n *\n * @param {ApproveParams} params The parameters to approve.\n *\n * @throws {IcrcTransferError} If the approval fails.\n */\n approve = async (params: ApproveParams): Promise<BlockIndex> => {\n const response = await this.caller({ certified: true }).icrc2_approve(\n toApproveArgs(params),\n );\n if (\"Err\" in response) {\n throw new IcrcTransferError({\n errorType: response.Err,\n msg: \"Failed to entitle the spender to transfer the amount\",\n });\n }\n return response.Ok;\n };\n\n /**\n * Returns the token allowance that the `spender` account can transfer from the specified `account`, and the expiration time for that allowance, if any.\n *\n * Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_allowance\n *\n * @param {AllowanceParams} params The parameters to call the allowance.\n *\n * @returns {Allowance} The token allowance. If there is no active approval, the ledger MUST return `{ allowance = 0; expires_at = null }`.\n */\n allowance = async (params: AllowanceParams): Promise<Allowance> => {\n const { certified, ...rest } = params;\n return this.caller({ certified }).icrc2_allowance({ ...rest });\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_ledger.did */\nexport const idlFactory = ({ IDL }) => {\n const GetBlocksResult = IDL.Rec();\n const ICRC3Value = IDL.Rec();\n const Value = IDL.Rec();\n const ChangeArchiveOptions = IDL.Record({\n 'num_blocks_to_archive' : IDL.Opt(IDL.Nat64),\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Opt(IDL.Nat64),\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Opt(IDL.Principal),\n });\n const MetadataValue = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const ChangeFeeCollector = IDL.Variant({\n 'SetTo' : Account,\n 'Unset' : IDL.Null,\n });\n const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });\n const UpgradeArgs = IDL.Record({\n 'change_archive_options' : IDL.Opt(ChangeArchiveOptions),\n 'token_symbol' : IDL.Opt(IDL.Text),\n 'transfer_fee' : IDL.Opt(IDL.Nat),\n 'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'change_fee_collector' : IDL.Opt(ChangeFeeCollector),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Opt(IDL.Text),\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const InitArgs = IDL.Record({\n 'decimals' : IDL.Opt(IDL.Nat8),\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat)),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'fee_collector_account' : IDL.Opt(Account),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Nat64,\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Text,\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const LedgerArg = IDL.Variant({\n 'Upgrade' : IDL.Opt(UpgradeArgs),\n 'Init' : InitArgs,\n });\n const BlockIndex = IDL.Nat;\n const ArchiveInfo = IDL.Record({\n 'block_range_end' : BlockIndex,\n 'canister_id' : IDL.Principal,\n 'block_range_start' : BlockIndex,\n });\n const GetBlocksArgs = IDL.Record({\n 'start' : BlockIndex,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const BlockRange = IDL.Record({ 'blocks' : IDL.Vec(Block) });\n const QueryBlockArchiveFn = IDL.Func([GetBlocksArgs], [BlockRange], []);\n const GetBlocksResponse = IDL.Record({\n 'certificate' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'first_index' : BlockIndex,\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n 'archived_blocks' : IDL.Vec(\n IDL.Record({\n 'callback' : QueryBlockArchiveFn,\n 'start' : BlockIndex,\n 'length' : IDL.Nat,\n })\n ),\n });\n const DataCertificate = IDL.Record({\n 'certificate' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'hash_tree' : IDL.Vec(IDL.Nat8),\n });\n const TxIndex = IDL.Nat;\n const GetTransactionsRequest = IDL.Record({\n 'start' : TxIndex,\n 'length' : IDL.Nat,\n });\n const Timestamp = IDL.Nat64;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(Timestamp),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : Timestamp,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionRange = IDL.Record({\n 'transactions' : IDL.Vec(Transaction),\n });\n const QueryArchiveFn = IDL.Func(\n [GetTransactionsRequest],\n [TransactionRange],\n [],\n );\n const GetTransactionsResponse = IDL.Record({\n 'first_index' : TxIndex,\n 'log_length' : IDL.Nat,\n 'transactions' : IDL.Vec(Transaction),\n 'archived_transactions' : IDL.Vec(\n IDL.Record({\n 'callback' : QueryArchiveFn,\n 'start' : TxIndex,\n 'length' : IDL.Nat,\n })\n ),\n });\n const Tokens = IDL.Nat;\n const StandardRecord = IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text });\n const TransferArg = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(Subaccount),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const TransferError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferError,\n });\n const AllowanceArgs = IDL.Record({\n 'account' : Account,\n 'spender' : Account,\n });\n const Allowance = IDL.Record({\n 'allowance' : IDL.Nat,\n 'expires_at' : IDL.Opt(Timestamp),\n });\n const ApproveArgs = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(Timestamp),\n 'spender' : Account,\n });\n const ApproveError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : IDL.Nat }),\n 'AllowanceChanged' : IDL.Record({ 'current_allowance' : IDL.Nat }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'Expired' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'InsufficientFunds' : IDL.Record({ 'balance' : IDL.Nat }),\n });\n const ApproveResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : ApproveError,\n });\n const TransferFromArgs = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'spender_subaccount' : IDL.Opt(Subaccount),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const TransferFromError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'InsufficientAllowance' : IDL.Record({ 'allowance' : Tokens }),\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferFromResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferFromError,\n });\n const GetArchivesArgs = IDL.Record({ 'from' : IDL.Opt(IDL.Principal) });\n const GetArchivesResult = IDL.Vec(\n IDL.Record({\n 'end' : IDL.Nat,\n 'canister_id' : IDL.Principal,\n 'start' : IDL.Nat,\n })\n );\n ICRC3Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(ICRC3Value),\n })\n );\n GetBlocksResult.fill(\n IDL.Record({\n 'log_length' : IDL.Nat,\n 'blocks' : IDL.Vec(IDL.Record({ 'id' : IDL.Nat, 'block' : ICRC3Value })),\n 'archived_blocks' : IDL.Vec(\n IDL.Record({\n 'args' : IDL.Vec(GetBlocksArgs),\n 'callback' : IDL.Func(\n [IDL.Vec(GetBlocksArgs)],\n [GetBlocksResult],\n [],\n ),\n })\n ),\n })\n );\n const ICRC3DataCertificate = IDL.Record({\n 'certificate' : IDL.Vec(IDL.Nat8),\n 'hash_tree' : IDL.Vec(IDL.Nat8),\n });\n return IDL.Service({\n 'archives' : IDL.Func([], [IDL.Vec(ArchiveInfo)], []),\n 'get_blocks' : IDL.Func([GetBlocksArgs], [GetBlocksResponse], []),\n 'get_data_certificate' : IDL.Func([], [DataCertificate], []),\n 'get_transactions' : IDL.Func(\n [GetTransactionsRequest],\n [GetTransactionsResponse],\n [],\n ),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),\n 'icrc1_decimals' : IDL.Func([], [IDL.Nat8], []),\n 'icrc1_fee' : IDL.Func([], [Tokens], []),\n 'icrc1_metadata' : IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))],\n [],\n ),\n 'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], []),\n 'icrc1_name' : IDL.Func([], [IDL.Text], []),\n 'icrc1_supported_standards' : IDL.Func([], [IDL.Vec(StandardRecord)], []),\n 'icrc1_symbol' : IDL.Func([], [IDL.Text], []),\n 'icrc1_total_supply' : IDL.Func([], [Tokens], []),\n 'icrc1_transfer' : IDL.Func([TransferArg], [TransferResult], []),\n 'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], []),\n 'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []),\n 'icrc2_transfer_from' : IDL.Func(\n [TransferFromArgs],\n [TransferFromResult],\n [],\n ),\n 'icrc3_get_archives' : IDL.Func([GetArchivesArgs], [GetArchivesResult], []),\n 'icrc3_get_blocks' : IDL.Func(\n [IDL.Vec(GetBlocksArgs)],\n [GetBlocksResult],\n [],\n ),\n 'icrc3_get_tip_certificate' : IDL.Func(\n [],\n [IDL.Opt(ICRC3DataCertificate)],\n [],\n ),\n 'icrc3_supported_block_types' : IDL.Func(\n [],\n [IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'block_type' : IDL.Text }))],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const ChangeArchiveOptions = IDL.Record({\n 'num_blocks_to_archive' : IDL.Opt(IDL.Nat64),\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Opt(IDL.Nat64),\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Opt(IDL.Principal),\n });\n const MetadataValue = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const ChangeFeeCollector = IDL.Variant({\n 'SetTo' : Account,\n 'Unset' : IDL.Null,\n });\n const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });\n const UpgradeArgs = IDL.Record({\n 'change_archive_options' : IDL.Opt(ChangeArchiveOptions),\n 'token_symbol' : IDL.Opt(IDL.Text),\n 'transfer_fee' : IDL.Opt(IDL.Nat),\n 'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'change_fee_collector' : IDL.Opt(ChangeFeeCollector),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Opt(IDL.Text),\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const InitArgs = IDL.Record({\n 'decimals' : IDL.Opt(IDL.Nat8),\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat)),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'fee_collector_account' : IDL.Opt(Account),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Nat64,\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Text,\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const LedgerArg = IDL.Variant({\n 'Upgrade' : IDL.Opt(UpgradeArgs),\n 'Init' : InitArgs,\n });\n return [LedgerArg];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_ledger.did */\nexport const idlFactory = ({ IDL }) => {\n const GetBlocksResult = IDL.Rec();\n const ICRC3Value = IDL.Rec();\n const Value = IDL.Rec();\n const ChangeArchiveOptions = IDL.Record({\n 'num_blocks_to_archive' : IDL.Opt(IDL.Nat64),\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Opt(IDL.Nat64),\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Opt(IDL.Principal),\n });\n const MetadataValue = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const ChangeFeeCollector = IDL.Variant({\n 'SetTo' : Account,\n 'Unset' : IDL.Null,\n });\n const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });\n const UpgradeArgs = IDL.Record({\n 'change_archive_options' : IDL.Opt(ChangeArchiveOptions),\n 'token_symbol' : IDL.Opt(IDL.Text),\n 'transfer_fee' : IDL.Opt(IDL.Nat),\n 'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'change_fee_collector' : IDL.Opt(ChangeFeeCollector),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Opt(IDL.Text),\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const InitArgs = IDL.Record({\n 'decimals' : IDL.Opt(IDL.Nat8),\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat)),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'fee_collector_account' : IDL.Opt(Account),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Nat64,\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Text,\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const LedgerArg = IDL.Variant({\n 'Upgrade' : IDL.Opt(UpgradeArgs),\n 'Init' : InitArgs,\n });\n const BlockIndex = IDL.Nat;\n const ArchiveInfo = IDL.Record({\n 'block_range_end' : BlockIndex,\n 'canister_id' : IDL.Principal,\n 'block_range_start' : BlockIndex,\n });\n const GetBlocksArgs = IDL.Record({\n 'start' : BlockIndex,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const BlockRange = IDL.Record({ 'blocks' : IDL.Vec(Block) });\n const QueryBlockArchiveFn = IDL.Func(\n [GetBlocksArgs],\n [BlockRange],\n ['query'],\n );\n const GetBlocksResponse = IDL.Record({\n 'certificate' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'first_index' : BlockIndex,\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n 'archived_blocks' : IDL.Vec(\n IDL.Record({\n 'callback' : QueryBlockArchiveFn,\n 'start' : BlockIndex,\n 'length' : IDL.Nat,\n })\n ),\n });\n const DataCertificate = IDL.Record({\n 'certificate' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'hash_tree' : IDL.Vec(IDL.Nat8),\n });\n const TxIndex = IDL.Nat;\n const GetTransactionsRequest = IDL.Record({\n 'start' : TxIndex,\n 'length' : IDL.Nat,\n });\n const Timestamp = IDL.Nat64;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(Timestamp),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : Timestamp,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionRange = IDL.Record({\n 'transactions' : IDL.Vec(Transaction),\n });\n const QueryArchiveFn = IDL.Func(\n [GetTransactionsRequest],\n [TransactionRange],\n ['query'],\n );\n const GetTransactionsResponse = IDL.Record({\n 'first_index' : TxIndex,\n 'log_length' : IDL.Nat,\n 'transactions' : IDL.Vec(Transaction),\n 'archived_transactions' : IDL.Vec(\n IDL.Record({\n 'callback' : QueryArchiveFn,\n 'start' : TxIndex,\n 'length' : IDL.Nat,\n })\n ),\n });\n const Tokens = IDL.Nat;\n const StandardRecord = IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text });\n const TransferArg = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(Subaccount),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const TransferError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferError,\n });\n const AllowanceArgs = IDL.Record({\n 'account' : Account,\n 'spender' : Account,\n });\n const Allowance = IDL.Record({\n 'allowance' : IDL.Nat,\n 'expires_at' : IDL.Opt(Timestamp),\n });\n const ApproveArgs = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(Timestamp),\n 'spender' : Account,\n });\n const ApproveError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : IDL.Nat }),\n 'AllowanceChanged' : IDL.Record({ 'current_allowance' : IDL.Nat }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'Expired' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'InsufficientFunds' : IDL.Record({ 'balance' : IDL.Nat }),\n });\n const ApproveResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : ApproveError,\n });\n const TransferFromArgs = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'spender_subaccount' : IDL.Opt(Subaccount),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const TransferFromError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'InsufficientAllowance' : IDL.Record({ 'allowance' : Tokens }),\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferFromResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferFromError,\n });\n const GetArchivesArgs = IDL.Record({ 'from' : IDL.Opt(IDL.Principal) });\n const GetArchivesResult = IDL.Vec(\n IDL.Record({\n 'end' : IDL.Nat,\n 'canister_id' : IDL.Principal,\n 'start' : IDL.Nat,\n })\n );\n ICRC3Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(ICRC3Value),\n })\n );\n GetBlocksResult.fill(\n IDL.Record({\n 'log_length' : IDL.Nat,\n 'blocks' : IDL.Vec(IDL.Record({ 'id' : IDL.Nat, 'block' : ICRC3Value })),\n 'archived_blocks' : IDL.Vec(\n IDL.Record({\n 'args' : IDL.Vec(GetBlocksArgs),\n 'callback' : IDL.Func(\n [IDL.Vec(GetBlocksArgs)],\n [GetBlocksResult],\n ['query'],\n ),\n })\n ),\n })\n );\n const ICRC3DataCertificate = IDL.Record({\n 'certificate' : IDL.Vec(IDL.Nat8),\n 'hash_tree' : IDL.Vec(IDL.Nat8),\n });\n return IDL.Service({\n 'archives' : IDL.Func([], [IDL.Vec(ArchiveInfo)], ['query']),\n 'get_blocks' : IDL.Func([GetBlocksArgs], [GetBlocksResponse], ['query']),\n 'get_data_certificate' : IDL.Func([], [DataCertificate], ['query']),\n 'get_transactions' : IDL.Func(\n [GetTransactionsRequest],\n [GetTransactionsResponse],\n ['query'],\n ),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),\n 'icrc1_decimals' : IDL.Func([], [IDL.Nat8], ['query']),\n 'icrc1_fee' : IDL.Func([], [Tokens], ['query']),\n 'icrc1_metadata' : IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))],\n ['query'],\n ),\n 'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], ['query']),\n 'icrc1_name' : IDL.Func([], [IDL.Text], ['query']),\n 'icrc1_supported_standards' : IDL.Func(\n [],\n [IDL.Vec(StandardRecord)],\n ['query'],\n ),\n 'icrc1_symbol' : IDL.Func([], [IDL.Text], ['query']),\n 'icrc1_total_supply' : IDL.Func([], [Tokens], ['query']),\n 'icrc1_transfer' : IDL.Func([TransferArg], [TransferResult], []),\n 'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], ['query']),\n 'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []),\n 'icrc2_transfer_from' : IDL.Func(\n [TransferFromArgs],\n [TransferFromResult],\n [],\n ),\n 'icrc3_get_archives' : IDL.Func(\n [GetArchivesArgs],\n [GetArchivesResult],\n ['query'],\n ),\n 'icrc3_get_blocks' : IDL.Func(\n [IDL.Vec(GetBlocksArgs)],\n [GetBlocksResult],\n ['query'],\n ),\n 'icrc3_get_tip_certificate' : IDL.Func(\n [],\n [IDL.Opt(ICRC3DataCertificate)],\n ['query'],\n ),\n 'icrc3_supported_block_types' : IDL.Func(\n [],\n [IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'block_type' : IDL.Text }))],\n ['query'],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const ChangeArchiveOptions = IDL.Record({\n 'num_blocks_to_archive' : IDL.Opt(IDL.Nat64),\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Opt(IDL.Nat64),\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Opt(IDL.Principal),\n });\n const MetadataValue = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const ChangeFeeCollector = IDL.Variant({\n 'SetTo' : Account,\n 'Unset' : IDL.Null,\n });\n const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });\n const UpgradeArgs = IDL.Record({\n 'change_archive_options' : IDL.Opt(ChangeArchiveOptions),\n 'token_symbol' : IDL.Opt(IDL.Text),\n 'transfer_fee' : IDL.Opt(IDL.Nat),\n 'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'change_fee_collector' : IDL.Opt(ChangeFeeCollector),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Opt(IDL.Text),\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const InitArgs = IDL.Record({\n 'decimals' : IDL.Opt(IDL.Nat8),\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat)),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'fee_collector_account' : IDL.Opt(Account),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Nat64,\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Text,\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const LedgerArg = IDL.Variant({\n 'Upgrade' : IDL.Opt(UpgradeArgs),\n 'Init' : InitArgs,\n });\n return [LedgerArg];\n};\n", "import { toNullable } from \"@dfinity/utils\";\nimport type {\n ApproveArgs,\n TransferArg,\n TransferFromArgs,\n} from \"../../candid/icrc_ledger\";\nimport type {\n ApproveParams,\n TransferFromParams,\n TransferParams,\n} from \"../types/ledger.params\";\n\n// WARNING: When using the ICRC-1 interface of the ICP ledger, there is no\n// relationship between the memo and the icrc1Memo of a transaction. The ICRC-1\n// interface simply cannot set the memo field and the non-ICRC-1 interface\n// cannot set the icrc1Memo field, even though the icrc1Memo field is called\n// just \"memo\" in canister method params.\nexport const toTransferArg = ({\n from_subaccount,\n fee,\n created_at_time,\n memo,\n ...rest\n}: TransferParams): TransferArg => ({\n ...rest,\n fee: toNullable(fee),\n memo: toNullable(memo),\n from_subaccount: toNullable(from_subaccount),\n created_at_time: toNullable(created_at_time),\n});\n\nexport const toTransferFromArgs = ({\n spender_subaccount,\n fee,\n created_at_time,\n memo,\n ...rest\n}: TransferFromParams): TransferFromArgs => ({\n ...rest,\n fee: toNullable(fee),\n memo: toNullable(memo),\n spender_subaccount: toNullable(spender_subaccount),\n created_at_time: toNullable(created_at_time),\n});\n\nexport const toApproveArgs = ({\n fee,\n created_at_time,\n memo,\n from_subaccount,\n expected_allowance,\n expires_at,\n ...rest\n}: ApproveParams): ApproveArgs => ({\n ...rest,\n fee: toNullable(fee),\n memo: toNullable(memo),\n from_subaccount: toNullable(from_subaccount),\n created_at_time: toNullable(created_at_time),\n expected_allowance: toNullable(expected_allowance),\n expires_at: toNullable(expires_at),\n});\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { Subaccount, Value } from \"../../candid/icrc_ledger\";\n\n// Source: https://github.com/dfinity/icrc-1#standard-metadata-entries\nexport enum IcrcMetadataResponseEntries {\n SYMBOL = \"icrc1:symbol\",\n NAME = \"icrc1:name\",\n DECIMALS = \"icrc1:decimals\",\n FEE = \"icrc1:fee\",\n LOGO = \"icrc1:logo\",\n}\n\nexport type IcrcTokenMetadataResponse = [\n string | IcrcMetadataResponseEntries,\n Value,\n][];\n\nexport interface IcrcAccount {\n owner: Principal;\n subaccount?: Subaccount;\n}\n", "import { Principal } from \"@dfinity/principal\";\nimport {\n bigEndianCrc32,\n encodeBase32,\n hexStringToUint8Array,\n isNullish,\n notEmptyString,\n uint8ArrayToHexString,\n} from \"@dfinity/utils\";\nimport type { IcrcAccount } from \"../types/ledger.responses\";\n\nconst MAX_SUBACCOUNT_HEX_LENGTH = 64;\n\n/**\n * Encodes an Icrc-1 account compatible into a string.\n * Formatting Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/TextualEncoding.md\n *\n * @param account { owner: Principal, subaccount?: Uint8Array }\n * @returns string\n */\nexport const encodeIcrcAccount = ({\n owner,\n subaccount,\n}: IcrcAccount): string => {\n if (isNullish(subaccount)) {\n return owner.toText();\n }\n\n const removeLeadingZeros = (text: string): string => text.replace(/^0+/, \"\");\n\n const subaccountText = removeLeadingZeros(\n uint8ArrayToHexString(Uint8Array.from(subaccount)),\n );\n\n if (subaccountText.length === 0) {\n return owner.toText();\n }\n\n return `${owner.toText()}-${encodeCrc({\n owner,\n subaccount,\n })}.${subaccountText}`;\n};\n\nconst encodeCrc = ({ owner, subaccount }: Required<IcrcAccount>): string => {\n const crc = bigEndianCrc32(\n Uint8Array.from([...owner.toUint8Array(), ...subaccount]),\n );\n\n return encodeBase32(crc);\n};\n\n/**\n * Decodes a string into an Icrc-1 compatible account.\n * Formatting Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/TextualEncoding.md\n *\n * @param accountString string\n * @throws Error if the string is not a valid Icrc-1 account\n * @returns IcrcAccount { owner: Principal, subaccount?: Uint8Array }\n */\nexport const decodeIcrcAccount = (accountString: string): IcrcAccount => {\n const [principalAndMaybeCheckSum, subaccountHex] = accountString.split(\".\");\n\n if (!notEmptyString(principalAndMaybeCheckSum)) {\n throw new Error(\"Invalid account. No string provided.\");\n }\n\n if (isNullish(subaccountHex)) {\n return {\n owner: Principal.fromText(accountString),\n };\n }\n\n const [checksum, ...rest] = principalAndMaybeCheckSum.split(\"-\").reverse();\n const principalText = rest.reverse().join(\"-\");\n\n const account = {\n owner: Principal.fromText(principalText),\n subaccount: hexStringToUint8Array(\n subaccountHex.padStart(MAX_SUBACCOUNT_HEX_LENGTH, \"0\"),\n ),\n };\n\n const crcText = encodeCrc(account);\n\n if (crcText !== checksum) {\n throw new Error(\"Invalid account. Invalid checksum.\");\n }\n\n return account;\n};\n", "import { isNullish, nonNullish } from \"@dfinity/utils\";\n\n/**\n * \uD83D\uDC40 This feature is currently in draft. You can find more information about it at https://github.com/dfinity/ICRC/issues/22.\n *\n * A naive implementation of a payment parser. Given a code, the function attempts to extract a token name, account identifier (textual representation), and an optional amount.\n *\n * If the code doesn't match the expected pattern, `undefined` is returned for simplicity.\n * Similarly, if an optional amount is provided but it's not a valid number, the parser will not throw an exception and returns `undefined`.\n *\n * Please note that this function doesn't perform any validity checks on the extracted information.\n * It does not verify if the token is known or if the identifier is a valid address.\n *\n * ```\n * urn = token \":\" address [ \"?\" params]\n * token = [ ckbtc / icp / chat / bitcoin / ethereum ... ]\n * address = STRING\n * params = param [ \"&\" params ]\n * param = [ amountparam ]\n * amountparam = \"amount=\" *digit [ \".\" *digit ]\n * ```\n *\n * @param code string\n * @returns { token: string; identifier: string; amount?: number } | undefined\n */\nexport const decodePayment = (\n code: string,\n): { token: string; identifier: string; amount?: number } | undefined => {\n const regex =\n /^([a-zA-Z]+):([A-Za-z0-9:\\-.]+).*?(?:[?&](?:amount|value)=(\\d+(?:\\.\\d+)?))?$/;\n\n const match = code.match(regex);\n if (isNullish(match)) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, token, identifier, amount] = match;\n\n return {\n token,\n identifier,\n ...(nonNullish(amount) &&\n !isNaN(parseFloat(amount)) && { amount: parseFloat(amount) }),\n };\n};\n"],
5
- "mappings": "ubAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,uBAAAE,EAAA,wBAAAC,EAAA,uBAAAC,EAAA,gCAAAC,GAAA,sBAAAC,EAAA,eAAAC,EAAA,sBAAAC,GAAA,kBAAAC,GAAA,sBAAAC,KAAA,eAAAC,GAAAX,ICAO,IAAMY,EAAN,cAAyB,KAAM,CAAC,ECAhC,IAAMC,EAAN,cAAmC,KAAM,CAE9C,YAAY,CAAE,IAAAC,EAAK,UAAAC,CAAU,EAAmC,CAC9D,MAAMD,CAAG,EACT,KAAK,UAAYC,CACnB,CACF,ECLA,IAAAC,GAAiD,0BCA1C,IAAMC,GAAa,CAAC,CAAE,IAAAC,CAAI,IAAM,CACrC,IAAMC,EAAQD,EAAI,IAAI,EAChBE,EAAaF,EAAI,OAAO,CAAE,UAAcA,EAAI,IAAIA,EAAI,SAAS,CAAE,CAAC,EAChEG,EAAUH,EAAI,OAAO,CAAE,UAAcA,EAAI,SAAU,CAAC,EACpDI,EAAWJ,EAAI,QAAQ,CAAE,QAAYE,EAAY,KAASC,CAAQ,CAAC,EACnEE,EAAaL,EAAI,IACjBM,EAAaN,EAAI,IAAIA,EAAI,IAAI,EAC7BO,EAAUP,EAAI,OAAO,CACzB,MAAUA,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TransferArg as IcrcTransferArg,\n TransferError as IcrcTransferVariatError,\n Value as IcrcValue,\n} from \"../candid/icrc_ledger\";\nexport * from \"./errors/index.errors\";\nexport * from \"./errors/ledger.errors\";\nexport { IcrcIndexNgCanister } from \"./index-ng.canister\";\nexport { IcrcIndexCanister } from \"./index.canister\";\nexport { IcrcLedgerCanister } from \"./ledger.canister\";\nexport type * from \"./types/index-ng.params\";\nexport type * from \"./types/index-ng.types\";\nexport type * from \"./types/index.params\";\nexport type * from \"./types/index.types\";\nexport * from \"./types/ledger.params\";\nexport * from \"./types/ledger.responses\";\nexport * from \"./utils/ledger.utils\";\nexport * from \"./utils/payment.utils\";\n", "export class IndexError extends Error {}\n", "export class IcrcTransferError<T> extends Error {\n public errorType: T;\n constructor({ msg, errorType }: { msg?: string; errorType: T }) {\n super(msg);\n this.errorType = errorType;\n }\n}\n", "import type { Principal } from \"@dfinity/principal\";\nimport { createServices, type QueryParams } from \"@dfinity/utils\";\nimport type {\n GetTransactions,\n _SERVICE as IcrcIndexNgService,\n} from \"../candid/icrc_index-ng\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc_index-ng.certified.idl\";\nimport { idlFactory } from \"../candid/icrc_index-ng.idl\";\nimport { IcrcCanister } from \"./canister\";\nimport { toGetTransactionsArgs } from \"./converters/index.converters\";\nimport { IndexError } from \"./errors/index.errors\";\nimport type { IcrcLedgerCanisterOptions } from \"./types/canister.options\";\nimport type { GetIndexNgAccountTransactionsParams } from \"./types/index-ng.params\";\n\nexport class IcrcIndexNgCanister extends IcrcCanister<IcrcIndexNgService> {\n static create(options: IcrcLedgerCanisterOptions<IcrcIndexNgService>) {\n const { service, certifiedService, canisterId } =\n createServices<IcrcIndexNgService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new IcrcIndexNgCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the transactions of an account\n *\n * Always certified.\n * `get_account_transactions` needs to be called with an update\n * because the index canisters makes a call to the ledger canister to get the transaction data.\n * Index Canister only holds the transactions ids in state, not the whole transaction data.\n */\n /**\n * Get the transactions of an account.\n *\n * @param {GetAccountTransactionsParams} params The parameters to get the transactions of an account.\n * @returns {Promise<GetTransactions>} The list of transactions and further related information of the given account.\n */\n getTransactions = async ({\n certified,\n ...rest\n }: GetIndexNgAccountTransactionsParams): Promise<GetTransactions> => {\n const response = await this.caller({\n certified,\n }).get_account_transactions(toGetTransactionsArgs(rest));\n\n if (\"Err\" in response) {\n throw new IndexError(response.Err.message);\n }\n\n return response.Ok;\n };\n\n /**\n * Returns the ledger canister ID related to the index canister.\n */\n ledgerId = (params: QueryParams): Promise<Principal> => {\n const { ledger_id } = this.caller(params);\n return ledger_id();\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Rec();\n const UpgradeArg = IDL.Record({\n 'ledger_id' : IDL.Opt(IDL.Principal),\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const InitArg = IDL.Record({\n 'ledger_id' : IDL.Principal,\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n const BlockIndex = IDL.Nat;\n const SubAccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(SubAccount),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(BlockIndex),\n 'account' : Account,\n });\n const Tokens = IDL.Nat;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : BlockIndex,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'balance' : Tokens,\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(BlockIndex),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const GetBlocksRequest = IDL.Record({\n 'start' : IDL.Nat,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const GetBlocksResponse = IDL.Record({\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n });\n const FeeCollectorRanges = IDL.Record({\n 'ranges' : IDL.Vec(\n IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))\n ),\n });\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n [],\n ),\n 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], []),\n 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], []),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),\n 'ledger_id' : IDL.Func([], [IDL.Principal], []),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n [],\n ),\n 'status' : IDL.Func([], [Status], []),\n });\n};\nexport const init = ({ IDL }) => {\n const UpgradeArg = IDL.Record({\n 'ledger_id' : IDL.Opt(IDL.Principal),\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const InitArg = IDL.Record({\n 'ledger_id' : IDL.Principal,\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n return [IDL.Opt(IndexArg)];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Rec();\n const UpgradeArg = IDL.Record({\n 'ledger_id' : IDL.Opt(IDL.Principal),\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const InitArg = IDL.Record({\n 'ledger_id' : IDL.Principal,\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n const BlockIndex = IDL.Nat;\n const SubAccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(SubAccount),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(BlockIndex),\n 'account' : Account,\n });\n const Tokens = IDL.Nat;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : BlockIndex,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'balance' : Tokens,\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(BlockIndex),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const GetBlocksRequest = IDL.Record({\n 'start' : IDL.Nat,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const GetBlocksResponse = IDL.Record({\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n });\n const FeeCollectorRanges = IDL.Record({\n 'ranges' : IDL.Vec(\n IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))\n ),\n });\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n ['query'],\n ),\n 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),\n 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], ['query']),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),\n 'ledger_id' : IDL.Func([], [IDL.Principal], ['query']),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n ['query'],\n ),\n 'status' : IDL.Func([], [Status], ['query']),\n });\n};\nexport const init = ({ IDL }) => {\n const UpgradeArg = IDL.Record({\n 'ledger_id' : IDL.Opt(IDL.Principal),\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const InitArg = IDL.Record({\n 'ledger_id' : IDL.Principal,\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n return [IDL.Opt(IndexArg)];\n};\n", "import { Canister, toNullable } from \"@dfinity/utils\";\nimport type { _SERVICE as IcrcIndexNgService } from \"../candid/icrc_index-ng\";\nimport type {\n _SERVICE as IcrcLedgerService,\n Tokens,\n} from \"../candid/icrc_ledger\";\nimport type { BalanceParams } from \"./types/ledger.params\";\n\nexport abstract class IcrcCanister<\n T extends IcrcLedgerService | IcrcIndexNgService,\n> extends Canister<T> {\n /**\n * Returns the balance for a given account provided as owner and with optional subaccount.\n *\n * @param {BalanceParams} params The parameters to get the balance of an account.\n * @returns {Promise<Tokens>} The balance of the given account.\n */\n balance = (params: BalanceParams): Promise<Tokens> =>\n this.caller({ certified: params.certified }).icrc1_balance_of({\n owner: params.owner,\n subaccount: toNullable(params.subaccount),\n });\n}\n", "import { toNullable } from \"@dfinity/utils\";\nimport type {\n Account,\n GetAccountTransactionsArgs,\n} from \"../../candid/icrc_index\";\nimport type { GetAccountTransactionsParams } from \"../types/index.params\";\nimport type { IcrcAccount } from \"../types/ledger.responses\";\n\nconst toCandidAccount = ({ owner, subaccount }: IcrcAccount): Account => ({\n owner,\n subaccount: toNullable(subaccount),\n});\n\nexport const toGetTransactionsArgs = ({\n account,\n max_results,\n start,\n}: GetAccountTransactionsParams): GetAccountTransactionsArgs => ({\n account: toCandidAccount(account),\n max_results,\n start: toNullable(start),\n});\n", "import { Canister, createServices } from \"@dfinity/utils\";\nimport type {\n GetTransactions,\n _SERVICE as IcrcIndexService,\n} from \"../candid/icrc_index\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc_index.certified.idl\";\nimport { idlFactory } from \"../candid/icrc_index.idl\";\nimport { toGetTransactionsArgs } from \"./converters/index.converters\";\nimport { IndexError } from \"./errors/index.errors\";\nimport type { IcrcLedgerCanisterOptions } from \"./types/canister.options\";\nimport type { GetAccountTransactionsParams } from \"./types/index.params\";\n\nexport class IcrcIndexCanister extends Canister<IcrcIndexService> {\n static create(options: IcrcLedgerCanisterOptions<IcrcIndexService>) {\n const { service, certifiedService, canisterId } =\n createServices<IcrcIndexService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new IcrcIndexCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the transactions of an account\n *\n * Always certified.\n * `get_account_transactions` needs to be called with an update\n * because the index canisters makes a call to the ledger canister to get the transaction data.\n * Index Canister only holds the transactions ids in state, not the whole transaction data.\n */\n getTransactions = async (\n params: GetAccountTransactionsParams,\n ): Promise<GetTransactions> => {\n const response = await this.caller({\n certified: true,\n }).get_account_transactions(toGetTransactionsArgs(params));\n\n if (\"Err\" in response) {\n throw new IndexError(response.Err.message);\n }\n\n return response.Ok;\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index.did */\nexport const idlFactory = ({ IDL }) => {\n const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });\n const TxId = IDL.Nat;\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(TxId),\n 'account' : Account,\n });\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : TxId,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(TxId),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const SubAccount = IDL.Vec(IDL.Nat8);\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n [],\n ),\n 'ledger_id' : IDL.Func([], [IDL.Principal], []),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });\n return [InitArgs];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index.did */\nexport const idlFactory = ({ IDL }) => {\n const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });\n const TxId = IDL.Nat;\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(TxId),\n 'account' : Account,\n });\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : TxId,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(TxId),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const SubAccount = IDL.Vec(IDL.Nat8);\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n [],\n ),\n 'ledger_id' : IDL.Func([], [IDL.Principal], ['query']),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n ['query'],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });\n return [InitArgs];\n};\n", "import type { QueryParams } from \"@dfinity/utils\";\nimport { Canister, createServices, toNullable } from \"@dfinity/utils\";\nimport type {\n Allowance,\n BlockIndex,\n _SERVICE as IcrcLedgerService,\n Tokens,\n} from \"../candid/icrc_ledger\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc_ledger.certified.idl\";\nimport { idlFactory } from \"../candid/icrc_ledger.idl\";\nimport {\n toApproveArgs,\n toTransferArg,\n toTransferFromArgs,\n} from \"./converters/ledger.converters\";\nimport { IcrcTransferError } from \"./errors/ledger.errors\";\nimport type { IcrcLedgerCanisterOptions } from \"./types/canister.options\";\nimport type {\n AllowanceParams,\n ApproveParams,\n BalanceParams,\n TransferFromParams,\n TransferParams,\n} from \"./types/ledger.params\";\nimport type { IcrcTokenMetadataResponse } from \"./types/ledger.responses\";\n\nexport class IcrcLedgerCanister extends Canister<IcrcLedgerService> {\n static create(options: IcrcLedgerCanisterOptions<IcrcLedgerService>) {\n const { service, certifiedService, canisterId } =\n createServices<IcrcLedgerService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new IcrcLedgerCanister(canisterId, service, certifiedService);\n }\n\n /**\n * The token metadata (name, symbol, etc.).\n */\n metadata = (params: QueryParams): Promise<IcrcTokenMetadataResponse> =>\n this.caller(params).icrc1_metadata();\n\n /**\n * The ledger transaction fees.\n *\n * @returns {Tokens} The ledger transaction fees in Tokens\n */\n transactionFee = (params: QueryParams): Promise<Tokens> =>\n this.caller(params).icrc1_fee();\n\n /**\n * Returns the balance for a given account provided as owner and with optional subaccount.\n *\n * @param {BalanceParams} params The parameters to get the balance of an account.\n * @returns {Promise<Tokens>} The balance of the given account.\n */\n balance = (params: BalanceParams): Promise<Tokens> =>\n this.caller({ certified: params.certified }).icrc1_balance_of({\n owner: params.owner,\n subaccount: toNullable(params.subaccount),\n });\n\n /**\n * Transfers tokens from the sender to the given account.\n *\n * @param {TransferArg} params The parameters to transfer tokens.\n *\n * @throws {IcrcTransferError} If the transfer fails.\n */\n transfer = async (params: TransferParams): Promise<BlockIndex> => {\n const response = await this.caller({ certified: true }).icrc1_transfer(\n toTransferArg(params),\n );\n if (\"Err\" in response) {\n throw new IcrcTransferError({\n errorType: response.Err,\n msg: \"Failed to transfer\",\n });\n }\n return response.Ok;\n };\n\n /**\n * Returns the total supply of tokens.\n */\n totalTokensSupply = (params: QueryParams): Promise<Tokens> => {\n return this.caller(params).icrc1_total_supply();\n };\n\n /**\n * Transfers a token amount from the `from` account to the `to` account using the allowance of the spender's account (`SpenderAccount = { owner = caller; subaccount = spender_subaccount }`). The ledger draws the fees from the `from` account.\n *\n * Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_transfer_from\n *\n * @param {TransferFromParams} params The parameters to transfer tokens from to.\n *\n * @throws {IcrcTransferError} If the transfer from fails.\n */\n transferFrom = async (params: TransferFromParams): Promise<BlockIndex> => {\n const response = await this.caller({ certified: true }).icrc2_transfer_from(\n toTransferFromArgs(params),\n );\n if (\"Err\" in response) {\n throw new IcrcTransferError({\n errorType: response.Err,\n msg: \"Failed to transfer from\",\n });\n }\n return response.Ok;\n };\n\n /**\n * This method entitles the `spender` to transfer token `amount` on behalf of the caller from account `{ owner = caller; subaccount = from_subaccount }`.\n *\n * Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_approve\n *\n * @param {ApproveParams} params The parameters to approve.\n *\n * @throws {IcrcTransferError} If the approval fails.\n */\n approve = async (params: ApproveParams): Promise<BlockIndex> => {\n const response = await this.caller({ certified: true }).icrc2_approve(\n toApproveArgs(params),\n );\n if (\"Err\" in response) {\n throw new IcrcTransferError({\n errorType: response.Err,\n msg: \"Failed to entitle the spender to transfer the amount\",\n });\n }\n return response.Ok;\n };\n\n /**\n * Returns the token allowance that the `spender` account can transfer from the specified `account`, and the expiration time for that allowance, if any.\n *\n * Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_allowance\n *\n * @param {AllowanceParams} params The parameters to call the allowance.\n *\n * @returns {Allowance} The token allowance. If there is no active approval, the ledger MUST return `{ allowance = 0; expires_at = null }`.\n */\n allowance = async (params: AllowanceParams): Promise<Allowance> => {\n const { certified, ...rest } = params;\n return this.caller({ certified }).icrc2_allowance({ ...rest });\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_ledger.did */\nexport const idlFactory = ({ IDL }) => {\n const GetBlocksResult = IDL.Rec();\n const ICRC3Value = IDL.Rec();\n const Value = IDL.Rec();\n const ChangeArchiveOptions = IDL.Record({\n 'num_blocks_to_archive' : IDL.Opt(IDL.Nat64),\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Opt(IDL.Nat64),\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Opt(IDL.Principal),\n });\n const MetadataValue = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const ChangeFeeCollector = IDL.Variant({\n 'SetTo' : Account,\n 'Unset' : IDL.Null,\n });\n const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });\n const UpgradeArgs = IDL.Record({\n 'change_archive_options' : IDL.Opt(ChangeArchiveOptions),\n 'token_symbol' : IDL.Opt(IDL.Text),\n 'transfer_fee' : IDL.Opt(IDL.Nat),\n 'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'change_fee_collector' : IDL.Opt(ChangeFeeCollector),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Opt(IDL.Text),\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const InitArgs = IDL.Record({\n 'decimals' : IDL.Opt(IDL.Nat8),\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat)),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'fee_collector_account' : IDL.Opt(Account),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Nat64,\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Text,\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const LedgerArg = IDL.Variant({\n 'Upgrade' : IDL.Opt(UpgradeArgs),\n 'Init' : InitArgs,\n });\n const BlockIndex = IDL.Nat;\n const ArchiveInfo = IDL.Record({\n 'block_range_end' : BlockIndex,\n 'canister_id' : IDL.Principal,\n 'block_range_start' : BlockIndex,\n });\n const GetBlocksArgs = IDL.Record({\n 'start' : BlockIndex,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const BlockRange = IDL.Record({ 'blocks' : IDL.Vec(Block) });\n const QueryBlockArchiveFn = IDL.Func([GetBlocksArgs], [BlockRange], []);\n const GetBlocksResponse = IDL.Record({\n 'certificate' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'first_index' : BlockIndex,\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n 'archived_blocks' : IDL.Vec(\n IDL.Record({\n 'callback' : QueryBlockArchiveFn,\n 'start' : BlockIndex,\n 'length' : IDL.Nat,\n })\n ),\n });\n const DataCertificate = IDL.Record({\n 'certificate' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'hash_tree' : IDL.Vec(IDL.Nat8),\n });\n const TxIndex = IDL.Nat;\n const GetTransactionsRequest = IDL.Record({\n 'start' : TxIndex,\n 'length' : IDL.Nat,\n });\n const Timestamp = IDL.Nat64;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(Timestamp),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : Timestamp,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionRange = IDL.Record({\n 'transactions' : IDL.Vec(Transaction),\n });\n const QueryArchiveFn = IDL.Func(\n [GetTransactionsRequest],\n [TransactionRange],\n [],\n );\n const GetTransactionsResponse = IDL.Record({\n 'first_index' : TxIndex,\n 'log_length' : IDL.Nat,\n 'transactions' : IDL.Vec(Transaction),\n 'archived_transactions' : IDL.Vec(\n IDL.Record({\n 'callback' : QueryArchiveFn,\n 'start' : TxIndex,\n 'length' : IDL.Nat,\n })\n ),\n });\n const Tokens = IDL.Nat;\n const StandardRecord = IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text });\n const TransferArg = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(Subaccount),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const TransferError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferError,\n });\n const AllowanceArgs = IDL.Record({\n 'account' : Account,\n 'spender' : Account,\n });\n const Allowance = IDL.Record({\n 'allowance' : IDL.Nat,\n 'expires_at' : IDL.Opt(Timestamp),\n });\n const ApproveArgs = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(Timestamp),\n 'spender' : Account,\n });\n const ApproveError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : IDL.Nat }),\n 'AllowanceChanged' : IDL.Record({ 'current_allowance' : IDL.Nat }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'Expired' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'InsufficientFunds' : IDL.Record({ 'balance' : IDL.Nat }),\n });\n const ApproveResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : ApproveError,\n });\n const TransferFromArgs = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'spender_subaccount' : IDL.Opt(Subaccount),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const TransferFromError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'InsufficientAllowance' : IDL.Record({ 'allowance' : Tokens }),\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferFromResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferFromError,\n });\n const GetArchivesArgs = IDL.Record({ 'from' : IDL.Opt(IDL.Principal) });\n const GetArchivesResult = IDL.Vec(\n IDL.Record({\n 'end' : IDL.Nat,\n 'canister_id' : IDL.Principal,\n 'start' : IDL.Nat,\n })\n );\n ICRC3Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(ICRC3Value),\n })\n );\n GetBlocksResult.fill(\n IDL.Record({\n 'log_length' : IDL.Nat,\n 'blocks' : IDL.Vec(IDL.Record({ 'id' : IDL.Nat, 'block' : ICRC3Value })),\n 'archived_blocks' : IDL.Vec(\n IDL.Record({\n 'args' : IDL.Vec(GetBlocksArgs),\n 'callback' : IDL.Func(\n [IDL.Vec(GetBlocksArgs)],\n [GetBlocksResult],\n [],\n ),\n })\n ),\n })\n );\n const ICRC3DataCertificate = IDL.Record({\n 'certificate' : IDL.Vec(IDL.Nat8),\n 'hash_tree' : IDL.Vec(IDL.Nat8),\n });\n return IDL.Service({\n 'archives' : IDL.Func([], [IDL.Vec(ArchiveInfo)], []),\n 'get_blocks' : IDL.Func([GetBlocksArgs], [GetBlocksResponse], []),\n 'get_data_certificate' : IDL.Func([], [DataCertificate], []),\n 'get_transactions' : IDL.Func(\n [GetTransactionsRequest],\n [GetTransactionsResponse],\n [],\n ),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),\n 'icrc1_decimals' : IDL.Func([], [IDL.Nat8], []),\n 'icrc1_fee' : IDL.Func([], [Tokens], []),\n 'icrc1_metadata' : IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))],\n [],\n ),\n 'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], []),\n 'icrc1_name' : IDL.Func([], [IDL.Text], []),\n 'icrc1_supported_standards' : IDL.Func([], [IDL.Vec(StandardRecord)], []),\n 'icrc1_symbol' : IDL.Func([], [IDL.Text], []),\n 'icrc1_total_supply' : IDL.Func([], [Tokens], []),\n 'icrc1_transfer' : IDL.Func([TransferArg], [TransferResult], []),\n 'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], []),\n 'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []),\n 'icrc2_transfer_from' : IDL.Func(\n [TransferFromArgs],\n [TransferFromResult],\n [],\n ),\n 'icrc3_get_archives' : IDL.Func([GetArchivesArgs], [GetArchivesResult], []),\n 'icrc3_get_blocks' : IDL.Func(\n [IDL.Vec(GetBlocksArgs)],\n [GetBlocksResult],\n [],\n ),\n 'icrc3_get_tip_certificate' : IDL.Func(\n [],\n [IDL.Opt(ICRC3DataCertificate)],\n [],\n ),\n 'icrc3_supported_block_types' : IDL.Func(\n [],\n [IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'block_type' : IDL.Text }))],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const ChangeArchiveOptions = IDL.Record({\n 'num_blocks_to_archive' : IDL.Opt(IDL.Nat64),\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Opt(IDL.Nat64),\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Opt(IDL.Principal),\n });\n const MetadataValue = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const ChangeFeeCollector = IDL.Variant({\n 'SetTo' : Account,\n 'Unset' : IDL.Null,\n });\n const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });\n const UpgradeArgs = IDL.Record({\n 'change_archive_options' : IDL.Opt(ChangeArchiveOptions),\n 'token_symbol' : IDL.Opt(IDL.Text),\n 'transfer_fee' : IDL.Opt(IDL.Nat),\n 'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'change_fee_collector' : IDL.Opt(ChangeFeeCollector),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Opt(IDL.Text),\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const InitArgs = IDL.Record({\n 'decimals' : IDL.Opt(IDL.Nat8),\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat)),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'fee_collector_account' : IDL.Opt(Account),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Nat64,\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Text,\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const LedgerArg = IDL.Variant({\n 'Upgrade' : IDL.Opt(UpgradeArgs),\n 'Init' : InitArgs,\n });\n return [LedgerArg];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_ledger.did */\nexport const idlFactory = ({ IDL }) => {\n const GetBlocksResult = IDL.Rec();\n const ICRC3Value = IDL.Rec();\n const Value = IDL.Rec();\n const ChangeArchiveOptions = IDL.Record({\n 'num_blocks_to_archive' : IDL.Opt(IDL.Nat64),\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Opt(IDL.Nat64),\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Opt(IDL.Principal),\n });\n const MetadataValue = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const ChangeFeeCollector = IDL.Variant({\n 'SetTo' : Account,\n 'Unset' : IDL.Null,\n });\n const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });\n const UpgradeArgs = IDL.Record({\n 'change_archive_options' : IDL.Opt(ChangeArchiveOptions),\n 'token_symbol' : IDL.Opt(IDL.Text),\n 'transfer_fee' : IDL.Opt(IDL.Nat),\n 'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'change_fee_collector' : IDL.Opt(ChangeFeeCollector),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Opt(IDL.Text),\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const InitArgs = IDL.Record({\n 'decimals' : IDL.Opt(IDL.Nat8),\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat)),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'fee_collector_account' : IDL.Opt(Account),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Nat64,\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Text,\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const LedgerArg = IDL.Variant({\n 'Upgrade' : IDL.Opt(UpgradeArgs),\n 'Init' : InitArgs,\n });\n const BlockIndex = IDL.Nat;\n const ArchiveInfo = IDL.Record({\n 'block_range_end' : BlockIndex,\n 'canister_id' : IDL.Principal,\n 'block_range_start' : BlockIndex,\n });\n const GetBlocksArgs = IDL.Record({\n 'start' : BlockIndex,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const BlockRange = IDL.Record({ 'blocks' : IDL.Vec(Block) });\n const QueryBlockArchiveFn = IDL.Func(\n [GetBlocksArgs],\n [BlockRange],\n ['query'],\n );\n const GetBlocksResponse = IDL.Record({\n 'certificate' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'first_index' : BlockIndex,\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n 'archived_blocks' : IDL.Vec(\n IDL.Record({\n 'callback' : QueryBlockArchiveFn,\n 'start' : BlockIndex,\n 'length' : IDL.Nat,\n })\n ),\n });\n const DataCertificate = IDL.Record({\n 'certificate' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'hash_tree' : IDL.Vec(IDL.Nat8),\n });\n const TxIndex = IDL.Nat;\n const GetTransactionsRequest = IDL.Record({\n 'start' : TxIndex,\n 'length' : IDL.Nat,\n });\n const Timestamp = IDL.Nat64;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(Timestamp),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : Timestamp,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionRange = IDL.Record({\n 'transactions' : IDL.Vec(Transaction),\n });\n const QueryArchiveFn = IDL.Func(\n [GetTransactionsRequest],\n [TransactionRange],\n ['query'],\n );\n const GetTransactionsResponse = IDL.Record({\n 'first_index' : TxIndex,\n 'log_length' : IDL.Nat,\n 'transactions' : IDL.Vec(Transaction),\n 'archived_transactions' : IDL.Vec(\n IDL.Record({\n 'callback' : QueryArchiveFn,\n 'start' : TxIndex,\n 'length' : IDL.Nat,\n })\n ),\n });\n const Tokens = IDL.Nat;\n const StandardRecord = IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text });\n const TransferArg = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(Subaccount),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const TransferError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferError,\n });\n const AllowanceArgs = IDL.Record({\n 'account' : Account,\n 'spender' : Account,\n });\n const Allowance = IDL.Record({\n 'allowance' : IDL.Nat,\n 'expires_at' : IDL.Opt(Timestamp),\n });\n const ApproveArgs = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(Timestamp),\n 'spender' : Account,\n });\n const ApproveError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : IDL.Nat }),\n 'AllowanceChanged' : IDL.Record({ 'current_allowance' : IDL.Nat }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'Expired' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'InsufficientFunds' : IDL.Record({ 'balance' : IDL.Nat }),\n });\n const ApproveResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : ApproveError,\n });\n const TransferFromArgs = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'spender_subaccount' : IDL.Opt(Subaccount),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const TransferFromError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'InsufficientAllowance' : IDL.Record({ 'allowance' : Tokens }),\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferFromResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferFromError,\n });\n const GetArchivesArgs = IDL.Record({ 'from' : IDL.Opt(IDL.Principal) });\n const GetArchivesResult = IDL.Vec(\n IDL.Record({\n 'end' : IDL.Nat,\n 'canister_id' : IDL.Principal,\n 'start' : IDL.Nat,\n })\n );\n ICRC3Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(ICRC3Value),\n })\n );\n GetBlocksResult.fill(\n IDL.Record({\n 'log_length' : IDL.Nat,\n 'blocks' : IDL.Vec(IDL.Record({ 'id' : IDL.Nat, 'block' : ICRC3Value })),\n 'archived_blocks' : IDL.Vec(\n IDL.Record({\n 'args' : IDL.Vec(GetBlocksArgs),\n 'callback' : IDL.Func(\n [IDL.Vec(GetBlocksArgs)],\n [GetBlocksResult],\n ['query'],\n ),\n })\n ),\n })\n );\n const ICRC3DataCertificate = IDL.Record({\n 'certificate' : IDL.Vec(IDL.Nat8),\n 'hash_tree' : IDL.Vec(IDL.Nat8),\n });\n return IDL.Service({\n 'archives' : IDL.Func([], [IDL.Vec(ArchiveInfo)], ['query']),\n 'get_blocks' : IDL.Func([GetBlocksArgs], [GetBlocksResponse], ['query']),\n 'get_data_certificate' : IDL.Func([], [DataCertificate], ['query']),\n 'get_transactions' : IDL.Func(\n [GetTransactionsRequest],\n [GetTransactionsResponse],\n ['query'],\n ),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),\n 'icrc1_decimals' : IDL.Func([], [IDL.Nat8], ['query']),\n 'icrc1_fee' : IDL.Func([], [Tokens], ['query']),\n 'icrc1_metadata' : IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))],\n ['query'],\n ),\n 'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], ['query']),\n 'icrc1_name' : IDL.Func([], [IDL.Text], ['query']),\n 'icrc1_supported_standards' : IDL.Func(\n [],\n [IDL.Vec(StandardRecord)],\n ['query'],\n ),\n 'icrc1_symbol' : IDL.Func([], [IDL.Text], ['query']),\n 'icrc1_total_supply' : IDL.Func([], [Tokens], ['query']),\n 'icrc1_transfer' : IDL.Func([TransferArg], [TransferResult], []),\n 'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], ['query']),\n 'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []),\n 'icrc2_transfer_from' : IDL.Func(\n [TransferFromArgs],\n [TransferFromResult],\n [],\n ),\n 'icrc3_get_archives' : IDL.Func(\n [GetArchivesArgs],\n [GetArchivesResult],\n ['query'],\n ),\n 'icrc3_get_blocks' : IDL.Func(\n [IDL.Vec(GetBlocksArgs)],\n [GetBlocksResult],\n ['query'],\n ),\n 'icrc3_get_tip_certificate' : IDL.Func(\n [],\n [IDL.Opt(ICRC3DataCertificate)],\n ['query'],\n ),\n 'icrc3_supported_block_types' : IDL.Func(\n [],\n [IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'block_type' : IDL.Text }))],\n ['query'],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const ChangeArchiveOptions = IDL.Record({\n 'num_blocks_to_archive' : IDL.Opt(IDL.Nat64),\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Opt(IDL.Nat64),\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Opt(IDL.Principal),\n });\n const MetadataValue = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const ChangeFeeCollector = IDL.Variant({\n 'SetTo' : Account,\n 'Unset' : IDL.Null,\n });\n const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });\n const UpgradeArgs = IDL.Record({\n 'change_archive_options' : IDL.Opt(ChangeArchiveOptions),\n 'token_symbol' : IDL.Opt(IDL.Text),\n 'transfer_fee' : IDL.Opt(IDL.Nat),\n 'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'change_fee_collector' : IDL.Opt(ChangeFeeCollector),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Opt(IDL.Text),\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const InitArgs = IDL.Record({\n 'decimals' : IDL.Opt(IDL.Nat8),\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat)),\n 'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),\n 'accounts_overflow_trim_quantity' : IDL.Opt(IDL.Nat64),\n 'fee_collector_account' : IDL.Opt(Account),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'max_transactions_per_response' : IDL.Opt(IDL.Nat64),\n 'trigger_threshold' : IDL.Nat64,\n 'more_controller_ids' : IDL.Opt(IDL.Vec(IDL.Principal)),\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'max_memo_length' : IDL.Opt(IDL.Nat16),\n 'token_name' : IDL.Text,\n 'feature_flags' : IDL.Opt(FeatureFlags),\n });\n const LedgerArg = IDL.Variant({\n 'Upgrade' : IDL.Opt(UpgradeArgs),\n 'Init' : InitArgs,\n });\n return [LedgerArg];\n};\n", "import { toNullable } from \"@dfinity/utils\";\nimport type {\n ApproveArgs,\n TransferArg,\n TransferFromArgs,\n} from \"../../candid/icrc_ledger\";\nimport type {\n ApproveParams,\n TransferFromParams,\n TransferParams,\n} from \"../types/ledger.params\";\n\n// WARNING: When using the ICRC-1 interface of the ICP ledger, there is no\n// relationship between the memo and the icrc1Memo of a transaction. The ICRC-1\n// interface simply cannot set the memo field and the non-ICRC-1 interface\n// cannot set the icrc1Memo field, even though the icrc1Memo field is called\n// just \"memo\" in canister method params.\nexport const toTransferArg = ({\n from_subaccount,\n fee,\n created_at_time,\n memo,\n ...rest\n}: TransferParams): TransferArg => ({\n ...rest,\n fee: toNullable(fee),\n memo: toNullable(memo),\n from_subaccount: toNullable(from_subaccount),\n created_at_time: toNullable(created_at_time),\n});\n\nexport const toTransferFromArgs = ({\n spender_subaccount,\n fee,\n created_at_time,\n memo,\n ...rest\n}: TransferFromParams): TransferFromArgs => ({\n ...rest,\n fee: toNullable(fee),\n memo: toNullable(memo),\n spender_subaccount: toNullable(spender_subaccount),\n created_at_time: toNullable(created_at_time),\n});\n\nexport const toApproveArgs = ({\n fee,\n created_at_time,\n memo,\n from_subaccount,\n expected_allowance,\n expires_at,\n ...rest\n}: ApproveParams): ApproveArgs => ({\n ...rest,\n fee: toNullable(fee),\n memo: toNullable(memo),\n from_subaccount: toNullable(from_subaccount),\n created_at_time: toNullable(created_at_time),\n expected_allowance: toNullable(expected_allowance),\n expires_at: toNullable(expires_at),\n});\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { Subaccount, Value } from \"../../candid/icrc_ledger\";\n\n// Source: https://github.com/dfinity/icrc-1#standard-metadata-entries\nexport enum IcrcMetadataResponseEntries {\n SYMBOL = \"icrc1:symbol\",\n NAME = \"icrc1:name\",\n DECIMALS = \"icrc1:decimals\",\n FEE = \"icrc1:fee\",\n LOGO = \"icrc1:logo\",\n}\n\nexport type IcrcTokenMetadataResponse = [\n string | IcrcMetadataResponseEntries,\n Value,\n][];\n\nexport interface IcrcAccount {\n owner: Principal;\n subaccount?: Subaccount;\n}\n", "import { Principal } from \"@dfinity/principal\";\nimport {\n bigEndianCrc32,\n encodeBase32,\n hexStringToUint8Array,\n isNullish,\n notEmptyString,\n uint8ArrayToHexString,\n} from \"@dfinity/utils\";\nimport type { IcrcAccount } from \"../types/ledger.responses\";\n\nconst MAX_SUBACCOUNT_HEX_LENGTH = 64;\n\n/**\n * Encodes an Icrc-1 account compatible into a string.\n * Formatting Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/TextualEncoding.md\n *\n * @param account { owner: Principal, subaccount?: Uint8Array }\n * @returns string\n */\nexport const encodeIcrcAccount = ({\n owner,\n subaccount,\n}: IcrcAccount): string => {\n if (isNullish(subaccount)) {\n return owner.toText();\n }\n\n const removeLeadingZeros = (text: string): string => text.replace(/^0+/, \"\");\n\n const subaccountText = removeLeadingZeros(\n uint8ArrayToHexString(Uint8Array.from(subaccount)),\n );\n\n if (subaccountText.length === 0) {\n return owner.toText();\n }\n\n return `${owner.toText()}-${encodeCrc({\n owner,\n subaccount,\n })}.${subaccountText}`;\n};\n\nconst encodeCrc = ({ owner, subaccount }: Required<IcrcAccount>): string => {\n const crc = bigEndianCrc32(\n Uint8Array.from([...owner.toUint8Array(), ...subaccount]),\n );\n\n return encodeBase32(crc);\n};\n\n/**\n * Decodes a string into an Icrc-1 compatible account.\n * Formatting Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/TextualEncoding.md\n *\n * @param accountString string\n * @throws Error if the string is not a valid Icrc-1 account\n * @returns IcrcAccount { owner: Principal, subaccount?: Uint8Array }\n */\nexport const decodeIcrcAccount = (accountString: string): IcrcAccount => {\n const [principalAndMaybeCheckSum, subaccountHex] = accountString.split(\".\");\n\n if (!notEmptyString(principalAndMaybeCheckSum)) {\n throw new Error(\"Invalid account. No string provided.\");\n }\n\n if (isNullish(subaccountHex)) {\n return {\n owner: Principal.fromText(accountString),\n };\n }\n\n const [checksum, ...rest] = principalAndMaybeCheckSum.split(\"-\").reverse();\n const principalText = rest.reverse().join(\"-\");\n\n const account = {\n owner: Principal.fromText(principalText),\n subaccount: hexStringToUint8Array(\n subaccountHex.padStart(MAX_SUBACCOUNT_HEX_LENGTH, \"0\"),\n ),\n };\n\n const crcText = encodeCrc(account);\n\n if (crcText !== checksum) {\n throw new Error(\"Invalid account. Invalid checksum.\");\n }\n\n return account;\n};\n", "import { isNullish, nonNullish } from \"@dfinity/utils\";\n\n/**\n * \uD83D\uDC40 This feature is currently in draft. You can find more information about it at https://github.com/dfinity/ICRC/issues/22.\n *\n * A naive implementation of a payment parser. Given a code, the function attempts to extract a token name, account identifier (textual representation), and an optional amount.\n *\n * If the code doesn't match the expected pattern, `undefined` is returned for simplicity.\n * Similarly, if an optional amount is provided but it's not a valid number, the parser will not throw an exception and returns `undefined`.\n *\n * Please note that this function doesn't perform any validity checks on the extracted information.\n * It does not verify if the token is known or if the identifier is a valid address.\n *\n * ```\n * urn = token \":\" address [ \"?\" params]\n * token = [ ckbtc / icp / chat / bitcoin / ethereum ... ]\n * address = STRING\n * params = param [ \"&\" params ]\n * param = [ amountparam ]\n * amountparam = \"amount=\" *digit [ \".\" *digit ]\n * ```\n *\n * @param code string\n * @returns { token: string; identifier: string; amount?: number } | undefined\n */\nexport const decodePayment = (\n code: string,\n): { token: string; identifier: string; amount?: number } | undefined => {\n const regex =\n /^([a-zA-Z]+):([A-Za-z0-9:\\-.]+).*?(?:[?&](?:amount|value)=(\\d+(?:\\.\\d+)?))?$/;\n\n const match = code.match(regex);\n if (isNullish(match)) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, token, identifier, amount] = match;\n\n return {\n token,\n identifier,\n ...(nonNullish(amount) &&\n !isNaN(parseFloat(amount)) && { amount: parseFloat(amount) }),\n };\n};\n"],
5
+ "mappings": "ubAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,uBAAAE,EAAA,wBAAAC,EAAA,uBAAA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BAAeC,CAAyB,EAC3C,MAAM,IAAI,MAAM,sCAAsC,EAGxD,MAAI,aAAUC,CAAa,EACzB,MAAO,CACL,MAAO,aAAU,SAASF,CAAa,CACzC,EAGF,GAAM,CAACG,EAAU,GAAGC,CAAI,EAAIH,EAA0B,MAAM,GAAG,EAAE,QAAQ,EACnEI,EAAgBD,EAAK,QAAQ,EAAE,KAAK,GAAG,EAEvCE,EAAU,CACd,MAAO,aAAU,SAASD,CAAa,EACvC,cAAY,yBACVH,EAAc,SAASX,GAA2B,GAAG,CACvD,CACF,EAIA,GAFgBM,GAAUS,CAAO,IAEjBH,EACd,MAAM,IAAI,MAAM,oCAAoC,EAGtD,OAAOG,CACT,EC1FA,IAAAC,EAAsC,0BAyBzBC,GACXC,GACuE,CACvE,IAAMC,EACJ,+EAEIC,EAAQF,EAAK,MAAMC,CAAK,EAC9B,MAAI,aAAUC,CAAK,EACjB,OAIF,GAAM,CAACC,EAAGC,EAAOC,EAAYC,CAAM,EAAIJ,EAEvC,MAAO,CACL,MAAAE,EACA,WAAAC,EACA,MAAI,cAAWC,CAAM,GACnB,CAAC,MAAM,WAAWA,CAAM,CAAC,GAAK,CAAE,OAAQ,WAAWA,CAAM,CAAE,CAC/D,CACF",
6
6
  "names": ["src_exports", "__export", "IcrcIndexCanister", "IcrcIndexNgCanister", "IcrcLedgerCanister", "IcrcMetadataResponseEntries", "IcrcTransferError", "IndexError", "decodeIcrcAccount", "decodePayment", "encodeIcrcAccount", "__toCommonJS", "IndexError", "IcrcTransferError", "msg", "errorType", "import_utils", "idlFactory", "IDL", "Value", "UpgradeArg", "InitArg", "IndexArg", "BlockIndex", "SubAccount", "Account", "GetAccountTransactionsArgs", "Tokens", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionWithId", "GetTransactions", "GetTransactionsErr", "GetTransactionsResult", "GetBlocksRequest", "Map", "Block", "GetBlocksResponse", "FeeCollectorRanges", "ListSubaccountsArgs", "Status", "idlFactory", "IDL", "Value", "UpgradeArg", "InitArg", "IndexArg", "BlockIndex", "SubAccount", "Account", "GetAccountTransactionsArgs", "Tokens", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionWithId", "GetTransactions", "GetTransactionsErr", "GetTransactionsResult", "GetBlocksRequest", "Map", "Block", "GetBlocksResponse", "FeeCollectorRanges", "ListSubaccountsArgs", "Status", "import_utils", "IcrcCanister", "params", "import_utils", "toCandidAccount", "owner", "subaccount", "toGetTransactionsArgs", "account", "max_results", "start", "IcrcIndexNgCanister", "_IcrcIndexNgCanister", "IcrcCanister", "certified", "rest", "response", "toGetTransactionsArgs", "IndexError", "params", "ledger_id", "options", "service", "certifiedService", "canisterId", "idlFactory", "import_utils", "idlFactory", "IDL", "InitArgs", "TxId", "Account", "GetAccountTransactionsArgs", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionWithId", "GetTransactions", "GetTransactionsErr", "GetTransactionsResult", "SubAccount", "ListSubaccountsArgs", "idlFactory", "IDL", "InitArgs", "TxId", "Account", "GetAccountTransactionsArgs", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionWithId", "GetTransactions", "GetTransactionsErr", "GetTransactionsResult", "SubAccount", "ListSubaccountsArgs", "IcrcIndexCanister", "_IcrcIndexCanister", "params", "response", "toGetTransactionsArgs", "IndexError", "options", "service", "certifiedService", "canisterId", "idlFactory", "import_utils", "idlFactory", "IDL", "GetBlocksResult", "ICRC3Value", "Value", "ChangeArchiveOptions", "MetadataValue", "Subaccount", "Account", "ChangeFeeCollector", "FeatureFlags", "UpgradeArgs", "InitArgs", "LedgerArg", "BlockIndex", "ArchiveInfo", "GetBlocksArgs", "Map", "Block", "BlockRange", "QueryBlockArchiveFn", "GetBlocksResponse", "DataCertificate", "TxIndex", "GetTransactionsRequest", "Timestamp", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionRange", "QueryArchiveFn", "GetTransactionsResponse", "Tokens", "StandardRecord", "TransferArg", "TransferError", "TransferResult", "AllowanceArgs", "Allowance", "ApproveArgs", "ApproveError", "ApproveResult", "TransferFromArgs", "TransferFromError", "TransferFromResult", "GetArchivesArgs", "GetArchivesResult", "ICRC3DataCertificate", "idlFactory", "IDL", "GetBlocksResult", "ICRC3Value", "Value", "ChangeArchiveOptions", "MetadataValue", "Subaccount", "Account", "ChangeFeeCollector", "FeatureFlags", "UpgradeArgs", "InitArgs", "LedgerArg", "BlockIndex", "ArchiveInfo", "GetBlocksArgs", "Map", "Block", "BlockRange", "QueryBlockArchiveFn", "GetBlocksResponse", "DataCertificate", "TxIndex", "GetTransactionsRequest", "Timestamp", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionRange", "QueryArchiveFn", "GetTransactionsResponse", "Tokens", "StandardRecord", "TransferArg", "TransferError", "TransferResult", "AllowanceArgs", "Allowance", "ApproveArgs", "ApproveError", "ApproveResult", "TransferFromArgs", "TransferFromError", "TransferFromResult", "GetArchivesArgs", "GetArchivesResult", "ICRC3DataCertificate", "import_utils", "toTransferArg", "from_subaccount", "fee", "created_at_time", "memo", "rest", "toTransferFromArgs", "spender_subaccount", "toApproveArgs", "expected_allowance", "expires_at", "IcrcLedgerCanister", "_IcrcLedgerCanister", "params", "response", "toTransferArg", "IcrcTransferError", "toTransferFromArgs", "toApproveArgs", "certified", "rest", "options", "service", "certifiedService", "canisterId", "idlFactory", "IcrcMetadataResponseEntries", "import_principal", "import_utils", "MAX_SUBACCOUNT_HEX_LENGTH", "encodeIcrcAccount", "owner", "subaccount", "subaccountText", "text", "encodeCrc", "crc", "decodeIcrcAccount", "accountString", "principalAndMaybeCheckSum", "subaccountHex", "checksum", "rest", "principalText", "account", "import_utils", "decodePayment", "code", "regex", "match", "_", "token", "identifier", "amount"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ import{a as A}from"./chunk-6GLYJI63.js";import{a as y,b as P}from"./chunk-42OX77TJ.js";import{createServices as B}from"@dfinity/utils";var F=({IDL:t})=>{let c=t.Rec(),n=t.Record({ledger_id:t.Opt(t.Principal),retrieve_blocks_from_ledger_interval_seconds:t.Opt(t.Nat64)}),a=t.Record({ledger_id:t.Principal,retrieve_blocks_from_ledger_interval_seconds:t.Opt(t.Nat64)}),o=t.Variant({Upgrade:n,Init:a}),r=t.Nat,s=t.Vec(t.Nat8),e=t.Record({owner:t.Principal,subaccount:t.Opt(s)}),p=t.Record({max_results:t.Nat,start:t.Opt(r),account:e}),i=t.Nat,d=t.Record({from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(e)}),l=t.Record({to:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),_=t.Record({fee:t.Opt(t.Nat),from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:e}),u=t.Record({to:e,fee:t.Opt(t.Nat),from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(e)}),m=t.Record({burn:t.Opt(d),kind:t.Text,mint:t.Opt(l),approve:t.Opt(_),timestamp:t.Nat64,transfer:t.Opt(u)}),g=t.Record({id:r,transaction:m}),N=t.Record({balance:i,transactions:t.Vec(g),oldest_tx_id:t.Opt(r)}),O=t.Record({message:t.Text}),R=t.Variant({Ok:N,Err:O}),f=t.Record({start:t.Nat,length:t.Nat}),x=t.Vec(t.Tuple(t.Text,c));c.fill(t.Variant({Int:t.Int,Map:x,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(c)}));let T=c,V=t.Record({blocks:t.Vec(T),chain_length:t.Nat64}),b=t.Record({ranges:t.Vec(t.Tuple(e,t.Vec(t.Tuple(r,r))))}),k=t.Record({owner:t.Principal,start:t.Opt(s)}),v=t.Record({num_blocks_synced:r});return t.Service({get_account_transactions:t.Func([p],[R],[]),get_blocks:t.Func([f],[V],[]),get_fee_collectors_ranges:t.Func([],[b],[]),icrc1_balance_of:t.Func([e],[i],[]),ledger_id:t.Func([],[t.Principal],[]),list_subaccounts:t.Func([k],[t.Vec(s)],[]),status:t.Func([],[v],[])})};var G=({IDL:t})=>{let c=t.Rec(),n=t.Record({ledger_id:t.Opt(t.Principal),retrieve_blocks_from_ledger_interval_seconds:t.Opt(t.Nat64)}),a=t.Record({ledger_id:t.Principal,retrieve_blocks_from_ledger_interval_seconds:t.Opt(t.Nat64)}),o=t.Variant({Upgrade:n,Init:a}),r=t.Nat,s=t.Vec(t.Nat8),e=t.Record({owner:t.Principal,subaccount:t.Opt(s)}),p=t.Record({max_results:t.Nat,start:t.Opt(r),account:e}),i=t.Nat,d=t.Record({from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(e)}),l=t.Record({to:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),_=t.Record({fee:t.Opt(t.Nat),from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:e}),u=t.Record({to:e,fee:t.Opt(t.Nat),from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(e)}),m=t.Record({burn:t.Opt(d),kind:t.Text,mint:t.Opt(l),approve:t.Opt(_),timestamp:t.Nat64,transfer:t.Opt(u)}),g=t.Record({id:r,transaction:m}),N=t.Record({balance:i,transactions:t.Vec(g),oldest_tx_id:t.Opt(r)}),O=t.Record({message:t.Text}),R=t.Variant({Ok:N,Err:O}),f=t.Record({start:t.Nat,length:t.Nat}),x=t.Vec(t.Tuple(t.Text,c));c.fill(t.Variant({Int:t.Int,Map:x,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(c)}));let T=c,V=t.Record({blocks:t.Vec(T),chain_length:t.Nat64}),b=t.Record({ranges:t.Vec(t.Tuple(e,t.Vec(t.Tuple(r,r))))}),k=t.Record({owner:t.Principal,start:t.Opt(s)}),v=t.Record({num_blocks_synced:r});return t.Service({get_account_transactions:t.Func([p],[R],["query"]),get_blocks:t.Func([f],[V],["query"]),get_fee_collectors_ranges:t.Func([],[b],["query"]),icrc1_balance_of:t.Func([e],[i],["query"]),ledger_id:t.Func([],[t.Principal],["query"]),list_subaccounts:t.Func([k],[t.Vec(s)],["query"]),status:t.Func([],[v],["query"])})};var S=class t extends A{constructor(){super(...arguments);this.getTransactions=async({certified:n,...a})=>{let o=await this.caller({certified:n}).get_account_transactions(y(a));if("Err"in o)throw new P(o.Err.message);return o.Ok};this.ledgerId=n=>{let{ledger_id:a}=this.caller(n);return a()}}static create(n){let{service:a,certifiedService:o,canisterId:r}=B({options:n,idlFactory:G,certifiedIdlFactory:F});return new t(r,a,o)}};export{S as a};
2
+ //# sourceMappingURL=chunk-ZAZML4GO.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index-ng.canister.ts", "../../candid/icrc_index-ng.certified.idl.js", "../../candid/icrc_index-ng.idl.js"],
4
+ "sourcesContent": ["import type { Principal } from \"@dfinity/principal\";\nimport { createServices, type QueryParams } from \"@dfinity/utils\";\nimport type {\n GetTransactions,\n _SERVICE as IcrcIndexNgService,\n} from \"../candid/icrc_index-ng\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc_index-ng.certified.idl\";\nimport { idlFactory } from \"../candid/icrc_index-ng.idl\";\nimport { IcrcCanister } from \"./canister\";\nimport { toGetTransactionsArgs } from \"./converters/index.converters\";\nimport { IndexError } from \"./errors/index.errors\";\nimport type { IcrcLedgerCanisterOptions } from \"./types/canister.options\";\nimport type { GetIndexNgAccountTransactionsParams } from \"./types/index-ng.params\";\n\nexport class IcrcIndexNgCanister extends IcrcCanister<IcrcIndexNgService> {\n static create(options: IcrcLedgerCanisterOptions<IcrcIndexNgService>) {\n const { service, certifiedService, canisterId } =\n createServices<IcrcIndexNgService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new IcrcIndexNgCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the transactions of an account\n *\n * Always certified.\n * `get_account_transactions` needs to be called with an update\n * because the index canisters makes a call to the ledger canister to get the transaction data.\n * Index Canister only holds the transactions ids in state, not the whole transaction data.\n */\n /**\n * Get the transactions of an account.\n *\n * @param {GetAccountTransactionsParams} params The parameters to get the transactions of an account.\n * @returns {Promise<GetTransactions>} The list of transactions and further related information of the given account.\n */\n getTransactions = async ({\n certified,\n ...rest\n }: GetIndexNgAccountTransactionsParams): Promise<GetTransactions> => {\n const response = await this.caller({\n certified,\n }).get_account_transactions(toGetTransactionsArgs(rest));\n\n if (\"Err\" in response) {\n throw new IndexError(response.Err.message);\n }\n\n return response.Ok;\n };\n\n /**\n * Returns the ledger canister ID related to the index canister.\n */\n ledgerId = (params: QueryParams): Promise<Principal> => {\n const { ledger_id } = this.caller(params);\n return ledger_id();\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Rec();\n const UpgradeArg = IDL.Record({\n 'ledger_id' : IDL.Opt(IDL.Principal),\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const InitArg = IDL.Record({\n 'ledger_id' : IDL.Principal,\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n const BlockIndex = IDL.Nat;\n const SubAccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(SubAccount),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(BlockIndex),\n 'account' : Account,\n });\n const Tokens = IDL.Nat;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : BlockIndex,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'balance' : Tokens,\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(BlockIndex),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const GetBlocksRequest = IDL.Record({\n 'start' : IDL.Nat,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const GetBlocksResponse = IDL.Record({\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n });\n const FeeCollectorRanges = IDL.Record({\n 'ranges' : IDL.Vec(\n IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))\n ),\n });\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n [],\n ),\n 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], []),\n 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], []),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),\n 'ledger_id' : IDL.Func([], [IDL.Principal], []),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n [],\n ),\n 'status' : IDL.Func([], [Status], []),\n });\n};\nexport const init = ({ IDL }) => {\n const UpgradeArg = IDL.Record({\n 'ledger_id' : IDL.Opt(IDL.Principal),\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const InitArg = IDL.Record({\n 'ledger_id' : IDL.Principal,\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n return [IDL.Opt(IndexArg)];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Rec();\n const UpgradeArg = IDL.Record({\n 'ledger_id' : IDL.Opt(IDL.Principal),\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const InitArg = IDL.Record({\n 'ledger_id' : IDL.Principal,\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n const BlockIndex = IDL.Nat;\n const SubAccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(SubAccount),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(BlockIndex),\n 'account' : Account,\n });\n const Tokens = IDL.Nat;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : BlockIndex,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'balance' : Tokens,\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(BlockIndex),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const GetBlocksRequest = IDL.Record({\n 'start' : IDL.Nat,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const GetBlocksResponse = IDL.Record({\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n });\n const FeeCollectorRanges = IDL.Record({\n 'ranges' : IDL.Vec(\n IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))\n ),\n });\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n ['query'],\n ),\n 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),\n 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], ['query']),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),\n 'ledger_id' : IDL.Func([], [IDL.Principal], ['query']),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n ['query'],\n ),\n 'status' : IDL.Func([], [Status], ['query']),\n });\n};\nexport const init = ({ IDL }) => {\n const UpgradeArg = IDL.Record({\n 'ledger_id' : IDL.Opt(IDL.Principal),\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const InitArg = IDL.Record({\n 'ledger_id' : IDL.Principal,\n 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),\n });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n return [IDL.Opt(IndexArg)];\n};\n"],
5
+ "mappings": "uFACA,OAAS,kBAAAA,MAAwC,iBCA1C,IAAMC,EAAa,CAAC,CAAE,IAAAC,CAAI,IAAM,CACrC,IAAMC,EAAQD,EAAI,IAAI,EAChBE,EAAaF,EAAI,OAAO,CAC5B,UAAcA,EAAI,IAAIA,EAAI,SAAS,EACnC,6CAAiDA,EAAI,IAAIA,EAAI,KAAK,CACpE,CAAC,EACKG,EAAUH,EAAI,OAAO,CACzB,UAAcA,EAAI,UAClB,6CAAiDA,EAAI,IAAIA,EAAI,KAAK,CACpE,CAAC,EACKI,EAAWJ,EAAI,QAAQ,CAAE,QAAYE,EAAY,KAASC,CAAQ,CAAC,EACnEE,EAAaL,EAAI,IACjBM,EAAaN,EAAI,IAAIA,EAAI,IAAI,EAC7BO,EAAUP,EAAI,OAAO,CACzB,MAAUA,EAAI,UACd,WAAeA,EAAI,IAAIM,CAAU,CACnC,CAAC,EACKE,EAA6BR,EAAI,OAAO,CAC5C,YAAgBA,EAAI,IACpB,MAAUA,EAAI,IAAIK,CAAU,EAC5B,QAAYE,CACd,CAAC,EACK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AO,CACV,EACF,OAAWN,EAAI,KAAK,CAAC,EAAG,CAACyB,CAAM,EAAG,CAAC,OAAO,CAAC,CAC7C,CAAC,CACH,EFhHO,IAAMC,EAAN,MAAMC,UAA4BC,CAAiC,CAAnE,kCA0BL,qBAAkB,MAAO,CACvB,UAAAC,EACA,GAAGC,CACL,IAAqE,CACnE,IAAMC,EAAW,MAAM,KAAK,OAAO,CACjC,UAAAF,CACF,CAAC,EAAE,yBAAyBG,EAAsBF,CAAI,CAAC,EAEvD,GAAI,QAASC,EACX,MAAM,IAAIE,EAAWF,EAAS,IAAI,OAAO,EAG3C,OAAOA,EAAS,EAClB,EAKA,cAAYG,GAA4C,CACtD,GAAM,CAAE,UAAAC,CAAU,EAAI,KAAK,OAAOD,CAAM,EACxC,OAAOC,EAAU,CACnB,EA9CA,OAAO,OAAOC,EAAwD,CACpE,GAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,WAAAC,CAAW,EAC5CC,EAAmC,CACjC,QAAAJ,EACA,WAAAK,EACA,oBAAAA,CACF,CAAC,EAEH,OAAO,IAAId,EAAoBY,EAAYF,EAASC,CAAgB,CACtE,CAsCF",
6
+ "names": ["createServices", "idlFactory", "IDL", "Value", "UpgradeArg", "InitArg", "IndexArg", "BlockIndex", "SubAccount", "Account", "GetAccountTransactionsArgs", "Tokens", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionWithId", "GetTransactions", "GetTransactionsErr", "GetTransactionsResult", "GetBlocksRequest", "Map", "Block", "GetBlocksResponse", "FeeCollectorRanges", "ListSubaccountsArgs", "Status", "idlFactory", "IDL", "Value", "UpgradeArg", "InitArg", "IndexArg", "BlockIndex", "SubAccount", "Account", "GetAccountTransactionsArgs", "Tokens", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionWithId", "GetTransactions", "GetTransactionsErr", "GetTransactionsResult", "GetBlocksRequest", "Map", "Block", "GetBlocksResponse", "FeeCollectorRanges", "ListSubaccountsArgs", "Status", "IcrcIndexNgCanister", "_IcrcIndexNgCanister", "IcrcCanister", "certified", "rest", "response", "toGetTransactionsArgs", "IndexError", "params", "ledger_id", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-7QBNVANW.js";import"./chunk-6GLYJI63.js";import"./chunk-42OX77TJ.js";export{a as IcrcIndexNgCanister};
1
+ import{a}from"./chunk-ZAZML4GO.js";import"./chunk-6GLYJI63.js";import"./chunk-42OX77TJ.js";export{a as IcrcIndexNgCanister};
2
2
  //# sourceMappingURL=index-ng.canister.js.map
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-7QBNVANW.js";import"./chunk-6GLYJI63.js";import{a as u}from"./chunk-O4F4HWON.js";import{b}from"./chunk-42OX77TJ.js";import{a as k,b as d}from"./chunk-2PDEGA3G.js";var f=(t=>(t.SYMBOL="icrc1:symbol",t.NAME="icrc1:name",t.DECIMALS="icrc1:decimals",t.FEE="icrc1:fee",t.LOGO="icrc1:logo",t))(f||{});import{Principal as s}from"@dfinity/principal";import{bigEndianCrc32 as x,encodeBase32 as l,hexStringToUint8Array as g,isNullish as a,notEmptyString as y,uint8ArrayToHexString as A}from"@dfinity/utils";var I=64,E=({owner:r,subaccount:e})=>{if(a(e))return r.toText();let n=(i=>i.replace(/^0+/,""))(A(Uint8Array.from(e)));return n.length===0?r.toText():`${r.toText()}-${p({owner:r,subaccount:e})}.${n}`},p=({owner:r,subaccount:e})=>{let o=x(Uint8Array.from([...r.toUint8Array(),...e]));return l(o)},L=r=>{let[e,o]=r.split(".");if(!y(e))throw new Error("Invalid account. No string provided.");if(a(o))return{owner:s.fromText(r)};let[n,...i]=e.split("-").reverse(),t=i.reverse().join("-"),c={owner:s.fromText(t),subaccount:g(o.padStart(I,"0"))};if(p(c)!==n)throw new Error("Invalid account. Invalid checksum.");return c};import{isNullish as T,nonNullish as h}from"@dfinity/utils";var B=r=>{let e=/^([a-zA-Z]+):([A-Za-z0-9:\-.]+).*?(?:[?&](?:amount|value)=(\d+(?:\.\d+)?))?$/,o=r.match(e);if(T(o))return;let[n,i,t,c]=o;return{token:i,identifier:t,...h(c)&&!isNaN(parseFloat(c))&&{amount:parseFloat(c)}}};export{u as IcrcIndexCanister,m as IcrcIndexNgCanister,d as IcrcLedgerCanister,f as IcrcMetadataResponseEntries,k as IcrcTransferError,b as IndexError,L as decodeIcrcAccount,B as decodePayment,E as encodeIcrcAccount};
1
+ import{a as m}from"./chunk-ZAZML4GO.js";import"./chunk-6GLYJI63.js";import{a as u}from"./chunk-O4F4HWON.js";import{b}from"./chunk-42OX77TJ.js";import{a as k,b as d}from"./chunk-2PDEGA3G.js";var f=(t=>(t.SYMBOL="icrc1:symbol",t.NAME="icrc1:name",t.DECIMALS="icrc1:decimals",t.FEE="icrc1:fee",t.LOGO="icrc1:logo",t))(f||{});import{Principal as s}from"@dfinity/principal";import{bigEndianCrc32 as x,encodeBase32 as l,hexStringToUint8Array as g,isNullish as a,notEmptyString as y,uint8ArrayToHexString as A}from"@dfinity/utils";var I=64,E=({owner:r,subaccount:e})=>{if(a(e))return r.toText();let n=(i=>i.replace(/^0+/,""))(A(Uint8Array.from(e)));return n.length===0?r.toText():`${r.toText()}-${p({owner:r,subaccount:e})}.${n}`},p=({owner:r,subaccount:e})=>{let o=x(Uint8Array.from([...r.toUint8Array(),...e]));return l(o)},L=r=>{let[e,o]=r.split(".");if(!y(e))throw new Error("Invalid account. No string provided.");if(a(o))return{owner:s.fromText(r)};let[n,...i]=e.split("-").reverse(),t=i.reverse().join("-"),c={owner:s.fromText(t),subaccount:g(o.padStart(I,"0"))};if(p(c)!==n)throw new Error("Invalid account. Invalid checksum.");return c};import{isNullish as T,nonNullish as h}from"@dfinity/utils";var B=r=>{let e=/^([a-zA-Z]+):([A-Za-z0-9:\-.]+).*?(?:[?&](?:amount|value)=(\d+(?:\.\d+)?))?$/,o=r.match(e);if(T(o))return;let[n,i,t,c]=o;return{token:i,identifier:t,...h(c)&&!isNaN(parseFloat(c))&&{amount:parseFloat(c)}}};export{u as IcrcIndexCanister,m as IcrcIndexNgCanister,d as IcrcLedgerCanister,f as IcrcMetadataResponseEntries,k as IcrcTransferError,b as IndexError,L as decodeIcrcAccount,B as decodePayment,E as encodeIcrcAccount};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfinity/ledger-icrc",
3
- "version": "2.3.1",
3
+ "version": "2.3.2-next-2024-06-05",
4
4
  "description": "A library for interfacing with ICRC ledgers on the Internet Computer.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/cjs/index.cjs.js",
@@ -37,9 +37,9 @@
37
37
  ],
38
38
  "homepage": "https://github.com/dfinity/ic-js#readme",
39
39
  "peerDependencies": {
40
- "@dfinity/agent": "^1.3.0",
41
- "@dfinity/candid": "^1.3.0",
42
- "@dfinity/principal": "^1.3.0",
43
- "@dfinity/utils": "^2.3.0"
40
+ "@dfinity/agent": "*",
41
+ "@dfinity/candid": "*",
42
+ "@dfinity/principal": "*",
43
+ "@dfinity/utils": "*"
44
44
  }
45
- }
45
+ }
@@ -1,2 +0,0 @@
1
- import{a as P}from"./chunk-6GLYJI63.js";import{a as k,b as F}from"./chunk-42OX77TJ.js";import{createServices as B}from"@dfinity/utils";var G=({IDL:t})=>{let r=t.Rec(),n=t.Record({ledger_id:t.Opt(t.Principal)}),a=t.Record({ledger_id:t.Principal}),o=t.Variant({Upgrade:n,Init:a}),c=t.Nat,s=t.Vec(t.Nat8),e=t.Record({owner:t.Principal,subaccount:t.Opt(s)}),p=t.Record({max_results:t.Nat,start:t.Opt(c),account:e}),i=t.Nat,d=t.Record({from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(e)}),l=t.Record({to:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),u=t.Record({fee:t.Opt(t.Nat),from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:e}),m=t.Record({to:e,fee:t.Opt(t.Nat),from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(e)}),g=t.Record({burn:t.Opt(d),kind:t.Text,mint:t.Opt(l),approve:t.Opt(u),timestamp:t.Nat64,transfer:t.Opt(m)}),_=t.Record({id:c,transaction:g}),N=t.Record({balance:i,transactions:t.Vec(_),oldest_tx_id:t.Opt(c)}),O=t.Record({message:t.Text}),R=t.Variant({Ok:N,Err:O}),x=t.Record({start:t.Nat,length:t.Nat}),T=t.Vec(t.Tuple(t.Text,r));r.fill(t.Variant({Int:t.Int,Map:T,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(r)}));let V=r,f=t.Record({blocks:t.Vec(V),chain_length:t.Nat64}),A=t.Record({ranges:t.Vec(t.Tuple(e,t.Vec(t.Tuple(c,c))))}),y=t.Record({owner:t.Principal,start:t.Opt(s)}),b=t.Record({num_blocks_synced:c});return t.Service({get_account_transactions:t.Func([p],[R],[]),get_blocks:t.Func([x],[f],[]),get_fee_collectors_ranges:t.Func([],[A],[]),icrc1_balance_of:t.Func([e],[i],[]),ledger_id:t.Func([],[t.Principal],[]),list_subaccounts:t.Func([y],[t.Vec(s)],[]),status:t.Func([],[b],[])})};var S=({IDL:t})=>{let r=t.Rec(),n=t.Record({ledger_id:t.Opt(t.Principal)}),a=t.Record({ledger_id:t.Principal}),o=t.Variant({Upgrade:n,Init:a}),c=t.Nat,s=t.Vec(t.Nat8),e=t.Record({owner:t.Principal,subaccount:t.Opt(s)}),p=t.Record({max_results:t.Nat,start:t.Opt(c),account:e}),i=t.Nat,d=t.Record({from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(e)}),l=t.Record({to:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),u=t.Record({fee:t.Opt(t.Nat),from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,expected_allowance:t.Opt(t.Nat),expires_at:t.Opt(t.Nat64),spender:e}),m=t.Record({to:e,fee:t.Opt(t.Nat),from:e,memo:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat,spender:t.Opt(e)}),g=t.Record({burn:t.Opt(d),kind:t.Text,mint:t.Opt(l),approve:t.Opt(u),timestamp:t.Nat64,transfer:t.Opt(m)}),_=t.Record({id:c,transaction:g}),N=t.Record({balance:i,transactions:t.Vec(_),oldest_tx_id:t.Opt(c)}),O=t.Record({message:t.Text}),R=t.Variant({Ok:N,Err:O}),x=t.Record({start:t.Nat,length:t.Nat}),T=t.Vec(t.Tuple(t.Text,r));r.fill(t.Variant({Int:t.Int,Map:T,Nat:t.Nat,Nat64:t.Nat64,Blob:t.Vec(t.Nat8),Text:t.Text,Array:t.Vec(r)}));let V=r,f=t.Record({blocks:t.Vec(V),chain_length:t.Nat64}),A=t.Record({ranges:t.Vec(t.Tuple(e,t.Vec(t.Tuple(c,c))))}),y=t.Record({owner:t.Principal,start:t.Opt(s)}),b=t.Record({num_blocks_synced:c});return t.Service({get_account_transactions:t.Func([p],[R],["query"]),get_blocks:t.Func([x],[f],["query"]),get_fee_collectors_ranges:t.Func([],[A],["query"]),icrc1_balance_of:t.Func([e],[i],["query"]),ledger_id:t.Func([],[t.Principal],["query"]),list_subaccounts:t.Func([y],[t.Vec(s)],["query"]),status:t.Func([],[b],["query"])})};var v=class t extends P{constructor(){super(...arguments);this.getTransactions=async({certified:n,...a})=>{let o=await this.caller({certified:n}).get_account_transactions(k(a));if("Err"in o)throw new F(o.Err.message);return o.Ok};this.ledgerId=n=>{let{ledger_id:a}=this.caller(n);return a()}}static create(n){let{service:a,certifiedService:o,canisterId:c}=B({options:n,idlFactory:S,certifiedIdlFactory:G});return new t(c,a,o)}};export{v as a};
2
- //# sourceMappingURL=chunk-7QBNVANW.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index-ng.canister.ts", "../../candid/icrc_index-ng.certified.idl.js", "../../candid/icrc_index-ng.idl.js"],
4
- "sourcesContent": ["import type { Principal } from \"@dfinity/principal\";\nimport { createServices, type QueryParams } from \"@dfinity/utils\";\nimport type {\n GetTransactions,\n _SERVICE as IcrcIndexNgService,\n} from \"../candid/icrc_index-ng\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc_index-ng.certified.idl\";\nimport { idlFactory } from \"../candid/icrc_index-ng.idl\";\nimport { IcrcCanister } from \"./canister\";\nimport { toGetTransactionsArgs } from \"./converters/index.converters\";\nimport { IndexError } from \"./errors/index.errors\";\nimport type { IcrcLedgerCanisterOptions } from \"./types/canister.options\";\nimport type { GetIndexNgAccountTransactionsParams } from \"./types/index-ng.params\";\n\nexport class IcrcIndexNgCanister extends IcrcCanister<IcrcIndexNgService> {\n static create(options: IcrcLedgerCanisterOptions<IcrcIndexNgService>) {\n const { service, certifiedService, canisterId } =\n createServices<IcrcIndexNgService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new IcrcIndexNgCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the transactions of an account\n *\n * Always certified.\n * `get_account_transactions` needs to be called with an update\n * because the index canisters makes a call to the ledger canister to get the transaction data.\n * Index Canister only holds the transactions ids in state, not the whole transaction data.\n */\n /**\n * Get the transactions of an account.\n *\n * @param {GetAccountTransactionsParams} params The parameters to get the transactions of an account.\n * @returns {Promise<GetTransactions>} The list of transactions and further related information of the given account.\n */\n getTransactions = async ({\n certified,\n ...rest\n }: GetIndexNgAccountTransactionsParams): Promise<GetTransactions> => {\n const response = await this.caller({\n certified,\n }).get_account_transactions(toGetTransactionsArgs(rest));\n\n if (\"Err\" in response) {\n throw new IndexError(response.Err.message);\n }\n\n return response.Ok;\n };\n\n /**\n * Returns the ledger canister ID related to the index canister.\n */\n ledgerId = (params: QueryParams): Promise<Principal> => {\n const { ledger_id } = this.caller(params);\n return ledger_id();\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Rec();\n const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });\n const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n const BlockIndex = IDL.Nat;\n const SubAccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(SubAccount),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(BlockIndex),\n 'account' : Account,\n });\n const Tokens = IDL.Nat;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : BlockIndex,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'balance' : Tokens,\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(BlockIndex),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const GetBlocksRequest = IDL.Record({\n 'start' : IDL.Nat,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const GetBlocksResponse = IDL.Record({\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n });\n const FeeCollectorRanges = IDL.Record({\n 'ranges' : IDL.Vec(\n IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))\n ),\n });\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n [],\n ),\n 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], []),\n 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], []),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),\n 'ledger_id' : IDL.Func([], [IDL.Principal], []),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n [],\n ),\n 'status' : IDL.Func([], [Status], []),\n });\n};\nexport const init = ({ IDL }) => {\n const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });\n const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n return [IDL.Opt(IndexArg)];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Rec();\n const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });\n const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n const BlockIndex = IDL.Nat;\n const SubAccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(SubAccount),\n });\n const GetAccountTransactionsArgs = IDL.Record({\n 'max_results' : IDL.Nat,\n 'start' : IDL.Opt(BlockIndex),\n 'account' : Account,\n });\n const Tokens = IDL.Nat;\n const Burn = IDL.Record({\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Mint = IDL.Record({\n 'to' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n });\n const Approve = IDL.Record({\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'expected_allowance' : IDL.Opt(IDL.Nat),\n 'expires_at' : IDL.Opt(IDL.Nat64),\n 'spender' : Account,\n });\n const Transfer = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(IDL.Nat),\n 'from' : Account,\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'created_at_time' : IDL.Opt(IDL.Nat64),\n 'amount' : IDL.Nat,\n 'spender' : IDL.Opt(Account),\n });\n const Transaction = IDL.Record({\n 'burn' : IDL.Opt(Burn),\n 'kind' : IDL.Text,\n 'mint' : IDL.Opt(Mint),\n 'approve' : IDL.Opt(Approve),\n 'timestamp' : IDL.Nat64,\n 'transfer' : IDL.Opt(Transfer),\n });\n const TransactionWithId = IDL.Record({\n 'id' : BlockIndex,\n 'transaction' : Transaction,\n });\n const GetTransactions = IDL.Record({\n 'balance' : Tokens,\n 'transactions' : IDL.Vec(TransactionWithId),\n 'oldest_tx_id' : IDL.Opt(BlockIndex),\n });\n const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });\n const GetTransactionsResult = IDL.Variant({\n 'Ok' : GetTransactions,\n 'Err' : GetTransactionsErr,\n });\n const GetBlocksRequest = IDL.Record({\n 'start' : IDL.Nat,\n 'length' : IDL.Nat,\n });\n const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));\n Value.fill(\n IDL.Variant({\n 'Int' : IDL.Int,\n 'Map' : Map,\n 'Nat' : IDL.Nat,\n 'Nat64' : IDL.Nat64,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n 'Array' : IDL.Vec(Value),\n })\n );\n const Block = Value;\n const GetBlocksResponse = IDL.Record({\n 'blocks' : IDL.Vec(Block),\n 'chain_length' : IDL.Nat64,\n });\n const FeeCollectorRanges = IDL.Record({\n 'ranges' : IDL.Vec(\n IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))\n ),\n });\n const ListSubaccountsArgs = IDL.Record({\n 'owner' : IDL.Principal,\n 'start' : IDL.Opt(SubAccount),\n });\n const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });\n return IDL.Service({\n 'get_account_transactions' : IDL.Func(\n [GetAccountTransactionsArgs],\n [GetTransactionsResult],\n ['query'],\n ),\n 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),\n 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], ['query']),\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),\n 'ledger_id' : IDL.Func([], [IDL.Principal], ['query']),\n 'list_subaccounts' : IDL.Func(\n [ListSubaccountsArgs],\n [IDL.Vec(SubAccount)],\n ['query'],\n ),\n 'status' : IDL.Func([], [Status], ['query']),\n });\n};\nexport const init = ({ IDL }) => {\n const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });\n const InitArg = IDL.Record({ 'ledger_id' : IDL.Principal });\n const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });\n return [IDL.Opt(IndexArg)];\n};\n"],
5
- "mappings": "uFACA,OAAS,kBAAAA,MAAwC,iBCA1C,IAAMC,EAAa,CAAC,CAAE,IAAAC,CAAI,IAAM,CACrC,IAAMC,EAAQD,EAAI,IAAI,EAChBE,EAAaF,EAAI,OAAO,CAAE,UAAcA,EAAI,IAAIA,EAAI,SAAS,CAAE,CAAC,EAChEG,EAAUH,EAAI,OAAO,CAAE,UAAcA,EAAI,SAAU,CAAC,EACpDI,EAAWJ,EAAI,QAAQ,CAAE,QAAYE,EAAY,KAASC,CAAQ,CAAC,EACnEE,EAAaL,EAAI,IACjBM,EAAaN,EAAI,IAAIA,EAAI,IAAI,EAC7BO,EAAUP,EAAI,OA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EACrD,iBAAqBA,EAAI,KACrB,CAACwB,CAAmB,EACpB,CAACxB,EAAI,IAAIM,CAAU,CAAC,EACpB,CAAC,OAAO,CACV,EACF,OAAWN,EAAI,KAAK,CAAC,EAAG,CAACyB,CAAM,EAAG,CAAC,OAAO,CAAC,CAC7C,CAAC,CACH,EF1GO,IAAMC,EAAN,MAAMC,UAA4BC,CAAiC,CAAnE,kCA0BL,qBAAkB,MAAO,CACvB,UAAAC,EACA,GAAGC,CACL,IAAqE,CACnE,IAAMC,EAAW,MAAM,KAAK,OAAO,CACjC,UAAAF,CACF,CAAC,EAAE,yBAAyBG,EAAsBF,CAAI,CAAC,EAEvD,GAAI,QAASC,EACX,MAAM,IAAIE,EAAWF,EAAS,IAAI,OAAO,EAG3C,OAAOA,EAAS,EAClB,EAKA,cAAYG,GAA4C,CACtD,GAAM,CAAE,UAAAC,CAAU,EAAI,KAAK,OAAOD,CAAM,EACxC,OAAOC,EAAU,CACnB,EA9CA,OAAO,OAAOC,EAAwD,CACpE,GAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,WAAAC,CAAW,EAC5CC,EAAmC,CACjC,QAAAJ,EACA,WAAAK,EACA,oBAAAA,CACF,CAAC,EAEH,OAAO,IAAId,EAAoBY,EAAYF,EAASC,CAAgB,CACtE,CAsCF",
6
- "names": ["createServices", "idlFactory", "IDL", "Value", "UpgradeArg", "InitArg", "IndexArg", "BlockIndex", "SubAccount", "Account", "GetAccountTransactionsArgs", "Tokens", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionWithId", "GetTransactions", "GetTransactionsErr", "GetTransactionsResult", "GetBlocksRequest", "Map", "Block", "GetBlocksResponse", "FeeCollectorRanges", "ListSubaccountsArgs", "Status", "idlFactory", "IDL", "Value", "UpgradeArg", "InitArg", "IndexArg", "BlockIndex", "SubAccount", "Account", "GetAccountTransactionsArgs", "Tokens", "Burn", "Mint", "Approve", "Transfer", "Transaction", "TransactionWithId", "GetTransactions", "GetTransactionsErr", "GetTransactionsResult", "GetBlocksRequest", "Map", "Block", "GetBlocksResponse", "FeeCollectorRanges", "ListSubaccountsArgs", "Status", "IcrcIndexNgCanister", "_IcrcIndexNgCanister", "IcrcCanister", "certified", "rest", "response", "toGetTransactionsArgs", "IndexError", "params", "ledger_id", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory"]
7
- }