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