@dfinity/ledger-icrc 6.0.1-next-2025-12-08.1 → 6.0.1-next-2025-12-10

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 (62) hide show
  1. package/dist/index.d.ts +18 -18
  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 +3 -4
  7. package/dist/candid/icrc_icrc-1.certified.idl.d.ts +0 -2
  8. package/dist/candid/icrc_icrc-1.certified.idl.js +0 -68
  9. package/dist/candid/icrc_icrc-1.d.ts +0 -69
  10. package/dist/candid/icrc_icrc-1.did +0 -54
  11. package/dist/candid/icrc_icrc-1.idl.d.ts +0 -2
  12. package/dist/candid/icrc_icrc-1.idl.js +0 -72
  13. package/dist/candid/icrc_icrc-10.certified.idl.d.ts +0 -2
  14. package/dist/candid/icrc_icrc-10.certified.idl.js +0 -20
  15. package/dist/candid/icrc_icrc-10.d.ts +0 -21
  16. package/dist/candid/icrc_icrc-10.did +0 -8
  17. package/dist/candid/icrc_icrc-10.idl.d.ts +0 -2
  18. package/dist/candid/icrc_icrc-10.idl.js +0 -24
  19. package/dist/candid/icrc_index-ng.certified.idl.d.ts +0 -2
  20. package/dist/candid/icrc_index-ng.certified.idl.js +0 -157
  21. package/dist/candid/icrc_index-ng.d.ts +0 -160
  22. package/dist/candid/icrc_index-ng.did +0 -163
  23. package/dist/candid/icrc_index-ng.idl.d.ts +0 -2
  24. package/dist/candid/icrc_index-ng.idl.js +0 -157
  25. package/dist/candid/icrc_index.certified.idl.d.ts +0 -2
  26. package/dist/candid/icrc_index.certified.idl.js +0 -99
  27. package/dist/candid/icrc_index.d.ts +0 -108
  28. package/dist/candid/icrc_index.did +0 -98
  29. package/dist/candid/icrc_index.idl.d.ts +0 -2
  30. package/dist/candid/icrc_index.idl.js +0 -99
  31. package/dist/candid/icrc_ledger.certified.idl.d.ts +0 -2
  32. package/dist/candid/icrc_ledger.certified.idl.js +0 -531
  33. package/dist/candid/icrc_ledger.d.ts +0 -596
  34. package/dist/candid/icrc_ledger.did +0 -586
  35. package/dist/candid/icrc_ledger.idl.d.ts +0 -2
  36. package/dist/candid/icrc_ledger.idl.js +0 -551
  37. package/dist/candid/icrc_nft-ledger.certified.idl.d.ts +0 -2
  38. package/dist/candid/icrc_nft-ledger.certified.idl.js +0 -102
  39. package/dist/candid/icrc_nft-ledger.d.ts +0 -80
  40. package/dist/candid/icrc_nft-ledger.did +0 -67
  41. package/dist/candid/icrc_nft-ledger.idl.d.ts +0 -2
  42. package/dist/candid/icrc_nft-ledger.idl.js +0 -106
  43. package/dist/canister.d.ts +0 -13
  44. package/dist/converters/converters.d.ts +0 -16
  45. package/dist/converters/index.converters.d.ts +0 -6
  46. package/dist/converters/ledger.converters.d.ts +0 -6
  47. package/dist/errors/index.errors.d.ts +0 -2
  48. package/dist/errors/ledger.errors.d.ts +0 -25
  49. package/dist/index-ng.canister.d.ts +0 -43
  50. package/dist/index.canister.d.ts +0 -21
  51. package/dist/ledger.canister.d.ts +0 -121
  52. package/dist/nft-ledger.canister.d.ts +0 -16
  53. package/dist/types/canister.options.d.ts +0 -5
  54. package/dist/types/canister.types.d.ts +0 -2
  55. package/dist/types/index-ng.params.d.ts +0 -12
  56. package/dist/types/index-ng.types.d.ts +0 -1
  57. package/dist/types/index.params.d.ts +0 -7
  58. package/dist/types/index.types.d.ts +0 -1
  59. package/dist/types/ledger.params.d.ts +0 -109
  60. package/dist/types/ledger.responses.d.ts +0 -24
  61. package/dist/utils/ledger.utils.d.ts +0 -31
  62. package/dist/utils/payment.utils.d.ts +0 -28
@@ -1,586 +0,0 @@
1
- // Generated from IC repo commit 724ae41 (2025-11-27 tags: release-2025-11-28_03-22-base) 'rs/ledger_suite/icrc1/ledger/ledger.did' by import-candid
2
-
3
- type BlockIndex = nat;
4
- type Subaccount = blob;
5
- // Number of nanoseconds since the UNIX epoch in UTC timezone.
6
- type Timestamp = nat64;
7
- // Number of nanoseconds between two [Timestamp]s.
8
- type Duration = nat64;
9
- type Tokens = nat;
10
- type TxIndex = nat;
11
- type Allowance = record { allowance : nat; expires_at : opt Timestamp };
12
- type AllowanceArgs = record { account : Account; spender : Account };
13
- type Approve = record {
14
- fee : opt nat;
15
- from : Account;
16
- memo : opt blob;
17
- created_at_time : opt Timestamp;
18
- amount : nat;
19
- expected_allowance : opt nat;
20
- expires_at : opt Timestamp;
21
- spender : Account
22
- };
23
- type ApproveArgs = record {
24
- fee : opt nat;
25
- memo : opt blob;
26
- from_subaccount : opt blob;
27
- created_at_time : opt Timestamp;
28
- amount : nat;
29
- expected_allowance : opt nat;
30
- expires_at : opt Timestamp;
31
- spender : Account
32
- };
33
- type ApproveError = variant {
34
- GenericError : record { message : text; error_code : nat };
35
- TemporarilyUnavailable;
36
- Duplicate : record { duplicate_of : BlockIndex };
37
- BadFee : record { expected_fee : nat };
38
- AllowanceChanged : record { current_allowance : nat };
39
- CreatedInFuture : record { ledger_time : Timestamp };
40
- TooOld;
41
- Expired : record { ledger_time : Timestamp };
42
- InsufficientFunds : record { balance : nat }
43
- };
44
- type ApproveResult = variant { Ok : BlockIndex; Err : ApproveError };
45
-
46
- type HttpRequest = record {
47
- url : text;
48
- method : text;
49
- body : blob;
50
- headers : vec record { text; text }
51
- };
52
- type HttpResponse = record {
53
- body : blob;
54
- headers : vec record { text; text };
55
- status_code : nat16
56
- };
57
-
58
- type Account = record {
59
- owner : principal;
60
- subaccount : opt Subaccount
61
- };
62
-
63
- type TransferArg = record {
64
- from_subaccount : opt Subaccount;
65
- to : Account;
66
- amount : Tokens;
67
- fee : opt Tokens;
68
- memo : opt blob;
69
- created_at_time : opt Timestamp
70
- };
71
-
72
- type TransferError = variant {
73
- BadFee : record { expected_fee : Tokens };
74
- BadBurn : record { min_burn_amount : Tokens };
75
- InsufficientFunds : record { balance : Tokens };
76
- TooOld;
77
- CreatedInFuture : record { ledger_time : Timestamp };
78
- TemporarilyUnavailable;
79
- Duplicate : record { duplicate_of : BlockIndex };
80
- GenericError : record { error_code : nat; message : text }
81
- };
82
-
83
- type TransferResult = variant {
84
- Ok : BlockIndex;
85
- Err : TransferError
86
- };
87
-
88
- // The value returned from the [icrc1_metadata] endpoint.
89
- type MetadataValue = variant {
90
- Nat : nat;
91
- Int : int;
92
- Text : text;
93
- Blob : blob
94
- };
95
-
96
- type FeatureFlags = record {
97
- icrc2 : bool
98
- };
99
-
100
- // The initialization parameters of the Ledger
101
- type InitArgs = record {
102
- minting_account : Account;
103
- fee_collector_account : opt Account;
104
- transfer_fee : nat;
105
- decimals : opt nat8;
106
- max_memo_length : opt nat16;
107
- token_symbol : text;
108
- token_name : text;
109
- metadata : vec record { text; MetadataValue };
110
- initial_balances : vec record { Account; nat };
111
- feature_flags : opt FeatureFlags;
112
- archive_options : record {
113
- num_blocks_to_archive : nat64;
114
- max_transactions_per_response : opt nat64;
115
- trigger_threshold : nat64;
116
- max_message_size_bytes : opt nat64;
117
- cycles_for_archive_creation : opt nat64;
118
- node_max_memory_size_bytes : opt nat64;
119
- controller_id : principal;
120
- more_controller_ids : opt vec principal
121
- };
122
- index_principal : opt principal
123
- };
124
-
125
- type ChangeFeeCollector = variant {
126
- Unset;
127
- SetTo : Account
128
- };
129
-
130
- type ChangeArchiveOptions = record {
131
- num_blocks_to_archive : opt nat64;
132
- max_transactions_per_response : opt nat64;
133
- trigger_threshold : opt nat64;
134
- max_message_size_bytes : opt nat64;
135
- cycles_for_archive_creation : opt nat64;
136
- node_max_memory_size_bytes : opt nat64;
137
- controller_id : opt principal;
138
- more_controller_ids : opt vec principal
139
- };
140
-
141
- type UpgradeArgs = record {
142
- metadata : opt vec record { text; MetadataValue };
143
- token_symbol : opt text;
144
- token_name : opt text;
145
- transfer_fee : opt nat;
146
- change_fee_collector : opt ChangeFeeCollector;
147
- max_memo_length : opt nat16;
148
- feature_flags : opt FeatureFlags;
149
- change_archive_options : opt ChangeArchiveOptions;
150
- index_principal : opt principal
151
- };
152
-
153
- type LedgerArg = variant {
154
- Init : InitArgs;
155
- Upgrade : opt UpgradeArgs
156
- };
157
-
158
- type GetTransactionsRequest = record {
159
- // The index of the first tx to fetch.
160
- start : TxIndex;
161
- // The number of transactions to fetch.
162
- length : nat
163
- };
164
-
165
- type GetTransactionsResponse = record {
166
- // The total number of transactions in the log.
167
- log_length : nat;
168
-
169
- // List of transaction that were available in the ledger when it processed the call.
170
- //
171
- // The transactions form a contiguous range, with the first transaction having index
172
- // [first_index] (see below), and the last transaction having index
173
- // [first_index] + len(transactions) - 1.
174
- //
175
- // The transaction range can be an arbitrary sub-range of the originally requested range.
176
- transactions : vec Transaction;
177
-
178
- // The index of the first transaction in [transactions].
179
- // If the transaction vector is empty, the exact value of this field is not specified.
180
- first_index : TxIndex;
181
-
182
- // Encoding of instructions for fetching archived transactions whose indices fall into the
183
- // requested range.
184
- //
185
- // For each entry `e` in [archived_transactions], `[e.from, e.from + len)` is a sub-range
186
- // of the originally requested transaction range.
187
- archived_transactions : vec record {
188
- // The index of the first archived transaction you can fetch using the [callback].
189
- start : TxIndex;
190
-
191
- // The number of transactions you can fetch using the callback.
192
- length : nat;
193
-
194
- // The function you should call to fetch the archived transactions.
195
- // The range of the transaction accessible using this function is given by [from]
196
- // and [len] fields above.
197
- callback : QueryArchiveFn
198
- }
199
- };
200
-
201
- // A prefix of the transaction range specified in the [GetTransactionsRequest] request.
202
- type TransactionRange = record {
203
- // A prefix of the requested transaction range.
204
- // The index of the first transaction is equal to [GetTransactionsRequest.from].
205
- //
206
- // Note that the number of transactions might be less than the requested
207
- // [GetTransactionsRequest.length] for various reasons, for example:
208
- //
209
- // 1. The query might have hit the replica with an outdated state
210
- // that doesn't have the whole range yet.
211
- // 2. The requested range is too large to fit into a single reply.
212
- //
213
- // NOTE: the list of transactions can be empty if:
214
- //
215
- // 1. [GetTransactionsRequest.length] was zero.
216
- // 2. [GetTransactionsRequest.from] was larger than the last transaction known to
217
- // the canister.
218
- transactions : vec Transaction
219
- };
220
-
221
- // A function for fetching archived transaction.
222
- type QueryArchiveFn = func(GetTransactionsRequest) -> (TransactionRange) query;
223
-
224
- type Transaction = record {
225
- burn : opt Burn;
226
- kind : text;
227
- mint : opt Mint;
228
- approve : opt Approve;
229
- fee_collector : opt FeeCollector;
230
- timestamp : Timestamp;
231
- transfer : opt Transfer
232
- };
233
-
234
- type FeeCollector = record {
235
- caller : opt principal;
236
- fee_collector : opt Account;
237
- ts : opt nat64
238
- };
239
-
240
- type Burn = record {
241
- from : Account;
242
- memo : opt blob;
243
- created_at_time : opt Timestamp;
244
- amount : nat;
245
- spender : opt Account;
246
- fee : opt nat
247
- };
248
-
249
- type Mint = record {
250
- to : Account;
251
- memo : opt blob;
252
- created_at_time : opt Timestamp;
253
- amount : nat;
254
- fee : opt nat
255
- };
256
-
257
- type Transfer = record {
258
- to : Account;
259
- fee : opt nat;
260
- from : Account;
261
- memo : opt blob;
262
- created_at_time : opt Timestamp;
263
- amount : nat;
264
- spender : opt Account
265
- };
266
-
267
- type Value = variant {
268
- Blob : blob;
269
- Text : text;
270
- Nat : nat;
271
- Nat64 : nat64;
272
- Int : int;
273
- Array : vec Value;
274
- Map : Map
275
- };
276
-
277
- type Map = vec record { text; Value };
278
-
279
- type Block = Value;
280
-
281
- type GetBlocksArgs = record {
282
- // The index of the first block to fetch.
283
- start : BlockIndex;
284
- // Max number of blocks to fetch.
285
- length : nat
286
- };
287
-
288
- // A prefix of the block range specified in the [GetBlocksArgs] request.
289
- type BlockRange = record {
290
- // A prefix of the requested block range.
291
- // The index of the first block is equal to [GetBlocksArgs.start].
292
- //
293
- // Note that the number of blocks might be less than the requested
294
- // [GetBlocksArgs.length] for various reasons, for example:
295
- //
296
- // 1. The query might have hit the replica with an outdated state
297
- // that doesn't have the whole range yet.
298
- // 2. The requested range is too large to fit into a single reply.
299
- //
300
- // NOTE: the list of blocks can be empty if:
301
- //
302
- // 1. [GetBlocksArgs.length] was zero.
303
- // 2. [GetBlocksArgs.start] was larger than the last block known to
304
- // the canister.
305
- blocks : vec Block
306
- };
307
-
308
- // A function for fetching archived blocks.
309
- type QueryBlockArchiveFn = func(GetBlocksArgs) -> (BlockRange) query;
310
-
311
- // The result of a "get_blocks" call.
312
- type GetBlocksResponse = record {
313
- // The index of the first block in "blocks".
314
- // If the blocks vector is empty, the exact value of this field is not specified.
315
- first_index : BlockIndex;
316
-
317
- // The total number of blocks in the chain.
318
- // If the chain length is positive, the index of the last block is `chain_len - 1`.
319
- chain_length : nat64;
320
-
321
- // System certificate for the hash of the latest block in the chain.
322
- // Only present if `get_blocks` is called in a non-replicated query context.
323
- certificate : opt blob;
324
-
325
- // List of blocks that were available in the ledger when it processed the call.
326
- //
327
- // The blocks form a contiguous range, with the first block having index
328
- // [first_block_index] (see below), and the last block having index
329
- // [first_block_index] + len(blocks) - 1.
330
- //
331
- // The block range can be an arbitrary sub-range of the originally requested range.
332
- blocks : vec Block;
333
-
334
- // Encoding of instructions for fetching archived blocks.
335
- archived_blocks : vec record {
336
- // The index of the first archived block.
337
- start : BlockIndex;
338
-
339
- // The number of blocks that can be fetched.
340
- length : nat;
341
-
342
- // Callback to fetch the archived blocks.
343
- callback : QueryBlockArchiveFn
344
- }
345
- };
346
-
347
- // Certificate for the block at `block_index`.
348
- type DataCertificate = record {
349
- certificate : opt blob;
350
- hash_tree : blob
351
- };
352
-
353
- type StandardRecord = record { url : text; name : text };
354
-
355
- type TransferFromArgs = record {
356
- spender_subaccount : opt Subaccount;
357
- from : Account;
358
- to : Account;
359
- amount : Tokens;
360
- fee : opt Tokens;
361
- memo : opt blob;
362
- created_at_time : opt Timestamp
363
- };
364
-
365
- type TransferFromResult = variant {
366
- Ok : BlockIndex;
367
- Err : TransferFromError
368
- };
369
-
370
- type TransferFromError = variant {
371
- BadFee : record { expected_fee : Tokens };
372
- BadBurn : record { min_burn_amount : Tokens };
373
- InsufficientFunds : record { balance : Tokens };
374
- InsufficientAllowance : record { allowance : Tokens };
375
- TooOld;
376
- CreatedInFuture : record { ledger_time : Timestamp };
377
- Duplicate : record { duplicate_of : BlockIndex };
378
- TemporarilyUnavailable;
379
- GenericError : record { error_code : nat; message : text }
380
- };
381
-
382
- type ArchiveInfo = record {
383
- canister_id : principal;
384
- block_range_start : BlockIndex;
385
- block_range_end : BlockIndex
386
- };
387
-
388
- type ICRC3Value = variant {
389
- Blob : blob;
390
- Text : text;
391
- Nat : nat;
392
- Int : int;
393
- Array : vec ICRC3Value;
394
- Map : vec record { text; ICRC3Value }
395
- };
396
-
397
- type GetArchivesArgs = record {
398
- // The last archive seen by the client.
399
- // The Ledger will return archives coming
400
- // after this one if set, otherwise it
401
- // will return the first archives.
402
- from : opt principal
403
- };
404
-
405
- type GetArchivesResult = vec record {
406
- // The id of the archive
407
- canister_id : principal;
408
-
409
- // The first block in the archive
410
- start : nat;
411
-
412
- // The last block in the archive
413
- end : nat
414
- };
415
-
416
- type GetBlocksResult = record {
417
- // Total number of blocks in the
418
- // block log
419
- log_length : nat;
420
-
421
- blocks : vec record { id : nat; block : ICRC3Value };
422
-
423
- archived_blocks : vec record {
424
- args : vec GetBlocksArgs;
425
- callback : func(vec GetBlocksArgs) -> (GetBlocksResult) query
426
- }
427
- };
428
-
429
- type ICRC3DataCertificate = record {
430
- // See https://internetcomputer.org/docs/current/references/ic-interface-spec#certification
431
- certificate : blob;
432
-
433
- // CBOR encoded hash_tree
434
- hash_tree : blob
435
- };
436
-
437
- type icrc21_consent_message_metadata = record {
438
- language : text;
439
- utc_offset_minutes : opt int16
440
- };
441
-
442
- type icrc21_consent_message_spec = record {
443
- metadata : icrc21_consent_message_metadata;
444
- device_spec : opt variant {
445
- GenericDisplay;
446
- FieldsDisplay
447
- }
448
- };
449
-
450
- type icrc21_consent_message_request = record {
451
- method : text;
452
- arg : blob;
453
- user_preferences : icrc21_consent_message_spec
454
- };
455
-
456
- type Icrc21Value = variant {
457
- TokenAmount : record {
458
- decimals : nat8;
459
- amount : nat64;
460
- symbol : text
461
- };
462
- TimestampSeconds : record {
463
- amount : nat64
464
- };
465
- DurationSeconds : record {
466
- amount : nat64
467
- };
468
- Text : record {
469
- content : text
470
- }
471
- };
472
-
473
- type FieldsDisplay = record {
474
- intent : text;
475
- fields : vec record { text; Icrc21Value }
476
- };
477
-
478
- type icrc21_consent_message = variant {
479
- GenericDisplayMessage : text;
480
- FieldsDisplayMessage : FieldsDisplay
481
- };
482
-
483
- type icrc21_consent_info = record {
484
- consent_message : icrc21_consent_message;
485
- metadata : icrc21_consent_message_metadata
486
- };
487
-
488
- type icrc21_error_info = record {
489
- description : text
490
- };
491
-
492
- type icrc21_error = variant {
493
- UnsupportedCanisterCall : icrc21_error_info;
494
- ConsentMessageUnavailable : icrc21_error_info;
495
- InsufficientPayment : icrc21_error_info;
496
-
497
- // Any error not covered by the above variants.
498
- GenericError : record {
499
- error_code : nat;
500
- description : text
501
- }
502
- };
503
-
504
- type icrc21_consent_message_response = variant {
505
- Ok : icrc21_consent_info;
506
- Err : icrc21_error
507
- };
508
-
509
- type GetAllowancesArgs = record {
510
- from_account : opt Account;
511
- prev_spender : opt Account;
512
- take : opt nat
513
- };
514
-
515
- type Allowance103 = record {
516
- from_account : Account;
517
- to_spender : Account;
518
- allowance : nat;
519
- expires_at : opt nat64
520
- };
521
-
522
- type GetAllowancesError = variant {
523
- AccessDenied : record {
524
- reason : text
525
- };
526
- GenericError : record {
527
- error_code : nat;
528
- message : text
529
- }
530
- };
531
-
532
- type icrc103_get_allowances_response = variant {
533
- Ok : vec Allowance103;
534
- Err : GetAllowancesError
535
- };
536
-
537
- type GetIndexPrincipalResult = variant {
538
- Ok : principal;
539
- Err : GetIndexPrincipalError
540
- };
541
-
542
- type GetIndexPrincipalError = variant {
543
- IndexPrincipalNotSet;
544
-
545
- // Any error not covered by the above variants.
546
- GenericError : record {
547
- error_code : nat;
548
- description : text
549
- }
550
- };
551
-
552
- service : (ledger_arg : LedgerArg) -> {
553
- archives : () -> (vec ArchiveInfo) query;
554
- get_transactions : (GetTransactionsRequest) -> (GetTransactionsResponse) query;
555
- get_blocks : (GetBlocksArgs) -> (GetBlocksResponse) query;
556
- get_data_certificate : () -> (DataCertificate) query;
557
-
558
- icrc1_name : () -> (text) query;
559
- icrc1_symbol : () -> (text) query;
560
- icrc1_decimals : () -> (nat8) query;
561
- icrc1_metadata : () -> (vec record { text; MetadataValue }) query;
562
- icrc1_total_supply : () -> (Tokens) query;
563
- icrc1_fee : () -> (Tokens) query;
564
- icrc1_minting_account : () -> (opt Account) query;
565
- icrc1_balance_of : (Account) -> (Tokens) query;
566
- icrc1_transfer : (TransferArg) -> (TransferResult);
567
- icrc1_supported_standards : () -> (vec StandardRecord) query;
568
-
569
- icrc2_approve : (ApproveArgs) -> (ApproveResult);
570
- icrc2_allowance : (AllowanceArgs) -> (Allowance) query;
571
- icrc2_transfer_from : (TransferFromArgs) -> (TransferFromResult);
572
-
573
- icrc3_get_archives : (GetArchivesArgs) -> (GetArchivesResult) query;
574
- icrc3_get_tip_certificate : () -> (opt ICRC3DataCertificate) query;
575
- icrc3_get_blocks : (vec GetBlocksArgs) -> (GetBlocksResult) query;
576
- icrc3_supported_block_types : () -> (vec record { block_type : text; url : text }) query;
577
-
578
- icrc21_canister_call_consent_message : (icrc21_consent_message_request) -> (icrc21_consent_message_response);
579
- icrc10_supported_standards : () -> (vec record { name : text; url : text }) query;
580
-
581
- icrc103_get_allowances : (GetAllowancesArgs) -> (icrc103_get_allowances_response) query;
582
-
583
- icrc106_get_index_principal : () -> (GetIndexPrincipalResult) query;
584
-
585
- is_ledger_ready : () -> (bool) query
586
- }
@@ -1,2 +0,0 @@
1
- import type { IDL } from "@icp-sdk/core/candid";
2
- export const idlFactory: IDL.InterfaceFactory;