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