UNPKG

@funded-labs/dab-js

Version:
68 lines (67 loc) 3.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.idlFactory = void 0; const idlFactory = ({ IDL }) => { const Value = IDL.Rec(); const Subaccount = IDL.Vec(IDL.Nat8); const Account = IDL.Record({ owner: IDL.Principal, subaccount: IDL.Opt(Subaccount), }); Value.fill(IDL.Variant({ Int: IDL.Int, Map: IDL.Vec(IDL.Tuple(IDL.Text, Value)), Nat: IDL.Nat, Blob: IDL.Vec(IDL.Nat8), Text: IDL.Text, Array: IDL.Vec(Value), })); const TransferArg = IDL.Record({ to: Account, token_id: IDL.Nat, memo: IDL.Opt(IDL.Vec(IDL.Nat8)), from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), created_at_time: IDL.Opt(IDL.Nat64), }); const TransferError = IDL.Variant({ GenericError: IDL.Record({ message: IDL.Text, error_code: IDL.Nat, }), Duplicate: IDL.Record({ duplicate_of: IDL.Nat }), NonExistingTokenId: IDL.Null, Unauthorized: IDL.Null, CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }), InvalidRecipient: IDL.Null, GenericBatchError: IDL.Record({ message: IDL.Text, error_code: IDL.Nat, }), TooOld: IDL.Null, }); const TransferResult = IDL.Variant({ Ok: IDL.Nat, Err: TransferError }); return IDL.Service({ icrc7_atomic_batch_transfers: IDL.Func([], [IDL.Opt(IDL.Bool)], ['query']), icrc7_balance_of: IDL.Func([IDL.Vec(Account)], [IDL.Vec(IDL.Nat)], ['query']), icrc7_collection_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, Value))], ['query']), icrc7_default_take_value: IDL.Func([], [IDL.Opt(IDL.Nat)], ['query']), icrc7_description: IDL.Func([], [IDL.Opt(IDL.Text)], ['query']), icrc7_logo: IDL.Func([], [IDL.Opt(IDL.Text)], ['query']), icrc7_max_memo_size: IDL.Func([], [IDL.Opt(IDL.Nat)], ['query']), icrc7_max_query_batch_size: IDL.Func([], [IDL.Opt(IDL.Nat)], ['query']), icrc7_max_take_value: IDL.Func([], [IDL.Opt(IDL.Nat)], ['query']), icrc7_max_update_batch_size: IDL.Func([], [IDL.Opt(IDL.Nat)], ['query']), icrc7_name: IDL.Func([], [IDL.Text], ['query']), icrc7_owner_of: IDL.Func([IDL.Vec(IDL.Nat)], [IDL.Vec(IDL.Opt(Account))], ['query']), icrc7_permitted_drift: IDL.Func([], [IDL.Opt(IDL.Nat)], ['query']), icrc7_supply_cap: IDL.Func([], [IDL.Opt(IDL.Nat)], ['query']), icrc7_symbol: IDL.Func([], [IDL.Text], ['query']), icrc7_token_metadata: IDL.Func([IDL.Vec(IDL.Nat)], [IDL.Vec(IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, Value))))], ['query']), icrc7_tokens: IDL.Func([IDL.Opt(IDL.Nat), IDL.Opt(IDL.Nat)], [IDL.Vec(IDL.Nat)], ['query']), icrc7_tokens_of: IDL.Func([Account, IDL.Opt(IDL.Nat), IDL.Opt(IDL.Nat)], [IDL.Vec(IDL.Nat)], ['query']), icrc7_total_supply: IDL.Func([], [IDL.Nat], ['query']), icrc7_transfer: IDL.Func([IDL.Vec(TransferArg)], [IDL.Vec(IDL.Opt(TransferResult))], []), icrc7_tx_window: IDL.Func([], [IDL.Opt(IDL.Nat)], ['query']), }); }; exports.idlFactory = idlFactory;