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