@dfinity/pic 0.13.0 → 0.14.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 +1 -1
- package/dist/http2-client.js +14 -3
- package/dist/http2-client.js.map +1 -1
- package/dist/identity.d.ts +4 -4
- package/dist/identity.js +4 -4
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/pocket-ic-actor.d.ts +3 -3
- package/dist/pocket-ic-client-types.d.ts +34 -4
- package/dist/pocket-ic-client-types.js +55 -6
- package/dist/pocket-ic-client-types.js.map +1 -1
- package/dist/pocket-ic-client.d.ts +2 -1
- package/dist/pocket-ic-client.js +21 -2
- package/dist/pocket-ic-client.js.map +1 -1
- package/dist/pocket-ic-deferred-actor.d.ts +3 -3
- package/dist/pocket-ic-server.d.ts +1 -1
- package/dist/pocket-ic-server.js +3 -3
- package/dist/pocket-ic-server.js.map +1 -1
- package/dist/pocket-ic-types.d.ts +41 -12
- package/dist/pocket-ic-types.js +9 -1
- package/dist/pocket-ic-types.js.map +1 -1
- package/dist/pocket-ic.d.ts +50 -50
- package/dist/pocket-ic.js +50 -50
- package/dist/util/candid.d.ts +1 -1
- package/dist/util/candid.js.map +1 -1
- package/package.json +6 -8
- package/postinstall.mjs +1 -1
|
@@ -56,7 +56,7 @@ export interface CreateInstanceOptions {
|
|
|
56
56
|
* Determines if non-mainnet features (e.g., best-effort responses) should be
|
|
57
57
|
* enabled for the PocketIC instance. Defaults to `false`.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
icpConfig?: IcpConfig;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Common options for creating a subnet.
|
|
@@ -190,6 +190,35 @@ export declare enum SubnetStateType {
|
|
|
190
190
|
*/
|
|
191
191
|
FromPath = "fromPath"
|
|
192
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Flag for configuration options in `IcpConfig`.
|
|
195
|
+
*/
|
|
196
|
+
export declare enum IcpConfigFlag {
|
|
197
|
+
Disabled = 0,
|
|
198
|
+
Enabled = 1
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Configures IC protocol properties.
|
|
202
|
+
*/
|
|
203
|
+
export interface IcpConfig {
|
|
204
|
+
/**
|
|
205
|
+
* Beta features (disabled on the ICP mainnet).
|
|
206
|
+
*/
|
|
207
|
+
betaFeatures?: IcpConfigFlag;
|
|
208
|
+
/**
|
|
209
|
+
* Canister backtraces (enabled on the ICP mainnet).
|
|
210
|
+
*/
|
|
211
|
+
canisterBacktrace?: IcpConfigFlag;
|
|
212
|
+
/**
|
|
213
|
+
* Limits on function name length in canister WASM (enabled on the ICP mainnet).
|
|
214
|
+
*/
|
|
215
|
+
functionNameLengthLimits?: IcpConfigFlag;
|
|
216
|
+
/**
|
|
217
|
+
* Rate-limiting of canister execution (enabled on the ICP mainnet).
|
|
218
|
+
* Canister execution refers to instructions and memory writes here.
|
|
219
|
+
*/
|
|
220
|
+
canisterExecutionRateLimiting?: IcpConfigFlag;
|
|
221
|
+
}
|
|
193
222
|
/**
|
|
194
223
|
* The topology of a subnet.
|
|
195
224
|
*/
|
|
@@ -277,7 +306,7 @@ export interface SetupCanisterOptions extends CreateCanisterOptions {
|
|
|
277
306
|
* such as an {@link Actor} and CanisterId.
|
|
278
307
|
*
|
|
279
308
|
* @category Types
|
|
280
|
-
* @see [Principal](https://
|
|
309
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
281
310
|
*/
|
|
282
311
|
export interface CanisterFixture<T extends ActorInterface<T> = ActorInterface> {
|
|
283
312
|
/**
|
|
@@ -293,7 +322,7 @@ export interface CanisterFixture<T extends ActorInterface<T> = ActorInterface> {
|
|
|
293
322
|
* Canister settings.
|
|
294
323
|
*
|
|
295
324
|
* @category Types
|
|
296
|
-
* @see [Principal](https://
|
|
325
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
297
326
|
*/
|
|
298
327
|
export interface CanisterSettings {
|
|
299
328
|
/**
|
|
@@ -322,7 +351,7 @@ export interface CanisterSettings {
|
|
|
322
351
|
* Options for creating a canister.
|
|
323
352
|
*
|
|
324
353
|
* @category Types
|
|
325
|
-
* @see [Principal](https://
|
|
354
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
326
355
|
*/
|
|
327
356
|
export interface CreateCanisterOptions extends CanisterSettings {
|
|
328
357
|
/**
|
|
@@ -349,7 +378,7 @@ export interface CreateCanisterOptions extends CanisterSettings {
|
|
|
349
378
|
* Options for starting a given canister.
|
|
350
379
|
*
|
|
351
380
|
* @category Types
|
|
352
|
-
* @see [Principal](https://
|
|
381
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
353
382
|
*/
|
|
354
383
|
export interface StartCanisterOptions {
|
|
355
384
|
/**
|
|
@@ -370,7 +399,7 @@ export interface StartCanisterOptions {
|
|
|
370
399
|
* Options for stopping a given canister.
|
|
371
400
|
*
|
|
372
401
|
* @category Types
|
|
373
|
-
* @see [Principal](https://
|
|
402
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
374
403
|
*/
|
|
375
404
|
export interface StopCanisterOptions {
|
|
376
405
|
/**
|
|
@@ -391,7 +420,7 @@ export interface StopCanisterOptions {
|
|
|
391
420
|
* Options for installing a WASM module to a given canister.
|
|
392
421
|
*
|
|
393
422
|
* @category Types
|
|
394
|
-
* @see [Principal](https://
|
|
423
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
395
424
|
*/
|
|
396
425
|
export interface InstallCodeOptions {
|
|
397
426
|
/**
|
|
@@ -424,7 +453,7 @@ export interface InstallCodeOptions {
|
|
|
424
453
|
* This will reset both the canister's heap and its stable memory.
|
|
425
454
|
*
|
|
426
455
|
* @category Types
|
|
427
|
-
* @see [Principal](https://
|
|
456
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
428
457
|
*/
|
|
429
458
|
export interface ReinstallCodeOptions {
|
|
430
459
|
/**
|
|
@@ -452,7 +481,7 @@ export interface ReinstallCodeOptions {
|
|
|
452
481
|
* This will reset the canister's heap, but preserve stable memory.
|
|
453
482
|
*
|
|
454
483
|
* @category Types
|
|
455
|
-
* @see [Principal](https://
|
|
484
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
456
485
|
*/
|
|
457
486
|
export interface UpgradeCanisterOptions {
|
|
458
487
|
/**
|
|
@@ -479,7 +508,7 @@ export interface UpgradeCanisterOptions {
|
|
|
479
508
|
* Options for updating the settings of a given canister.
|
|
480
509
|
*
|
|
481
510
|
* @category Types
|
|
482
|
-
* @see [Principal](https://
|
|
511
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
483
512
|
*/
|
|
484
513
|
export interface UpdateCanisterSettingsOptions extends Partial<CanisterSettings> {
|
|
485
514
|
/**
|
|
@@ -496,7 +525,7 @@ export interface UpdateCanisterSettingsOptions extends Partial<CanisterSettings>
|
|
|
496
525
|
* Options for making a query call to a given canister.
|
|
497
526
|
*
|
|
498
527
|
* @category Types
|
|
499
|
-
* @see [Principal](https://
|
|
528
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
500
529
|
*/
|
|
501
530
|
export interface QueryCallOptions {
|
|
502
531
|
/**
|
|
@@ -526,7 +555,7 @@ export interface QueryCallOptions {
|
|
|
526
555
|
* Options for making an update call to a given canister.
|
|
527
556
|
*
|
|
528
557
|
* @category Types
|
|
529
|
-
* @see [Principal](https://
|
|
558
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
530
559
|
*/
|
|
531
560
|
export interface UpdateCallOptions {
|
|
532
561
|
/**
|
package/dist/pocket-ic-types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CanisterHttpMethod = exports.SubnetType = exports.SubnetStateType = void 0;
|
|
3
|
+
exports.CanisterHttpMethod = exports.SubnetType = exports.IcpConfigFlag = exports.SubnetStateType = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* The type of state to initialize a subnet with.
|
|
6
6
|
*/
|
|
@@ -16,6 +16,14 @@ var SubnetStateType;
|
|
|
16
16
|
*/
|
|
17
17
|
SubnetStateType["FromPath"] = "fromPath";
|
|
18
18
|
})(SubnetStateType || (exports.SubnetStateType = SubnetStateType = {}));
|
|
19
|
+
/**
|
|
20
|
+
* Flag for configuration options in `IcpConfig`.
|
|
21
|
+
*/
|
|
22
|
+
var IcpConfigFlag;
|
|
23
|
+
(function (IcpConfigFlag) {
|
|
24
|
+
IcpConfigFlag[IcpConfigFlag["Disabled"] = 0] = "Disabled";
|
|
25
|
+
IcpConfigFlag[IcpConfigFlag["Enabled"] = 1] = "Enabled";
|
|
26
|
+
})(IcpConfigFlag || (exports.IcpConfigFlag = IcpConfigFlag = {}));
|
|
19
27
|
/**
|
|
20
28
|
* The type of a subnet.
|
|
21
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pocket-ic-types.js","sourceRoot":"","sources":["../src/pocket-ic-types.ts"],"names":[],"mappings":";;;AA6NA;;GAEG;AACH,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB;;OAEG;IACH,8BAAW,CAAA;IAEX;;;OAGG;IACH,wCAAqB,CAAA;AACvB,CAAC,EAXW,eAAe,+BAAf,eAAe,QAW1B;
|
|
1
|
+
{"version":3,"file":"pocket-ic-types.js","sourceRoot":"","sources":["../src/pocket-ic-types.ts"],"names":[],"mappings":";;;AA6NA;;GAEG;AACH,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB;;OAEG;IACH,8BAAW,CAAA;IAEX;;;OAGG;IACH,wCAAqB,CAAA;AACvB,CAAC,EAXW,eAAe,+BAAf,eAAe,QAW1B;AAED;;GAEG;AACH,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,yDAAQ,CAAA;IACR,uDAAO,CAAA;AACT,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAqDD;;GAEG;AACH,IAAY,UAmCX;AAnCD,WAAY,UAAU;IACpB;;OAEG;IACH,yCAA2B,CAAA;IAE3B;;OAEG;IACH,iCAAmB,CAAA;IAEnB;;OAEG;IACH,qCAAuB,CAAA;IAEvB;;OAEG;IACH,qCAAuB,CAAA;IAEvB;;OAEG;IACH,yBAAW,CAAA;IAEX;;OAEG;IACH,yBAAW,CAAA;IAEX;;OAEG;IACH,+BAAiB,CAAA;AACnB,CAAC,EAnCW,UAAU,0BAAV,UAAU,QAmCrB;AA6ZD;;GAEG;AACH,IAAY,kBAeX;AAfD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,iCAAW,CAAA;IAEX;;OAEG;IACH,mCAAa,CAAA;IAEb;;OAEG;IACH,mCAAa,CAAA;AACf,CAAC,EAfW,kBAAkB,kCAAlB,kBAAkB,QAe7B;AAiFD,2BAA2B"}
|
package/dist/pocket-ic.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { DeferredActor } from './pocket-ic-deferred-actor';
|
|
|
18
18
|
*
|
|
19
19
|
* const wasmPath = resolve('..', '..', 'canister.wasm');
|
|
20
20
|
*
|
|
21
|
-
* const picServer = await PocketIcServer.
|
|
21
|
+
* const picServer = await PocketIcServer.start();
|
|
22
22
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
23
23
|
*
|
|
24
24
|
* const fixture = await pic.setupCanister<_SERVICE>({ idlFactory, wasmPath });
|
|
@@ -38,7 +38,7 @@ import { DeferredActor } from './pocket-ic-deferred-actor';
|
|
|
38
38
|
*
|
|
39
39
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
40
40
|
*
|
|
41
|
-
* const picServer = await PocketIcServer.
|
|
41
|
+
* const picServer = await PocketIcServer.start();
|
|
42
42
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
43
43
|
*
|
|
44
44
|
* const canisterId = await pic.createCanister();
|
|
@@ -65,7 +65,7 @@ export declare class PocketIc {
|
|
|
65
65
|
* ```ts
|
|
66
66
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
67
67
|
*
|
|
68
|
-
* const picServer = await PocketIcServer.
|
|
68
|
+
* const picServer = await PocketIcServer.start();
|
|
69
69
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
70
70
|
*
|
|
71
71
|
* const fixture = await pic.setupCanister<_SERVICE>({ idlFactory, wasmPath });
|
|
@@ -88,7 +88,7 @@ export declare class PocketIc {
|
|
|
88
88
|
* @returns The {@link Actor} instance.
|
|
89
89
|
*
|
|
90
90
|
* @see [Candid](https://internetcomputer.org/docs/current/references/candid-ref)
|
|
91
|
-
* @see [Principal](https://
|
|
91
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
92
92
|
*
|
|
93
93
|
* @example
|
|
94
94
|
* ```ts
|
|
@@ -97,7 +97,7 @@ export declare class PocketIc {
|
|
|
97
97
|
*
|
|
98
98
|
* const wasmPath = resolve('..', '..', 'canister.wasm');
|
|
99
99
|
*
|
|
100
|
-
* const picServer = await PocketIcServer.
|
|
100
|
+
* const picServer = await PocketIcServer.start();
|
|
101
101
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
102
102
|
*
|
|
103
103
|
* const fixture = await pic.setupCanister<_SERVICE>({ idlFactory, wasmPath });
|
|
@@ -116,13 +116,13 @@ export declare class PocketIc {
|
|
|
116
116
|
* @param options Options for creating the canister, see {@link CreateCanisterOptions}.
|
|
117
117
|
* @returns The Principal of the newly created canister.
|
|
118
118
|
*
|
|
119
|
-
* @see [Principal](https://
|
|
119
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
120
120
|
*
|
|
121
121
|
* @example
|
|
122
122
|
* ```ts
|
|
123
123
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
124
124
|
*
|
|
125
|
-
* const picServer = await PocketIcServer.
|
|
125
|
+
* const picServer = await PocketIcServer.start();
|
|
126
126
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
127
127
|
*
|
|
128
128
|
* const canisterId = await pic.createCanister();
|
|
@@ -137,7 +137,7 @@ export declare class PocketIc {
|
|
|
137
137
|
*
|
|
138
138
|
* @param options Options for starting the canister, see {@link StartCanisterOptions}.
|
|
139
139
|
*
|
|
140
|
-
* @see [Principal](https://
|
|
140
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
141
141
|
*
|
|
142
142
|
* @example
|
|
143
143
|
* ```ts
|
|
@@ -146,7 +146,7 @@ export declare class PocketIc {
|
|
|
146
146
|
*
|
|
147
147
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
148
148
|
*
|
|
149
|
-
* const picServer = await PocketIcServer.
|
|
149
|
+
* const picServer = await PocketIcServer.start();
|
|
150
150
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
151
151
|
*
|
|
152
152
|
* await pic.startCanister({ canisterId });
|
|
@@ -161,7 +161,7 @@ export declare class PocketIc {
|
|
|
161
161
|
*
|
|
162
162
|
* @param options Options for stopping the canister, see {@link StopCanisterOptions}.
|
|
163
163
|
*
|
|
164
|
-
* @see [Principal](https://
|
|
164
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
165
165
|
*
|
|
166
166
|
* @example
|
|
167
167
|
* ```ts
|
|
@@ -170,7 +170,7 @@ export declare class PocketIc {
|
|
|
170
170
|
*
|
|
171
171
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
172
172
|
*
|
|
173
|
-
* const picServer = await PocketIcServer.
|
|
173
|
+
* const picServer = await PocketIcServer.start();
|
|
174
174
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
175
175
|
*
|
|
176
176
|
* await pic.stopCanister({ canisterId });
|
|
@@ -188,7 +188,7 @@ export declare class PocketIc {
|
|
|
188
188
|
*
|
|
189
189
|
* @param options Options for installing the code, see {@link InstallCodeOptions}.
|
|
190
190
|
*
|
|
191
|
-
* @see [Principal](https://
|
|
191
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
192
192
|
*
|
|
193
193
|
* @example
|
|
194
194
|
* ```ts
|
|
@@ -199,7 +199,7 @@ export declare class PocketIc {
|
|
|
199
199
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
200
200
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
201
201
|
*
|
|
202
|
-
* const picServer = await PocketIcServer.
|
|
202
|
+
* const picServer = await PocketIcServer.start();
|
|
203
203
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
204
204
|
*
|
|
205
205
|
* await pic.installCode({ canisterId, wasm });
|
|
@@ -217,7 +217,7 @@ export declare class PocketIc {
|
|
|
217
217
|
*
|
|
218
218
|
* @param options Options for reinstalling the code, see {@link ReinstallCodeOptions}.
|
|
219
219
|
*
|
|
220
|
-
* @see [Principal](https://
|
|
220
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
221
221
|
*
|
|
222
222
|
* @example
|
|
223
223
|
* ```ts
|
|
@@ -228,7 +228,7 @@ export declare class PocketIc {
|
|
|
228
228
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
229
229
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
230
230
|
*
|
|
231
|
-
* const picServer = await PocketIcServer.
|
|
231
|
+
* const picServer = await PocketIcServer.start();
|
|
232
232
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
233
233
|
*
|
|
234
234
|
* await pic.reinstallCode({ canisterId, wasm });
|
|
@@ -246,7 +246,7 @@ export declare class PocketIc {
|
|
|
246
246
|
*
|
|
247
247
|
* @param options Options for upgrading the canister, see {@link UpgradeCanisterOptions}.
|
|
248
248
|
*
|
|
249
|
-
* @see [Principal](https://
|
|
249
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
250
250
|
*
|
|
251
251
|
* @example
|
|
252
252
|
* ```ts
|
|
@@ -257,7 +257,7 @@ export declare class PocketIc {
|
|
|
257
257
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
258
258
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
259
259
|
*
|
|
260
|
-
* const picServer = await PocketIcServer.
|
|
260
|
+
* const picServer = await PocketIcServer.start();
|
|
261
261
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
262
262
|
*
|
|
263
263
|
* await pic.upgradeCanister({ canisterId, wasm });
|
|
@@ -272,7 +272,7 @@ export declare class PocketIc {
|
|
|
272
272
|
*
|
|
273
273
|
* @param options Options for updating the canister settings, see {@link UpdateCanisterSettingsOptions}.
|
|
274
274
|
*
|
|
275
|
-
* @see [Principal](https://
|
|
275
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
276
276
|
*
|
|
277
277
|
* @example
|
|
278
278
|
* ```ts
|
|
@@ -281,7 +281,7 @@ export declare class PocketIc {
|
|
|
281
281
|
*
|
|
282
282
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
283
283
|
*
|
|
284
|
-
* const picServer = await PocketIcServer.
|
|
284
|
+
* const picServer = await PocketIcServer.start();
|
|
285
285
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
286
286
|
*
|
|
287
287
|
* await pic.updateCanisterSettings({
|
|
@@ -306,8 +306,8 @@ export declare class PocketIc {
|
|
|
306
306
|
* @typeparam T The type of the {@link Actor}. Must implement {@link ActorInterface}.
|
|
307
307
|
* @returns The {@link Actor} instance.
|
|
308
308
|
*
|
|
309
|
-
* @see [Principal](https://
|
|
310
|
-
* @see [InterfaceFactory](https://
|
|
309
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
310
|
+
* @see [InterfaceFactory](https://js.icp.build/core/latest/libs/candid/api/namespaces/idl/type-aliases/interfacefactory/)
|
|
311
311
|
*
|
|
312
312
|
* @example
|
|
313
313
|
* ```ts
|
|
@@ -318,7 +318,7 @@ export declare class PocketIc {
|
|
|
318
318
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
319
319
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
320
320
|
*
|
|
321
|
-
* const picServer = await PocketIcServer.
|
|
321
|
+
* const picServer = await PocketIcServer.start();
|
|
322
322
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
323
323
|
*
|
|
324
324
|
* const canisterId = await pic.createCanister();
|
|
@@ -347,8 +347,8 @@ export declare class PocketIc {
|
|
|
347
347
|
* @typeparam T The type of the {@link DeferredActor}. Must implement {@link ActorInterface}.
|
|
348
348
|
* @returns The {@link DeferredActor} instance.
|
|
349
349
|
*
|
|
350
|
-
* @see [Principal](https://
|
|
351
|
-
* @see [InterfaceFactory](https://
|
|
350
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
351
|
+
* @see [InterfaceFactory](https://js.icp.build/core/latest/libs/candid/api/namespaces/idl/type-aliases/interfacefactory/)
|
|
352
352
|
*
|
|
353
353
|
* @example
|
|
354
354
|
*/
|
|
@@ -367,7 +367,7 @@ export declare class PocketIc {
|
|
|
367
367
|
*
|
|
368
368
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
369
369
|
*
|
|
370
|
-
* const picServer = await PocketIcServer.
|
|
370
|
+
* const picServer = await PocketIcServer.start();
|
|
371
371
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
372
372
|
*
|
|
373
373
|
* canisterId = await pic.createCanister({
|
|
@@ -399,7 +399,7 @@ export declare class PocketIc {
|
|
|
399
399
|
*
|
|
400
400
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
401
401
|
*
|
|
402
|
-
* const picServer = await PocketIcServer.
|
|
402
|
+
* const picServer = await PocketIcServer.start();
|
|
403
403
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
404
404
|
*
|
|
405
405
|
* canisterId = await pic.createCanister({
|
|
@@ -424,7 +424,7 @@ export declare class PocketIc {
|
|
|
424
424
|
* ```ts
|
|
425
425
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
426
426
|
*
|
|
427
|
-
* const picServer = await PocketIcServer.
|
|
427
|
+
* const picServer = await PocketIcServer.start();
|
|
428
428
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
429
429
|
*
|
|
430
430
|
* await pic.tearDown();
|
|
@@ -441,7 +441,7 @@ export declare class PocketIc {
|
|
|
441
441
|
* ```ts
|
|
442
442
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
443
443
|
*
|
|
444
|
-
* const picServer = await PocketIcServer.
|
|
444
|
+
* const picServer = await PocketIcServer.start();
|
|
445
445
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
446
446
|
*
|
|
447
447
|
* await pic.tick();
|
|
@@ -460,7 +460,7 @@ export declare class PocketIc {
|
|
|
460
460
|
* @param canisterId The Principal of the canister to get the controllers of.
|
|
461
461
|
* @returns The controllers of the specified canister.
|
|
462
462
|
*
|
|
463
|
-
* @see [Principal](https://
|
|
463
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
464
464
|
*
|
|
465
465
|
* @example
|
|
466
466
|
* ```ts
|
|
@@ -468,7 +468,7 @@ export declare class PocketIc {
|
|
|
468
468
|
*
|
|
469
469
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
470
470
|
*
|
|
471
|
-
* const picServer = await PocketIcServer.
|
|
471
|
+
* const picServer = await PocketIcServer.start();
|
|
472
472
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
473
473
|
*
|
|
474
474
|
* const controllers = await pic.getControllers(canisterId);
|
|
@@ -486,7 +486,7 @@ export declare class PocketIc {
|
|
|
486
486
|
* ```ts
|
|
487
487
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
488
488
|
*
|
|
489
|
-
* const picServer = await PocketIcServer.
|
|
489
|
+
* const picServer = await PocketIcServer.start();
|
|
490
490
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
491
491
|
*
|
|
492
492
|
* const time = await pic.getTime();
|
|
@@ -508,7 +508,7 @@ export declare class PocketIc {
|
|
|
508
508
|
* ```ts
|
|
509
509
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
510
510
|
*
|
|
511
|
-
* const picServer = await PocketIcServer.
|
|
511
|
+
* const picServer = await PocketIcServer.start();
|
|
512
512
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
513
513
|
*
|
|
514
514
|
* await pic.resetTime();
|
|
@@ -531,7 +531,7 @@ export declare class PocketIc {
|
|
|
531
531
|
* ```ts
|
|
532
532
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
533
533
|
*
|
|
534
|
-
* const picServer = await PocketIcServer.
|
|
534
|
+
* const picServer = await PocketIcServer.start();
|
|
535
535
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
536
536
|
*
|
|
537
537
|
* await pic.resetCertifiedTime();
|
|
@@ -561,7 +561,7 @@ export declare class PocketIc {
|
|
|
561
561
|
*
|
|
562
562
|
* const date = new Date();
|
|
563
563
|
*
|
|
564
|
-
* const picServer = await PocketIcServer.
|
|
564
|
+
* const picServer = await PocketIcServer.start();
|
|
565
565
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
566
566
|
*
|
|
567
567
|
* await pic.setTime(date);
|
|
@@ -593,7 +593,7 @@ export declare class PocketIc {
|
|
|
593
593
|
*
|
|
594
594
|
* const date = new Date();
|
|
595
595
|
*
|
|
596
|
-
* const picServer = await PocketIcServer.
|
|
596
|
+
* const picServer = await PocketIcServer.start();
|
|
597
597
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
598
598
|
*
|
|
599
599
|
* await pic.setCertifiedTime(date);
|
|
@@ -621,7 +621,7 @@ export declare class PocketIc {
|
|
|
621
621
|
* ```ts
|
|
622
622
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
623
623
|
*
|
|
624
|
-
* const picServer = await PocketIcServer.
|
|
624
|
+
* const picServer = await PocketIcServer.start();
|
|
625
625
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
626
626
|
*
|
|
627
627
|
* const initialTime = await pic.getTime();
|
|
@@ -647,7 +647,7 @@ export declare class PocketIc {
|
|
|
647
647
|
* ```ts
|
|
648
648
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
649
649
|
*
|
|
650
|
-
* const picServer = await PocketIcServer.
|
|
650
|
+
* const picServer = await PocketIcServer.start();
|
|
651
651
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
652
652
|
*
|
|
653
653
|
* const initialTime = await pic.getTime();
|
|
@@ -670,7 +670,7 @@ export declare class PocketIc {
|
|
|
670
670
|
* ```ts
|
|
671
671
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
672
672
|
*
|
|
673
|
-
* const picServer = await PocketIcServer.
|
|
673
|
+
* const picServer = await PocketIcServer.start();
|
|
674
674
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
675
675
|
*
|
|
676
676
|
* const subnets = pic.getApplicationSubnets();
|
|
@@ -687,7 +687,7 @@ export declare class PocketIc {
|
|
|
687
687
|
* @param canisterId The Principal of the canister to get the subnet Id of.
|
|
688
688
|
* @returns The canister's subnet Id if the canister exists, `null` otherwise.
|
|
689
689
|
*
|
|
690
|
-
* @see [Principal](https://
|
|
690
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
691
691
|
*
|
|
692
692
|
* @example
|
|
693
693
|
* ```ts
|
|
@@ -695,7 +695,7 @@ export declare class PocketIc {
|
|
|
695
695
|
*
|
|
696
696
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
697
697
|
*
|
|
698
|
-
* const picServer = await PocketIcServer.
|
|
698
|
+
* const picServer = await PocketIcServer.start();
|
|
699
699
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
700
700
|
*
|
|
701
701
|
* const subnetId = await pic.getCanisterSubnetId(canisterId);
|
|
@@ -776,7 +776,7 @@ export declare class PocketIc {
|
|
|
776
776
|
* @param canisterId The Principal of the canister to check.
|
|
777
777
|
* @returns The current cycles balance of the canister.
|
|
778
778
|
*
|
|
779
|
-
* @see [Principal](https://
|
|
779
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
780
780
|
*
|
|
781
781
|
* @example
|
|
782
782
|
* ```ts
|
|
@@ -785,7 +785,7 @@ export declare class PocketIc {
|
|
|
785
785
|
*
|
|
786
786
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
787
787
|
*
|
|
788
|
-
* const picServer = await PocketIcServer.
|
|
788
|
+
* const picServer = await PocketIcServer.start();
|
|
789
789
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
790
790
|
*
|
|
791
791
|
* const cyclesBalance = await pic.getCyclesBalance(canisterId);
|
|
@@ -802,7 +802,7 @@ export declare class PocketIc {
|
|
|
802
802
|
* @param amount The amount of cycles to add.
|
|
803
803
|
* @returns The new cycle balance of the canister.
|
|
804
804
|
*
|
|
805
|
-
* @see [Principal](https://
|
|
805
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
806
806
|
*
|
|
807
807
|
* @example
|
|
808
808
|
* ```ts
|
|
@@ -811,7 +811,7 @@ export declare class PocketIc {
|
|
|
811
811
|
*
|
|
812
812
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
813
813
|
*
|
|
814
|
-
* const picServer = await PocketIcServer.
|
|
814
|
+
* const picServer = await PocketIcServer.start();
|
|
815
815
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
816
816
|
*
|
|
817
817
|
* const newCyclesBalance = await pic.addCycles(canisterId, 10_000_000);
|
|
@@ -827,7 +827,7 @@ export declare class PocketIc {
|
|
|
827
827
|
* @param canisterId The Principal of the canister to set the stable memory of.
|
|
828
828
|
* @param stableMemory A blob containing the stable memory to set.
|
|
829
829
|
*
|
|
830
|
-
* @see [Principal](https://
|
|
830
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
831
831
|
*
|
|
832
832
|
* @example
|
|
833
833
|
* ```ts
|
|
@@ -837,7 +837,7 @@ export declare class PocketIc {
|
|
|
837
837
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
838
838
|
* const stableMemory = new Uint8Array([0, 1, 2, 3, 4]);
|
|
839
839
|
*
|
|
840
|
-
* const picServer = await PocketIcServer.
|
|
840
|
+
* const picServer = await PocketIcServer.start();
|
|
841
841
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
842
842
|
*
|
|
843
843
|
* await pic.setStableMemory(canisterId, stableMemory);
|
|
@@ -853,7 +853,7 @@ export declare class PocketIc {
|
|
|
853
853
|
* @param canisterId The Principal of the canister to get the stable memory of.
|
|
854
854
|
* @returns A blob containing the canister's stable memory.
|
|
855
855
|
*
|
|
856
|
-
* @see [Principal](https://
|
|
856
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
857
857
|
*
|
|
858
858
|
* @example
|
|
859
859
|
* ```ts
|
|
@@ -862,7 +862,7 @@ export declare class PocketIc {
|
|
|
862
862
|
*
|
|
863
863
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
864
864
|
*
|
|
865
|
-
* const picServer = await PocketIcServer.
|
|
865
|
+
* const picServer = await PocketIcServer.start();
|
|
866
866
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
867
867
|
*
|
|
868
868
|
* const stableMemory = await pic.getStableMemory(canisterId);
|
|
@@ -885,7 +885,7 @@ export declare class PocketIc {
|
|
|
885
885
|
*
|
|
886
886
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
887
887
|
*
|
|
888
|
-
* const picServer = await PocketIcServer.
|
|
888
|
+
* const picServer = await PocketIcServer.start();
|
|
889
889
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
890
890
|
*
|
|
891
891
|
* // queue the canister message that will send the HTTPS Outcall
|
|
@@ -933,7 +933,7 @@ export declare class PocketIc {
|
|
|
933
933
|
*
|
|
934
934
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
935
935
|
*
|
|
936
|
-
* const picServer = await PocketIcServer.
|
|
936
|
+
* const picServer = await PocketIcServer.start();
|
|
937
937
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
938
938
|
*
|
|
939
939
|
* // queue the canister message that will send the HTTPS Outcall
|