@dfinity/pic 0.13.1 → 0.14.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 +3 -9
- 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
package/dist/pocket-ic.js
CHANGED
|
@@ -23,7 +23,7 @@ const pocket_ic_deferred_actor_1 = require("./pocket-ic-deferred-actor");
|
|
|
23
23
|
*
|
|
24
24
|
* const wasmPath = resolve('..', '..', 'canister.wasm');
|
|
25
25
|
*
|
|
26
|
-
* const picServer = await PocketIcServer.
|
|
26
|
+
* const picServer = await PocketIcServer.start();
|
|
27
27
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
28
28
|
*
|
|
29
29
|
* const fixture = await pic.setupCanister<_SERVICE>({ idlFactory, wasmPath });
|
|
@@ -43,7 +43,7 @@ const pocket_ic_deferred_actor_1 = require("./pocket-ic-deferred-actor");
|
|
|
43
43
|
*
|
|
44
44
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
45
45
|
*
|
|
46
|
-
* const picServer = await PocketIcServer.
|
|
46
|
+
* const picServer = await PocketIcServer.start();
|
|
47
47
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
48
48
|
*
|
|
49
49
|
* const canisterId = await pic.createCanister();
|
|
@@ -72,7 +72,7 @@ class PocketIc {
|
|
|
72
72
|
* ```ts
|
|
73
73
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
74
74
|
*
|
|
75
|
-
* const picServer = await PocketIcServer.
|
|
75
|
+
* const picServer = await PocketIcServer.start();
|
|
76
76
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
77
77
|
*
|
|
78
78
|
* const fixture = await pic.setupCanister<_SERVICE>({ idlFactory, wasmPath });
|
|
@@ -98,7 +98,7 @@ class PocketIc {
|
|
|
98
98
|
* @returns The {@link Actor} instance.
|
|
99
99
|
*
|
|
100
100
|
* @see [Candid](https://internetcomputer.org/docs/current/references/candid-ref)
|
|
101
|
-
* @see [Principal](https://
|
|
101
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
102
102
|
*
|
|
103
103
|
* @example
|
|
104
104
|
* ```ts
|
|
@@ -107,7 +107,7 @@ class PocketIc {
|
|
|
107
107
|
*
|
|
108
108
|
* const wasmPath = resolve('..', '..', 'canister.wasm');
|
|
109
109
|
*
|
|
110
|
-
* const picServer = await PocketIcServer.
|
|
110
|
+
* const picServer = await PocketIcServer.start();
|
|
111
111
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
112
112
|
*
|
|
113
113
|
* const fixture = await pic.setupCanister<_SERVICE>({ idlFactory, wasmPath });
|
|
@@ -141,13 +141,13 @@ class PocketIc {
|
|
|
141
141
|
* @param options Options for creating the canister, see {@link CreateCanisterOptions}.
|
|
142
142
|
* @returns The Principal of the newly created canister.
|
|
143
143
|
*
|
|
144
|
-
* @see [Principal](https://
|
|
144
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
145
145
|
*
|
|
146
146
|
* @example
|
|
147
147
|
* ```ts
|
|
148
148
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
149
149
|
*
|
|
150
|
-
* const picServer = await PocketIcServer.
|
|
150
|
+
* const picServer = await PocketIcServer.start();
|
|
151
151
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
152
152
|
*
|
|
153
153
|
* const canisterId = await pic.createCanister();
|
|
@@ -188,7 +188,7 @@ class PocketIc {
|
|
|
188
188
|
*
|
|
189
189
|
* @param options Options for starting the canister, see {@link StartCanisterOptions}.
|
|
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
|
|
@@ -197,7 +197,7 @@ class PocketIc {
|
|
|
197
197
|
*
|
|
198
198
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
199
199
|
*
|
|
200
|
-
* const picServer = await PocketIcServer.
|
|
200
|
+
* const picServer = await PocketIcServer.start();
|
|
201
201
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
202
202
|
*
|
|
203
203
|
* await pic.startCanister({ canisterId });
|
|
@@ -227,7 +227,7 @@ class PocketIc {
|
|
|
227
227
|
*
|
|
228
228
|
* @param options Options for stopping the canister, see {@link StopCanisterOptions}.
|
|
229
229
|
*
|
|
230
|
-
* @see [Principal](https://
|
|
230
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
231
231
|
*
|
|
232
232
|
* @example
|
|
233
233
|
* ```ts
|
|
@@ -236,7 +236,7 @@ class PocketIc {
|
|
|
236
236
|
*
|
|
237
237
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
238
238
|
*
|
|
239
|
-
* const picServer = await PocketIcServer.
|
|
239
|
+
* const picServer = await PocketIcServer.start();
|
|
240
240
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
241
241
|
*
|
|
242
242
|
* await pic.stopCanister({ canisterId });
|
|
@@ -269,7 +269,7 @@ class PocketIc {
|
|
|
269
269
|
*
|
|
270
270
|
* @param options Options for installing the code, see {@link InstallCodeOptions}.
|
|
271
271
|
*
|
|
272
|
-
* @see [Principal](https://
|
|
272
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
273
273
|
*
|
|
274
274
|
* @example
|
|
275
275
|
* ```ts
|
|
@@ -280,7 +280,7 @@ class PocketIc {
|
|
|
280
280
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
281
281
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
282
282
|
*
|
|
283
|
-
* const picServer = await PocketIcServer.
|
|
283
|
+
* const picServer = await PocketIcServer.start();
|
|
284
284
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
285
285
|
*
|
|
286
286
|
* await pic.installCode({ canisterId, wasm });
|
|
@@ -321,7 +321,7 @@ class PocketIc {
|
|
|
321
321
|
*
|
|
322
322
|
* @param options Options for reinstalling the code, see {@link ReinstallCodeOptions}.
|
|
323
323
|
*
|
|
324
|
-
* @see [Principal](https://
|
|
324
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
325
325
|
*
|
|
326
326
|
* @example
|
|
327
327
|
* ```ts
|
|
@@ -332,7 +332,7 @@ class PocketIc {
|
|
|
332
332
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
333
333
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
334
334
|
*
|
|
335
|
-
* const picServer = await PocketIcServer.
|
|
335
|
+
* const picServer = await PocketIcServer.start();
|
|
336
336
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
337
337
|
*
|
|
338
338
|
* await pic.reinstallCode({ canisterId, wasm });
|
|
@@ -368,7 +368,7 @@ class PocketIc {
|
|
|
368
368
|
*
|
|
369
369
|
* @param options Options for upgrading the canister, see {@link UpgradeCanisterOptions}.
|
|
370
370
|
*
|
|
371
|
-
* @see [Principal](https://
|
|
371
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
372
372
|
*
|
|
373
373
|
* @example
|
|
374
374
|
* ```ts
|
|
@@ -379,7 +379,7 @@ class PocketIc {
|
|
|
379
379
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
380
380
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
381
381
|
*
|
|
382
|
-
* const picServer = await PocketIcServer.
|
|
382
|
+
* const picServer = await PocketIcServer.start();
|
|
383
383
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
384
384
|
*
|
|
385
385
|
* await pic.upgradeCanister({ canisterId, wasm });
|
|
@@ -412,7 +412,7 @@ class PocketIc {
|
|
|
412
412
|
*
|
|
413
413
|
* @param options Options for updating the canister settings, see {@link UpdateCanisterSettingsOptions}.
|
|
414
414
|
*
|
|
415
|
-
* @see [Principal](https://
|
|
415
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
416
416
|
*
|
|
417
417
|
* @example
|
|
418
418
|
* ```ts
|
|
@@ -421,7 +421,7 @@ class PocketIc {
|
|
|
421
421
|
*
|
|
422
422
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
423
423
|
*
|
|
424
|
-
* const picServer = await PocketIcServer.
|
|
424
|
+
* const picServer = await PocketIcServer.start();
|
|
425
425
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
426
426
|
*
|
|
427
427
|
* await pic.updateCanisterSettings({
|
|
@@ -463,8 +463,8 @@ class PocketIc {
|
|
|
463
463
|
* @typeparam T The type of the {@link Actor}. Must implement {@link ActorInterface}.
|
|
464
464
|
* @returns The {@link Actor} instance.
|
|
465
465
|
*
|
|
466
|
-
* @see [Principal](https://
|
|
467
|
-
* @see [InterfaceFactory](https://
|
|
466
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
467
|
+
* @see [InterfaceFactory](https://js.icp.build/core/latest/libs/candid/api/namespaces/idl/type-aliases/interfacefactory/)
|
|
468
468
|
*
|
|
469
469
|
* @example
|
|
470
470
|
* ```ts
|
|
@@ -475,7 +475,7 @@ class PocketIc {
|
|
|
475
475
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
476
476
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
477
477
|
*
|
|
478
|
-
* const picServer = await PocketIcServer.
|
|
478
|
+
* const picServer = await PocketIcServer.start();
|
|
479
479
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
480
480
|
*
|
|
481
481
|
* const canisterId = await pic.createCanister();
|
|
@@ -507,8 +507,8 @@ class PocketIc {
|
|
|
507
507
|
* @typeparam T The type of the {@link DeferredActor}. Must implement {@link ActorInterface}.
|
|
508
508
|
* @returns The {@link DeferredActor} instance.
|
|
509
509
|
*
|
|
510
|
-
* @see [Principal](https://
|
|
511
|
-
* @see [InterfaceFactory](https://
|
|
510
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
511
|
+
* @see [InterfaceFactory](https://js.icp.build/core/latest/libs/candid/api/namespaces/idl/type-aliases/interfacefactory/)
|
|
512
512
|
*
|
|
513
513
|
* @example
|
|
514
514
|
*/
|
|
@@ -530,7 +530,7 @@ class PocketIc {
|
|
|
530
530
|
*
|
|
531
531
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
532
532
|
*
|
|
533
|
-
* const picServer = await PocketIcServer.
|
|
533
|
+
* const picServer = await PocketIcServer.start();
|
|
534
534
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
535
535
|
*
|
|
536
536
|
* canisterId = await pic.createCanister({
|
|
@@ -575,7 +575,7 @@ class PocketIc {
|
|
|
575
575
|
*
|
|
576
576
|
* const wasm = resolve('..', '..', 'canister.wasm');
|
|
577
577
|
*
|
|
578
|
-
* const picServer = await PocketIcServer.
|
|
578
|
+
* const picServer = await PocketIcServer.start();
|
|
579
579
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
580
580
|
*
|
|
581
581
|
* canisterId = await pic.createCanister({
|
|
@@ -613,7 +613,7 @@ class PocketIc {
|
|
|
613
613
|
* ```ts
|
|
614
614
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
615
615
|
*
|
|
616
|
-
* const picServer = await PocketIcServer.
|
|
616
|
+
* const picServer = await PocketIcServer.start();
|
|
617
617
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
618
618
|
*
|
|
619
619
|
* await pic.tearDown();
|
|
@@ -632,7 +632,7 @@ class PocketIc {
|
|
|
632
632
|
* ```ts
|
|
633
633
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
634
634
|
*
|
|
635
|
-
* const picServer = await PocketIcServer.
|
|
635
|
+
* const picServer = await PocketIcServer.start();
|
|
636
636
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
637
637
|
*
|
|
638
638
|
* await pic.tick();
|
|
@@ -655,7 +655,7 @@ class PocketIc {
|
|
|
655
655
|
* @param canisterId The Principal of the canister to get the controllers of.
|
|
656
656
|
* @returns The controllers of the specified canister.
|
|
657
657
|
*
|
|
658
|
-
* @see [Principal](https://
|
|
658
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
659
659
|
*
|
|
660
660
|
* @example
|
|
661
661
|
* ```ts
|
|
@@ -663,7 +663,7 @@ class PocketIc {
|
|
|
663
663
|
*
|
|
664
664
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
665
665
|
*
|
|
666
|
-
* const picServer = await PocketIcServer.
|
|
666
|
+
* const picServer = await PocketIcServer.start();
|
|
667
667
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
668
668
|
*
|
|
669
669
|
* const controllers = await pic.getControllers(canisterId);
|
|
@@ -683,7 +683,7 @@ class PocketIc {
|
|
|
683
683
|
* ```ts
|
|
684
684
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
685
685
|
*
|
|
686
|
-
* const picServer = await PocketIcServer.
|
|
686
|
+
* const picServer = await PocketIcServer.start();
|
|
687
687
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
688
688
|
*
|
|
689
689
|
* const time = await pic.getTime();
|
|
@@ -708,7 +708,7 @@ class PocketIc {
|
|
|
708
708
|
* ```ts
|
|
709
709
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
710
710
|
*
|
|
711
|
-
* const picServer = await PocketIcServer.
|
|
711
|
+
* const picServer = await PocketIcServer.start();
|
|
712
712
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
713
713
|
*
|
|
714
714
|
* await pic.resetTime();
|
|
@@ -733,7 +733,7 @@ class PocketIc {
|
|
|
733
733
|
* ```ts
|
|
734
734
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
735
735
|
*
|
|
736
|
-
* const picServer = await PocketIcServer.
|
|
736
|
+
* const picServer = await PocketIcServer.start();
|
|
737
737
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
738
738
|
*
|
|
739
739
|
* await pic.resetCertifiedTime();
|
|
@@ -765,7 +765,7 @@ class PocketIc {
|
|
|
765
765
|
*
|
|
766
766
|
* const date = new Date();
|
|
767
767
|
*
|
|
768
|
-
* const picServer = await PocketIcServer.
|
|
768
|
+
* const picServer = await PocketIcServer.start();
|
|
769
769
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
770
770
|
*
|
|
771
771
|
* await pic.setTime(date);
|
|
@@ -802,7 +802,7 @@ class PocketIc {
|
|
|
802
802
|
*
|
|
803
803
|
* const date = new Date();
|
|
804
804
|
*
|
|
805
|
-
* const picServer = await PocketIcServer.
|
|
805
|
+
* const picServer = await PocketIcServer.start();
|
|
806
806
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
807
807
|
*
|
|
808
808
|
* await pic.setCertifiedTime(date);
|
|
@@ -835,7 +835,7 @@ class PocketIc {
|
|
|
835
835
|
* ```ts
|
|
836
836
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
837
837
|
*
|
|
838
|
-
* const picServer = await PocketIcServer.
|
|
838
|
+
* const picServer = await PocketIcServer.start();
|
|
839
839
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
840
840
|
*
|
|
841
841
|
* const initialTime = await pic.getTime();
|
|
@@ -865,7 +865,7 @@ class PocketIc {
|
|
|
865
865
|
* ```ts
|
|
866
866
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
867
867
|
*
|
|
868
|
-
* const picServer = await PocketIcServer.
|
|
868
|
+
* const picServer = await PocketIcServer.start();
|
|
869
869
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
870
870
|
*
|
|
871
871
|
* const initialTime = await pic.getTime();
|
|
@@ -892,7 +892,7 @@ class PocketIc {
|
|
|
892
892
|
* ```ts
|
|
893
893
|
* import { PocketIc, PocketIcServer } from '@dfinity/pic';
|
|
894
894
|
*
|
|
895
|
-
* const picServer = await PocketIcServer.
|
|
895
|
+
* const picServer = await PocketIcServer.start();
|
|
896
896
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
897
897
|
*
|
|
898
898
|
* const subnets = pic.getApplicationSubnets();
|
|
@@ -911,7 +911,7 @@ class PocketIc {
|
|
|
911
911
|
* @param canisterId The Principal of the canister to get the subnet Id of.
|
|
912
912
|
* @returns The canister's subnet Id if the canister exists, `null` otherwise.
|
|
913
913
|
*
|
|
914
|
-
* @see [Principal](https://
|
|
914
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
915
915
|
*
|
|
916
916
|
* @example
|
|
917
917
|
* ```ts
|
|
@@ -919,7 +919,7 @@ class PocketIc {
|
|
|
919
919
|
*
|
|
920
920
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
921
921
|
*
|
|
922
|
-
* const picServer = await PocketIcServer.
|
|
922
|
+
* const picServer = await PocketIcServer.start();
|
|
923
923
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
924
924
|
*
|
|
925
925
|
* const subnetId = await pic.getCanisterSubnetId(canisterId);
|
|
@@ -1027,7 +1027,7 @@ class PocketIc {
|
|
|
1027
1027
|
* @param canisterId The Principal of the canister to check.
|
|
1028
1028
|
* @returns The current cycles balance of the canister.
|
|
1029
1029
|
*
|
|
1030
|
-
* @see [Principal](https://
|
|
1030
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
1031
1031
|
*
|
|
1032
1032
|
* @example
|
|
1033
1033
|
* ```ts
|
|
@@ -1036,7 +1036,7 @@ class PocketIc {
|
|
|
1036
1036
|
*
|
|
1037
1037
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
1038
1038
|
*
|
|
1039
|
-
* const picServer = await PocketIcServer.
|
|
1039
|
+
* const picServer = await PocketIcServer.start();
|
|
1040
1040
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
1041
1041
|
*
|
|
1042
1042
|
* const cyclesBalance = await pic.getCyclesBalance(canisterId);
|
|
@@ -1056,7 +1056,7 @@ class PocketIc {
|
|
|
1056
1056
|
* @param amount The amount of cycles to add.
|
|
1057
1057
|
* @returns The new cycle balance of the canister.
|
|
1058
1058
|
*
|
|
1059
|
-
* @see [Principal](https://
|
|
1059
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
1060
1060
|
*
|
|
1061
1061
|
* @example
|
|
1062
1062
|
* ```ts
|
|
@@ -1065,7 +1065,7 @@ class PocketIc {
|
|
|
1065
1065
|
*
|
|
1066
1066
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
1067
1067
|
*
|
|
1068
|
-
* const picServer = await PocketIcServer.
|
|
1068
|
+
* const picServer = await PocketIcServer.start();
|
|
1069
1069
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
1070
1070
|
*
|
|
1071
1071
|
* const newCyclesBalance = await pic.addCycles(canisterId, 10_000_000);
|
|
@@ -1084,7 +1084,7 @@ class PocketIc {
|
|
|
1084
1084
|
* @param canisterId The Principal of the canister to set the stable memory of.
|
|
1085
1085
|
* @param stableMemory A blob containing the stable memory to set.
|
|
1086
1086
|
*
|
|
1087
|
-
* @see [Principal](https://
|
|
1087
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
1088
1088
|
*
|
|
1089
1089
|
* @example
|
|
1090
1090
|
* ```ts
|
|
@@ -1094,7 +1094,7 @@ class PocketIc {
|
|
|
1094
1094
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
1095
1095
|
* const stableMemory = new Uint8Array([0, 1, 2, 3, 4]);
|
|
1096
1096
|
*
|
|
1097
|
-
* const picServer = await PocketIcServer.
|
|
1097
|
+
* const picServer = await PocketIcServer.start();
|
|
1098
1098
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
1099
1099
|
*
|
|
1100
1100
|
* await pic.setStableMemory(canisterId, stableMemory);
|
|
@@ -1115,7 +1115,7 @@ class PocketIc {
|
|
|
1115
1115
|
* @param canisterId The Principal of the canister to get the stable memory of.
|
|
1116
1116
|
* @returns A blob containing the canister's stable memory.
|
|
1117
1117
|
*
|
|
1118
|
-
* @see [Principal](https://
|
|
1118
|
+
* @see [Principal](https://js.icp.build/core/latest/libs/principal/api/classes/principal/)
|
|
1119
1119
|
*
|
|
1120
1120
|
* @example
|
|
1121
1121
|
* ```ts
|
|
@@ -1124,7 +1124,7 @@ class PocketIc {
|
|
|
1124
1124
|
*
|
|
1125
1125
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
1126
1126
|
*
|
|
1127
|
-
* const picServer = await PocketIcServer.
|
|
1127
|
+
* const picServer = await PocketIcServer.start();
|
|
1128
1128
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
1129
1129
|
*
|
|
1130
1130
|
* const stableMemory = await pic.getStableMemory(canisterId);
|
|
@@ -1150,7 +1150,7 @@ class PocketIc {
|
|
|
1150
1150
|
*
|
|
1151
1151
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
1152
1152
|
*
|
|
1153
|
-
* const picServer = await PocketIcServer.
|
|
1153
|
+
* const picServer = await PocketIcServer.start();
|
|
1154
1154
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
1155
1155
|
*
|
|
1156
1156
|
* // queue the canister message that will send the HTTPS Outcall
|
|
@@ -1200,7 +1200,7 @@ class PocketIc {
|
|
|
1200
1200
|
*
|
|
1201
1201
|
* const canisterId = Principal.fromUint8Array(new Uint8Array([0]));
|
|
1202
1202
|
*
|
|
1203
|
-
* const picServer = await PocketIcServer.
|
|
1203
|
+
* const picServer = await PocketIcServer.start();
|
|
1204
1204
|
* const pic = await PocketIc.create(picServer.getUrl());
|
|
1205
1205
|
*
|
|
1206
1206
|
* // queue the canister message that will send the HTTPS Outcall
|
package/dist/util/candid.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IDL } from '@dfinity/candid';
|
|
2
2
|
export declare function optional<T>(value: T | undefined | null): [] | [T];
|
|
3
|
-
export declare function decodeCandid<T>(types: IDL.Type[], data:
|
|
3
|
+
export declare function decodeCandid<T>(types: IDL.Type[], data: Uint8Array): T | null;
|
package/dist/util/candid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candid.js","sourceRoot":"","sources":["../../src/util/candid.ts"],"names":[],"mappings":";;AAGA,4BAEC;AAED,
|
|
1
|
+
{"version":3,"file":"candid.js","sourceRoot":"","sources":["../../src/util/candid.ts"],"names":[],"mappings":";;AAGA,4BAEC;AAED,oCAWC;AAlBD,4CAAsC;AACtC,qCAAiC;AAEjC,SAAgB,QAAQ,CAAI,KAA2B;IACrD,OAAO,IAAA,cAAK,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,YAAY,CAAI,KAAiB,EAAE,IAAgB;IACjE,MAAM,YAAY,GAAG,YAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAE7C,QAAQ,YAAY,CAAC,MAAM,EAAE,CAAC;QAC5B,KAAK,CAAC;YACJ,OAAO,IAAI,CAAC;QACd,KAAK,CAAC;YACJ,OAAO,YAAY,CAAC,CAAC,CAAM,CAAC;QAC9B;YACE,OAAO,YAAiB,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfinity/pic",
|
|
3
3
|
"description": "An Internet Computer Protocol canister testing library for TypeScript and JavaScript.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.1",
|
|
5
5
|
"author": "DFINITY Stiftung",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": "github:dfinity/pic-js",
|
|
8
8
|
"bugs": "https://github.com/dfinity/pic-js/issues",
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://js.icp.build/pic-js/",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"internet-computer",
|
|
12
12
|
"internet-computer-protocol",
|
|
@@ -29,12 +29,10 @@
|
|
|
29
29
|
"postinstall": "node ./postinstall.mjs"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@dfinity/agent": "^3.2.4",
|
|
33
|
+
"@dfinity/candid": "^3.2.4",
|
|
34
|
+
"@dfinity/identity": "^3.2.4",
|
|
35
|
+
"@dfinity/principal": "^3.2.4",
|
|
32
36
|
"bip39": "^3.1.0"
|
|
33
|
-
},
|
|
34
|
-
"peerDependencies": {
|
|
35
|
-
"@dfinity/agent": "^2.3.0",
|
|
36
|
-
"@dfinity/candid": "^2.3.0",
|
|
37
|
-
"@dfinity/identity": "^2.3.0",
|
|
38
|
-
"@dfinity/principal": "^2.3.0"
|
|
39
37
|
}
|
|
40
38
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -9,7 +9,7 @@ const __dirname = dirname(__filename);
|
|
|
9
9
|
|
|
10
10
|
const IS_LINUX = process.platform === 'linux';
|
|
11
11
|
const PLATFORM = IS_LINUX ? 'x86_64-linux' : 'x86_64-darwin';
|
|
12
|
-
const VERSION = '
|
|
12
|
+
const VERSION = '10.0.0';
|
|
13
13
|
const DOWNLOAD_PATH = `https://github.com/dfinity/pocketic/releases/download/${VERSION}/pocket-ic-${PLATFORM}.gz`;
|
|
14
14
|
|
|
15
15
|
const TARGET_PATH = resolve(__dirname, 'pocket-ic');
|