@junobuild/admin 0.0.20 → 0.0.21

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.
Files changed (73) hide show
  1. package/declarations/cmc/index.js +6 -1
  2. package/declarations/console/console.did.d.ts +5 -4
  3. package/declarations/console/console.factory.did.js +3 -2
  4. package/declarations/console/console.factory.did.mjs +3 -2
  5. package/declarations/console/index.js +6 -1
  6. package/declarations/ic/ic.did +131 -18
  7. package/declarations/ic/ic.did.d.ts +184 -53
  8. package/declarations/ic/ic.factory.did.js +167 -24
  9. package/declarations/mission_control/index.js +7 -1
  10. package/declarations/mission_control/mission_control.did.d.ts +1 -0
  11. package/declarations/mission_control/mission_control.factory.did.js +5 -0
  12. package/declarations/observatory/index.js +7 -1
  13. package/declarations/satellite/index.js +6 -1
  14. package/declarations/satellite/satellite.did.d.ts +1 -0
  15. package/declarations/satellite/satellite.factory.did.js +1 -0
  16. package/declarations/satellite/satellite.factory.did.mjs +1 -0
  17. package/dist/browser/index.js +15 -15
  18. package/dist/browser/index.js.map +4 -4
  19. package/dist/declarations/cmc/index.js +6 -1
  20. package/dist/declarations/console/console.did.d.ts +5 -4
  21. package/dist/declarations/console/console.factory.did.js +3 -2
  22. package/dist/declarations/console/console.factory.did.mjs +3 -2
  23. package/dist/declarations/console/index.js +6 -1
  24. package/dist/declarations/ic/ic.did +131 -18
  25. package/dist/declarations/ic/ic.did.d.ts +184 -53
  26. package/dist/declarations/ic/ic.factory.did.js +167 -24
  27. package/dist/declarations/mission_control/index.js +7 -1
  28. package/dist/declarations/mission_control/mission_control.did.d.ts +1 -0
  29. package/dist/declarations/mission_control/mission_control.factory.did.js +5 -0
  30. package/dist/declarations/observatory/index.js +7 -1
  31. package/dist/declarations/satellite/index.js +6 -1
  32. package/dist/declarations/satellite/satellite.did.d.ts +1 -0
  33. package/dist/declarations/satellite/satellite.factory.did.js +1 -0
  34. package/dist/declarations/satellite/satellite.factory.did.mjs +1 -0
  35. package/dist/node/index.mjs +19 -19
  36. package/dist/node/index.mjs.map +4 -4
  37. package/dist/types/api/ic.api.d.ts +1 -1
  38. package/dist/types/constants/config.constants.d.ts +2 -0
  39. package/dist/types/services/mission-control.services.d.ts +1 -1
  40. package/dist/types/services/satellite.services.d.ts +2 -2
  41. package/dist/types/types/config.types.d.ts +9 -3
  42. package/dist/types/types/ic.types.d.ts +2 -1
  43. package/package.json +1 -1
  44. package/declarations/frontend/frontend.did +0 -188
  45. package/declarations/frontend/frontend.did.d.ts +0 -172
  46. package/declarations/frontend/frontend.factory.did.js +0 -210
  47. package/declarations/frontend/index.d.ts +0 -45
  48. package/declarations/frontend/index.js +0 -32
  49. package/declarations/internet_identity/index.d.ts +0 -45
  50. package/declarations/internet_identity/index.js +0 -32
  51. package/declarations/internet_identity/internet_identity.did +0 -378
  52. package/declarations/internet_identity/internet_identity.did.d.ts +0 -231
  53. package/declarations/internet_identity/internet_identity.factory.did.js +0 -277
  54. package/declarations/ledger/index.d.ts +0 -45
  55. package/declarations/ledger/index.js +0 -32
  56. package/declarations/ledger/ledger.did +0 -266
  57. package/declarations/ledger/ledger.did.d.ts +0 -117
  58. package/declarations/ledger/ledger.factory.did.js +0 -115
  59. package/dist/declarations/frontend/frontend.did +0 -188
  60. package/dist/declarations/frontend/frontend.did.d.ts +0 -172
  61. package/dist/declarations/frontend/frontend.factory.did.js +0 -210
  62. package/dist/declarations/frontend/index.d.ts +0 -45
  63. package/dist/declarations/frontend/index.js +0 -32
  64. package/dist/declarations/internet_identity/index.d.ts +0 -45
  65. package/dist/declarations/internet_identity/index.js +0 -32
  66. package/dist/declarations/internet_identity/internet_identity.did +0 -378
  67. package/dist/declarations/internet_identity/internet_identity.did.d.ts +0 -231
  68. package/dist/declarations/internet_identity/internet_identity.factory.did.js +0 -277
  69. package/dist/declarations/ledger/index.d.ts +0 -45
  70. package/dist/declarations/ledger/index.js +0 -32
  71. package/dist/declarations/ledger/ledger.did +0 -266
  72. package/dist/declarations/ledger/ledger.did.d.ts +0 -117
  73. package/dist/declarations/ledger/ledger.factory.did.js +0 -115
@@ -1,172 +0,0 @@
1
- import type {ActorMethod} from '@dfinity/agent';
2
- import type {Principal} from '@dfinity/principal';
3
-
4
- export type BatchId = bigint;
5
- export type BatchOperationKind =
6
- | {CreateAsset: CreateAssetArguments}
7
- | {UnsetAssetContent: UnsetAssetContentArguments}
8
- | {DeleteAsset: DeleteAssetArguments}
9
- | {SetAssetContent: SetAssetContentArguments}
10
- | {Clear: ClearArguments};
11
- export type ChunkId = bigint;
12
- export type ClearArguments = {};
13
- export interface CreateAssetArguments {
14
- key: Key;
15
- content_type: string;
16
- headers: [] | [Array<HeaderField>];
17
- allow_raw_access: [] | [boolean];
18
- max_age: [] | [bigint];
19
- enable_aliasing: [] | [boolean];
20
- }
21
- export interface DeleteAssetArguments {
22
- key: Key;
23
- }
24
- export interface GrantPermission {
25
- permission: Permission;
26
- to_principal: Principal;
27
- }
28
- export type HeaderField = [string, string];
29
- export interface HttpRequest {
30
- url: string;
31
- method: string;
32
- body: Uint8Array | number[];
33
- headers: Array<HeaderField>;
34
- }
35
- export interface HttpResponse {
36
- body: Uint8Array | number[];
37
- headers: Array<HeaderField>;
38
- streaming_strategy: [] | [StreamingStrategy];
39
- status_code: number;
40
- }
41
- export type Key = string;
42
- export interface ListPermitted {
43
- permission: Permission;
44
- }
45
- export type Permission = {Prepare: null} | {ManagePermissions: null} | {Commit: null};
46
- export interface RevokePermission {
47
- permission: Permission;
48
- of_principal: Principal;
49
- }
50
- export interface SetAssetContentArguments {
51
- key: Key;
52
- sha256: [] | [Uint8Array | number[]];
53
- chunk_ids: Array<ChunkId>;
54
- content_encoding: string;
55
- }
56
- export interface SetAssetPropertiesArguments {
57
- key: Key;
58
- headers: [] | [[] | [Array<HeaderField>]];
59
- allow_raw_access: [] | [[] | [boolean]];
60
- max_age: [] | [[] | [bigint]];
61
- }
62
- export interface StreamingCallbackHttpResponse {
63
- token: [] | [StreamingCallbackToken];
64
- body: Uint8Array | number[];
65
- }
66
- export interface StreamingCallbackToken {
67
- key: Key;
68
- sha256: [] | [Uint8Array | number[]];
69
- index: bigint;
70
- content_encoding: string;
71
- }
72
- export type StreamingStrategy = {
73
- Callback: {
74
- token: StreamingCallbackToken;
75
- callback: [Principal, string];
76
- };
77
- };
78
- export type Time = bigint;
79
- export interface UnsetAssetContentArguments {
80
- key: Key;
81
- content_encoding: string;
82
- }
83
- export type ValidationResult = {Ok: string} | {Err: string};
84
- export interface _SERVICE {
85
- authorize: ActorMethod<[Principal], undefined>;
86
- certified_tree: ActorMethod<
87
- [{}],
88
- {certificate: Uint8Array | number[]; tree: Uint8Array | number[]}
89
- >;
90
- clear: ActorMethod<[ClearArguments], undefined>;
91
- commit_batch: ActorMethod<
92
- [{batch_id: BatchId; operations: Array<BatchOperationKind>}],
93
- undefined
94
- >;
95
- create_asset: ActorMethod<[CreateAssetArguments], undefined>;
96
- create_batch: ActorMethod<[{}], {batch_id: BatchId}>;
97
- create_chunk: ActorMethod<
98
- [{content: Uint8Array | number[]; batch_id: BatchId}],
99
- {chunk_id: ChunkId}
100
- >;
101
- deauthorize: ActorMethod<[Principal], undefined>;
102
- delete_asset: ActorMethod<[DeleteAssetArguments], undefined>;
103
- get: ActorMethod<
104
- [{key: Key; accept_encodings: Array<string>}],
105
- {
106
- content: Uint8Array | number[];
107
- sha256: [] | [Uint8Array | number[]];
108
- content_type: string;
109
- content_encoding: string;
110
- total_length: bigint;
111
- }
112
- >;
113
- get_asset_properties: ActorMethod<
114
- [Key],
115
- {
116
- headers: [] | [Array<HeaderField>];
117
- allow_raw_access: [] | [boolean];
118
- max_age: [] | [bigint];
119
- }
120
- >;
121
- get_chunk: ActorMethod<
122
- [
123
- {
124
- key: Key;
125
- sha256: [] | [Uint8Array | number[]];
126
- index: bigint;
127
- content_encoding: string;
128
- }
129
- ],
130
- {content: Uint8Array | number[]}
131
- >;
132
- grant_permission: ActorMethod<[GrantPermission], undefined>;
133
- http_request: ActorMethod<[HttpRequest], HttpResponse>;
134
- http_request_streaming_callback: ActorMethod<
135
- [StreamingCallbackToken],
136
- [] | [StreamingCallbackHttpResponse]
137
- >;
138
- list: ActorMethod<
139
- [{}],
140
- Array<{
141
- key: Key;
142
- encodings: Array<{
143
- modified: Time;
144
- sha256: [] | [Uint8Array | number[]];
145
- length: bigint;
146
- content_encoding: string;
147
- }>;
148
- content_type: string;
149
- }>
150
- >;
151
- list_authorized: ActorMethod<[], Array<Principal>>;
152
- list_permitted: ActorMethod<[ListPermitted], Array<Principal>>;
153
- revoke_permission: ActorMethod<[RevokePermission], undefined>;
154
- set_asset_content: ActorMethod<[SetAssetContentArguments], undefined>;
155
- set_asset_properties: ActorMethod<[SetAssetPropertiesArguments], undefined>;
156
- store: ActorMethod<
157
- [
158
- {
159
- key: Key;
160
- content: Uint8Array | number[];
161
- sha256: [] | [Uint8Array | number[]];
162
- content_type: string;
163
- content_encoding: string;
164
- }
165
- ],
166
- undefined
167
- >;
168
- take_ownership: ActorMethod<[], undefined>;
169
- unset_asset_content: ActorMethod<[UnsetAssetContentArguments], undefined>;
170
- validate_grant_permission: ActorMethod<[GrantPermission], ValidationResult>;
171
- validate_revoke_permission: ActorMethod<[RevokePermission], ValidationResult>;
172
- }
@@ -1,210 +0,0 @@
1
- // @ts-ignore
2
- export const idlFactory = ({IDL}) => {
3
- const ClearArguments = IDL.Record({});
4
- const BatchId = IDL.Nat;
5
- const Key = IDL.Text;
6
- const HeaderField = IDL.Tuple(IDL.Text, IDL.Text);
7
- const CreateAssetArguments = IDL.Record({
8
- key: Key,
9
- content_type: IDL.Text,
10
- headers: IDL.Opt(IDL.Vec(HeaderField)),
11
- allow_raw_access: IDL.Opt(IDL.Bool),
12
- max_age: IDL.Opt(IDL.Nat64),
13
- enable_aliasing: IDL.Opt(IDL.Bool)
14
- });
15
- const UnsetAssetContentArguments = IDL.Record({
16
- key: Key,
17
- content_encoding: IDL.Text
18
- });
19
- const DeleteAssetArguments = IDL.Record({key: Key});
20
- const ChunkId = IDL.Nat;
21
- const SetAssetContentArguments = IDL.Record({
22
- key: Key,
23
- sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
24
- chunk_ids: IDL.Vec(ChunkId),
25
- content_encoding: IDL.Text
26
- });
27
- const BatchOperationKind = IDL.Variant({
28
- CreateAsset: CreateAssetArguments,
29
- UnsetAssetContent: UnsetAssetContentArguments,
30
- DeleteAsset: DeleteAssetArguments,
31
- SetAssetContent: SetAssetContentArguments,
32
- Clear: ClearArguments
33
- });
34
- const Permission = IDL.Variant({
35
- Prepare: IDL.Null,
36
- ManagePermissions: IDL.Null,
37
- Commit: IDL.Null
38
- });
39
- const GrantPermission = IDL.Record({
40
- permission: Permission,
41
- to_principal: IDL.Principal
42
- });
43
- const HttpRequest = IDL.Record({
44
- url: IDL.Text,
45
- method: IDL.Text,
46
- body: IDL.Vec(IDL.Nat8),
47
- headers: IDL.Vec(HeaderField)
48
- });
49
- const StreamingCallbackToken = IDL.Record({
50
- key: Key,
51
- sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
52
- index: IDL.Nat,
53
- content_encoding: IDL.Text
54
- });
55
- const StreamingCallbackHttpResponse = IDL.Record({
56
- token: IDL.Opt(StreamingCallbackToken),
57
- body: IDL.Vec(IDL.Nat8)
58
- });
59
- const StreamingStrategy = IDL.Variant({
60
- Callback: IDL.Record({
61
- token: StreamingCallbackToken,
62
- callback: IDL.Func(
63
- [StreamingCallbackToken],
64
- [IDL.Opt(StreamingCallbackHttpResponse)],
65
- ['query']
66
- )
67
- })
68
- });
69
- const HttpResponse = IDL.Record({
70
- body: IDL.Vec(IDL.Nat8),
71
- headers: IDL.Vec(HeaderField),
72
- streaming_strategy: IDL.Opt(StreamingStrategy),
73
- status_code: IDL.Nat16
74
- });
75
- const Time = IDL.Int;
76
- const ListPermitted = IDL.Record({permission: Permission});
77
- const RevokePermission = IDL.Record({
78
- permission: Permission,
79
- of_principal: IDL.Principal
80
- });
81
- const SetAssetPropertiesArguments = IDL.Record({
82
- key: Key,
83
- headers: IDL.Opt(IDL.Opt(IDL.Vec(HeaderField))),
84
- allow_raw_access: IDL.Opt(IDL.Opt(IDL.Bool)),
85
- max_age: IDL.Opt(IDL.Opt(IDL.Nat64))
86
- });
87
- const ValidationResult = IDL.Variant({Ok: IDL.Text, Err: IDL.Text});
88
- return IDL.Service({
89
- authorize: IDL.Func([IDL.Principal], [], []),
90
- certified_tree: IDL.Func(
91
- [IDL.Record({})],
92
- [
93
- IDL.Record({
94
- certificate: IDL.Vec(IDL.Nat8),
95
- tree: IDL.Vec(IDL.Nat8)
96
- })
97
- ],
98
- ['query']
99
- ),
100
- clear: IDL.Func([ClearArguments], [], []),
101
- commit_batch: IDL.Func(
102
- [
103
- IDL.Record({
104
- batch_id: BatchId,
105
- operations: IDL.Vec(BatchOperationKind)
106
- })
107
- ],
108
- [],
109
- []
110
- ),
111
- create_asset: IDL.Func([CreateAssetArguments], [], []),
112
- create_batch: IDL.Func([IDL.Record({})], [IDL.Record({batch_id: BatchId})], []),
113
- create_chunk: IDL.Func(
114
- [IDL.Record({content: IDL.Vec(IDL.Nat8), batch_id: BatchId})],
115
- [IDL.Record({chunk_id: ChunkId})],
116
- []
117
- ),
118
- deauthorize: IDL.Func([IDL.Principal], [], []),
119
- delete_asset: IDL.Func([DeleteAssetArguments], [], []),
120
- get: IDL.Func(
121
- [IDL.Record({key: Key, accept_encodings: IDL.Vec(IDL.Text)})],
122
- [
123
- IDL.Record({
124
- content: IDL.Vec(IDL.Nat8),
125
- sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
126
- content_type: IDL.Text,
127
- content_encoding: IDL.Text,
128
- total_length: IDL.Nat
129
- })
130
- ],
131
- ['query']
132
- ),
133
- get_asset_properties: IDL.Func(
134
- [Key],
135
- [
136
- IDL.Record({
137
- headers: IDL.Opt(IDL.Vec(HeaderField)),
138
- allow_raw_access: IDL.Opt(IDL.Bool),
139
- max_age: IDL.Opt(IDL.Nat64)
140
- })
141
- ],
142
- ['query']
143
- ),
144
- get_chunk: IDL.Func(
145
- [
146
- IDL.Record({
147
- key: Key,
148
- sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
149
- index: IDL.Nat,
150
- content_encoding: IDL.Text
151
- })
152
- ],
153
- [IDL.Record({content: IDL.Vec(IDL.Nat8)})],
154
- ['query']
155
- ),
156
- grant_permission: IDL.Func([GrantPermission], [], []),
157
- http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
158
- http_request_streaming_callback: IDL.Func(
159
- [StreamingCallbackToken],
160
- [IDL.Opt(StreamingCallbackHttpResponse)],
161
- ['query']
162
- ),
163
- list: IDL.Func(
164
- [IDL.Record({})],
165
- [
166
- IDL.Vec(
167
- IDL.Record({
168
- key: Key,
169
- encodings: IDL.Vec(
170
- IDL.Record({
171
- modified: Time,
172
- sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
173
- length: IDL.Nat,
174
- content_encoding: IDL.Text
175
- })
176
- ),
177
- content_type: IDL.Text
178
- })
179
- )
180
- ],
181
- ['query']
182
- ),
183
- list_authorized: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
184
- list_permitted: IDL.Func([ListPermitted], [IDL.Vec(IDL.Principal)], ['query']),
185
- revoke_permission: IDL.Func([RevokePermission], [], []),
186
- set_asset_content: IDL.Func([SetAssetContentArguments], [], []),
187
- set_asset_properties: IDL.Func([SetAssetPropertiesArguments], [], []),
188
- store: IDL.Func(
189
- [
190
- IDL.Record({
191
- key: Key,
192
- content: IDL.Vec(IDL.Nat8),
193
- sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
194
- content_type: IDL.Text,
195
- content_encoding: IDL.Text
196
- })
197
- ],
198
- [],
199
- []
200
- ),
201
- take_ownership: IDL.Func([], [], []),
202
- unset_asset_content: IDL.Func([UnsetAssetContentArguments], [], []),
203
- validate_grant_permission: IDL.Func([GrantPermission], [ValidationResult], []),
204
- validate_revoke_permission: IDL.Func([RevokePermission], [ValidationResult], [])
205
- });
206
- };
207
- // @ts-ignore
208
- export const init = ({IDL}) => {
209
- return [];
210
- };
@@ -1,45 +0,0 @@
1
- import type {ActorConfig, ActorSubclass, Agent, HttpAgentOptions} from '@dfinity/agent';
2
- import type {IDL} from '@dfinity/candid';
3
- import type {Principal} from '@dfinity/principal';
4
-
5
- import {_SERVICE} from './frontend.did';
6
-
7
- export declare const idlFactory: IDL.InterfaceFactory;
8
- export declare const canisterId: string;
9
-
10
- export declare interface CreateActorOptions {
11
- /**
12
- * @see {@link Agent}
13
- */
14
- agent?: Agent;
15
- /**
16
- * @see {@link HttpAgentOptions}
17
- */
18
- agentOptions?: HttpAgentOptions;
19
- /**
20
- * @see {@link ActorConfig}
21
- */
22
- actorOptions?: ActorConfig;
23
- }
24
-
25
- /**
26
- * Intializes an {@link ActorSubclass}, configured with the provided SERVICE interface of a canister.
27
- * @constructs {@link ActorSubClass}
28
- * @param {string | Principal} canisterId - ID of the canister the {@link Actor} will talk to
29
- * @param {CreateActorOptions} options - see {@link CreateActorOptions}
30
- * @param {CreateActorOptions["agent"]} options.agent - a pre-configured agent you'd like to use. Supercedes agentOptions
31
- * @param {CreateActorOptions["agentOptions"]} options.agentOptions - options to set up a new agent
32
- * @see {@link HttpAgentOptions}
33
- * @param {CreateActorOptions["actorOptions"]} options.actorOptions - options for the Actor
34
- * @see {@link ActorConfig}
35
- */
36
- export declare const createActor: (
37
- canisterId: string | Principal,
38
- options?: CreateActorOptions
39
- ) => ActorSubclass<_SERVICE>;
40
-
41
- /**
42
- * Intialized Actor using default settings, ready to talk to a canister using its candid interface
43
- * @constructs {@link ActorSubClass}
44
- */
45
- export declare const frontend: ActorSubclass<_SERVICE>;
@@ -1,32 +0,0 @@
1
- import {Actor, HttpAgent} from '@dfinity/agent';
2
-
3
- // Imports and re-exports candid interface
4
- import {idlFactory} from './frontend.did.js';
5
- export {idlFactory} from './frontend.did.js';
6
-
7
- // CANISTER_ID is replaced by webpack based on node environment
8
-
9
- export const createActor = (canisterId, options = {}) => {
10
- const agent = options.agent || new HttpAgent({...options.agentOptions});
11
-
12
- if (options.agent && options.agentOptions) {
13
- console.warn(
14
- 'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
15
- );
16
- }
17
-
18
- // Fetch root key for certificate validation during development
19
- if (process.env.DFX_NETWORK !== 'ic') {
20
- agent.fetchRootKey().catch((err) => {
21
- console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
22
- console.error(err);
23
- });
24
- }
25
-
26
- // Creates an actor with using the candid interface and the HttpAgent
27
- return Actor.createActor(idlFactory, {
28
- agent,
29
- canisterId,
30
- ...options.actorOptions
31
- });
32
- };
@@ -1,45 +0,0 @@
1
- import type {ActorConfig, ActorSubclass, Agent, HttpAgentOptions} from '@dfinity/agent';
2
- import type {IDL} from '@dfinity/candid';
3
- import type {Principal} from '@dfinity/principal';
4
-
5
- import {_SERVICE} from './internet_identity.did';
6
-
7
- export declare const idlFactory: IDL.InterfaceFactory;
8
- export declare const canisterId: string;
9
-
10
- export declare interface CreateActorOptions {
11
- /**
12
- * @see {@link Agent}
13
- */
14
- agent?: Agent;
15
- /**
16
- * @see {@link HttpAgentOptions}
17
- */
18
- agentOptions?: HttpAgentOptions;
19
- /**
20
- * @see {@link ActorConfig}
21
- */
22
- actorOptions?: ActorConfig;
23
- }
24
-
25
- /**
26
- * Intializes an {@link ActorSubclass}, configured with the provided SERVICE interface of a canister.
27
- * @constructs {@link ActorSubClass}
28
- * @param {string | Principal} canisterId - ID of the canister the {@link Actor} will talk to
29
- * @param {CreateActorOptions} options - see {@link CreateActorOptions}
30
- * @param {CreateActorOptions["agent"]} options.agent - a pre-configured agent you'd like to use. Supercedes agentOptions
31
- * @param {CreateActorOptions["agentOptions"]} options.agentOptions - options to set up a new agent
32
- * @see {@link HttpAgentOptions}
33
- * @param {CreateActorOptions["actorOptions"]} options.actorOptions - options for the Actor
34
- * @see {@link ActorConfig}
35
- */
36
- export declare const createActor: (
37
- canisterId: string | Principal,
38
- options?: CreateActorOptions
39
- ) => ActorSubclass<_SERVICE>;
40
-
41
- /**
42
- * Intialized Actor using default settings, ready to talk to a canister using its candid interface
43
- * @constructs {@link ActorSubClass}
44
- */
45
- export declare const internet_identity: ActorSubclass<_SERVICE>;
@@ -1,32 +0,0 @@
1
- import {Actor, HttpAgent} from '@dfinity/agent';
2
-
3
- // Imports and re-exports candid interface
4
- import {idlFactory} from './internet_identity.did.js';
5
- export {idlFactory} from './internet_identity.did.js';
6
-
7
- // CANISTER_ID is replaced by webpack based on node environment
8
-
9
- export const createActor = (canisterId, options = {}) => {
10
- const agent = options.agent || new HttpAgent({...options.agentOptions});
11
-
12
- if (options.agent && options.agentOptions) {
13
- console.warn(
14
- 'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
15
- );
16
- }
17
-
18
- // Fetch root key for certificate validation during development
19
- if (process.env.DFX_NETWORK !== 'ic') {
20
- agent.fetchRootKey().catch((err) => {
21
- console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
22
- console.error(err);
23
- });
24
- }
25
-
26
- // Creates an actor with using the candid interface and the HttpAgent
27
- return Actor.createActor(idlFactory, {
28
- agent,
29
- canisterId,
30
- ...options.actorOptions
31
- });
32
- };