@junobuild/admin 0.0.47 → 0.0.48-next-2024-05-17.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/declarations/ic/ic.did.d.ts +220 -140
- package/declarations/ic/ic.factory.did.js +234 -169
- package/declarations/ic/ic.factory.did.mjs +339 -0
- package/declarations/orbiter/orbiter.did.d.ts +7 -2
- package/declarations/orbiter/orbiter.factory.did.js +8 -3
- package/declarations/orbiter/orbiter.factory.did.mjs +8 -3
- package/declarations/satellite/satellite.did.d.ts +17 -3
- package/declarations/satellite/satellite.factory.did.js +23 -6
- package/declarations/satellite/satellite.factory.did.mjs +23 -6
- package/dist/browser/index.js +7 -7
- package/dist/browser/index.js.map +3 -3
- package/dist/declarations/ic/ic.did.d.ts +220 -140
- package/dist/declarations/ic/ic.factory.did.js +234 -169
- package/dist/declarations/ic/ic.factory.did.mjs +339 -0
- package/dist/declarations/orbiter/orbiter.did.d.ts +7 -2
- package/dist/declarations/orbiter/orbiter.factory.did.js +8 -3
- package/dist/declarations/orbiter/orbiter.factory.did.mjs +8 -3
- package/dist/declarations/satellite/satellite.did.d.ts +17 -3
- package/dist/declarations/satellite/satellite.factory.did.js +23 -6
- package/dist/declarations/satellite/satellite.factory.did.mjs +23 -6
- package/dist/node/index.mjs +7 -7
- package/dist/node/index.mjs.map +3 -3
- package/dist/types/api/ic.api.d.ts +1 -1
- package/dist/types/api/satellite.api.d.ts +8 -1
- package/dist/types/services/orbiter.services.d.ts +1 -1
- package/dist/types/services/satellite.services.d.ts +10 -3
- package/dist/types/types/ic.types.d.ts +3 -11
- package/dist/types/utils/actor.utils.d.ts +1 -1
- package/dist/types/utils/rule.utils.d.ts +1 -1
- package/package.json +6 -6
- package/declarations/ic/ic.did +0 -195
- package/declarations/mission_control/index.d.ts +0 -45
- package/declarations/mission_control/index.js +0 -38
- package/declarations/orbiter/index.d.ts +0 -45
- package/declarations/orbiter/index.js +0 -37
- package/declarations/satellite/index.d.ts +0 -45
- package/declarations/satellite/index.js +0 -37
- package/dist/declarations/ic/ic.did +0 -195
- package/dist/declarations/mission_control/index.d.ts +0 -45
- package/dist/declarations/mission_control/index.js +0 -38
- package/dist/declarations/orbiter/index.d.ts +0 -45
- package/dist/declarations/orbiter/index.js +0 -37
- package/dist/declarations/satellite/index.d.ts +0 -45
- package/dist/declarations/satellite/index.js +0 -37
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
type canister_id = principal;
|
|
2
|
-
type wasm_module = blob;
|
|
3
|
-
|
|
4
|
-
type canister_settings = record {
|
|
5
|
-
controllers : opt vec principal;
|
|
6
|
-
compute_allocation : opt nat;
|
|
7
|
-
memory_allocation : opt nat;
|
|
8
|
-
freezing_threshold : opt nat;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
type definite_canister_settings = record {
|
|
12
|
-
controllers : vec principal;
|
|
13
|
-
compute_allocation : nat;
|
|
14
|
-
memory_allocation : nat;
|
|
15
|
-
freezing_threshold : nat;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
type change_origin = variant {
|
|
19
|
-
from_user : record {
|
|
20
|
-
user_id : principal;
|
|
21
|
-
};
|
|
22
|
-
from_canister : record {
|
|
23
|
-
canister_id : principal;
|
|
24
|
-
canister_version : opt nat64;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
type change_details = variant {
|
|
29
|
-
creation : record {
|
|
30
|
-
controllers : vec principal;
|
|
31
|
-
};
|
|
32
|
-
code_uninstall;
|
|
33
|
-
code_deployment : record {
|
|
34
|
-
mode : variant {install; reinstall; upgrade};
|
|
35
|
-
module_hash : blob;
|
|
36
|
-
};
|
|
37
|
-
controllers_change : record {
|
|
38
|
-
controllers : vec principal;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
type change = record {
|
|
43
|
-
timestamp_nanos : nat64;
|
|
44
|
-
canister_version : nat64;
|
|
45
|
-
origin : change_origin;
|
|
46
|
-
details : change_details;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
type http_header = record { name: text; value: text };
|
|
50
|
-
|
|
51
|
-
type http_response = record {
|
|
52
|
-
status: nat;
|
|
53
|
-
headers: vec http_header;
|
|
54
|
-
body: blob;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
type ecdsa_curve = variant { secp256k1; };
|
|
58
|
-
|
|
59
|
-
type satoshi = nat64;
|
|
60
|
-
|
|
61
|
-
type bitcoin_network = variant {
|
|
62
|
-
mainnet;
|
|
63
|
-
testnet;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
type bitcoin_address = text;
|
|
67
|
-
|
|
68
|
-
type block_hash = blob;
|
|
69
|
-
|
|
70
|
-
type outpoint = record {
|
|
71
|
-
txid : blob;
|
|
72
|
-
vout : nat32
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
type utxo = record {
|
|
76
|
-
outpoint: outpoint;
|
|
77
|
-
value: satoshi;
|
|
78
|
-
height: nat32;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
type get_utxos_request = record {
|
|
82
|
-
address : bitcoin_address;
|
|
83
|
-
network: bitcoin_network;
|
|
84
|
-
filter: opt variant {
|
|
85
|
-
min_confirmations: nat32;
|
|
86
|
-
page: blob;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
type get_current_fee_percentiles_request = record {
|
|
91
|
-
network: bitcoin_network;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
type get_utxos_response = record {
|
|
95
|
-
utxos: vec utxo;
|
|
96
|
-
tip_block_hash: block_hash;
|
|
97
|
-
tip_height: nat32;
|
|
98
|
-
next_page: opt blob;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
type get_balance_request = record {
|
|
102
|
-
address : bitcoin_address;
|
|
103
|
-
network: bitcoin_network;
|
|
104
|
-
min_confirmations: opt nat32;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
type send_transaction_request = record {
|
|
108
|
-
transaction: blob;
|
|
109
|
-
network: bitcoin_network;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
type millisatoshi_per_byte = nat64;
|
|
113
|
-
|
|
114
|
-
service ic : {
|
|
115
|
-
create_canister : (record {
|
|
116
|
-
settings : opt canister_settings;
|
|
117
|
-
sender_canister_version : opt nat64;
|
|
118
|
-
}) -> (record {canister_id : canister_id});
|
|
119
|
-
update_settings : (record {
|
|
120
|
-
canister_id : principal;
|
|
121
|
-
settings : canister_settings;
|
|
122
|
-
sender_canister_version : opt nat64;
|
|
123
|
-
}) -> ();
|
|
124
|
-
install_code : (record {
|
|
125
|
-
mode : variant {install; reinstall; upgrade};
|
|
126
|
-
canister_id : canister_id;
|
|
127
|
-
wasm_module : wasm_module;
|
|
128
|
-
arg : blob;
|
|
129
|
-
sender_canister_version : opt nat64;
|
|
130
|
-
}) -> ();
|
|
131
|
-
uninstall_code : (record {
|
|
132
|
-
canister_id : canister_id;
|
|
133
|
-
sender_canister_version : opt nat64;
|
|
134
|
-
}) -> ();
|
|
135
|
-
start_canister : (record {canister_id : canister_id}) -> ();
|
|
136
|
-
stop_canister : (record {canister_id : canister_id}) -> ();
|
|
137
|
-
canister_status : (record {canister_id : canister_id}) -> (record {
|
|
138
|
-
status : variant { running; stopping; stopped };
|
|
139
|
-
settings: definite_canister_settings;
|
|
140
|
-
module_hash: opt blob;
|
|
141
|
-
memory_size: nat;
|
|
142
|
-
cycles: nat;
|
|
143
|
-
idle_cycles_burned_per_day: nat;
|
|
144
|
-
});
|
|
145
|
-
canister_info : (record {
|
|
146
|
-
canister_id : canister_id;
|
|
147
|
-
num_requested_changes : opt nat64;
|
|
148
|
-
}) -> (record {
|
|
149
|
-
total_num_changes : nat64;
|
|
150
|
-
recent_changes : vec change;
|
|
151
|
-
module_hash : opt blob;
|
|
152
|
-
controllers : vec principal;
|
|
153
|
-
});
|
|
154
|
-
delete_canister : (record {canister_id : canister_id}) -> ();
|
|
155
|
-
deposit_cycles : (record {canister_id : canister_id}) -> ();
|
|
156
|
-
raw_rand : () -> (blob);
|
|
157
|
-
http_request : (record {
|
|
158
|
-
url : text;
|
|
159
|
-
max_response_bytes: opt nat64;
|
|
160
|
-
method : variant { get; head; post };
|
|
161
|
-
headers: vec http_header;
|
|
162
|
-
body : opt blob;
|
|
163
|
-
transform : opt record {
|
|
164
|
-
function : func (record {response : http_response; context : blob}) -> (http_response) query;
|
|
165
|
-
context : blob
|
|
166
|
-
};
|
|
167
|
-
}) -> (http_response);
|
|
168
|
-
|
|
169
|
-
// Threshold ECDSA signature
|
|
170
|
-
ecdsa_public_key : (record {
|
|
171
|
-
canister_id : opt canister_id;
|
|
172
|
-
derivation_path : vec blob;
|
|
173
|
-
key_id : record { curve: ecdsa_curve; name: text };
|
|
174
|
-
}) -> (record { public_key : blob; chain_code : blob; });
|
|
175
|
-
sign_with_ecdsa : (record {
|
|
176
|
-
message_hash : blob;
|
|
177
|
-
derivation_path : vec blob;
|
|
178
|
-
key_id : record { curve: ecdsa_curve; name: text };
|
|
179
|
-
}) -> (record { signature : blob });
|
|
180
|
-
|
|
181
|
-
// bitcoin interface
|
|
182
|
-
bitcoin_get_balance: (get_balance_request) -> (satoshi);
|
|
183
|
-
bitcoin_get_utxos: (get_utxos_request) -> (get_utxos_response);
|
|
184
|
-
bitcoin_send_transaction: (send_transaction_request) -> ();
|
|
185
|
-
bitcoin_get_current_fee_percentiles: (get_current_fee_percentiles_request) -> (vec millisatoshi_per_byte);
|
|
186
|
-
|
|
187
|
-
// provisional interfaces for the pre-ledger world
|
|
188
|
-
provisional_create_canister_with_cycles : (record {
|
|
189
|
-
amount: opt nat;
|
|
190
|
-
settings : opt canister_settings;
|
|
191
|
-
specified_id: opt canister_id;
|
|
192
|
-
}) -> (record {canister_id : canister_id});
|
|
193
|
-
provisional_top_up_canister :
|
|
194
|
-
(record { canister_id: canister_id; amount: nat }) -> ();
|
|
195
|
-
}
|
|
@@ -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 './mission_control.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 mission_control: ActorSubclass<_SERVICE>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {Actor, HttpAgent} from '@dfinity/agent';
|
|
2
|
-
|
|
3
|
-
// Imports and re-exports candid interface
|
|
4
|
-
import {idlFactory} from './mission_control.did.js';
|
|
5
|
-
export {idlFactory} from './mission_control.did.js';
|
|
6
|
-
|
|
7
|
-
/* CANISTER_ID is replaced by webpack based on node environment
|
|
8
|
-
* Note: canister environment variable will be standardized as
|
|
9
|
-
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
|
|
10
|
-
* beginning in dfx 0.15.0
|
|
11
|
-
*/
|
|
12
|
-
export const canisterId =
|
|
13
|
-
process.env.CANISTER_ID_MISSION_CONTROL || process.env.MISSION_CONTROL_CANISTER_ID;
|
|
14
|
-
|
|
15
|
-
export const createActor = (canisterId, options = {}) => {
|
|
16
|
-
const agent = options.agent || new HttpAgent({...options.agentOptions});
|
|
17
|
-
|
|
18
|
-
if (options.agent && options.agentOptions) {
|
|
19
|
-
console.warn(
|
|
20
|
-
'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Fetch root key for certificate validation during development
|
|
25
|
-
if (process.env.DFX_NETWORK !== 'ic') {
|
|
26
|
-
agent.fetchRootKey().catch((err) => {
|
|
27
|
-
console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
|
|
28
|
-
console.error(err);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Creates an actor with using the candid interface and the HttpAgent
|
|
33
|
-
return Actor.createActor(idlFactory, {
|
|
34
|
-
agent,
|
|
35
|
-
canisterId,
|
|
36
|
-
...options.actorOptions
|
|
37
|
-
});
|
|
38
|
-
};
|
|
@@ -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 './orbiter.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 orbiter: ActorSubclass<_SERVICE>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {Actor, HttpAgent} from '@dfinity/agent';
|
|
2
|
-
|
|
3
|
-
// Imports and re-exports candid interface
|
|
4
|
-
import {idlFactory} from './orbiter.did.js';
|
|
5
|
-
export {idlFactory} from './orbiter.did.js';
|
|
6
|
-
|
|
7
|
-
/* CANISTER_ID is replaced by webpack based on node environment
|
|
8
|
-
* Note: canister environment variable will be standardized as
|
|
9
|
-
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
|
|
10
|
-
* beginning in dfx 0.15.0
|
|
11
|
-
*/
|
|
12
|
-
export const canisterId = process.env.CANISTER_ID_ORBITER || process.env.ORBITER_CANISTER_ID;
|
|
13
|
-
|
|
14
|
-
export const createActor = (canisterId, options = {}) => {
|
|
15
|
-
const agent = options.agent || new HttpAgent({...options.agentOptions});
|
|
16
|
-
|
|
17
|
-
if (options.agent && options.agentOptions) {
|
|
18
|
-
console.warn(
|
|
19
|
-
'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Fetch root key for certificate validation during development
|
|
24
|
-
if (process.env.DFX_NETWORK !== 'ic') {
|
|
25
|
-
agent.fetchRootKey().catch((err) => {
|
|
26
|
-
console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
|
|
27
|
-
console.error(err);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Creates an actor with using the candid interface and the HttpAgent
|
|
32
|
-
return Actor.createActor(idlFactory, {
|
|
33
|
-
agent,
|
|
34
|
-
canisterId,
|
|
35
|
-
...options.actorOptions
|
|
36
|
-
});
|
|
37
|
-
};
|
|
@@ -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 './satellite.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 satellite: ActorSubclass<_SERVICE>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {Actor, HttpAgent} from '@dfinity/agent';
|
|
2
|
-
|
|
3
|
-
// Imports and re-exports candid interface
|
|
4
|
-
import {idlFactory} from './satellite.did.js';
|
|
5
|
-
export {idlFactory} from './satellite.did.js';
|
|
6
|
-
|
|
7
|
-
/* CANISTER_ID is replaced by webpack based on node environment
|
|
8
|
-
* Note: canister environment variable will be standardized as
|
|
9
|
-
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
|
|
10
|
-
* beginning in dfx 0.15.0
|
|
11
|
-
*/
|
|
12
|
-
export const canisterId = process.env.CANISTER_ID_SATELLITE || process.env.SATELLITE_CANISTER_ID;
|
|
13
|
-
|
|
14
|
-
export const createActor = (canisterId, options = {}) => {
|
|
15
|
-
const agent = options.agent || new HttpAgent({...options.agentOptions});
|
|
16
|
-
|
|
17
|
-
if (options.agent && options.agentOptions) {
|
|
18
|
-
console.warn(
|
|
19
|
-
'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Fetch root key for certificate validation during development
|
|
24
|
-
if (process.env.DFX_NETWORK !== 'ic') {
|
|
25
|
-
agent.fetchRootKey().catch((err) => {
|
|
26
|
-
console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
|
|
27
|
-
console.error(err);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Creates an actor with using the candid interface and the HttpAgent
|
|
32
|
-
return Actor.createActor(idlFactory, {
|
|
33
|
-
agent,
|
|
34
|
-
canisterId,
|
|
35
|
-
...options.actorOptions
|
|
36
|
-
});
|
|
37
|
-
};
|