@dfinity/ledger-icp
Version:
A library for interfacing with the ICP ledger on the Internet Computer.
3 lines (2 loc) • 18.2 kB
JavaScript
import{a as we,c as ve}from"./chunk-BN2VGC4I.js";import{Canister as We,createServices as Xe}from"@dfinity/utils";var Be=({IDL:e})=>{let r=e.Vec(e.Nat8),t=e.Record({owner:e.Principal,subaccount:e.Opt(r)}),a=e.Record({icrc2:e.Bool}),d=e.Record({icrc1_minting_account:e.Opt(t),feature_flags:e.Opt(a)}),c=e.Record({e8s:e.Nat64}),s=e.Text,T=e.Record({secs:e.Nat64,nanos:e.Nat32}),q=e.Record({num_blocks_to_archive:e.Nat64,max_transactions_per_response:e.Opt(e.Nat64),trigger_threshold:e.Nat64,more_controller_ids:e.Opt(e.Vec(e.Principal)),max_message_size_bytes:e.Opt(e.Nat64),cycles_for_archive_creation:e.Opt(e.Nat64),node_max_memory_size_bytes:e.Opt(e.Nat64),controller_id:e.Principal}),C=e.Record({send_whitelist:e.Vec(e.Principal),token_symbol:e.Opt(e.Text),transfer_fee:e.Opt(c),minting_account:s,transaction_window:e.Opt(T),max_message_size_bytes:e.Opt(e.Nat64),icrc1_minting_account:e.Opt(t),archive_options:e.Opt(q),initial_values:e.Vec(e.Tuple(s,c)),token_name:e.Opt(e.Text),feature_flags:e.Opt(a)}),Ke=e.Variant({Upgrade:e.Opt(d),Init:C}),o=e.Vec(e.Nat8),P=e.Record({account:o}),E=e.Record({account:s}),U=e.Record({canister_id:e.Principal}),M=e.Record({archives:e.Vec(U)}),G=e.Record({prev_spender_id:e.Opt(s),from_account_id:s,take:e.Opt(e.Nat64)}),S=e.Vec(e.Record({from_account_id:s,to_spender_id:s,allowance:c,expires_at:e.Opt(e.Nat64)})),n=e.Nat,Q=e.Variant({Int:e.Int,Nat:e.Nat,Blob:e.Vec(e.Nat8),Text:e.Text}),l=e.Nat64,z=e.Record({to:t,fee:e.Opt(n),memo:e.Opt(e.Vec(e.Nat8)),from_subaccount:e.Opt(r),created_at_time:e.Opt(l),amount:n}),u=e.Nat,H=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,BadBurn:e.Record({min_burn_amount:n}),Duplicate:e.Record({duplicate_of:u}),BadFee:e.Record({expected_fee:n}),CreatedInFuture:e.Record({ledger_time:e.Nat64}),TooOld:e.Null,InsufficientFunds:e.Record({balance:n})}),J=e.Variant({Ok:u,Err:H}),y=e.Record({utc_offset_minutes:e.Opt(e.Int16),language:e.Text}),$=e.Record({metadata:y,device_spec:e.Opt(e.Variant({GenericDisplay:e.Null,LineDisplay:e.Record({characters_per_line:e.Nat16,lines_per_page:e.Nat16})}))}),K=e.Record({arg:e.Vec(e.Nat8),method:e.Text,user_preferences:$}),Y=e.Variant({LineDisplayMessage:e.Record({pages:e.Vec(e.Record({lines:e.Vec(e.Text)}))}),GenericDisplayMessage:e.Text}),j=e.Record({metadata:y,consent_message:Y}),g=e.Record({description:e.Text}),W=e.Variant({GenericError:e.Record({description:e.Text,error_code:e.Nat}),InsufficientPayment:g,UnsupportedCanisterCall:g,ConsentMessageUnavailable:g}),X=e.Variant({Ok:j,Err:W}),Z=e.Record({account:t,spender:t}),I=e.Record({allowance:n,expires_at:e.Opt(l)}),D=e.Record({fee:e.Opt(n),memo:e.Opt(e.Vec(e.Nat8)),from_subaccount:e.Opt(r),created_at_time:e.Opt(l),amount:n,expected_allowance:e.Opt(n),expires_at:e.Opt(l),spender:t}),L=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,Duplicate:e.Record({duplicate_of:u}),BadFee:e.Record({expected_fee:n}),AllowanceChanged:e.Record({current_allowance:n}),CreatedInFuture:e.Record({ledger_time:e.Nat64}),TooOld:e.Null,Expired:e.Record({ledger_time:e.Nat64}),InsufficientFunds:e.Record({balance:n})}),ee=e.Variant({Ok:u,Err:L}),te=e.Record({to:t,fee:e.Opt(n),spender_subaccount:e.Opt(r),from:t,memo:e.Opt(e.Vec(e.Nat8)),created_at_time:e.Opt(l),amount:n}),ce=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,InsufficientAllowance:e.Record({allowance:n}),BadBurn:e.Record({min_burn_amount:n}),Duplicate:e.Record({duplicate_of:u}),BadFee:e.Record({expected_fee:n}),CreatedInFuture:e.Record({ledger_time:l}),TooOld:e.Null,InsufficientFunds:e.Record({balance:n})}),re=e.Variant({Ok:u,Err:ce}),i=e.Nat64,f=e.Record({start:i,length:e.Nat64}),x=e.Nat64,p=e.Record({timestamp_nanos:e.Nat64}),ne=e.Variant({Approve:e.Record({fee:c,from:o,allowance_e8s:e.Int,allowance:c,expected_allowance:e.Opt(c),expires_at:e.Opt(p),spender:o}),Burn:e.Record({from:o,amount:c,spender:e.Opt(o)}),Mint:e.Record({to:o,amount:c}),Transfer:e.Record({to:o,fee:c,from:o,amount:c,spender:e.Opt(e.Vec(e.Nat8))})}),ae=e.Record({memo:x,icrc1_memo:e.Opt(e.Vec(e.Nat8)),operation:e.Opt(ne),created_at_time:p}),F=e.Record({transaction:ae,timestamp:p,parent_hash:e.Opt(e.Vec(e.Nat8))}),oe=e.Record({blocks:e.Vec(F)}),b=e.Variant({BadFirstBlockIndex:e.Record({requested_index:i,first_valid_index:i}),Other:e.Record({error_message:e.Text,error_code:e.Nat64})}),se=e.Variant({Ok:oe,Err:b}),ie=e.Func([f],[se],[]),de=e.Record({callback:ie,start:i,length:e.Nat64}),le=e.Record({certificate:e.Opt(e.Vec(e.Nat8)),blocks:e.Vec(F),chain_length:e.Nat64,first_block_index:i,archived_blocks:e.Vec(de)}),ue=e.Record({callback:e.Func([f],[e.Variant({Ok:e.Vec(e.Vec(e.Nat8)),Err:b})],[]),start:e.Nat64,length:e.Nat64}),_e=e.Record({certificate:e.Opt(e.Vec(e.Nat8)),blocks:e.Vec(e.Vec(e.Nat8)),chain_length:e.Nat64,first_block_index:e.Nat64,archived_blocks:e.Vec(ue)}),pe=e.Record({to:s,fee:c,memo:x,from_subaccount:e.Opt(r),created_at_time:e.Opt(p),amount:c}),me=e.Record({certification:e.Opt(e.Vec(e.Nat8)),tip_index:i}),fe=e.Record({to:o,fee:c,memo:x,from_subaccount:e.Opt(r),created_at_time:e.Opt(p),amount:c}),Re=e.Variant({TxTooOld:e.Record({allowed_window_nanos:e.Nat64}),BadFee:e.Record({expected_fee:c}),TxDuplicate:e.Record({duplicate_of:i}),TxCreatedInFuture:e.Null,InsufficientFunds:e.Record({balance:c})}),ge=e.Variant({Ok:i,Err:Re}),xe=e.Record({}),Oe=e.Record({transfer_fee:c});return e.Service({account_balance:e.Func([P],[c],[]),account_balance_dfx:e.Func([E],[c],[]),account_identifier:e.Func([t],[o],[]),archives:e.Func([],[M],[]),decimals:e.Func([],[e.Record({decimals:e.Nat32})],[]),get_allowances:e.Func([G],[S],[]),icrc10_supported_standards:e.Func([],[e.Vec(e.Record({url:e.Text,name:e.Text}))],[]),icrc1_balance_of:e.Func([t],[n],[]),icrc1_decimals:e.Func([],[e.Nat8],[]),icrc1_fee:e.Func([],[n],[]),icrc1_metadata:e.Func([],[e.Vec(e.Tuple(e.Text,Q))],[]),icrc1_minting_account:e.Func([],[e.Opt(t)],[]),icrc1_name:e.Func([],[e.Text],[]),icrc1_supported_standards:e.Func([],[e.Vec(e.Record({url:e.Text,name:e.Text}))],[]),icrc1_symbol:e.Func([],[e.Text],[]),icrc1_total_supply:e.Func([],[n],[]),icrc1_transfer:e.Func([z],[J],[]),icrc21_canister_call_consent_message:e.Func([K],[X],[]),icrc2_allowance:e.Func([Z],[I],[]),icrc2_approve:e.Func([D],[ee],[]),icrc2_transfer_from:e.Func([te],[re],[]),is_ledger_ready:e.Func([],[e.Bool],[]),name:e.Func([],[e.Record({name:e.Text})],[]),query_blocks:e.Func([f],[le],[]),query_encoded_blocks:e.Func([f],[_e],[]),send_dfx:e.Func([pe],[i],[]),symbol:e.Func([],[e.Record({symbol:e.Text})],[]),tip_of_chain:e.Func([],[me],[]),transfer:e.Func([fe],[ge],[]),transfer_fee:e.Func([xe],[Oe],[])})};var qe=({IDL:e})=>{let r=e.Vec(e.Nat8),t=e.Record({owner:e.Principal,subaccount:e.Opt(r)}),a=e.Record({icrc2:e.Bool}),d=e.Record({icrc1_minting_account:e.Opt(t),feature_flags:e.Opt(a)}),c=e.Record({e8s:e.Nat64}),s=e.Text,T=e.Record({secs:e.Nat64,nanos:e.Nat32}),q=e.Record({num_blocks_to_archive:e.Nat64,max_transactions_per_response:e.Opt(e.Nat64),trigger_threshold:e.Nat64,more_controller_ids:e.Opt(e.Vec(e.Principal)),max_message_size_bytes:e.Opt(e.Nat64),cycles_for_archive_creation:e.Opt(e.Nat64),node_max_memory_size_bytes:e.Opt(e.Nat64),controller_id:e.Principal}),C=e.Record({send_whitelist:e.Vec(e.Principal),token_symbol:e.Opt(e.Text),transfer_fee:e.Opt(c),minting_account:s,transaction_window:e.Opt(T),max_message_size_bytes:e.Opt(e.Nat64),icrc1_minting_account:e.Opt(t),archive_options:e.Opt(q),initial_values:e.Vec(e.Tuple(s,c)),token_name:e.Opt(e.Text),feature_flags:e.Opt(a)}),Ke=e.Variant({Upgrade:e.Opt(d),Init:C}),o=e.Vec(e.Nat8),P=e.Record({account:o}),E=e.Record({account:s}),U=e.Record({canister_id:e.Principal}),M=e.Record({archives:e.Vec(U)}),G=e.Record({prev_spender_id:e.Opt(s),from_account_id:s,take:e.Opt(e.Nat64)}),S=e.Vec(e.Record({from_account_id:s,to_spender_id:s,allowance:c,expires_at:e.Opt(e.Nat64)})),n=e.Nat,Q=e.Variant({Int:e.Int,Nat:e.Nat,Blob:e.Vec(e.Nat8),Text:e.Text}),l=e.Nat64,z=e.Record({to:t,fee:e.Opt(n),memo:e.Opt(e.Vec(e.Nat8)),from_subaccount:e.Opt(r),created_at_time:e.Opt(l),amount:n}),u=e.Nat,H=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,BadBurn:e.Record({min_burn_amount:n}),Duplicate:e.Record({duplicate_of:u}),BadFee:e.Record({expected_fee:n}),CreatedInFuture:e.Record({ledger_time:e.Nat64}),TooOld:e.Null,InsufficientFunds:e.Record({balance:n})}),J=e.Variant({Ok:u,Err:H}),y=e.Record({utc_offset_minutes:e.Opt(e.Int16),language:e.Text}),$=e.Record({metadata:y,device_spec:e.Opt(e.Variant({GenericDisplay:e.Null,LineDisplay:e.Record({characters_per_line:e.Nat16,lines_per_page:e.Nat16})}))}),K=e.Record({arg:e.Vec(e.Nat8),method:e.Text,user_preferences:$}),Y=e.Variant({LineDisplayMessage:e.Record({pages:e.Vec(e.Record({lines:e.Vec(e.Text)}))}),GenericDisplayMessage:e.Text}),j=e.Record({metadata:y,consent_message:Y}),g=e.Record({description:e.Text}),W=e.Variant({GenericError:e.Record({description:e.Text,error_code:e.Nat}),InsufficientPayment:g,UnsupportedCanisterCall:g,ConsentMessageUnavailable:g}),X=e.Variant({Ok:j,Err:W}),Z=e.Record({account:t,spender:t}),I=e.Record({allowance:n,expires_at:e.Opt(l)}),D=e.Record({fee:e.Opt(n),memo:e.Opt(e.Vec(e.Nat8)),from_subaccount:e.Opt(r),created_at_time:e.Opt(l),amount:n,expected_allowance:e.Opt(n),expires_at:e.Opt(l),spender:t}),L=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,Duplicate:e.Record({duplicate_of:u}),BadFee:e.Record({expected_fee:n}),AllowanceChanged:e.Record({current_allowance:n}),CreatedInFuture:e.Record({ledger_time:e.Nat64}),TooOld:e.Null,Expired:e.Record({ledger_time:e.Nat64}),InsufficientFunds:e.Record({balance:n})}),ee=e.Variant({Ok:u,Err:L}),te=e.Record({to:t,fee:e.Opt(n),spender_subaccount:e.Opt(r),from:t,memo:e.Opt(e.Vec(e.Nat8)),created_at_time:e.Opt(l),amount:n}),ce=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,InsufficientAllowance:e.Record({allowance:n}),BadBurn:e.Record({min_burn_amount:n}),Duplicate:e.Record({duplicate_of:u}),BadFee:e.Record({expected_fee:n}),CreatedInFuture:e.Record({ledger_time:l}),TooOld:e.Null,InsufficientFunds:e.Record({balance:n})}),re=e.Variant({Ok:u,Err:ce}),i=e.Nat64,f=e.Record({start:i,length:e.Nat64}),x=e.Nat64,p=e.Record({timestamp_nanos:e.Nat64}),ne=e.Variant({Approve:e.Record({fee:c,from:o,allowance_e8s:e.Int,allowance:c,expected_allowance:e.Opt(c),expires_at:e.Opt(p),spender:o}),Burn:e.Record({from:o,amount:c,spender:e.Opt(o)}),Mint:e.Record({to:o,amount:c}),Transfer:e.Record({to:o,fee:c,from:o,amount:c,spender:e.Opt(e.Vec(e.Nat8))})}),ae=e.Record({memo:x,icrc1_memo:e.Opt(e.Vec(e.Nat8)),operation:e.Opt(ne),created_at_time:p}),F=e.Record({transaction:ae,timestamp:p,parent_hash:e.Opt(e.Vec(e.Nat8))}),oe=e.Record({blocks:e.Vec(F)}),b=e.Variant({BadFirstBlockIndex:e.Record({requested_index:i,first_valid_index:i}),Other:e.Record({error_message:e.Text,error_code:e.Nat64})}),se=e.Variant({Ok:oe,Err:b}),ie=e.Func([f],[se],["query"]),de=e.Record({callback:ie,start:i,length:e.Nat64}),le=e.Record({certificate:e.Opt(e.Vec(e.Nat8)),blocks:e.Vec(F),chain_length:e.Nat64,first_block_index:i,archived_blocks:e.Vec(de)}),ue=e.Record({callback:e.Func([f],[e.Variant({Ok:e.Vec(e.Vec(e.Nat8)),Err:b})],["query"]),start:e.Nat64,length:e.Nat64}),_e=e.Record({certificate:e.Opt(e.Vec(e.Nat8)),blocks:e.Vec(e.Vec(e.Nat8)),chain_length:e.Nat64,first_block_index:e.Nat64,archived_blocks:e.Vec(ue)}),pe=e.Record({to:s,fee:c,memo:x,from_subaccount:e.Opt(r),created_at_time:e.Opt(p),amount:c}),me=e.Record({certification:e.Opt(e.Vec(e.Nat8)),tip_index:i}),fe=e.Record({to:o,fee:c,memo:x,from_subaccount:e.Opt(r),created_at_time:e.Opt(p),amount:c}),Re=e.Variant({TxTooOld:e.Record({allowed_window_nanos:e.Nat64}),BadFee:e.Record({expected_fee:c}),TxDuplicate:e.Record({duplicate_of:i}),TxCreatedInFuture:e.Null,InsufficientFunds:e.Record({balance:c})}),ge=e.Variant({Ok:i,Err:Re}),xe=e.Record({}),Oe=e.Record({transfer_fee:c});return e.Service({account_balance:e.Func([P],[c],["query"]),account_balance_dfx:e.Func([E],[c],["query"]),account_identifier:e.Func([t],[o],["query"]),archives:e.Func([],[M],["query"]),decimals:e.Func([],[e.Record({decimals:e.Nat32})],["query"]),get_allowances:e.Func([G],[S],["query"]),icrc10_supported_standards:e.Func([],[e.Vec(e.Record({url:e.Text,name:e.Text}))],["query"]),icrc1_balance_of:e.Func([t],[n],["query"]),icrc1_decimals:e.Func([],[e.Nat8],["query"]),icrc1_fee:e.Func([],[n],["query"]),icrc1_metadata:e.Func([],[e.Vec(e.Tuple(e.Text,Q))],["query"]),icrc1_minting_account:e.Func([],[e.Opt(t)],["query"]),icrc1_name:e.Func([],[e.Text],["query"]),icrc1_supported_standards:e.Func([],[e.Vec(e.Record({url:e.Text,name:e.Text}))],["query"]),icrc1_symbol:e.Func([],[e.Text],["query"]),icrc1_total_supply:e.Func([],[n],["query"]),icrc1_transfer:e.Func([z],[J],[]),icrc21_canister_call_consent_message:e.Func([K],[X],[]),icrc2_allowance:e.Func([Z],[I],["query"]),icrc2_approve:e.Func([D],[ee],[]),icrc2_transfer_from:e.Func([te],[re],[]),is_ledger_ready:e.Func([],[e.Bool],["query"]),name:e.Func([],[e.Record({name:e.Text})],["query"]),query_blocks:e.Func([f],[le],["query"]),query_encoded_blocks:e.Func([f],[_e],["query"]),send_dfx:e.Func([pe],[i],[]),symbol:e.Func([],[e.Record({symbol:e.Text})],["query"]),tip_of_chain:e.Func([],[me],["query"]),transfer:e.Func([fe],[ge],[]),transfer_fee:e.Func([xe],[Oe],["query"])})};import{arrayOfNumberToUint8Array as Ye,isNullish as je,toNullable as _}from"@dfinity/utils";var De=BigInt(1095062083),Le=BigInt(1347768404),h=BigInt(1e4),et=BigInt(1e8);var Ce=e=>({e8s:e}),Pe=({to:e,amount:r,memo:t,fee:a,fromSubAccount:d,createdAt:c})=>({to:e.toUint8Array(),fee:Ce(a??h),amount:Ce(r),memo:t??BigInt(0),created_at_time:c!==void 0?[{timestamp_nanos:c}]:[],from_subaccount:d===void 0?[]:[Ye(d)]}),Ee=({fromSubAccount:e,to:r,amount:t,fee:a,icrc1Memo:d,createdAt:c})=>({to:r,fee:_(a??h),amount:t,memo:_(d),created_at_time:_(c),from_subaccount:_(e)}),Ue=({fee:e,createdAt:r,icrc1Memo:t,fromSubAccount:a,expected_allowance:d,expires_at:c,amount:s,...T})=>({...T,fee:_(e??h),memo:_(t),from_subaccount:_(a),created_at_time:_(r),amount:s,expected_allowance:_(d),expires_at:_(c)}),Me=({userPreferences:{metadata:{utcOffsetMinutes:e,language:r},deriveSpec:t},...a})=>({...a,user_preferences:{metadata:{language:r,utc_offset_minutes:_(e)},device_spec:je(t)?_():_("GenericDisplay"in t?{GenericDisplay:null}:{LineDisplay:{characters_per_line:t.LineDisplay.charactersPerLine,lines_per_page:t.LineDisplay.linesPerPage}})}});var O=class extends Error{},R=class extends O{},m=class extends O{},N=class extends O{},Ge=class extends R{},Se=class extends Error{},V=class extends R{constructor(t){super();this.balance=t}},k=class extends R{constructor(t){super();this.allowed_window_secs=t}},w=class extends R{},v=class extends R{constructor(t){super();this.duplicateOf=t}},A=class extends O{constructor(t){super();this.expectedFee=t}},B=class extends m{constructor(t,a){super();this.message=t;this.error_code=a}},Ne=class extends m{},Te=class extends m{constructor(t){super();this.duplicateOf=t}},ye=class extends m{constructor(t){super();this.currentAllowance=t}},Fe=class extends m{},be=class extends m{},Ve=class extends m{constructor(t){super();this.ledgerTime=t}},Ae=class extends N{},he=class extends N{},ke=class extends N{},Qe=e=>"TxDuplicate"in e?new v(e.TxDuplicate.duplicate_of):"InsufficientFunds"in e?new V(e.InsufficientFunds.balance.e8s):"TxCreatedInFuture"in e?new w:"TxTooOld"in e?new k(Number(e.TxTooOld.allowed_window_nanos)):"BadFee"in e?new A(e.BadFee.expected_fee.e8s):new R(`Unknown error type ${JSON.stringify(e)}`),ze=e=>"Duplicate"in e?new v(e.Duplicate.duplicate_of):"InsufficientFunds"in e?new V(e.InsufficientFunds.balance):"CreatedInFuture"in e?new w:"TooOld"in e?new k:"BadFee"in e?new A(e.BadFee.expected_fee):new R(`Unknown error type ${JSON.stringify(e)}`),He=e=>"GenericError"in e?new B(e.GenericError.message,e.GenericError.error_code):"TemporarilyUnavailable"in e?new Ne:"Duplicate"in e?new Te(e.Duplicate.duplicate_of):"BadFee"in e?new A(e.BadFee.expected_fee):"AllowanceChanged"in e?new ye(e.AllowanceChanged.current_allowance):"CreatedInFuture"in e?new Fe:"TooOld"in e?new be:"Expired"in e?new Ve(e.Expired.ledger_time):"InsufficientFunds"in e?new V(e.InsufficientFunds.balance):new m(`Unknown error type ${JSON.stringify(e)}`),Je=e=>"GenericError"in e?new B(e.GenericError.description,e.GenericError.error_code):"InsufficientPayment"in e?new Ae(e.InsufficientPayment.description):"UnsupportedCanisterCall"in e?new he(e.UnsupportedCanisterCall.description):"ConsentMessageUnavailable"in e?new ke(e.ConsentMessageUnavailable.description):new N(`Unknown error type ${JSON.stringify(e)}`);var $e=class e extends We{static create(r={}){let t=r.canisterId??we,{service:a,certifiedService:d}=Xe({options:{...r,canisterId:t},idlFactory:qe,certifiedIdlFactory:Be});return new e(t,a,d)}accountBalance=async({accountIdentifier:r,certified:t=!0})=>{let a=ve(r);return(await(t?this.certifiedService:this.service).account_balance({account:a.toUint8Array()})).e8s};metadata=r=>{let{icrc1_metadata:t}=this.caller(r);return t()};transactionFee=async(r={certified:!1})=>{let{transfer_fee:t}=this.caller(r),{transfer_fee:{e8s:a}}=await t({});return a};transfer=async r=>{let t=Pe(r),a=await this.certifiedService.transfer(t);if("Err"in a)throw Qe(a.Err);return a.Ok};icrc1Transfer=async r=>{let t=Ee(r),a=await this.certifiedService.icrc1_transfer(t);if("Err"in a)throw ze(a.Err);return a.Ok};icrc2Approve=async r=>{let{icrc2_approve:t}=this.caller({certified:!0}),a=await t(Ue(r));if("Err"in a)throw He(a.Err);return a.Ok};icrc21ConsentMessage=async r=>{let{icrc21_canister_call_consent_message:t}=this.caller({certified:!0}),a=await t(Me(r));if("Err"in a)throw Je(a.Err);return a.Ok}};export{Pe as a,Ee as b,Ue as c,Me as d,O as e,R as f,m as g,N as h,Ge as i,Se as j,V as k,k as l,w as m,v as n,A as o,B as p,Ne as q,Te as r,ye as s,Fe as t,be as u,Ve as v,Ae as w,he as x,ke as y,Qe as z,ze as A,He as B,Je as C,$e as D};
//# sourceMappingURL=chunk-UY6EVLL3.js.map