@dfinity/ledger-icrc 6.0.1 → 7.0.0-beta-2025-12-18

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.
Files changed (48) hide show
  1. package/dist/index.d.ts +23 -17
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +4 -4
  4. package/dist/index.mjs +1 -1
  5. package/dist/index.mjs.map +4 -4
  6. package/package.json +4 -5
  7. package/dist/candid/icrc_index-ng.certified.idl.d.ts +0 -2
  8. package/dist/candid/icrc_index-ng.certified.idl.js +0 -151
  9. package/dist/candid/icrc_index-ng.d.ts +0 -154
  10. package/dist/candid/icrc_index-ng.did +0 -156
  11. package/dist/candid/icrc_index-ng.idl.d.ts +0 -2
  12. package/dist/candid/icrc_index-ng.idl.js +0 -151
  13. package/dist/candid/icrc_index.certified.idl.d.ts +0 -2
  14. package/dist/candid/icrc_index.certified.idl.js +0 -99
  15. package/dist/candid/icrc_index.d.ts +0 -108
  16. package/dist/candid/icrc_index.did +0 -98
  17. package/dist/candid/icrc_index.idl.d.ts +0 -2
  18. package/dist/candid/icrc_index.idl.js +0 -99
  19. package/dist/candid/icrc_ledger.certified.idl.d.ts +0 -2
  20. package/dist/candid/icrc_ledger.certified.idl.js +0 -525
  21. package/dist/candid/icrc_ledger.d.ts +0 -590
  22. package/dist/candid/icrc_ledger.did +0 -579
  23. package/dist/candid/icrc_ledger.idl.d.ts +0 -2
  24. package/dist/candid/icrc_ledger.idl.js +0 -545
  25. package/dist/candid/icrc_nft-ledger.certified.idl.d.ts +0 -2
  26. package/dist/candid/icrc_nft-ledger.certified.idl.js +0 -102
  27. package/dist/candid/icrc_nft-ledger.d.ts +0 -80
  28. package/dist/candid/icrc_nft-ledger.did +0 -67
  29. package/dist/candid/icrc_nft-ledger.idl.d.ts +0 -2
  30. package/dist/candid/icrc_nft-ledger.idl.js +0 -106
  31. package/dist/canister.d.ts +0 -13
  32. package/dist/converters/converters.d.ts +0 -16
  33. package/dist/converters/index.converters.d.ts +0 -6
  34. package/dist/converters/ledger.converters.d.ts +0 -6
  35. package/dist/errors/index.errors.d.ts +0 -2
  36. package/dist/errors/ledger.errors.d.ts +0 -25
  37. package/dist/index-ng.canister.d.ts +0 -43
  38. package/dist/index.canister.d.ts +0 -21
  39. package/dist/ledger.canister.d.ts +0 -127
  40. package/dist/types/canister.options.d.ts +0 -5
  41. package/dist/types/index-ng.params.d.ts +0 -12
  42. package/dist/types/index-ng.types.d.ts +0 -1
  43. package/dist/types/index.params.d.ts +0 -7
  44. package/dist/types/index.types.d.ts +0 -1
  45. package/dist/types/ledger.params.d.ts +0 -109
  46. package/dist/types/ledger.responses.d.ts +0 -24
  47. package/dist/utils/ledger.utils.d.ts +0 -31
  48. package/dist/utils/payment.utils.d.ts +0 -28
@@ -1,154 +0,0 @@
1
- /* eslint-disable */
2
-
3
- // @ts-nocheck
4
-
5
- // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
- // You should NOT make any changes in this file as it will be overwritten.
7
- // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
-
9
- import type { ActorMethod } from "@icp-sdk/core/agent";
10
- import type { IDL } from "@icp-sdk/core/candid";
11
- import type { Principal } from "@icp-sdk/core/principal";
12
-
13
- export interface Account {
14
- owner: Principal;
15
- subaccount: [] | [SubAccount];
16
- }
17
- export interface Approve {
18
- fee: [] | [Tokens];
19
- from: Account;
20
- memo: [] | [Uint8Array];
21
- created_at_time: [] | [bigint];
22
- amount: Tokens;
23
- expected_allowance: [] | [Tokens];
24
- expires_at: [] | [bigint];
25
- spender: Account;
26
- }
27
- export type Block = Value;
28
- export type BlockIndex = bigint;
29
- export interface Burn {
30
- fee: [] | [bigint];
31
- from: Account;
32
- memo: [] | [Uint8Array];
33
- created_at_time: [] | [bigint];
34
- amount: Tokens;
35
- spender: [] | [Account];
36
- }
37
- export interface FeeCollectorRanges {
38
- ranges: Array<[Account, Array<[BlockIndex, BlockIndex]>]>;
39
- }
40
- export interface GetAccountTransactionsArgs {
41
- /**
42
- * Maximum number of transactions to fetch.
43
- */
44
- max_results: bigint;
45
- /**
46
- * The txid of the last transaction seen by the client.
47
- * If None then the results will start from the most recent
48
- * txid. If set then the results will start from the next
49
- * most recent txid after start (start won't be included).
50
- */
51
- start: [] | [BlockIndex];
52
- account: Account;
53
- }
54
- export interface GetBlocksRequest {
55
- start: bigint;
56
- length: bigint;
57
- }
58
- export interface GetBlocksResponse {
59
- blocks: Array<Block>;
60
- chain_length: bigint;
61
- }
62
- export interface GetTransactions {
63
- balance: Tokens;
64
- transactions: Array<TransactionWithId>;
65
- /**
66
- * The txid of the oldest transaction the account has
67
- */
68
- oldest_tx_id: [] | [BlockIndex];
69
- }
70
- export interface GetTransactionsErr {
71
- message: string;
72
- }
73
- export type GetTransactionsResult =
74
- | { Ok: GetTransactions }
75
- | { Err: GetTransactionsErr };
76
- export type IndexArg = { Upgrade: UpgradeArg } | { Init: InitArg };
77
- export interface InitArg {
78
- ledger_id: Principal;
79
- /**
80
- * The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
81
- * responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
82
- * A higher values means that it takes longer for new blocks to show up in the index.
83
- */
84
- retrieve_blocks_from_ledger_interval_seconds: [] | [bigint];
85
- }
86
- export interface ListSubaccountsArgs {
87
- owner: Principal;
88
- start: [] | [SubAccount];
89
- }
90
- export type Map = Array<[string, Value]>;
91
- export interface Mint {
92
- to: Account;
93
- fee: [] | [bigint];
94
- memo: [] | [Uint8Array];
95
- created_at_time: [] | [bigint];
96
- amount: Tokens;
97
- }
98
- export interface Status {
99
- num_blocks_synced: BlockIndex;
100
- }
101
- export type SubAccount = Uint8Array;
102
- export type Tokens = bigint;
103
- export interface Transaction {
104
- burn: [] | [Burn];
105
- kind: string;
106
- mint: [] | [Mint];
107
- approve: [] | [Approve];
108
- timestamp: bigint;
109
- transfer: [] | [Transfer];
110
- }
111
- export interface TransactionWithId {
112
- id: BlockIndex;
113
- transaction: Transaction;
114
- }
115
- export interface Transfer {
116
- to: Account;
117
- fee: [] | [Tokens];
118
- from: Account;
119
- memo: [] | [Uint8Array];
120
- created_at_time: [] | [bigint];
121
- amount: Tokens;
122
- spender: [] | [Account];
123
- }
124
- export interface UpgradeArg {
125
- ledger_id: [] | [Principal];
126
- /**
127
- * The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
128
- * responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
129
- * A higher values means that it takes longer for new blocks to show up in the index.
130
- */
131
- retrieve_blocks_from_ledger_interval_seconds: [] | [bigint];
132
- }
133
- export type Value =
134
- | { Int: bigint }
135
- | { Map: Map }
136
- | { Nat: bigint }
137
- | { Nat64: bigint }
138
- | { Blob: Uint8Array }
139
- | { Text: string }
140
- | { Array: Array<Value> };
141
- export interface _SERVICE {
142
- get_account_transactions: ActorMethod<
143
- [GetAccountTransactionsArgs],
144
- GetTransactionsResult
145
- >;
146
- get_blocks: ActorMethod<[GetBlocksRequest], GetBlocksResponse>;
147
- get_fee_collectors_ranges: ActorMethod<[], FeeCollectorRanges>;
148
- icrc1_balance_of: ActorMethod<[Account], Tokens>;
149
- ledger_id: ActorMethod<[], Principal>;
150
- list_subaccounts: ActorMethod<[ListSubaccountsArgs], Array<SubAccount>>;
151
- status: ActorMethod<[], Status>;
152
- }
153
- export declare const idlFactory: IDL.InterfaceFactory;
154
- export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
@@ -1,156 +0,0 @@
1
- // Generated from IC repo commit fa06b0e (2025-11-12 tags: release-2025-11-13_03-24-base) 'rs/ledger_suite/icrc1/index-ng/index-ng.did' by import-candid
2
-
3
- type Tokens = nat;
4
-
5
- type InitArg = record {
6
- ledger_id : principal;
7
- // The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
8
- // responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
9
- // A higher values means that it takes longer for new blocks to show up in the index.
10
- retrieve_blocks_from_ledger_interval_seconds : opt nat64
11
- };
12
-
13
- type UpgradeArg = record {
14
- ledger_id : opt principal;
15
- // The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
16
- // responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
17
- // A higher values means that it takes longer for new blocks to show up in the index.
18
- retrieve_blocks_from_ledger_interval_seconds : opt nat64
19
- };
20
-
21
- type IndexArg = variant {
22
- Init : InitArg;
23
- Upgrade : UpgradeArg
24
- };
25
-
26
- type GetBlocksRequest = record {
27
- start : nat;
28
- length : nat
29
- };
30
-
31
- type Value = variant {
32
- Blob : blob;
33
- Text : text;
34
- Nat : nat;
35
- Nat64 : nat64;
36
- Int : int;
37
- Array : vec Value;
38
- Map : Map
39
- };
40
-
41
- type Map = vec record { text; Value };
42
-
43
- type Block = Value;
44
-
45
- type GetBlocksResponse = record {
46
- chain_length : nat64;
47
- blocks : vec Block
48
- };
49
-
50
- type BlockIndex = nat;
51
-
52
- type SubAccount = blob;
53
-
54
- type Account = record { owner : principal; subaccount : opt SubAccount };
55
-
56
- type Transaction = record {
57
- burn : opt Burn;
58
- kind : text;
59
- mint : opt Mint;
60
- approve : opt Approve;
61
- timestamp : nat64;
62
- transfer : opt Transfer
63
- };
64
-
65
- type Approve = record {
66
- fee : opt Tokens;
67
- from : Account;
68
- memo : opt vec nat8;
69
- created_at_time : opt nat64;
70
- amount : Tokens;
71
- expected_allowance : opt Tokens;
72
- expires_at : opt nat64;
73
- spender : Account
74
- };
75
-
76
- type Burn = record {
77
- from : Account;
78
- memo : opt vec nat8;
79
- created_at_time : opt nat64;
80
- amount : Tokens;
81
- spender : opt Account;
82
- fee : opt nat
83
- };
84
-
85
- type Mint = record {
86
- to : Account;
87
- memo : opt vec nat8;
88
- created_at_time : opt nat64;
89
- amount : Tokens;
90
- fee : opt nat
91
- };
92
-
93
- type Transfer = record {
94
- to : Account;
95
- fee : opt Tokens;
96
- from : Account;
97
- memo : opt vec nat8;
98
- created_at_time : opt nat64;
99
- amount : Tokens;
100
- spender : opt Account
101
- };
102
-
103
- type GetAccountTransactionsArgs = record {
104
- account : Account;
105
- // The txid of the last transaction seen by the client.
106
- // If None then the results will start from the most recent
107
- // txid. If set then the results will start from the next
108
- // most recent txid after start (start won't be included).
109
- start : opt BlockIndex;
110
- // Maximum number of transactions to fetch.
111
- max_results : nat
112
- };
113
-
114
- type TransactionWithId = record {
115
- id : BlockIndex;
116
- transaction : Transaction
117
- };
118
-
119
- type GetTransactions = record {
120
- balance : Tokens;
121
- transactions : vec TransactionWithId;
122
- // The txid of the oldest transaction the account has
123
- oldest_tx_id : opt BlockIndex
124
- };
125
-
126
- type GetTransactionsErr = record {
127
- message : text
128
- };
129
-
130
- type GetTransactionsResult = variant {
131
- Ok : GetTransactions;
132
- Err : GetTransactionsErr
133
- };
134
-
135
- type ListSubaccountsArgs = record {
136
- owner : principal;
137
- start : opt SubAccount
138
- };
139
-
140
- type Status = record {
141
- num_blocks_synced : BlockIndex
142
- };
143
-
144
- type FeeCollectorRanges = record {
145
- ranges : vec record { Account; vec record { BlockIndex; BlockIndex } }
146
- }
147
-
148
- service : (index_arg : opt IndexArg) -> {
149
- get_account_transactions : (GetAccountTransactionsArgs) -> (GetTransactionsResult) query;
150
- get_blocks : (GetBlocksRequest) -> (GetBlocksResponse) query;
151
- get_fee_collectors_ranges : () -> (FeeCollectorRanges) query;
152
- icrc1_balance_of : (Account) -> (Tokens) query;
153
- ledger_id : () -> (principal) query;
154
- list_subaccounts : (ListSubaccountsArgs) -> (vec SubAccount) query;
155
- status : () -> (Status) query
156
- }
@@ -1,2 +0,0 @@
1
- import type { IDL } from "@icp-sdk/core/candid";
2
- export const idlFactory: IDL.InterfaceFactory;
@@ -1,151 +0,0 @@
1
- /* eslint-disable */
2
-
3
- // @ts-nocheck
4
-
5
- // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
- // You should NOT make any changes in this file as it will be overwritten.
7
- // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
-
9
- export const idlFactory = ({ IDL }) => {
10
- const Value = IDL.Rec();
11
- const UpgradeArg = IDL.Record({
12
- ledger_id: IDL.Opt(IDL.Principal),
13
- retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
14
- });
15
- const InitArg = IDL.Record({
16
- ledger_id: IDL.Principal,
17
- retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
18
- });
19
- const IndexArg = IDL.Variant({ Upgrade: UpgradeArg, Init: InitArg });
20
- const BlockIndex = IDL.Nat;
21
- const SubAccount = IDL.Vec(IDL.Nat8);
22
- const Account = IDL.Record({
23
- owner: IDL.Principal,
24
- subaccount: IDL.Opt(SubAccount),
25
- });
26
- const GetAccountTransactionsArgs = IDL.Record({
27
- max_results: IDL.Nat,
28
- start: IDL.Opt(BlockIndex),
29
- account: Account,
30
- });
31
- const Tokens = IDL.Nat;
32
- const Burn = IDL.Record({
33
- fee: IDL.Opt(IDL.Nat),
34
- from: Account,
35
- memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
36
- created_at_time: IDL.Opt(IDL.Nat64),
37
- amount: Tokens,
38
- spender: IDL.Opt(Account),
39
- });
40
- const Mint = IDL.Record({
41
- to: Account,
42
- fee: IDL.Opt(IDL.Nat),
43
- memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
44
- created_at_time: IDL.Opt(IDL.Nat64),
45
- amount: Tokens,
46
- });
47
- const Approve = IDL.Record({
48
- fee: IDL.Opt(Tokens),
49
- from: Account,
50
- memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
51
- created_at_time: IDL.Opt(IDL.Nat64),
52
- amount: Tokens,
53
- expected_allowance: IDL.Opt(Tokens),
54
- expires_at: IDL.Opt(IDL.Nat64),
55
- spender: Account,
56
- });
57
- const Transfer = IDL.Record({
58
- to: Account,
59
- fee: IDL.Opt(Tokens),
60
- from: Account,
61
- memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
62
- created_at_time: IDL.Opt(IDL.Nat64),
63
- amount: Tokens,
64
- spender: IDL.Opt(Account),
65
- });
66
- const Transaction = IDL.Record({
67
- burn: IDL.Opt(Burn),
68
- kind: IDL.Text,
69
- mint: IDL.Opt(Mint),
70
- approve: IDL.Opt(Approve),
71
- timestamp: IDL.Nat64,
72
- transfer: IDL.Opt(Transfer),
73
- });
74
- const TransactionWithId = IDL.Record({
75
- id: BlockIndex,
76
- transaction: Transaction,
77
- });
78
- const GetTransactions = IDL.Record({
79
- balance: Tokens,
80
- transactions: IDL.Vec(TransactionWithId),
81
- oldest_tx_id: IDL.Opt(BlockIndex),
82
- });
83
- const GetTransactionsErr = IDL.Record({ message: IDL.Text });
84
- const GetTransactionsResult = IDL.Variant({
85
- Ok: GetTransactions,
86
- Err: GetTransactionsErr,
87
- });
88
- const GetBlocksRequest = IDL.Record({
89
- start: IDL.Nat,
90
- length: IDL.Nat,
91
- });
92
- const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
93
- Value.fill(
94
- IDL.Variant({
95
- Int: IDL.Int,
96
- Map: Map,
97
- Nat: IDL.Nat,
98
- Nat64: IDL.Nat64,
99
- Blob: IDL.Vec(IDL.Nat8),
100
- Text: IDL.Text,
101
- Array: IDL.Vec(Value),
102
- }),
103
- );
104
- const Block = Value;
105
- const GetBlocksResponse = IDL.Record({
106
- blocks: IDL.Vec(Block),
107
- chain_length: IDL.Nat64,
108
- });
109
- const FeeCollectorRanges = IDL.Record({
110
- ranges: IDL.Vec(
111
- IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex))),
112
- ),
113
- });
114
- const ListSubaccountsArgs = IDL.Record({
115
- owner: IDL.Principal,
116
- start: IDL.Opt(SubAccount),
117
- });
118
- const Status = IDL.Record({ num_blocks_synced: BlockIndex });
119
-
120
- return IDL.Service({
121
- get_account_transactions: IDL.Func(
122
- [GetAccountTransactionsArgs],
123
- [GetTransactionsResult],
124
- ["query"],
125
- ),
126
- get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], ["query"]),
127
- get_fee_collectors_ranges: IDL.Func([], [FeeCollectorRanges], ["query"]),
128
- icrc1_balance_of: IDL.Func([Account], [Tokens], ["query"]),
129
- ledger_id: IDL.Func([], [IDL.Principal], ["query"]),
130
- list_subaccounts: IDL.Func(
131
- [ListSubaccountsArgs],
132
- [IDL.Vec(SubAccount)],
133
- ["query"],
134
- ),
135
- status: IDL.Func([], [Status], ["query"]),
136
- });
137
- };
138
-
139
- export const init = ({ IDL }) => {
140
- const UpgradeArg = IDL.Record({
141
- ledger_id: IDL.Opt(IDL.Principal),
142
- retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
143
- });
144
- const InitArg = IDL.Record({
145
- ledger_id: IDL.Principal,
146
- retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
147
- });
148
- const IndexArg = IDL.Variant({ Upgrade: UpgradeArg, Init: InitArg });
149
-
150
- return [IDL.Opt(IndexArg)];
151
- };
@@ -1,2 +0,0 @@
1
- import type { IDL } from "@icp-sdk/core/candid";
2
- export const idlFactory: IDL.InterfaceFactory;
@@ -1,99 +0,0 @@
1
- /* eslint-disable */
2
-
3
- // @ts-nocheck
4
-
5
- // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
- // You should NOT make any changes in this file as it will be overwritten.
7
- // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
-
9
- export const idlFactory = ({ IDL }) => {
10
- const InitArgs = IDL.Record({ ledger_id: IDL.Principal });
11
- const TxId = IDL.Nat;
12
- const Account = IDL.Record({
13
- owner: IDL.Principal,
14
- subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
15
- });
16
- const GetAccountTransactionsArgs = IDL.Record({
17
- max_results: IDL.Nat,
18
- start: IDL.Opt(TxId),
19
- account: Account,
20
- });
21
- const Burn = IDL.Record({
22
- from: Account,
23
- memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
24
- created_at_time: IDL.Opt(IDL.Nat64),
25
- amount: IDL.Nat,
26
- spender: IDL.Opt(Account),
27
- });
28
- const Mint = IDL.Record({
29
- to: Account,
30
- memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
31
- created_at_time: IDL.Opt(IDL.Nat64),
32
- amount: IDL.Nat,
33
- });
34
- const Approve = IDL.Record({
35
- fee: IDL.Opt(IDL.Nat),
36
- from: Account,
37
- memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
38
- created_at_time: IDL.Opt(IDL.Nat64),
39
- amount: IDL.Nat,
40
- expected_allowance: IDL.Opt(IDL.Nat),
41
- expires_at: IDL.Opt(IDL.Nat64),
42
- spender: Account,
43
- });
44
- const Transfer = IDL.Record({
45
- to: Account,
46
- fee: IDL.Opt(IDL.Nat),
47
- from: Account,
48
- memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
49
- created_at_time: IDL.Opt(IDL.Nat64),
50
- amount: IDL.Nat,
51
- spender: IDL.Opt(Account),
52
- });
53
- const Transaction = IDL.Record({
54
- burn: IDL.Opt(Burn),
55
- kind: IDL.Text,
56
- mint: IDL.Opt(Mint),
57
- approve: IDL.Opt(Approve),
58
- timestamp: IDL.Nat64,
59
- transfer: IDL.Opt(Transfer),
60
- });
61
- const TransactionWithId = IDL.Record({
62
- id: TxId,
63
- transaction: Transaction,
64
- });
65
- const GetTransactions = IDL.Record({
66
- transactions: IDL.Vec(TransactionWithId),
67
- oldest_tx_id: IDL.Opt(TxId),
68
- });
69
- const GetTransactionsErr = IDL.Record({ message: IDL.Text });
70
- const GetTransactionsResult = IDL.Variant({
71
- Ok: GetTransactions,
72
- Err: GetTransactionsErr,
73
- });
74
- const SubAccount = IDL.Vec(IDL.Nat8);
75
- const ListSubaccountsArgs = IDL.Record({
76
- owner: IDL.Principal,
77
- start: IDL.Opt(SubAccount),
78
- });
79
-
80
- return IDL.Service({
81
- get_account_transactions: IDL.Func(
82
- [GetAccountTransactionsArgs],
83
- [GetTransactionsResult],
84
- [],
85
- ),
86
- ledger_id: IDL.Func([], [IDL.Principal], []),
87
- list_subaccounts: IDL.Func(
88
- [ListSubaccountsArgs],
89
- [IDL.Vec(SubAccount)],
90
- [],
91
- ),
92
- });
93
- };
94
-
95
- export const init = ({ IDL }) => {
96
- const InitArgs = IDL.Record({ ledger_id: IDL.Principal });
97
-
98
- return [InitArgs];
99
- };
@@ -1,108 +0,0 @@
1
- /* eslint-disable */
2
-
3
- // @ts-nocheck
4
-
5
- // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
- // You should NOT make any changes in this file as it will be overwritten.
7
- // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
-
9
- import type { ActorMethod } from "@icp-sdk/core/agent";
10
- import type { IDL } from "@icp-sdk/core/candid";
11
- import type { Principal } from "@icp-sdk/core/principal";
12
-
13
- export interface Account {
14
- owner: Principal;
15
- subaccount: [] | [Uint8Array];
16
- }
17
- export interface Approve {
18
- fee: [] | [bigint];
19
- from: Account;
20
- memo: [] | [Uint8Array];
21
- created_at_time: [] | [bigint];
22
- amount: bigint;
23
- expected_allowance: [] | [bigint];
24
- expires_at: [] | [bigint];
25
- spender: Account;
26
- }
27
- export interface Burn {
28
- from: Account;
29
- memo: [] | [Uint8Array];
30
- created_at_time: [] | [bigint];
31
- amount: bigint;
32
- spender: [] | [Account];
33
- }
34
- export interface GetAccountTransactionsArgs {
35
- /**
36
- * Maximum number of transactions to fetch.
37
- */
38
- max_results: bigint;
39
- /**
40
- * The txid of the last transaction seen by the client.
41
- * If None then the results will start from the most recent
42
- * txid.
43
- */
44
- start: [] | [TxId];
45
- account: Account;
46
- }
47
- export interface GetTransactions {
48
- transactions: Array<TransactionWithId>;
49
- /**
50
- * The txid of the oldest transaction the account has
51
- */
52
- oldest_tx_id: [] | [TxId];
53
- }
54
- export interface GetTransactionsErr {
55
- message: string;
56
- }
57
- export type GetTransactionsResult =
58
- | { Ok: GetTransactions }
59
- | { Err: GetTransactionsErr };
60
- /**
61
- * The initialization parameters of the Index canister.
62
- */
63
- export interface InitArgs {
64
- ledger_id: Principal;
65
- }
66
- export interface ListSubaccountsArgs {
67
- owner: Principal;
68
- start: [] | [SubAccount];
69
- }
70
- export interface Mint {
71
- to: Account;
72
- memo: [] | [Uint8Array];
73
- created_at_time: [] | [bigint];
74
- amount: bigint;
75
- }
76
- export type SubAccount = Uint8Array;
77
- export interface Transaction {
78
- burn: [] | [Burn];
79
- kind: string;
80
- mint: [] | [Mint];
81
- approve: [] | [Approve];
82
- timestamp: bigint;
83
- transfer: [] | [Transfer];
84
- }
85
- export interface TransactionWithId {
86
- id: TxId;
87
- transaction: Transaction;
88
- }
89
- export interface Transfer {
90
- to: Account;
91
- fee: [] | [bigint];
92
- from: Account;
93
- memo: [] | [Uint8Array];
94
- created_at_time: [] | [bigint];
95
- amount: bigint;
96
- spender: [] | [Account];
97
- }
98
- export type TxId = bigint;
99
- export interface _SERVICE {
100
- get_account_transactions: ActorMethod<
101
- [GetAccountTransactionsArgs],
102
- GetTransactionsResult
103
- >;
104
- ledger_id: ActorMethod<[], Principal>;
105
- list_subaccounts: ActorMethod<[ListSubaccountsArgs], Array<SubAccount>>;
106
- }
107
- export declare const idlFactory: IDL.InterfaceFactory;
108
- export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];