@dfinity/ledger-icrc 4.1.2 → 5.0.0-next-2025-10-20.1
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.
- package/README.md +1 -1
- package/dist/candid/icrc_index-ng.certified.idl.d.ts +1 -1
- package/dist/candid/icrc_index-ng.certified.idl.js +96 -86
- package/dist/candid/icrc_index-ng.d.ts +11 -3
- package/dist/candid/icrc_index-ng.idl.d.ts +1 -1
- package/dist/candid/icrc_index-ng.idl.js +96 -86
- package/dist/candid/icrc_index.certified.idl.d.ts +1 -1
- package/dist/candid/icrc_index.certified.idl.js +68 -58
- package/dist/candid/icrc_index.d.ts +11 -3
- package/dist/candid/icrc_index.idl.d.ts +1 -1
- package/dist/candid/icrc_index.idl.js +68 -58
- package/dist/candid/icrc_ledger.certified.idl.d.ts +1 -1
- package/dist/candid/icrc_ledger.certified.idl.js +369 -367
- package/dist/candid/icrc_ledger.d.ts +11 -3
- package/dist/candid/icrc_ledger.idl.d.ts +1 -1
- package/dist/candid/icrc_ledger.idl.js +389 -383
- package/dist/{types/canister.d.ts → canister.d.ts} +2 -2
- package/dist/{types/converters → converters}/converters.d.ts +1 -1
- package/dist/{types/converters → converters}/index.converters.d.ts +2 -2
- package/dist/{types/converters → converters}/ledger.converters.d.ts +1 -1
- package/dist/{types/errors → errors}/ledger.errors.d.ts +1 -1
- package/dist/{types/index-ng.canister.d.ts → index-ng.canister.d.ts} +3 -3
- package/dist/{types/index.canister.d.ts → index.canister.d.ts} +2 -2
- package/dist/{types/index.d.ts → index.d.ts} +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +7 -0
- package/dist/{types/ledger.canister.d.ts → ledger.canister.d.ts} +2 -2
- package/dist/types/{types/canister.options.d.ts → canister.options.d.ts} +1 -1
- package/dist/types/{types/index-ng.params.d.ts → index-ng.params.d.ts} +1 -1
- package/dist/types/{types/index-ng.types.d.ts → index-ng.types.d.ts} +1 -1
- package/dist/types/{types/index.params.d.ts → index.params.d.ts} +1 -1
- package/dist/types/{types/index.types.d.ts → index.types.d.ts} +1 -1
- package/dist/types/{types/ledger.params.d.ts → ledger.params.d.ts} +1 -1
- package/dist/types/{types/ledger.responses.d.ts → ledger.responses.d.ts} +2 -2
- package/package.json +22 -11
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/index.cjs.js.map +0 -7
- package/dist/esm/canister.js +0 -2
- package/dist/esm/canister.js.map +0 -7
- package/dist/esm/chunk-BYKVMTGO.js +0 -2
- package/dist/esm/chunk-BYKVMTGO.js.map +0 -7
- package/dist/esm/chunk-F74MWPN7.js +0 -2
- package/dist/esm/chunk-F74MWPN7.js.map +0 -7
- package/dist/esm/chunk-WTMDWX2C.js +0 -2
- package/dist/esm/chunk-WTMDWX2C.js.map +0 -7
- package/dist/esm/chunk-YO5OUZGG.js +0 -2
- package/dist/esm/chunk-YO5OUZGG.js.map +0 -7
- package/dist/esm/chunk-ZMWODXAU.js +0 -2
- package/dist/esm/chunk-ZMWODXAU.js.map +0 -7
- package/dist/esm/index-ng.canister.js +0 -2
- package/dist/esm/index-ng.canister.js.map +0 -7
- package/dist/esm/index.canister.js +0 -2
- package/dist/esm/index.canister.js.map +0 -7
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/ledger.canister.js +0 -2
- package/dist/esm/ledger.canister.js.map +0 -7
- package/dist/index.cjs.js +0 -1
- /package/dist/{types/errors → errors}/index.errors.d.ts +0 -0
- /package/dist/{types/utils → utils}/ledger.utils.d.ts +0 -0
- /package/dist/{types/utils → utils}/payment.utils.d.ts +0 -0
|
@@ -1,521 +1,523 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
|
|
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
|
+
|
|
2
9
|
export const idlFactory = ({ IDL }) => {
|
|
3
10
|
const GetBlocksResult = IDL.Rec();
|
|
4
11
|
const ICRC3Value = IDL.Rec();
|
|
5
12
|
const Value = IDL.Rec();
|
|
6
13
|
const ChangeArchiveOptions = IDL.Record({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
num_blocks_to_archive: IDL.Opt(IDL.Nat64),
|
|
15
|
+
max_transactions_per_response: IDL.Opt(IDL.Nat64),
|
|
16
|
+
trigger_threshold: IDL.Opt(IDL.Nat64),
|
|
17
|
+
more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
|
|
18
|
+
max_message_size_bytes: IDL.Opt(IDL.Nat64),
|
|
19
|
+
cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
|
|
20
|
+
node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
|
|
21
|
+
controller_id: IDL.Opt(IDL.Principal),
|
|
15
22
|
});
|
|
16
23
|
const MetadataValue = IDL.Variant({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
Int: IDL.Int,
|
|
25
|
+
Nat: IDL.Nat,
|
|
26
|
+
Blob: IDL.Vec(IDL.Nat8),
|
|
27
|
+
Text: IDL.Text,
|
|
21
28
|
});
|
|
22
29
|
const Subaccount = IDL.Vec(IDL.Nat8);
|
|
23
30
|
const Account = IDL.Record({
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
owner: IDL.Principal,
|
|
32
|
+
subaccount: IDL.Opt(Subaccount),
|
|
26
33
|
});
|
|
27
34
|
const ChangeFeeCollector = IDL.Variant({
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
SetTo: Account,
|
|
36
|
+
Unset: IDL.Null,
|
|
30
37
|
});
|
|
31
|
-
const FeatureFlags = IDL.Record({
|
|
38
|
+
const FeatureFlags = IDL.Record({ icrc2: IDL.Bool });
|
|
32
39
|
const UpgradeArgs = IDL.Record({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
change_archive_options: IDL.Opt(ChangeArchiveOptions),
|
|
41
|
+
token_symbol: IDL.Opt(IDL.Text),
|
|
42
|
+
transfer_fee: IDL.Opt(IDL.Nat),
|
|
43
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
|
|
44
|
+
change_fee_collector: IDL.Opt(ChangeFeeCollector),
|
|
45
|
+
max_memo_length: IDL.Opt(IDL.Nat16),
|
|
46
|
+
index_principal: IDL.Opt(IDL.Principal),
|
|
47
|
+
token_name: IDL.Opt(IDL.Text),
|
|
48
|
+
feature_flags: IDL.Opt(FeatureFlags),
|
|
42
49
|
});
|
|
43
50
|
const InitArgs = IDL.Record({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
decimals: IDL.Opt(IDL.Nat8),
|
|
52
|
+
token_symbol: IDL.Text,
|
|
53
|
+
transfer_fee: IDL.Nat,
|
|
54
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),
|
|
55
|
+
minting_account: Account,
|
|
56
|
+
initial_balances: IDL.Vec(IDL.Tuple(Account, IDL.Nat)),
|
|
57
|
+
fee_collector_account: IDL.Opt(Account),
|
|
58
|
+
archive_options: IDL.Record({
|
|
59
|
+
num_blocks_to_archive: IDL.Nat64,
|
|
60
|
+
max_transactions_per_response: IDL.Opt(IDL.Nat64),
|
|
61
|
+
trigger_threshold: IDL.Nat64,
|
|
62
|
+
more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
|
|
63
|
+
max_message_size_bytes: IDL.Opt(IDL.Nat64),
|
|
64
|
+
cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
|
|
65
|
+
node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
|
|
66
|
+
controller_id: IDL.Principal,
|
|
60
67
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
max_memo_length: IDL.Opt(IDL.Nat16),
|
|
69
|
+
index_principal: IDL.Opt(IDL.Principal),
|
|
70
|
+
token_name: IDL.Text,
|
|
71
|
+
feature_flags: IDL.Opt(FeatureFlags),
|
|
65
72
|
});
|
|
66
73
|
const LedgerArg = IDL.Variant({
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
Upgrade: IDL.Opt(UpgradeArgs),
|
|
75
|
+
Init: InitArgs,
|
|
69
76
|
});
|
|
70
77
|
const BlockIndex = IDL.Nat;
|
|
71
78
|
const ArchiveInfo = IDL.Record({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
block_range_end: BlockIndex,
|
|
80
|
+
canister_id: IDL.Principal,
|
|
81
|
+
block_range_start: BlockIndex,
|
|
75
82
|
});
|
|
76
83
|
const GetBlocksArgs = IDL.Record({
|
|
77
|
-
|
|
78
|
-
|
|
84
|
+
start: BlockIndex,
|
|
85
|
+
length: IDL.Nat,
|
|
79
86
|
});
|
|
80
87
|
const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
|
|
81
88
|
Value.fill(
|
|
82
89
|
IDL.Variant({
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})
|
|
90
|
+
Int: IDL.Int,
|
|
91
|
+
Map: Map,
|
|
92
|
+
Nat: IDL.Nat,
|
|
93
|
+
Nat64: IDL.Nat64,
|
|
94
|
+
Blob: IDL.Vec(IDL.Nat8),
|
|
95
|
+
Text: IDL.Text,
|
|
96
|
+
Array: IDL.Vec(Value),
|
|
97
|
+
}),
|
|
91
98
|
);
|
|
92
99
|
const Block = Value;
|
|
93
|
-
const BlockRange = IDL.Record({
|
|
100
|
+
const BlockRange = IDL.Record({ blocks: IDL.Vec(Block) });
|
|
94
101
|
const QueryBlockArchiveFn = IDL.Func([GetBlocksArgs], [BlockRange], []);
|
|
95
102
|
const GetBlocksResponse = IDL.Record({
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
104
|
+
first_index: BlockIndex,
|
|
105
|
+
blocks: IDL.Vec(Block),
|
|
106
|
+
chain_length: IDL.Nat64,
|
|
107
|
+
archived_blocks: IDL.Vec(
|
|
101
108
|
IDL.Record({
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
})
|
|
109
|
+
callback: QueryBlockArchiveFn,
|
|
110
|
+
start: BlockIndex,
|
|
111
|
+
length: IDL.Nat,
|
|
112
|
+
}),
|
|
106
113
|
),
|
|
107
114
|
});
|
|
108
115
|
const DataCertificate = IDL.Record({
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
117
|
+
hash_tree: IDL.Vec(IDL.Nat8),
|
|
111
118
|
});
|
|
112
119
|
const TxIndex = IDL.Nat;
|
|
113
120
|
const GetTransactionsRequest = IDL.Record({
|
|
114
|
-
|
|
115
|
-
|
|
121
|
+
start: TxIndex,
|
|
122
|
+
length: IDL.Nat,
|
|
116
123
|
});
|
|
117
124
|
const Timestamp = IDL.Nat64;
|
|
118
125
|
const Burn = IDL.Record({
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
126
|
+
from: Account,
|
|
127
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
128
|
+
created_at_time: IDL.Opt(Timestamp),
|
|
129
|
+
amount: IDL.Nat,
|
|
130
|
+
spender: IDL.Opt(Account),
|
|
124
131
|
});
|
|
125
132
|
const Mint = IDL.Record({
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
to: Account,
|
|
134
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
135
|
+
created_at_time: IDL.Opt(Timestamp),
|
|
136
|
+
amount: IDL.Nat,
|
|
130
137
|
});
|
|
131
138
|
const Approve = IDL.Record({
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
fee: IDL.Opt(IDL.Nat),
|
|
140
|
+
from: Account,
|
|
141
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
142
|
+
created_at_time: IDL.Opt(Timestamp),
|
|
143
|
+
amount: IDL.Nat,
|
|
144
|
+
expected_allowance: IDL.Opt(IDL.Nat),
|
|
145
|
+
expires_at: IDL.Opt(Timestamp),
|
|
146
|
+
spender: Account,
|
|
140
147
|
});
|
|
141
148
|
const Transfer = IDL.Record({
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
to: Account,
|
|
150
|
+
fee: IDL.Opt(IDL.Nat),
|
|
151
|
+
from: Account,
|
|
152
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
153
|
+
created_at_time: IDL.Opt(Timestamp),
|
|
154
|
+
amount: IDL.Nat,
|
|
155
|
+
spender: IDL.Opt(Account),
|
|
149
156
|
});
|
|
150
157
|
const Transaction = IDL.Record({
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
burn: IDL.Opt(Burn),
|
|
159
|
+
kind: IDL.Text,
|
|
160
|
+
mint: IDL.Opt(Mint),
|
|
161
|
+
approve: IDL.Opt(Approve),
|
|
162
|
+
timestamp: Timestamp,
|
|
163
|
+
transfer: IDL.Opt(Transfer),
|
|
157
164
|
});
|
|
158
165
|
const TransactionRange = IDL.Record({
|
|
159
|
-
|
|
166
|
+
transactions: IDL.Vec(Transaction),
|
|
160
167
|
});
|
|
161
168
|
const QueryArchiveFn = IDL.Func(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
169
|
+
[GetTransactionsRequest],
|
|
170
|
+
[TransactionRange],
|
|
171
|
+
[],
|
|
172
|
+
);
|
|
166
173
|
const GetTransactionsResponse = IDL.Record({
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
first_index: TxIndex,
|
|
175
|
+
log_length: IDL.Nat,
|
|
176
|
+
transactions: IDL.Vec(Transaction),
|
|
177
|
+
archived_transactions: IDL.Vec(
|
|
171
178
|
IDL.Record({
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
})
|
|
179
|
+
callback: QueryArchiveFn,
|
|
180
|
+
start: TxIndex,
|
|
181
|
+
length: IDL.Nat,
|
|
182
|
+
}),
|
|
176
183
|
),
|
|
177
184
|
});
|
|
178
185
|
const GetAllowancesArgs = IDL.Record({
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
186
|
+
take: IDL.Opt(IDL.Nat),
|
|
187
|
+
prev_spender: IDL.Opt(Account),
|
|
188
|
+
from_account: IDL.Opt(Account),
|
|
182
189
|
});
|
|
183
190
|
const Allowance103 = IDL.Record({
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
191
|
+
from_account: Account,
|
|
192
|
+
to_spender: Account,
|
|
193
|
+
allowance: IDL.Nat,
|
|
194
|
+
expires_at: IDL.Opt(IDL.Nat64),
|
|
188
195
|
});
|
|
189
196
|
const GetAllowancesError = IDL.Variant({
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
197
|
+
GenericError: IDL.Record({
|
|
198
|
+
message: IDL.Text,
|
|
199
|
+
error_code: IDL.Nat,
|
|
193
200
|
}),
|
|
194
|
-
|
|
201
|
+
AccessDenied: IDL.Record({ reason: IDL.Text }),
|
|
195
202
|
});
|
|
196
203
|
const icrc103_get_allowances_response = IDL.Variant({
|
|
197
|
-
|
|
198
|
-
|
|
204
|
+
Ok: IDL.Vec(Allowance103),
|
|
205
|
+
Err: GetAllowancesError,
|
|
199
206
|
});
|
|
200
207
|
const GetIndexPrincipalError = IDL.Variant({
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
208
|
+
GenericError: IDL.Record({
|
|
209
|
+
description: IDL.Text,
|
|
210
|
+
error_code: IDL.Nat,
|
|
204
211
|
}),
|
|
205
|
-
|
|
212
|
+
IndexPrincipalNotSet: IDL.Null,
|
|
206
213
|
});
|
|
207
214
|
const GetIndexPrincipalResult = IDL.Variant({
|
|
208
|
-
|
|
209
|
-
|
|
215
|
+
Ok: IDL.Principal,
|
|
216
|
+
Err: GetIndexPrincipalError,
|
|
210
217
|
});
|
|
211
218
|
const Tokens = IDL.Nat;
|
|
212
|
-
const StandardRecord = IDL.Record({
|
|
219
|
+
const StandardRecord = IDL.Record({ url: IDL.Text, name: IDL.Text });
|
|
213
220
|
const TransferArg = IDL.Record({
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
to: Account,
|
|
222
|
+
fee: IDL.Opt(Tokens),
|
|
223
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
224
|
+
from_subaccount: IDL.Opt(Subaccount),
|
|
225
|
+
created_at_time: IDL.Opt(Timestamp),
|
|
226
|
+
amount: Tokens,
|
|
220
227
|
});
|
|
221
228
|
const TransferError = IDL.Variant({
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
GenericError: IDL.Record({
|
|
230
|
+
message: IDL.Text,
|
|
231
|
+
error_code: IDL.Nat,
|
|
225
232
|
}),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
+
TemporarilyUnavailable: IDL.Null,
|
|
234
|
+
BadBurn: IDL.Record({ min_burn_amount: Tokens }),
|
|
235
|
+
Duplicate: IDL.Record({ duplicate_of: BlockIndex }),
|
|
236
|
+
BadFee: IDL.Record({ expected_fee: Tokens }),
|
|
237
|
+
CreatedInFuture: IDL.Record({ ledger_time: Timestamp }),
|
|
238
|
+
TooOld: IDL.Null,
|
|
239
|
+
InsufficientFunds: IDL.Record({ balance: Tokens }),
|
|
233
240
|
});
|
|
234
241
|
const TransferResult = IDL.Variant({
|
|
235
|
-
|
|
236
|
-
|
|
242
|
+
Ok: BlockIndex,
|
|
243
|
+
Err: TransferError,
|
|
237
244
|
});
|
|
238
245
|
const icrc21_consent_message_metadata = IDL.Record({
|
|
239
|
-
|
|
240
|
-
|
|
246
|
+
utc_offset_minutes: IDL.Opt(IDL.Int16),
|
|
247
|
+
language: IDL.Text,
|
|
241
248
|
});
|
|
242
249
|
const icrc21_consent_message_spec = IDL.Record({
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
IDL.Variant({
|
|
250
|
+
metadata: icrc21_consent_message_metadata,
|
|
251
|
+
device_spec: IDL.Opt(
|
|
252
|
+
IDL.Variant({ GenericDisplay: IDL.Null, FieldsDisplay: IDL.Null }),
|
|
246
253
|
),
|
|
247
254
|
});
|
|
248
255
|
const icrc21_consent_message_request = IDL.Record({
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
256
|
+
arg: IDL.Vec(IDL.Nat8),
|
|
257
|
+
method: IDL.Text,
|
|
258
|
+
user_preferences: icrc21_consent_message_spec,
|
|
252
259
|
});
|
|
253
260
|
const Icrc21Value = IDL.Variant({
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
261
|
+
Text: IDL.Record({ content: IDL.Text }),
|
|
262
|
+
TokenAmount: IDL.Record({
|
|
263
|
+
decimals: IDL.Nat8,
|
|
264
|
+
amount: IDL.Nat64,
|
|
265
|
+
symbol: IDL.Text,
|
|
259
266
|
}),
|
|
260
|
-
|
|
261
|
-
|
|
267
|
+
TimestampSeconds: IDL.Record({ amount: IDL.Nat64 }),
|
|
268
|
+
DurationSeconds: IDL.Record({ amount: IDL.Nat64 }),
|
|
262
269
|
});
|
|
263
270
|
const FieldsDisplay = IDL.Record({
|
|
264
|
-
|
|
265
|
-
|
|
271
|
+
fields: IDL.Vec(IDL.Tuple(IDL.Text, Icrc21Value)),
|
|
272
|
+
intent: IDL.Text,
|
|
266
273
|
});
|
|
267
274
|
const icrc21_consent_message = IDL.Variant({
|
|
268
|
-
|
|
269
|
-
|
|
275
|
+
FieldsDisplayMessage: FieldsDisplay,
|
|
276
|
+
GenericDisplayMessage: IDL.Text,
|
|
270
277
|
});
|
|
271
278
|
const icrc21_consent_info = IDL.Record({
|
|
272
|
-
|
|
273
|
-
|
|
279
|
+
metadata: icrc21_consent_message_metadata,
|
|
280
|
+
consent_message: icrc21_consent_message,
|
|
274
281
|
});
|
|
275
|
-
const icrc21_error_info = IDL.Record({
|
|
282
|
+
const icrc21_error_info = IDL.Record({ description: IDL.Text });
|
|
276
283
|
const icrc21_error = IDL.Variant({
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
284
|
+
GenericError: IDL.Record({
|
|
285
|
+
description: IDL.Text,
|
|
286
|
+
error_code: IDL.Nat,
|
|
280
287
|
}),
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
288
|
+
InsufficientPayment: icrc21_error_info,
|
|
289
|
+
UnsupportedCanisterCall: icrc21_error_info,
|
|
290
|
+
ConsentMessageUnavailable: icrc21_error_info,
|
|
284
291
|
});
|
|
285
292
|
const icrc21_consent_message_response = IDL.Variant({
|
|
286
|
-
|
|
287
|
-
|
|
293
|
+
Ok: icrc21_consent_info,
|
|
294
|
+
Err: icrc21_error,
|
|
288
295
|
});
|
|
289
296
|
const AllowanceArgs = IDL.Record({
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
account: Account,
|
|
298
|
+
spender: Account,
|
|
292
299
|
});
|
|
293
300
|
const Allowance = IDL.Record({
|
|
294
|
-
|
|
295
|
-
|
|
301
|
+
allowance: IDL.Nat,
|
|
302
|
+
expires_at: IDL.Opt(Timestamp),
|
|
296
303
|
});
|
|
297
304
|
const ApproveArgs = IDL.Record({
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
305
|
+
fee: IDL.Opt(IDL.Nat),
|
|
306
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
307
|
+
from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
308
|
+
created_at_time: IDL.Opt(Timestamp),
|
|
309
|
+
amount: IDL.Nat,
|
|
310
|
+
expected_allowance: IDL.Opt(IDL.Nat),
|
|
311
|
+
expires_at: IDL.Opt(Timestamp),
|
|
312
|
+
spender: Account,
|
|
306
313
|
});
|
|
307
314
|
const ApproveError = IDL.Variant({
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
315
|
+
GenericError: IDL.Record({
|
|
316
|
+
message: IDL.Text,
|
|
317
|
+
error_code: IDL.Nat,
|
|
311
318
|
}),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
319
|
+
TemporarilyUnavailable: IDL.Null,
|
|
320
|
+
Duplicate: IDL.Record({ duplicate_of: BlockIndex }),
|
|
321
|
+
BadFee: IDL.Record({ expected_fee: IDL.Nat }),
|
|
322
|
+
AllowanceChanged: IDL.Record({ current_allowance: IDL.Nat }),
|
|
323
|
+
CreatedInFuture: IDL.Record({ ledger_time: Timestamp }),
|
|
324
|
+
TooOld: IDL.Null,
|
|
325
|
+
Expired: IDL.Record({ ledger_time: Timestamp }),
|
|
326
|
+
InsufficientFunds: IDL.Record({ balance: IDL.Nat }),
|
|
320
327
|
});
|
|
321
328
|
const ApproveResult = IDL.Variant({
|
|
322
|
-
|
|
323
|
-
|
|
329
|
+
Ok: BlockIndex,
|
|
330
|
+
Err: ApproveError,
|
|
324
331
|
});
|
|
325
332
|
const TransferFromArgs = IDL.Record({
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
+
to: Account,
|
|
334
|
+
fee: IDL.Opt(Tokens),
|
|
335
|
+
spender_subaccount: IDL.Opt(Subaccount),
|
|
336
|
+
from: Account,
|
|
337
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
338
|
+
created_at_time: IDL.Opt(Timestamp),
|
|
339
|
+
amount: Tokens,
|
|
333
340
|
});
|
|
334
341
|
const TransferFromError = IDL.Variant({
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
342
|
+
GenericError: IDL.Record({
|
|
343
|
+
message: IDL.Text,
|
|
344
|
+
error_code: IDL.Nat,
|
|
338
345
|
}),
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
346
|
+
TemporarilyUnavailable: IDL.Null,
|
|
347
|
+
InsufficientAllowance: IDL.Record({ allowance: Tokens }),
|
|
348
|
+
BadBurn: IDL.Record({ min_burn_amount: Tokens }),
|
|
349
|
+
Duplicate: IDL.Record({ duplicate_of: BlockIndex }),
|
|
350
|
+
BadFee: IDL.Record({ expected_fee: Tokens }),
|
|
351
|
+
CreatedInFuture: IDL.Record({ ledger_time: Timestamp }),
|
|
352
|
+
TooOld: IDL.Null,
|
|
353
|
+
InsufficientFunds: IDL.Record({ balance: Tokens }),
|
|
347
354
|
});
|
|
348
355
|
const TransferFromResult = IDL.Variant({
|
|
349
|
-
|
|
350
|
-
|
|
356
|
+
Ok: BlockIndex,
|
|
357
|
+
Err: TransferFromError,
|
|
351
358
|
});
|
|
352
|
-
const GetArchivesArgs = IDL.Record({
|
|
359
|
+
const GetArchivesArgs = IDL.Record({ from: IDL.Opt(IDL.Principal) });
|
|
353
360
|
const GetArchivesResult = IDL.Vec(
|
|
354
361
|
IDL.Record({
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
})
|
|
362
|
+
end: IDL.Nat,
|
|
363
|
+
canister_id: IDL.Principal,
|
|
364
|
+
start: IDL.Nat,
|
|
365
|
+
}),
|
|
359
366
|
);
|
|
360
367
|
ICRC3Value.fill(
|
|
361
368
|
IDL.Variant({
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
})
|
|
369
|
+
Int: IDL.Int,
|
|
370
|
+
Map: IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),
|
|
371
|
+
Nat: IDL.Nat,
|
|
372
|
+
Blob: IDL.Vec(IDL.Nat8),
|
|
373
|
+
Text: IDL.Text,
|
|
374
|
+
Array: IDL.Vec(ICRC3Value),
|
|
375
|
+
}),
|
|
369
376
|
);
|
|
370
377
|
GetBlocksResult.fill(
|
|
371
378
|
IDL.Record({
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
379
|
+
log_length: IDL.Nat,
|
|
380
|
+
blocks: IDL.Vec(IDL.Record({ id: IDL.Nat, block: ICRC3Value })),
|
|
381
|
+
archived_blocks: IDL.Vec(
|
|
375
382
|
IDL.Record({
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
})
|
|
383
|
+
args: IDL.Vec(GetBlocksArgs),
|
|
384
|
+
callback: IDL.Func(
|
|
385
|
+
[IDL.Vec(GetBlocksArgs)],
|
|
386
|
+
[GetBlocksResult],
|
|
387
|
+
["query"],
|
|
388
|
+
),
|
|
389
|
+
}),
|
|
383
390
|
),
|
|
384
|
-
})
|
|
391
|
+
}),
|
|
385
392
|
);
|
|
386
393
|
const ICRC3DataCertificate = IDL.Record({
|
|
387
|
-
|
|
388
|
-
|
|
394
|
+
certificate: IDL.Vec(IDL.Nat8),
|
|
395
|
+
hash_tree: IDL.Vec(IDL.Nat8),
|
|
389
396
|
});
|
|
397
|
+
|
|
390
398
|
return IDL.Service({
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
),
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
[],
|
|
446
|
-
),
|
|
447
|
-
'icrc3_supported_block_types' : IDL.Func(
|
|
448
|
-
[],
|
|
449
|
-
[IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'block_type' : IDL.Text }))],
|
|
450
|
-
[],
|
|
451
|
-
),
|
|
452
|
-
'is_ledger_ready' : IDL.Func([], [IDL.Bool], ['query']),
|
|
399
|
+
archives: IDL.Func([], [IDL.Vec(ArchiveInfo)], []),
|
|
400
|
+
get_blocks: IDL.Func([GetBlocksArgs], [GetBlocksResponse], []),
|
|
401
|
+
get_data_certificate: IDL.Func([], [DataCertificate], []),
|
|
402
|
+
get_transactions: IDL.Func(
|
|
403
|
+
[GetTransactionsRequest],
|
|
404
|
+
[GetTransactionsResponse],
|
|
405
|
+
[],
|
|
406
|
+
),
|
|
407
|
+
icrc103_get_allowances: IDL.Func(
|
|
408
|
+
[GetAllowancesArgs],
|
|
409
|
+
[icrc103_get_allowances_response],
|
|
410
|
+
[],
|
|
411
|
+
),
|
|
412
|
+
icrc106_get_index_principal: IDL.Func([], [GetIndexPrincipalResult], []),
|
|
413
|
+
icrc10_supported_standards: IDL.Func(
|
|
414
|
+
[],
|
|
415
|
+
[IDL.Vec(IDL.Record({ url: IDL.Text, name: IDL.Text }))],
|
|
416
|
+
[],
|
|
417
|
+
),
|
|
418
|
+
icrc1_balance_of: IDL.Func([Account], [Tokens], []),
|
|
419
|
+
icrc1_decimals: IDL.Func([], [IDL.Nat8], []),
|
|
420
|
+
icrc1_fee: IDL.Func([], [Tokens], []),
|
|
421
|
+
icrc1_metadata: IDL.Func(
|
|
422
|
+
[],
|
|
423
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))],
|
|
424
|
+
[],
|
|
425
|
+
),
|
|
426
|
+
icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], []),
|
|
427
|
+
icrc1_name: IDL.Func([], [IDL.Text], []),
|
|
428
|
+
icrc1_supported_standards: IDL.Func([], [IDL.Vec(StandardRecord)], []),
|
|
429
|
+
icrc1_symbol: IDL.Func([], [IDL.Text], []),
|
|
430
|
+
icrc1_total_supply: IDL.Func([], [Tokens], []),
|
|
431
|
+
icrc1_transfer: IDL.Func([TransferArg], [TransferResult], []),
|
|
432
|
+
icrc21_canister_call_consent_message: IDL.Func(
|
|
433
|
+
[icrc21_consent_message_request],
|
|
434
|
+
[icrc21_consent_message_response],
|
|
435
|
+
[],
|
|
436
|
+
),
|
|
437
|
+
icrc2_allowance: IDL.Func([AllowanceArgs], [Allowance], []),
|
|
438
|
+
icrc2_approve: IDL.Func([ApproveArgs], [ApproveResult], []),
|
|
439
|
+
icrc2_transfer_from: IDL.Func([TransferFromArgs], [TransferFromResult], []),
|
|
440
|
+
icrc3_get_archives: IDL.Func([GetArchivesArgs], [GetArchivesResult], []),
|
|
441
|
+
icrc3_get_blocks: IDL.Func([IDL.Vec(GetBlocksArgs)], [GetBlocksResult], []),
|
|
442
|
+
icrc3_get_tip_certificate: IDL.Func(
|
|
443
|
+
[],
|
|
444
|
+
[IDL.Opt(ICRC3DataCertificate)],
|
|
445
|
+
[],
|
|
446
|
+
),
|
|
447
|
+
icrc3_supported_block_types: IDL.Func(
|
|
448
|
+
[],
|
|
449
|
+
[IDL.Vec(IDL.Record({ url: IDL.Text, block_type: IDL.Text }))],
|
|
450
|
+
[],
|
|
451
|
+
),
|
|
452
|
+
is_ledger_ready: IDL.Func([], [IDL.Bool], ["query"]),
|
|
453
453
|
});
|
|
454
454
|
};
|
|
455
|
+
|
|
455
456
|
export const init = ({ IDL }) => {
|
|
456
457
|
const ChangeArchiveOptions = IDL.Record({
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
458
|
+
num_blocks_to_archive: IDL.Opt(IDL.Nat64),
|
|
459
|
+
max_transactions_per_response: IDL.Opt(IDL.Nat64),
|
|
460
|
+
trigger_threshold: IDL.Opt(IDL.Nat64),
|
|
461
|
+
more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
|
|
462
|
+
max_message_size_bytes: IDL.Opt(IDL.Nat64),
|
|
463
|
+
cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
|
|
464
|
+
node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
|
|
465
|
+
controller_id: IDL.Opt(IDL.Principal),
|
|
465
466
|
});
|
|
466
467
|
const MetadataValue = IDL.Variant({
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
468
|
+
Int: IDL.Int,
|
|
469
|
+
Nat: IDL.Nat,
|
|
470
|
+
Blob: IDL.Vec(IDL.Nat8),
|
|
471
|
+
Text: IDL.Text,
|
|
471
472
|
});
|
|
472
473
|
const Subaccount = IDL.Vec(IDL.Nat8);
|
|
473
474
|
const Account = IDL.Record({
|
|
474
|
-
|
|
475
|
-
|
|
475
|
+
owner: IDL.Principal,
|
|
476
|
+
subaccount: IDL.Opt(Subaccount),
|
|
476
477
|
});
|
|
477
478
|
const ChangeFeeCollector = IDL.Variant({
|
|
478
|
-
|
|
479
|
-
|
|
479
|
+
SetTo: Account,
|
|
480
|
+
Unset: IDL.Null,
|
|
480
481
|
});
|
|
481
|
-
const FeatureFlags = IDL.Record({
|
|
482
|
+
const FeatureFlags = IDL.Record({ icrc2: IDL.Bool });
|
|
482
483
|
const UpgradeArgs = IDL.Record({
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
484
|
+
change_archive_options: IDL.Opt(ChangeArchiveOptions),
|
|
485
|
+
token_symbol: IDL.Opt(IDL.Text),
|
|
486
|
+
transfer_fee: IDL.Opt(IDL.Nat),
|
|
487
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
|
|
488
|
+
change_fee_collector: IDL.Opt(ChangeFeeCollector),
|
|
489
|
+
max_memo_length: IDL.Opt(IDL.Nat16),
|
|
490
|
+
index_principal: IDL.Opt(IDL.Principal),
|
|
491
|
+
token_name: IDL.Opt(IDL.Text),
|
|
492
|
+
feature_flags: IDL.Opt(FeatureFlags),
|
|
492
493
|
});
|
|
493
494
|
const InitArgs = IDL.Record({
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
495
|
+
decimals: IDL.Opt(IDL.Nat8),
|
|
496
|
+
token_symbol: IDL.Text,
|
|
497
|
+
transfer_fee: IDL.Nat,
|
|
498
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),
|
|
499
|
+
minting_account: Account,
|
|
500
|
+
initial_balances: IDL.Vec(IDL.Tuple(Account, IDL.Nat)),
|
|
501
|
+
fee_collector_account: IDL.Opt(Account),
|
|
502
|
+
archive_options: IDL.Record({
|
|
503
|
+
num_blocks_to_archive: IDL.Nat64,
|
|
504
|
+
max_transactions_per_response: IDL.Opt(IDL.Nat64),
|
|
505
|
+
trigger_threshold: IDL.Nat64,
|
|
506
|
+
more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
|
|
507
|
+
max_message_size_bytes: IDL.Opt(IDL.Nat64),
|
|
508
|
+
cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
|
|
509
|
+
node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
|
|
510
|
+
controller_id: IDL.Principal,
|
|
510
511
|
}),
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
512
|
+
max_memo_length: IDL.Opt(IDL.Nat16),
|
|
513
|
+
index_principal: IDL.Opt(IDL.Principal),
|
|
514
|
+
token_name: IDL.Text,
|
|
515
|
+
feature_flags: IDL.Opt(FeatureFlags),
|
|
515
516
|
});
|
|
516
517
|
const LedgerArg = IDL.Variant({
|
|
517
|
-
|
|
518
|
-
|
|
518
|
+
Upgrade: IDL.Opt(UpgradeArgs),
|
|
519
|
+
Init: InitArgs,
|
|
519
520
|
});
|
|
521
|
+
|
|
520
522
|
return [LedgerArg];
|
|
521
523
|
};
|