@dfinity/ledger-icrc 2.8.1 → 2.9.0-beta-2025-06-28
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 +33 -18
- package/dist/candid/icrc_index-ng.certified.idl.js +7 -7
- package/dist/candid/icrc_index-ng.d.ts +7 -7
- package/dist/candid/icrc_index-ng.did +8 -8
- package/dist/candid/icrc_index-ng.idl.js +7 -7
- package/dist/candid/icrc_ledger.certified.idl.js +43 -0
- package/dist/candid/icrc_ledger.d.ts +34 -0
- package/dist/candid/icrc_ledger.did +50 -1
- package/dist/candid/icrc_ledger.idl.js +47 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/canister.js +1 -1
- package/dist/esm/chunk-62KIKAXV.js +2 -0
- package/dist/esm/{chunk-A77UW7FO.js.map → chunk-62KIKAXV.js.map} +2 -2
- package/dist/esm/chunk-F74MWPN7.js +2 -0
- package/dist/esm/{chunk-6GLYJI63.js.map → chunk-F74MWPN7.js.map} +1 -1
- package/dist/esm/chunk-IHNDUXP4.js +2 -0
- package/dist/esm/chunk-IHNDUXP4.js.map +7 -0
- package/dist/esm/chunk-NLNIA7XQ.js +2 -0
- package/dist/esm/chunk-NLNIA7XQ.js.map +7 -0
- package/dist/esm/chunk-OJD6CVD7.js +2 -0
- package/dist/esm/chunk-OJD6CVD7.js.map +7 -0
- package/dist/esm/index-ng.canister.js +1 -1
- package/dist/esm/index.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/ledger.canister.js +1 -1
- package/dist/types/converters/index.converters.d.ts +3 -0
- package/dist/types/index-ng.canister.d.ts +9 -1
- package/dist/types/ledger.canister.d.ts +1 -2
- package/dist/types/types/index-ng.params.d.ts +4 -0
- package/dist/types/utils/ledger.utils.d.ts +1 -1
- package/package.json +6 -6
- package/dist/esm/chunk-42OX77TJ.js +0 -2
- package/dist/esm/chunk-42OX77TJ.js.map +0 -7
- package/dist/esm/chunk-6GLYJI63.js +0 -2
- package/dist/esm/chunk-A77UW7FO.js +0 -2
- package/dist/esm/chunk-QSOCC3T6.js +0 -2
- package/dist/esm/chunk-QSOCC3T6.js.map +0 -7
- package/dist/esm/chunk-RQUD6I43.js +0 -2
- package/dist/esm/chunk-RQUD6I43.js.map +0 -7
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ Parameters:
|
|
|
108
108
|
|
|
109
109
|
- `response`: - An array of key-value pairs representing token metadata.
|
|
110
110
|
|
|
111
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/utils/ledger.utils.ts#
|
|
111
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/utils/ledger.utils.ts#L118)
|
|
112
112
|
|
|
113
113
|
#### :gear: decodePayment
|
|
114
114
|
|
|
@@ -165,7 +165,7 @@ Parameters:
|
|
|
165
165
|
|
|
166
166
|
### :factory: IcrcLedgerCanister
|
|
167
167
|
|
|
168
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
168
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L39)
|
|
169
169
|
|
|
170
170
|
#### Static Methods
|
|
171
171
|
|
|
@@ -177,7 +177,7 @@ Parameters:
|
|
|
177
177
|
| -------- | ---------------------------------------------------------------------- |
|
|
178
178
|
| `create` | `(options: IcrcLedgerCanisterOptions<_SERVICE>) => IcrcLedgerCanister` |
|
|
179
179
|
|
|
180
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
180
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L40)
|
|
181
181
|
|
|
182
182
|
#### Methods
|
|
183
183
|
|
|
@@ -200,7 +200,7 @@ The token metadata (name, symbol, etc.).
|
|
|
200
200
|
| ---------- | ------------------------------------------------------------- |
|
|
201
201
|
| `metadata` | `(params: QueryParams) => Promise<IcrcTokenMetadataResponse>` |
|
|
202
202
|
|
|
203
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
203
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L54)
|
|
204
204
|
|
|
205
205
|
##### :gear: transactionFee
|
|
206
206
|
|
|
@@ -210,7 +210,7 @@ The ledger transaction fees.
|
|
|
210
210
|
| ---------------- | ------------------------------------------ |
|
|
211
211
|
| `transactionFee` | `(params: QueryParams) => Promise<bigint>` |
|
|
212
212
|
|
|
213
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
213
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L62)
|
|
214
214
|
|
|
215
215
|
##### :gear: balance
|
|
216
216
|
|
|
@@ -224,7 +224,7 @@ Parameters:
|
|
|
224
224
|
|
|
225
225
|
- `params`: The parameters to get the balance of an account.
|
|
226
226
|
|
|
227
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
227
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L71)
|
|
228
228
|
|
|
229
229
|
##### :gear: transfer
|
|
230
230
|
|
|
@@ -238,7 +238,7 @@ Parameters:
|
|
|
238
238
|
|
|
239
239
|
- `params`: The parameters to transfer tokens.
|
|
240
240
|
|
|
241
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
241
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L84)
|
|
242
242
|
|
|
243
243
|
##### :gear: totalTokensSupply
|
|
244
244
|
|
|
@@ -248,7 +248,7 @@ Returns the total supply of tokens.
|
|
|
248
248
|
| ------------------- | ------------------------------------------ |
|
|
249
249
|
| `totalTokensSupply` | `(params: QueryParams) => Promise<bigint>` |
|
|
250
250
|
|
|
251
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
251
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L100)
|
|
252
252
|
|
|
253
253
|
##### :gear: transferFrom
|
|
254
254
|
|
|
@@ -264,7 +264,7 @@ Parameters:
|
|
|
264
264
|
|
|
265
265
|
- `params`: The parameters to transfer tokens from to.
|
|
266
266
|
|
|
267
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
267
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L112)
|
|
268
268
|
|
|
269
269
|
##### :gear: approve
|
|
270
270
|
|
|
@@ -280,7 +280,7 @@ Parameters:
|
|
|
280
280
|
|
|
281
281
|
- `params`: The parameters to approve.
|
|
282
282
|
|
|
283
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
283
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L134)
|
|
284
284
|
|
|
285
285
|
##### :gear: allowance
|
|
286
286
|
|
|
@@ -296,7 +296,7 @@ Parameters:
|
|
|
296
296
|
|
|
297
297
|
- `params`: The parameters to call the allowance.
|
|
298
298
|
|
|
299
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
299
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L156)
|
|
300
300
|
|
|
301
301
|
##### :gear: consentMessage
|
|
302
302
|
|
|
@@ -310,7 +310,7 @@ Parameters:
|
|
|
310
310
|
|
|
311
311
|
- `params`: - The request parameters containing the method name, arguments, and consent preferences (e.g., language).
|
|
312
312
|
|
|
313
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
313
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L174)
|
|
314
314
|
|
|
315
315
|
##### :gear: getBlocks
|
|
316
316
|
|
|
@@ -324,7 +324,7 @@ Parameters:
|
|
|
324
324
|
|
|
325
325
|
- `params`: The parameters to get the blocks.
|
|
326
326
|
|
|
327
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#
|
|
327
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/ledger.canister.ts#L198)
|
|
328
328
|
|
|
329
329
|
### :factory: IcrcIndexCanister
|
|
330
330
|
|
|
@@ -374,7 +374,7 @@ Returns the ledger canister ID related to the index canister.
|
|
|
374
374
|
|
|
375
375
|
### :factory: IcrcIndexNgCanister
|
|
376
376
|
|
|
377
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#
|
|
377
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#L23)
|
|
378
378
|
|
|
379
379
|
#### Static Methods
|
|
380
380
|
|
|
@@ -386,13 +386,14 @@ Returns the ledger canister ID related to the index canister.
|
|
|
386
386
|
| -------- | ----------------------------------------------------------------------- |
|
|
387
387
|
| `create` | `(options: IcrcLedgerCanisterOptions<_SERVICE>) => IcrcIndexNgCanister` |
|
|
388
388
|
|
|
389
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#
|
|
389
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#L24)
|
|
390
390
|
|
|
391
391
|
#### Methods
|
|
392
392
|
|
|
393
393
|
- [getTransactions](#gear-gettransactions)
|
|
394
394
|
- [ledgerId](#gear-ledgerid)
|
|
395
395
|
- [status](#gear-status)
|
|
396
|
+
- [listSubaccounts](#gear-listsubaccounts)
|
|
396
397
|
|
|
397
398
|
##### :gear: getTransactions
|
|
398
399
|
|
|
@@ -406,7 +407,7 @@ Parameters:
|
|
|
406
407
|
|
|
407
408
|
- `params`: The parameters to get the transactions of an account.
|
|
408
409
|
|
|
409
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#
|
|
410
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#L49)
|
|
410
411
|
|
|
411
412
|
##### :gear: ledgerId
|
|
412
413
|
|
|
@@ -416,7 +417,7 @@ Returns the ledger canister ID related to the index canister.
|
|
|
416
417
|
| ---------- | --------------------------------------------- |
|
|
417
418
|
| `ledgerId` | `(params: QueryParams) => Promise<Principal>` |
|
|
418
419
|
|
|
419
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#
|
|
420
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#L67)
|
|
420
421
|
|
|
421
422
|
##### :gear: status
|
|
422
423
|
|
|
@@ -430,7 +431,21 @@ Parameters:
|
|
|
430
431
|
|
|
431
432
|
- `params`: The parameters to get the status of the index canister.
|
|
432
433
|
|
|
433
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#
|
|
434
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#L78)
|
|
435
|
+
|
|
436
|
+
##### :gear: listSubaccounts
|
|
437
|
+
|
|
438
|
+
Returns the list of subaccounts for a given owner.
|
|
439
|
+
|
|
440
|
+
| Method | Type |
|
|
441
|
+
| ----------------- | -------------------------------------------------------------------------- |
|
|
442
|
+
| `listSubaccounts` | `({ certified, ...rest }: ListSubaccountsParams) => Promise<SubAccount[]>` |
|
|
443
|
+
|
|
444
|
+
Parameters:
|
|
445
|
+
|
|
446
|
+
- `params`: The parameters to get the list of subaccounts.
|
|
447
|
+
|
|
448
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger-icrc/src/index-ng.canister.ts#L87)
|
|
434
449
|
|
|
435
450
|
<!-- TSDOC_END -->
|
|
436
451
|
|
|
@@ -26,32 +26,32 @@ export const idlFactory = ({ IDL }) => {
|
|
|
26
26
|
'from' : Account,
|
|
27
27
|
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
28
28
|
'created_at_time' : IDL.Opt(IDL.Nat64),
|
|
29
|
-
'amount' :
|
|
29
|
+
'amount' : Tokens,
|
|
30
30
|
'spender' : IDL.Opt(Account),
|
|
31
31
|
});
|
|
32
32
|
const Mint = IDL.Record({
|
|
33
33
|
'to' : Account,
|
|
34
34
|
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
35
35
|
'created_at_time' : IDL.Opt(IDL.Nat64),
|
|
36
|
-
'amount' :
|
|
36
|
+
'amount' : Tokens,
|
|
37
37
|
});
|
|
38
38
|
const Approve = IDL.Record({
|
|
39
|
-
'fee' : IDL.Opt(
|
|
39
|
+
'fee' : IDL.Opt(Tokens),
|
|
40
40
|
'from' : Account,
|
|
41
41
|
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
42
42
|
'created_at_time' : IDL.Opt(IDL.Nat64),
|
|
43
|
-
'amount' :
|
|
44
|
-
'expected_allowance' : IDL.Opt(
|
|
43
|
+
'amount' : Tokens,
|
|
44
|
+
'expected_allowance' : IDL.Opt(Tokens),
|
|
45
45
|
'expires_at' : IDL.Opt(IDL.Nat64),
|
|
46
46
|
'spender' : Account,
|
|
47
47
|
});
|
|
48
48
|
const Transfer = IDL.Record({
|
|
49
49
|
'to' : Account,
|
|
50
|
-
'fee' : IDL.Opt(
|
|
50
|
+
'fee' : IDL.Opt(Tokens),
|
|
51
51
|
'from' : Account,
|
|
52
52
|
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
53
53
|
'created_at_time' : IDL.Opt(IDL.Nat64),
|
|
54
|
-
'amount' :
|
|
54
|
+
'amount' : Tokens,
|
|
55
55
|
'spender' : IDL.Opt(Account),
|
|
56
56
|
});
|
|
57
57
|
const Transaction = IDL.Record({
|
|
@@ -7,12 +7,12 @@ export interface Account {
|
|
|
7
7
|
subaccount: [] | [SubAccount];
|
|
8
8
|
}
|
|
9
9
|
export interface Approve {
|
|
10
|
-
fee: [] | [
|
|
10
|
+
fee: [] | [Tokens];
|
|
11
11
|
from: Account;
|
|
12
12
|
memo: [] | [Uint8Array | number[]];
|
|
13
13
|
created_at_time: [] | [bigint];
|
|
14
|
-
amount:
|
|
15
|
-
expected_allowance: [] | [
|
|
14
|
+
amount: Tokens;
|
|
15
|
+
expected_allowance: [] | [Tokens];
|
|
16
16
|
expires_at: [] | [bigint];
|
|
17
17
|
spender: Account;
|
|
18
18
|
}
|
|
@@ -22,7 +22,7 @@ export interface Burn {
|
|
|
22
22
|
from: Account;
|
|
23
23
|
memo: [] | [Uint8Array | number[]];
|
|
24
24
|
created_at_time: [] | [bigint];
|
|
25
|
-
amount:
|
|
25
|
+
amount: Tokens;
|
|
26
26
|
spender: [] | [Account];
|
|
27
27
|
}
|
|
28
28
|
export interface FeeCollectorRanges {
|
|
@@ -66,7 +66,7 @@ export interface Mint {
|
|
|
66
66
|
to: Account;
|
|
67
67
|
memo: [] | [Uint8Array | number[]];
|
|
68
68
|
created_at_time: [] | [bigint];
|
|
69
|
-
amount:
|
|
69
|
+
amount: Tokens;
|
|
70
70
|
}
|
|
71
71
|
export interface Status {
|
|
72
72
|
num_blocks_synced: BlockIndex;
|
|
@@ -87,11 +87,11 @@ export interface TransactionWithId {
|
|
|
87
87
|
}
|
|
88
88
|
export interface Transfer {
|
|
89
89
|
to: Account;
|
|
90
|
-
fee: [] | [
|
|
90
|
+
fee: [] | [Tokens];
|
|
91
91
|
from: Account;
|
|
92
92
|
memo: [] | [Uint8Array | number[]];
|
|
93
93
|
created_at_time: [] | [bigint];
|
|
94
|
-
amount:
|
|
94
|
+
amount: Tokens;
|
|
95
95
|
spender: [] | [Account];
|
|
96
96
|
}
|
|
97
97
|
export interface UpgradeArg {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 9bdaa01adf (2025-06-25) 'rs/ledger_suite/icrc1/index-ng/index-ng.did' by import-candid
|
|
2
2
|
type Tokens = nat;
|
|
3
3
|
|
|
4
4
|
type InitArg = record {
|
|
@@ -62,12 +62,12 @@ type Transaction = record {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
type Approve = record {
|
|
65
|
-
fee : opt
|
|
65
|
+
fee : opt Tokens;
|
|
66
66
|
from : Account;
|
|
67
67
|
memo : opt vec nat8;
|
|
68
68
|
created_at_time : opt nat64;
|
|
69
|
-
amount :
|
|
70
|
-
expected_allowance : opt
|
|
69
|
+
amount : Tokens;
|
|
70
|
+
expected_allowance : opt Tokens;
|
|
71
71
|
expires_at : opt nat64;
|
|
72
72
|
spender : Account;
|
|
73
73
|
};
|
|
@@ -76,7 +76,7 @@ type Burn = record {
|
|
|
76
76
|
from : Account;
|
|
77
77
|
memo : opt vec nat8;
|
|
78
78
|
created_at_time : opt nat64;
|
|
79
|
-
amount :
|
|
79
|
+
amount : Tokens;
|
|
80
80
|
spender : opt Account;
|
|
81
81
|
};
|
|
82
82
|
|
|
@@ -84,16 +84,16 @@ type Mint = record {
|
|
|
84
84
|
to : Account;
|
|
85
85
|
memo : opt vec nat8;
|
|
86
86
|
created_at_time : opt nat64;
|
|
87
|
-
amount :
|
|
87
|
+
amount : Tokens;
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
type Transfer = record {
|
|
91
91
|
to : Account;
|
|
92
|
-
fee : opt
|
|
92
|
+
fee : opt Tokens;
|
|
93
93
|
from : Account;
|
|
94
94
|
memo : opt vec nat8;
|
|
95
95
|
created_at_time : opt nat64;
|
|
96
|
-
amount :
|
|
96
|
+
amount : Tokens;
|
|
97
97
|
spender : opt Account;
|
|
98
98
|
};
|
|
99
99
|
|
|
@@ -26,32 +26,32 @@ export const idlFactory = ({ IDL }) => {
|
|
|
26
26
|
'from' : Account,
|
|
27
27
|
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
28
28
|
'created_at_time' : IDL.Opt(IDL.Nat64),
|
|
29
|
-
'amount' :
|
|
29
|
+
'amount' : Tokens,
|
|
30
30
|
'spender' : IDL.Opt(Account),
|
|
31
31
|
});
|
|
32
32
|
const Mint = IDL.Record({
|
|
33
33
|
'to' : Account,
|
|
34
34
|
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
35
35
|
'created_at_time' : IDL.Opt(IDL.Nat64),
|
|
36
|
-
'amount' :
|
|
36
|
+
'amount' : Tokens,
|
|
37
37
|
});
|
|
38
38
|
const Approve = IDL.Record({
|
|
39
|
-
'fee' : IDL.Opt(
|
|
39
|
+
'fee' : IDL.Opt(Tokens),
|
|
40
40
|
'from' : Account,
|
|
41
41
|
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
42
42
|
'created_at_time' : IDL.Opt(IDL.Nat64),
|
|
43
|
-
'amount' :
|
|
44
|
-
'expected_allowance' : IDL.Opt(
|
|
43
|
+
'amount' : Tokens,
|
|
44
|
+
'expected_allowance' : IDL.Opt(Tokens),
|
|
45
45
|
'expires_at' : IDL.Opt(IDL.Nat64),
|
|
46
46
|
'spender' : Account,
|
|
47
47
|
});
|
|
48
48
|
const Transfer = IDL.Record({
|
|
49
49
|
'to' : Account,
|
|
50
|
-
'fee' : IDL.Opt(
|
|
50
|
+
'fee' : IDL.Opt(Tokens),
|
|
51
51
|
'from' : Account,
|
|
52
52
|
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
53
53
|
'created_at_time' : IDL.Opt(IDL.Nat64),
|
|
54
|
-
'amount' :
|
|
54
|
+
'amount' : Tokens,
|
|
55
55
|
'spender' : IDL.Opt(Account),
|
|
56
56
|
});
|
|
57
57
|
const Transaction = IDL.Record({
|
|
@@ -36,6 +36,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
36
36
|
'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
|
|
37
37
|
'change_fee_collector' : IDL.Opt(ChangeFeeCollector),
|
|
38
38
|
'max_memo_length' : IDL.Opt(IDL.Nat16),
|
|
39
|
+
'index_principal' : IDL.Opt(IDL.Principal),
|
|
39
40
|
'token_name' : IDL.Opt(IDL.Text),
|
|
40
41
|
'feature_flags' : IDL.Opt(FeatureFlags),
|
|
41
42
|
});
|
|
@@ -58,6 +59,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
58
59
|
'controller_id' : IDL.Principal,
|
|
59
60
|
}),
|
|
60
61
|
'max_memo_length' : IDL.Opt(IDL.Nat16),
|
|
62
|
+
'index_principal' : IDL.Opt(IDL.Principal),
|
|
61
63
|
'token_name' : IDL.Text,
|
|
62
64
|
'feature_flags' : IDL.Opt(FeatureFlags),
|
|
63
65
|
});
|
|
@@ -173,6 +175,39 @@ export const idlFactory = ({ IDL }) => {
|
|
|
173
175
|
})
|
|
174
176
|
),
|
|
175
177
|
});
|
|
178
|
+
const GetAllowancesArgs = IDL.Record({
|
|
179
|
+
'take' : IDL.Opt(IDL.Nat),
|
|
180
|
+
'prev_spender' : IDL.Opt(Account),
|
|
181
|
+
'from_account' : IDL.Opt(Account),
|
|
182
|
+
});
|
|
183
|
+
const Allowance103 = IDL.Record({
|
|
184
|
+
'from_account' : Account,
|
|
185
|
+
'to_spender' : Account,
|
|
186
|
+
'allowance' : IDL.Nat,
|
|
187
|
+
'expires_at' : IDL.Opt(IDL.Nat64),
|
|
188
|
+
});
|
|
189
|
+
const GetAllowancesError = IDL.Variant({
|
|
190
|
+
'GenericError' : IDL.Record({
|
|
191
|
+
'message' : IDL.Text,
|
|
192
|
+
'error_code' : IDL.Nat,
|
|
193
|
+
}),
|
|
194
|
+
'AccessDenied' : IDL.Record({ 'reason' : IDL.Text }),
|
|
195
|
+
});
|
|
196
|
+
const icrc103_get_allowances_response = IDL.Variant({
|
|
197
|
+
'Ok' : IDL.Vec(Allowance103),
|
|
198
|
+
'Err' : GetAllowancesError,
|
|
199
|
+
});
|
|
200
|
+
const GetIndexPrincipalError = IDL.Variant({
|
|
201
|
+
'GenericError' : IDL.Record({
|
|
202
|
+
'description' : IDL.Text,
|
|
203
|
+
'error_code' : IDL.Nat,
|
|
204
|
+
}),
|
|
205
|
+
'IndexPrincipalNotSet' : IDL.Null,
|
|
206
|
+
});
|
|
207
|
+
const GetIndexPrincipalResult = IDL.Variant({
|
|
208
|
+
'Ok' : IDL.Principal,
|
|
209
|
+
'Err' : GetIndexPrincipalError,
|
|
210
|
+
});
|
|
176
211
|
const Tokens = IDL.Nat;
|
|
177
212
|
const StandardRecord = IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text });
|
|
178
213
|
const TransferArg = IDL.Record({
|
|
@@ -355,6 +390,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
355
390
|
[GetTransactionsResponse],
|
|
356
391
|
[],
|
|
357
392
|
),
|
|
393
|
+
'icrc103_get_allowances' : IDL.Func(
|
|
394
|
+
[GetAllowancesArgs],
|
|
395
|
+
[icrc103_get_allowances_response],
|
|
396
|
+
[],
|
|
397
|
+
),
|
|
398
|
+
'icrc106_get_index_principal' : IDL.Func([], [GetIndexPrincipalResult], []),
|
|
358
399
|
'icrc10_supported_standards' : IDL.Func(
|
|
359
400
|
[],
|
|
360
401
|
[IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text }))],
|
|
@@ -439,6 +480,7 @@ export const init = ({ IDL }) => {
|
|
|
439
480
|
'metadata' : IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
|
|
440
481
|
'change_fee_collector' : IDL.Opt(ChangeFeeCollector),
|
|
441
482
|
'max_memo_length' : IDL.Opt(IDL.Nat16),
|
|
483
|
+
'index_principal' : IDL.Opt(IDL.Principal),
|
|
442
484
|
'token_name' : IDL.Opt(IDL.Text),
|
|
443
485
|
'feature_flags' : IDL.Opt(FeatureFlags),
|
|
444
486
|
});
|
|
@@ -461,6 +503,7 @@ export const init = ({ IDL }) => {
|
|
|
461
503
|
'controller_id' : IDL.Principal,
|
|
462
504
|
}),
|
|
463
505
|
'max_memo_length' : IDL.Opt(IDL.Nat16),
|
|
506
|
+
'index_principal' : IDL.Opt(IDL.Principal),
|
|
464
507
|
'token_name' : IDL.Text,
|
|
465
508
|
'feature_flags' : IDL.Opt(FeatureFlags),
|
|
466
509
|
});
|
|
@@ -10,6 +10,12 @@ export interface Allowance {
|
|
|
10
10
|
allowance: bigint;
|
|
11
11
|
expires_at: [] | [Timestamp];
|
|
12
12
|
}
|
|
13
|
+
export interface Allowance103 {
|
|
14
|
+
from_account: Account;
|
|
15
|
+
to_spender: Account;
|
|
16
|
+
allowance: bigint;
|
|
17
|
+
expires_at: [] | [bigint];
|
|
18
|
+
}
|
|
13
19
|
export interface AllowanceArgs {
|
|
14
20
|
account: Account;
|
|
15
21
|
spender: Account;
|
|
@@ -83,6 +89,16 @@ export type Duration = bigint;
|
|
|
83
89
|
export interface FeatureFlags {
|
|
84
90
|
icrc2: boolean;
|
|
85
91
|
}
|
|
92
|
+
export interface GetAllowancesArgs {
|
|
93
|
+
take: [] | [bigint];
|
|
94
|
+
prev_spender: [] | [Account];
|
|
95
|
+
from_account: [] | [Account];
|
|
96
|
+
}
|
|
97
|
+
export type GetAllowancesError =
|
|
98
|
+
| {
|
|
99
|
+
GenericError: { message: string; error_code: bigint };
|
|
100
|
+
}
|
|
101
|
+
| { AccessDenied: { reason: string } };
|
|
86
102
|
export interface GetArchivesArgs {
|
|
87
103
|
from: [] | [Principal];
|
|
88
104
|
}
|
|
@@ -114,6 +130,14 @@ export interface GetBlocksResult {
|
|
|
114
130
|
callback: [Principal, string];
|
|
115
131
|
}>;
|
|
116
132
|
}
|
|
133
|
+
export type GetIndexPrincipalError =
|
|
134
|
+
| {
|
|
135
|
+
GenericError: { description: string; error_code: bigint };
|
|
136
|
+
}
|
|
137
|
+
| { IndexPrincipalNotSet: null };
|
|
138
|
+
export type GetIndexPrincipalResult =
|
|
139
|
+
| { Ok: Principal }
|
|
140
|
+
| { Err: GetIndexPrincipalError };
|
|
117
141
|
export interface GetTransactionsRequest {
|
|
118
142
|
start: TxIndex;
|
|
119
143
|
length: bigint;
|
|
@@ -169,6 +193,7 @@ export interface InitArgs {
|
|
|
169
193
|
controller_id: Principal;
|
|
170
194
|
};
|
|
171
195
|
max_memo_length: [] | [number];
|
|
196
|
+
index_principal: [] | [Principal];
|
|
172
197
|
token_name: string;
|
|
173
198
|
feature_flags: [] | [FeatureFlags];
|
|
174
199
|
}
|
|
@@ -269,6 +294,7 @@ export interface UpgradeArgs {
|
|
|
269
294
|
metadata: [] | [Array<[string, MetadataValue]>];
|
|
270
295
|
change_fee_collector: [] | [ChangeFeeCollector];
|
|
271
296
|
max_memo_length: [] | [number];
|
|
297
|
+
index_principal: [] | [Principal];
|
|
272
298
|
token_name: [] | [string];
|
|
273
299
|
feature_flags: [] | [FeatureFlags];
|
|
274
300
|
}
|
|
@@ -280,6 +306,9 @@ export type Value =
|
|
|
280
306
|
| { Blob: Uint8Array | number[] }
|
|
281
307
|
| { Text: string }
|
|
282
308
|
| { Array: Array<Value> };
|
|
309
|
+
export type icrc103_get_allowances_response =
|
|
310
|
+
| { Ok: Array<Allowance103> }
|
|
311
|
+
| { Err: GetAllowancesError };
|
|
283
312
|
export interface icrc21_consent_info {
|
|
284
313
|
metadata: icrc21_consent_message_metadata;
|
|
285
314
|
consent_message: icrc21_consent_message;
|
|
@@ -333,6 +362,11 @@ export interface _SERVICE {
|
|
|
333
362
|
[GetTransactionsRequest],
|
|
334
363
|
GetTransactionsResponse
|
|
335
364
|
>;
|
|
365
|
+
icrc103_get_allowances: ActorMethod<
|
|
366
|
+
[GetAllowancesArgs],
|
|
367
|
+
icrc103_get_allowances_response
|
|
368
|
+
>;
|
|
369
|
+
icrc106_get_index_principal: ActorMethod<[], GetIndexPrincipalResult>;
|
|
336
370
|
icrc10_supported_standards: ActorMethod<
|
|
337
371
|
[],
|
|
338
372
|
Array<{ url: string; name: string }>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 9bdaa01adf (2025-06-25) 'rs/ledger_suite/icrc1/ledger/ledger.did' by import-candid
|
|
2
2
|
type BlockIndex = nat;
|
|
3
3
|
type Subaccount = blob;
|
|
4
4
|
// Number of nanoseconds since the UNIX epoch in UTC timezone.
|
|
@@ -118,6 +118,7 @@ type InitArgs = record {
|
|
|
118
118
|
controller_id : principal;
|
|
119
119
|
more_controller_ids : opt vec principal;
|
|
120
120
|
};
|
|
121
|
+
index_principal : opt principal;
|
|
121
122
|
};
|
|
122
123
|
|
|
123
124
|
type ChangeFeeCollector = variant {
|
|
@@ -144,6 +145,7 @@ type UpgradeArgs = record {
|
|
|
144
145
|
max_memo_length : opt nat16;
|
|
145
146
|
feature_flags : opt FeatureFlags;
|
|
146
147
|
change_archive_options : opt ChangeArchiveOptions;
|
|
148
|
+
index_principal : opt principal;
|
|
147
149
|
};
|
|
148
150
|
|
|
149
151
|
type LedgerArg = variant {
|
|
@@ -479,6 +481,49 @@ type icrc21_consent_message_response = variant {
|
|
|
479
481
|
Err: icrc21_error;
|
|
480
482
|
};
|
|
481
483
|
|
|
484
|
+
type GetAllowancesArgs = record {
|
|
485
|
+
from_account: opt Account;
|
|
486
|
+
prev_spender: opt Account;
|
|
487
|
+
take: opt nat;
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
type Allowance103 = record {
|
|
491
|
+
from_account: Account;
|
|
492
|
+
to_spender: Account;
|
|
493
|
+
allowance: nat;
|
|
494
|
+
expires_at: opt nat64;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
type GetAllowancesError = variant {
|
|
498
|
+
AccessDenied: record {
|
|
499
|
+
reason: text;
|
|
500
|
+
};
|
|
501
|
+
GenericError: record {
|
|
502
|
+
error_code: nat;
|
|
503
|
+
message: text;
|
|
504
|
+
};
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
type icrc103_get_allowances_response = variant {
|
|
508
|
+
Ok: vec Allowance103;
|
|
509
|
+
Err: GetAllowancesError;
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
type GetIndexPrincipalResult = variant {
|
|
513
|
+
Ok : principal;
|
|
514
|
+
Err : GetIndexPrincipalError;
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
type GetIndexPrincipalError = variant {
|
|
518
|
+
IndexPrincipalNotSet;
|
|
519
|
+
|
|
520
|
+
// Any error not covered by the above variants.
|
|
521
|
+
GenericError: record {
|
|
522
|
+
error_code: nat;
|
|
523
|
+
description: text;
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
|
|
482
527
|
service : (ledger_arg : LedgerArg) -> {
|
|
483
528
|
archives : () -> (vec ArchiveInfo) query;
|
|
484
529
|
get_transactions : (GetTransactionsRequest) -> (GetTransactionsResponse) query;
|
|
@@ -508,5 +553,9 @@ service : (ledger_arg : LedgerArg) -> {
|
|
|
508
553
|
icrc21_canister_call_consent_message: (icrc21_consent_message_request) -> (icrc21_consent_message_response);
|
|
509
554
|
icrc10_supported_standards : () -> (vec record { name : text; url : text }) query;
|
|
510
555
|
|
|
556
|
+
icrc103_get_allowances : (GetAllowancesArgs) -> (icrc103_get_allowances_response) query;
|
|
557
|
+
|
|
558
|
+
icrc106_get_index_principal: () -> (GetIndexPrincipalResult) query;
|
|
559
|
+
|
|
511
560
|
is_ledger_ready: () -> (bool) query;
|
|
512
561
|
}
|