@dfinity/cmc 8.0.1 → 9.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/README.md +3 -3
- package/dist/index.d.ts +12 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +4 -4
- package/package.json +3 -4
- package/dist/candid/cmc.certified.idl.d.ts +0 -2
- package/dist/candid/cmc.certified.idl.js +0 -203
- package/dist/candid/cmc.d.ts +0 -355
- package/dist/candid/cmc.did +0 -275
- package/dist/candid/cmc.idl.d.ts +0 -2
- package/dist/candid/cmc.idl.js +0 -203
- package/dist/cmc.canister.d.ts +0 -63
- package/dist/cmc.errors.d.ts +0 -14
- package/dist/cmc.options.d.ts +0 -6
package/dist/candid/cmc.d.ts
DELETED
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
|
|
5
|
-
// This file was automatically generated by @icp-sdk/bindgen@0.2.0.
|
|
6
|
-
// You should NOT make any changes in this file as it will be overwritten.
|
|
7
|
-
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
8
|
-
|
|
9
|
-
import type { ActorMethod } from "@icp-sdk/core/agent";
|
|
10
|
-
import type { IDL } from "@icp-sdk/core/candid";
|
|
11
|
-
import type { Principal } from "@icp-sdk/core/principal";
|
|
12
|
-
|
|
13
|
-
export type AccountIdentifier = string;
|
|
14
|
-
export type BlockIndex = bigint;
|
|
15
|
-
export interface CanisterSettings {
|
|
16
|
-
freezing_threshold: [] | [bigint];
|
|
17
|
-
wasm_memory_threshold: [] | [bigint];
|
|
18
|
-
environment_variables: [] | [Array<environment_variable>];
|
|
19
|
-
controllers: [] | [Array<Principal>];
|
|
20
|
-
reserved_cycles_limit: [] | [bigint];
|
|
21
|
-
log_visibility: [] | [log_visibility];
|
|
22
|
-
log_memory_limit: [] | [bigint];
|
|
23
|
-
wasm_memory_limit: [] | [bigint];
|
|
24
|
-
memory_allocation: [] | [bigint];
|
|
25
|
-
compute_allocation: [] | [bigint];
|
|
26
|
-
}
|
|
27
|
-
export type ChangeSubnetTypeAssignmentArgs =
|
|
28
|
-
| { Add: SubnetListWithType }
|
|
29
|
-
| { Remove: SubnetListWithType };
|
|
30
|
-
/**
|
|
31
|
-
* The argument of the [create_canister] method.
|
|
32
|
-
*/
|
|
33
|
-
export interface CreateCanisterArg {
|
|
34
|
-
/**
|
|
35
|
-
* Optional instructions to select on which subnet the new canister will be created on.
|
|
36
|
-
*/
|
|
37
|
-
subnet_selection: [] | [SubnetSelection];
|
|
38
|
-
/**
|
|
39
|
-
* Optional canister settings that, if set, are applied to the newly created canister.
|
|
40
|
-
* If not specified, the caller is the controller of the canister and the other settings are set to default values.
|
|
41
|
-
*/
|
|
42
|
-
settings: [] | [CanisterSettings];
|
|
43
|
-
/**
|
|
44
|
-
* An optional subnet type that, if set, determines what type of subnet
|
|
45
|
-
* the new canister will be created on.
|
|
46
|
-
* Deprecated. Use subnet_selection instead.
|
|
47
|
-
*/
|
|
48
|
-
subnet_type: [] | [string];
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Canister creation failed and the cycles attached to the call were returned to the calling canister.
|
|
52
|
-
* A small fee may be charged.
|
|
53
|
-
*/
|
|
54
|
-
export type CreateCanisterError = {
|
|
55
|
-
Refunded: {
|
|
56
|
-
/**
|
|
57
|
-
* The reason why creating a canister failed.
|
|
58
|
-
*/
|
|
59
|
-
create_error: string;
|
|
60
|
-
/**
|
|
61
|
-
* The amount of cycles returned to the calling canister
|
|
62
|
-
*/
|
|
63
|
-
refund_amount: bigint;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export type CreateCanisterResult =
|
|
67
|
-
| {
|
|
68
|
-
/**
|
|
69
|
-
* The principal of the newly created canister.
|
|
70
|
-
*/
|
|
71
|
-
Ok: Principal;
|
|
72
|
-
}
|
|
73
|
-
| { Err: CreateCanisterError };
|
|
74
|
-
export type Cycles = bigint;
|
|
75
|
-
export interface CyclesCanisterInitPayload {
|
|
76
|
-
exchange_rate_canister: [] | [ExchangeRateCanister];
|
|
77
|
-
cycles_ledger_canister_id: [] | [Principal];
|
|
78
|
-
last_purged_notification: [] | [bigint];
|
|
79
|
-
governance_canister_id: [] | [Principal];
|
|
80
|
-
minting_account_id: [] | [AccountIdentifier];
|
|
81
|
-
ledger_canister_id: [] | [Principal];
|
|
82
|
-
}
|
|
83
|
-
export type ExchangeRateCanister =
|
|
84
|
-
| {
|
|
85
|
-
/**
|
|
86
|
-
* / Enables the exchange rate canister with the given canister ID.
|
|
87
|
-
*/
|
|
88
|
-
Set: Principal;
|
|
89
|
-
}
|
|
90
|
-
| {
|
|
91
|
-
/**
|
|
92
|
-
* / Disable the exchange rate canister.
|
|
93
|
-
*/
|
|
94
|
-
Unset: null;
|
|
95
|
-
};
|
|
96
|
-
export interface IcpXdrConversionRate {
|
|
97
|
-
/**
|
|
98
|
-
* The number of 10,000ths of IMF SDR (currency code XDR) that corresponds
|
|
99
|
-
* to 1 ICP. This value reflects the current market price of one ICP token.
|
|
100
|
-
*/
|
|
101
|
-
xdr_permyriad_per_icp: bigint;
|
|
102
|
-
/**
|
|
103
|
-
* The time for which the market data was queried, expressed in UNIX epoch
|
|
104
|
-
* time in seconds.
|
|
105
|
-
*/
|
|
106
|
-
timestamp_seconds: bigint;
|
|
107
|
-
}
|
|
108
|
-
export interface IcpXdrConversionRateResponse {
|
|
109
|
-
/**
|
|
110
|
-
* System certificate as specified in
|
|
111
|
-
* https://internetcomputer.org/docs/interface-spec/index.html#certification-encoding
|
|
112
|
-
*/
|
|
113
|
-
certificate: Uint8Array;
|
|
114
|
-
/**
|
|
115
|
-
* The latest ICP/XDR conversion rate.
|
|
116
|
-
*/
|
|
117
|
-
data: IcpXdrConversionRate;
|
|
118
|
-
/**
|
|
119
|
-
* CBOR-serialized hash tree as specified in
|
|
120
|
-
* https://internetcomputer.org/docs/interface-spec/index.html#certification-encoding
|
|
121
|
-
* The hash tree is used for certification and hash the following structure:
|
|
122
|
-
* ```
|
|
123
|
-
* *
|
|
124
|
-
* |
|
|
125
|
-
* +-- ICP_XDR_CONVERSION_RATE -- [ Candid encoded IcpXdrConversionRate ]
|
|
126
|
-
* |
|
|
127
|
-
* `-- AVERAGE_ICP_XDR_CONVERSION_RATE -- [ Candid encoded IcpXdrConversionRate ]
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
hash_tree: Uint8Array;
|
|
131
|
-
}
|
|
132
|
-
export type Memo = [] | [Uint8Array];
|
|
133
|
-
/**
|
|
134
|
-
* The argument of the [notify_create_canister] method.
|
|
135
|
-
*/
|
|
136
|
-
export interface NotifyCreateCanisterArg {
|
|
137
|
-
/**
|
|
138
|
-
* The controller of canister to create.
|
|
139
|
-
*/
|
|
140
|
-
controller: Principal;
|
|
141
|
-
/**
|
|
142
|
-
* Index of the block on the ICP ledger that contains the payment.
|
|
143
|
-
*/
|
|
144
|
-
block_index: BlockIndex;
|
|
145
|
-
/**
|
|
146
|
-
* Optional instructions to select on which subnet the new canister will be created on.
|
|
147
|
-
* vec may contain no more than one element.
|
|
148
|
-
*/
|
|
149
|
-
subnet_selection: [] | [SubnetSelection];
|
|
150
|
-
/**
|
|
151
|
-
* Optional canister settings that, if set, are applied to the newly created canister.
|
|
152
|
-
* If not specified, the caller is the controller of the canister and the other settings are set to default values.
|
|
153
|
-
*/
|
|
154
|
-
settings: [] | [CanisterSettings];
|
|
155
|
-
/**
|
|
156
|
-
* An optional subnet type that, if set, determines what type of subnet
|
|
157
|
-
* the new canister will be created on.
|
|
158
|
-
* Deprecated. Use subnet_selection instead.
|
|
159
|
-
*/
|
|
160
|
-
subnet_type: [] | [string];
|
|
161
|
-
}
|
|
162
|
-
export type NotifyCreateCanisterResult =
|
|
163
|
-
| {
|
|
164
|
-
/**
|
|
165
|
-
* The principal of the newly created canister.
|
|
166
|
-
*/
|
|
167
|
-
Ok: Principal;
|
|
168
|
-
}
|
|
169
|
-
| { Err: NotifyError };
|
|
170
|
-
export type NotifyError =
|
|
171
|
-
| {
|
|
172
|
-
/**
|
|
173
|
-
* The payment processing failed and the payment was returned the caller.
|
|
174
|
-
* This is a non-retriable error.
|
|
175
|
-
*/
|
|
176
|
-
Refunded: {
|
|
177
|
-
/**
|
|
178
|
-
* The index of the block containing the refund.
|
|
179
|
-
*/
|
|
180
|
-
block_index: [] | [BlockIndex];
|
|
181
|
-
/**
|
|
182
|
-
* The reason for the refund.
|
|
183
|
-
*/
|
|
184
|
-
reason: string;
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
| {
|
|
188
|
-
/**
|
|
189
|
-
* The transaction does not satisfy the cycle minting canister payment protocol.
|
|
190
|
-
* The text contains the description of the problem.
|
|
191
|
-
* This is a non-retriable error.
|
|
192
|
-
*/
|
|
193
|
-
InvalidTransaction: string;
|
|
194
|
-
}
|
|
195
|
-
| {
|
|
196
|
-
/**
|
|
197
|
-
* Other error.
|
|
198
|
-
*/
|
|
199
|
-
Other: { error_message: string; error_code: bigint };
|
|
200
|
-
}
|
|
201
|
-
| {
|
|
202
|
-
/**
|
|
203
|
-
* The same payment is already being processed by a concurrent request.
|
|
204
|
-
* This is a retriable error.
|
|
205
|
-
*/
|
|
206
|
-
Processing: null;
|
|
207
|
-
}
|
|
208
|
-
| {
|
|
209
|
-
/**
|
|
210
|
-
* The payment was too old to be processed.
|
|
211
|
-
* The value of the variant is the oldest block index that can still be processed.
|
|
212
|
-
* This a non-retriable error.
|
|
213
|
-
*/
|
|
214
|
-
TransactionTooOld: BlockIndex;
|
|
215
|
-
};
|
|
216
|
-
export interface NotifyMintCyclesArg {
|
|
217
|
-
block_index: BlockIndex;
|
|
218
|
-
deposit_memo: Memo;
|
|
219
|
-
to_subaccount: Subaccount;
|
|
220
|
-
}
|
|
221
|
-
export type NotifyMintCyclesResult =
|
|
222
|
-
| { Ok: NotifyMintCyclesSuccess }
|
|
223
|
-
| { Err: NotifyError };
|
|
224
|
-
export interface NotifyMintCyclesSuccess {
|
|
225
|
-
/**
|
|
226
|
-
* New balance of the cycles ledger account
|
|
227
|
-
*/
|
|
228
|
-
balance: bigint;
|
|
229
|
-
/**
|
|
230
|
-
* Cycles ledger block index of deposit
|
|
231
|
-
*/
|
|
232
|
-
block_index: bigint;
|
|
233
|
-
/**
|
|
234
|
-
* Amount of cycles that were minted and deposited to the cycles ledger
|
|
235
|
-
*/
|
|
236
|
-
minted: bigint;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* The argument of the [notify_top_up] method.
|
|
240
|
-
*/
|
|
241
|
-
export interface NotifyTopUpArg {
|
|
242
|
-
/**
|
|
243
|
-
* Index of the block on the ICP ledger that contains the payment.
|
|
244
|
-
*/
|
|
245
|
-
block_index: BlockIndex;
|
|
246
|
-
/**
|
|
247
|
-
* The canister to top up.
|
|
248
|
-
*/
|
|
249
|
-
canister_id: Principal;
|
|
250
|
-
}
|
|
251
|
-
export type NotifyTopUpResult =
|
|
252
|
-
| {
|
|
253
|
-
/**
|
|
254
|
-
* The amount of cycles sent to the specified canister.
|
|
255
|
-
*/
|
|
256
|
-
Ok: Cycles;
|
|
257
|
-
}
|
|
258
|
-
| { Err: NotifyError };
|
|
259
|
-
export interface PrincipalsAuthorizedToCreateCanistersToSubnetsResponse {
|
|
260
|
-
data: Array<[Principal, Array<Principal>]>;
|
|
261
|
-
}
|
|
262
|
-
export interface SetAuthorizedSubnetworkListArgs {
|
|
263
|
-
who: [] | [Principal];
|
|
264
|
-
subnets: Array<Principal>;
|
|
265
|
-
}
|
|
266
|
-
export type Subaccount = [] | [Uint8Array];
|
|
267
|
-
export interface SubnetFilter {
|
|
268
|
-
subnet_type: [] | [string];
|
|
269
|
-
}
|
|
270
|
-
export interface SubnetListWithType {
|
|
271
|
-
subnets: Array<Principal>;
|
|
272
|
-
subnet_type: string;
|
|
273
|
-
}
|
|
274
|
-
export type SubnetSelection =
|
|
275
|
-
| {
|
|
276
|
-
/**
|
|
277
|
-
* / Choose a random subnet that fulfills the specified properties
|
|
278
|
-
*/
|
|
279
|
-
Filter: SubnetFilter;
|
|
280
|
-
}
|
|
281
|
-
| {
|
|
282
|
-
/**
|
|
283
|
-
* / Choose a specific subnet
|
|
284
|
-
*/
|
|
285
|
-
Subnet: { subnet: Principal };
|
|
286
|
-
};
|
|
287
|
-
export interface SubnetTypesToSubnetsResponse {
|
|
288
|
-
data: Array<[string, Array<Principal>]>;
|
|
289
|
-
}
|
|
290
|
-
export type UpdateSubnetTypeArgs = { Add: string } | { Remove: string };
|
|
291
|
-
export interface environment_variable {
|
|
292
|
-
value: string;
|
|
293
|
-
name: string;
|
|
294
|
-
}
|
|
295
|
-
export type log_visibility =
|
|
296
|
-
| { controllers: null }
|
|
297
|
-
| { public: null }
|
|
298
|
-
| { allowed_viewers: Array<Principal> };
|
|
299
|
-
export interface _SERVICE {
|
|
300
|
-
change_subnet_type_assignment: ActorMethod<
|
|
301
|
-
[ChangeSubnetTypeAssignmentArgs],
|
|
302
|
-
undefined
|
|
303
|
-
>;
|
|
304
|
-
/**
|
|
305
|
-
* Creates a canister using the cycles attached to the function call.
|
|
306
|
-
*/
|
|
307
|
-
create_canister: ActorMethod<[CreateCanisterArg], CreateCanisterResult>;
|
|
308
|
-
get_build_metadata: ActorMethod<[], string>;
|
|
309
|
-
get_default_subnets: ActorMethod<[], Array<Principal>>;
|
|
310
|
-
/**
|
|
311
|
-
* Returns the ICP/XDR conversion rate.
|
|
312
|
-
*/
|
|
313
|
-
get_icp_xdr_conversion_rate: ActorMethod<[], IcpXdrConversionRateResponse>;
|
|
314
|
-
/**
|
|
315
|
-
* Returns the mapping from principals to subnets in which they are authorized
|
|
316
|
-
* to create canisters.
|
|
317
|
-
*/
|
|
318
|
-
get_principals_authorized_to_create_canisters_to_subnets: ActorMethod<
|
|
319
|
-
[],
|
|
320
|
-
PrincipalsAuthorizedToCreateCanistersToSubnetsResponse
|
|
321
|
-
>;
|
|
322
|
-
/**
|
|
323
|
-
* Returns the current mapping of subnet types to subnets.
|
|
324
|
-
*/
|
|
325
|
-
get_subnet_types_to_subnets: ActorMethod<[], SubnetTypesToSubnetsResponse>;
|
|
326
|
-
/**
|
|
327
|
-
* Prompts the cycles minting canister to process a payment for canister creation.
|
|
328
|
-
*/
|
|
329
|
-
notify_create_canister: ActorMethod<
|
|
330
|
-
[NotifyCreateCanisterArg],
|
|
331
|
-
NotifyCreateCanisterResult
|
|
332
|
-
>;
|
|
333
|
-
/**
|
|
334
|
-
* Mints cycles and deposits them to the cycles ledger
|
|
335
|
-
*/
|
|
336
|
-
notify_mint_cycles: ActorMethod<
|
|
337
|
-
[NotifyMintCyclesArg],
|
|
338
|
-
NotifyMintCyclesResult
|
|
339
|
-
>;
|
|
340
|
-
/**
|
|
341
|
-
* Prompts the cycles minting canister to process a payment by converting ICP
|
|
342
|
-
* into cycles and sending the cycles the specified canister.
|
|
343
|
-
*/
|
|
344
|
-
notify_top_up: ActorMethod<[NotifyTopUpArg], NotifyTopUpResult>;
|
|
345
|
-
/**
|
|
346
|
-
* Below are methods that can only be called by other NNS canisters.
|
|
347
|
-
*/
|
|
348
|
-
set_authorized_subnetwork_list: ActorMethod<
|
|
349
|
-
[SetAuthorizedSubnetworkListArgs],
|
|
350
|
-
undefined
|
|
351
|
-
>;
|
|
352
|
-
update_subnet_type: ActorMethod<[UpdateSubnetTypeArgs], undefined>;
|
|
353
|
-
}
|
|
354
|
-
export declare const idlFactory: IDL.InterfaceFactory;
|
|
355
|
-
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
package/dist/candid/cmc.did
DELETED
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
// Generated from IC repo commit fa06b0e (2025-11-12 tags: release-2025-11-13_03-24-base) 'rs/nns/cmc/cmc.did' by import-candid
|
|
2
|
-
|
|
3
|
-
type Cycles = nat;
|
|
4
|
-
type BlockIndex = nat64;
|
|
5
|
-
type log_visibility = variant {
|
|
6
|
-
controllers;
|
|
7
|
-
public;
|
|
8
|
-
allowed_viewers : vec principal;
|
|
9
|
-
};
|
|
10
|
-
type environment_variable = record {
|
|
11
|
-
name: text;
|
|
12
|
-
value: text;
|
|
13
|
-
};
|
|
14
|
-
type CanisterSettings = record {
|
|
15
|
-
controllers : opt vec principal;
|
|
16
|
-
compute_allocation : opt nat;
|
|
17
|
-
memory_allocation : opt nat;
|
|
18
|
-
freezing_threshold : opt nat;
|
|
19
|
-
reserved_cycles_limit : opt nat;
|
|
20
|
-
log_visibility : opt log_visibility;
|
|
21
|
-
wasm_memory_limit : opt nat;
|
|
22
|
-
wasm_memory_threshold : opt nat;
|
|
23
|
-
environment_variables : opt vec environment_variable;
|
|
24
|
-
log_memory_limit : opt nat;
|
|
25
|
-
};
|
|
26
|
-
type Subaccount = opt blob;
|
|
27
|
-
type Memo = opt blob;
|
|
28
|
-
|
|
29
|
-
// The argument of the [notify_top_up] method.
|
|
30
|
-
type NotifyTopUpArg = record {
|
|
31
|
-
// Index of the block on the ICP ledger that contains the payment.
|
|
32
|
-
block_index : BlockIndex;
|
|
33
|
-
|
|
34
|
-
// The canister to top up.
|
|
35
|
-
canister_id : principal;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
type SubnetSelection = variant {
|
|
39
|
-
/// Choose a specific subnet
|
|
40
|
-
Subnet : record {
|
|
41
|
-
subnet : principal;
|
|
42
|
-
};
|
|
43
|
-
/// Choose a random subnet that fulfills the specified properties
|
|
44
|
-
Filter : SubnetFilter;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
type SubnetFilter = record {
|
|
48
|
-
subnet_type : opt text;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// The argument of the [create_canister] method.
|
|
52
|
-
type CreateCanisterArg = record {
|
|
53
|
-
// Optional canister settings that, if set, are applied to the newly created canister.
|
|
54
|
-
// If not specified, the caller is the controller of the canister and the other settings are set to default values.
|
|
55
|
-
settings : opt CanisterSettings;
|
|
56
|
-
|
|
57
|
-
// An optional subnet type that, if set, determines what type of subnet
|
|
58
|
-
// the new canister will be created on.
|
|
59
|
-
// Deprecated. Use subnet_selection instead.
|
|
60
|
-
subnet_type : opt text;
|
|
61
|
-
|
|
62
|
-
// Optional instructions to select on which subnet the new canister will be created on.
|
|
63
|
-
subnet_selection : opt SubnetSelection;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// The argument of the [notify_create_canister] method.
|
|
67
|
-
type NotifyCreateCanisterArg = record {
|
|
68
|
-
// Index of the block on the ICP ledger that contains the payment.
|
|
69
|
-
block_index : BlockIndex;
|
|
70
|
-
|
|
71
|
-
// The controller of canister to create.
|
|
72
|
-
controller : principal;
|
|
73
|
-
|
|
74
|
-
// An optional subnet type that, if set, determines what type of subnet
|
|
75
|
-
// the new canister will be created on.
|
|
76
|
-
// Deprecated. Use subnet_selection instead.
|
|
77
|
-
subnet_type : opt text;
|
|
78
|
-
|
|
79
|
-
// Optional instructions to select on which subnet the new canister will be created on.
|
|
80
|
-
// vec may contain no more than one element.
|
|
81
|
-
subnet_selection : opt SubnetSelection;
|
|
82
|
-
|
|
83
|
-
// Optional canister settings that, if set, are applied to the newly created canister.
|
|
84
|
-
// If not specified, the caller is the controller of the canister and the other settings are set to default values.
|
|
85
|
-
settings : opt CanisterSettings;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// Canister creation failed and the cycles attached to the call were returned to the calling canister.
|
|
89
|
-
// A small fee may be charged.
|
|
90
|
-
type CreateCanisterError = variant {
|
|
91
|
-
Refunded : record {
|
|
92
|
-
// The amount of cycles returned to the calling canister
|
|
93
|
-
refund_amount : nat;
|
|
94
|
-
|
|
95
|
-
// The reason why creating a canister failed.
|
|
96
|
-
create_error : text;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
type NotifyError = variant {
|
|
101
|
-
// The payment processing failed and the payment was returned the caller.
|
|
102
|
-
// This is a non-retriable error.
|
|
103
|
-
Refunded : record {
|
|
104
|
-
// The reason for the refund.
|
|
105
|
-
reason : text;
|
|
106
|
-
// The index of the block containing the refund.
|
|
107
|
-
block_index : opt BlockIndex;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// The same payment is already being processed by a concurrent request.
|
|
111
|
-
// This is a retriable error.
|
|
112
|
-
Processing;
|
|
113
|
-
|
|
114
|
-
// The payment was too old to be processed.
|
|
115
|
-
// The value of the variant is the oldest block index that can still be processed.
|
|
116
|
-
// This a non-retriable error.
|
|
117
|
-
TransactionTooOld : BlockIndex;
|
|
118
|
-
|
|
119
|
-
// The transaction does not satisfy the cycle minting canister payment protocol.
|
|
120
|
-
// The text contains the description of the problem.
|
|
121
|
-
// This is a non-retriable error.
|
|
122
|
-
InvalidTransaction : text;
|
|
123
|
-
|
|
124
|
-
// Other error.
|
|
125
|
-
Other : record { error_code : nat64; error_message : text };
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
type NotifyTopUpResult = variant {
|
|
129
|
-
// The amount of cycles sent to the specified canister.
|
|
130
|
-
Ok : Cycles;
|
|
131
|
-
Err : NotifyError;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
type CreateCanisterResult = variant {
|
|
135
|
-
// The principal of the newly created canister.
|
|
136
|
-
Ok : principal;
|
|
137
|
-
Err : CreateCanisterError;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
type NotifyCreateCanisterResult = variant {
|
|
141
|
-
// The principal of the newly created canister.
|
|
142
|
-
Ok : principal;
|
|
143
|
-
Err : NotifyError;
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
type IcpXdrConversionRate = record {
|
|
147
|
-
// The time for which the market data was queried, expressed in UNIX epoch
|
|
148
|
-
// time in seconds.
|
|
149
|
-
timestamp_seconds : nat64;
|
|
150
|
-
|
|
151
|
-
// The number of 10,000ths of IMF SDR (currency code XDR) that corresponds
|
|
152
|
-
// to 1 ICP. This value reflects the current market price of one ICP token.
|
|
153
|
-
xdr_permyriad_per_icp : nat64;
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
type IcpXdrConversionRateResponse = record {
|
|
157
|
-
// The latest ICP/XDR conversion rate.
|
|
158
|
-
data : IcpXdrConversionRate;
|
|
159
|
-
|
|
160
|
-
// CBOR-serialized hash tree as specified in
|
|
161
|
-
// https://internetcomputer.org/docs/interface-spec/index.html#certification-encoding
|
|
162
|
-
// The hash tree is used for certification and hash the following structure:
|
|
163
|
-
// ```
|
|
164
|
-
// *
|
|
165
|
-
// |
|
|
166
|
-
// +-- ICP_XDR_CONVERSION_RATE -- [ Candid encoded IcpXdrConversionRate ]
|
|
167
|
-
// |
|
|
168
|
-
// `-- AVERAGE_ICP_XDR_CONVERSION_RATE -- [ Candid encoded IcpXdrConversionRate ]
|
|
169
|
-
// ```
|
|
170
|
-
hash_tree : blob;
|
|
171
|
-
|
|
172
|
-
// System certificate as specified in
|
|
173
|
-
// https://internetcomputer.org/docs/interface-spec/index.html#certification-encoding
|
|
174
|
-
certificate : blob;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
type SubnetTypesToSubnetsResponse = record {
|
|
178
|
-
data : vec record { text; vec principal };
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
type PrincipalsAuthorizedToCreateCanistersToSubnetsResponse = record {
|
|
182
|
-
data : vec record { principal; vec principal };
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
type AccountIdentifier = text;
|
|
186
|
-
|
|
187
|
-
type ExchangeRateCanister = variant {
|
|
188
|
-
/// Enables the exchange rate canister with the given canister ID.
|
|
189
|
-
Set : principal;
|
|
190
|
-
/// Disable the exchange rate canister.
|
|
191
|
-
Unset;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
type CyclesCanisterInitPayload = record {
|
|
195
|
-
ledger_canister_id : opt principal;
|
|
196
|
-
governance_canister_id : opt principal;
|
|
197
|
-
minting_account_id : opt AccountIdentifier;
|
|
198
|
-
last_purged_notification : opt nat64;
|
|
199
|
-
exchange_rate_canister : opt ExchangeRateCanister;
|
|
200
|
-
cycles_ledger_canister_id : opt principal;
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
type NotifyMintCyclesArg = record {
|
|
204
|
-
block_index : BlockIndex;
|
|
205
|
-
to_subaccount : Subaccount;
|
|
206
|
-
deposit_memo : Memo;
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
type NotifyMintCyclesResult = variant {
|
|
210
|
-
Ok : NotifyMintCyclesSuccess;
|
|
211
|
-
Err : NotifyError;
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
type NotifyMintCyclesSuccess = record {
|
|
215
|
-
// Cycles ledger block index of deposit
|
|
216
|
-
block_index : nat;
|
|
217
|
-
// Amount of cycles that were minted and deposited to the cycles ledger
|
|
218
|
-
minted : nat;
|
|
219
|
-
// New balance of the cycles ledger account
|
|
220
|
-
balance : nat;
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
type SetAuthorizedSubnetworkListArgs = record {
|
|
224
|
-
who : opt principal;
|
|
225
|
-
subnets : vec principal;
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
type UpdateSubnetTypeArgs = variant {
|
|
229
|
-
Add : text;
|
|
230
|
-
Remove : text;
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
type SubnetListWithType = record {
|
|
234
|
-
subnets : vec principal;
|
|
235
|
-
subnet_type : text;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
type ChangeSubnetTypeAssignmentArgs = variant {
|
|
239
|
-
Add : SubnetListWithType;
|
|
240
|
-
Remove : SubnetListWithType;
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
service : (opt CyclesCanisterInitPayload) -> {
|
|
244
|
-
// Prompts the cycles minting canister to process a payment by converting ICP
|
|
245
|
-
// into cycles and sending the cycles the specified canister.
|
|
246
|
-
notify_top_up : (NotifyTopUpArg) -> (NotifyTopUpResult);
|
|
247
|
-
|
|
248
|
-
// Creates a canister using the cycles attached to the function call.
|
|
249
|
-
create_canister : (CreateCanisterArg) -> (CreateCanisterResult);
|
|
250
|
-
|
|
251
|
-
// Prompts the cycles minting canister to process a payment for canister creation.
|
|
252
|
-
notify_create_canister : (NotifyCreateCanisterArg) -> (NotifyCreateCanisterResult);
|
|
253
|
-
|
|
254
|
-
// Mints cycles and deposits them to the cycles ledger
|
|
255
|
-
notify_mint_cycles : (NotifyMintCyclesArg) -> (NotifyMintCyclesResult);
|
|
256
|
-
|
|
257
|
-
// Returns the ICP/XDR conversion rate.
|
|
258
|
-
get_icp_xdr_conversion_rate : () -> (IcpXdrConversionRateResponse) query;
|
|
259
|
-
|
|
260
|
-
// Returns the current mapping of subnet types to subnets.
|
|
261
|
-
get_subnet_types_to_subnets : () -> (SubnetTypesToSubnetsResponse) query;
|
|
262
|
-
|
|
263
|
-
// Returns the mapping from principals to subnets in which they are authorized
|
|
264
|
-
// to create canisters.
|
|
265
|
-
get_principals_authorized_to_create_canisters_to_subnets : () -> (PrincipalsAuthorizedToCreateCanistersToSubnetsResponse) query;
|
|
266
|
-
|
|
267
|
-
get_default_subnets: () -> (vec principal) query;
|
|
268
|
-
|
|
269
|
-
get_build_metadata : () -> (text) query;
|
|
270
|
-
|
|
271
|
-
// Below are methods that can only be called by other NNS canisters.
|
|
272
|
-
set_authorized_subnetwork_list : (SetAuthorizedSubnetworkListArgs) -> ();
|
|
273
|
-
update_subnet_type : (UpdateSubnetTypeArgs) -> ();
|
|
274
|
-
change_subnet_type_assignment : (ChangeSubnetTypeAssignmentArgs) -> ();
|
|
275
|
-
};
|
package/dist/candid/cmc.idl.d.ts
DELETED