@junobuild/admin 0.0.32 → 0.0.34
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/declarations/satellite/satellite.did.d.ts +6 -0
- package/declarations/satellite/satellite.factory.did.js +6 -0
- package/declarations/satellite/satellite.factory.did.mjs +6 -0
- package/dist/browser/index.js +7 -7
- package/dist/browser/index.js.map +3 -3
- package/dist/declarations/satellite/satellite.did.d.ts +6 -0
- package/dist/declarations/satellite/satellite.factory.did.js +6 -0
- package/dist/declarations/satellite/satellite.factory.did.mjs +6 -0
- package/dist/node/index.mjs +7 -7
- package/dist/node/index.mjs.map +3 -3
- package/dist/types/api/actor.api.d.ts +1 -3
- package/dist/types/constants/rules.constants.d.ts +3 -1
- package/dist/types/types/rules.types.d.ts +3 -0
- package/dist/types/utils/rule.utils.d.ts +5 -3
- package/package.json +3 -3
- package/declarations/cmc/cmc.did +0 -122
- package/declarations/cmc/cmc.did.d.ts +0 -48
- package/declarations/cmc/cmc.factory.did.js +0 -67
- package/declarations/cmc/index.d.ts +0 -45
- package/declarations/cmc/index.js +0 -37
- package/declarations/console/console.did.d.ts +0 -71
- package/declarations/console/console.factory.did.js +0 -79
- package/declarations/console/console.factory.did.mjs +0 -79
- package/declarations/console/index.d.ts +0 -45
- package/declarations/console/index.js +0 -37
- package/declarations/observatory/index.d.ts +0 -45
- package/declarations/observatory/index.js +0 -38
- package/declarations/observatory/observatory.did.d.ts +0 -86
- package/declarations/observatory/observatory.factory.did.js +0 -95
- package/declarations/observatory/observatory.factory.did.mjs +0 -95
- package/dist/declarations/cmc/cmc.did +0 -122
- package/dist/declarations/cmc/cmc.did.d.ts +0 -48
- package/dist/declarations/cmc/cmc.factory.did.js +0 -67
- package/dist/declarations/cmc/index.d.ts +0 -45
- package/dist/declarations/cmc/index.js +0 -37
- package/dist/declarations/console/console.did.d.ts +0 -71
- package/dist/declarations/console/console.factory.did.js +0 -79
- package/dist/declarations/console/console.factory.did.mjs +0 -79
- package/dist/declarations/console/index.d.ts +0 -45
- package/dist/declarations/console/index.js +0 -37
- package/dist/declarations/observatory/index.d.ts +0 -45
- package/dist/declarations/observatory/index.js +0 -38
- package/dist/declarations/observatory/observatory.did.d.ts +0 -86
- package/dist/declarations/observatory/observatory.factory.did.js +0 -95
- package/dist/declarations/observatory/observatory.factory.did.mjs +0 -95
|
@@ -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 './console.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 console: 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 './console.did.js';
|
|
5
|
-
export {idlFactory} from './console.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_CONSOLE || process.env.CONSOLE_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 './observatory.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 observatory: 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 './observatory.did.js';
|
|
5
|
-
export {idlFactory} from './observatory.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_OBSERVATORY || process.env.OBSERVATORY_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,86 +0,0 @@
|
|
|
1
|
-
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
-
import type {Principal} from '@dfinity/principal';
|
|
3
|
-
|
|
4
|
-
export interface CanisterStatusResponse {
|
|
5
|
-
status: CanisterStatusType;
|
|
6
|
-
memory_size: bigint;
|
|
7
|
-
cycles: bigint;
|
|
8
|
-
settings: DefiniteCanisterSettings;
|
|
9
|
-
idle_cycles_burned_per_day: bigint;
|
|
10
|
-
module_hash: [] | [Uint8Array | number[]];
|
|
11
|
-
}
|
|
12
|
-
export type CanisterStatusType = {stopped: null} | {stopping: null} | {running: null};
|
|
13
|
-
export type ControllerScope = {Write: null} | {Admin: null};
|
|
14
|
-
export interface CronJobStatuses {
|
|
15
|
-
mission_control_cycles_threshold: [] | [bigint];
|
|
16
|
-
orbiters: Array<[Principal, CronJobStatusesConfig]>;
|
|
17
|
-
satellites: Array<[Principal, CronJobStatusesConfig]>;
|
|
18
|
-
enabled: boolean;
|
|
19
|
-
cycles_threshold: [] | [bigint];
|
|
20
|
-
}
|
|
21
|
-
export interface CronJobStatusesConfig {
|
|
22
|
-
enabled: boolean;
|
|
23
|
-
cycles_threshold: [] | [bigint];
|
|
24
|
-
}
|
|
25
|
-
export interface CronJobs {
|
|
26
|
-
metadata: Array<[string, string]>;
|
|
27
|
-
statuses: CronJobStatuses;
|
|
28
|
-
}
|
|
29
|
-
export interface CronTab {
|
|
30
|
-
cron_jobs: CronJobs;
|
|
31
|
-
updated_at: bigint;
|
|
32
|
-
mission_control_id: Principal;
|
|
33
|
-
created_at: bigint;
|
|
34
|
-
}
|
|
35
|
-
export interface DefiniteCanisterSettings {
|
|
36
|
-
freezing_threshold: bigint;
|
|
37
|
-
controllers: Array<Principal>;
|
|
38
|
-
memory_allocation: bigint;
|
|
39
|
-
compute_allocation: bigint;
|
|
40
|
-
}
|
|
41
|
-
export interface DeleteControllersArgs {
|
|
42
|
-
controllers: Array<Principal>;
|
|
43
|
-
}
|
|
44
|
-
export interface ListStatuses {
|
|
45
|
-
cron_jobs: CronJobs;
|
|
46
|
-
statuses: Result_1;
|
|
47
|
-
timestamp: bigint;
|
|
48
|
-
}
|
|
49
|
-
export interface ListStatusesArgs {
|
|
50
|
-
time_delta: [] | [bigint];
|
|
51
|
-
}
|
|
52
|
-
export type Result = {Ok: SegmentStatus} | {Err: string};
|
|
53
|
-
export type Result_1 = {Ok: SegmentsStatuses} | {Err: string};
|
|
54
|
-
export interface SegmentStatus {
|
|
55
|
-
id: Principal;
|
|
56
|
-
status: CanisterStatusResponse;
|
|
57
|
-
metadata: [] | [Array<[string, string]>];
|
|
58
|
-
status_at: bigint;
|
|
59
|
-
}
|
|
60
|
-
export interface SegmentsStatuses {
|
|
61
|
-
orbiters: [] | [Array<Result>];
|
|
62
|
-
satellites: [] | [Array<Result>];
|
|
63
|
-
mission_control: Result;
|
|
64
|
-
}
|
|
65
|
-
export interface SetController {
|
|
66
|
-
metadata: Array<[string, string]>;
|
|
67
|
-
scope: ControllerScope;
|
|
68
|
-
expires_at: [] | [bigint];
|
|
69
|
-
}
|
|
70
|
-
export interface SetControllersArgs {
|
|
71
|
-
controller: SetController;
|
|
72
|
-
controllers: Array<Principal>;
|
|
73
|
-
}
|
|
74
|
-
export interface SetCronTab {
|
|
75
|
-
cron_jobs: CronJobs;
|
|
76
|
-
updated_at: [] | [bigint];
|
|
77
|
-
mission_control_id: Principal;
|
|
78
|
-
}
|
|
79
|
-
export interface _SERVICE {
|
|
80
|
-
del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
|
|
81
|
-
get_cron_tab: ActorMethod<[], [] | [CronTab]>;
|
|
82
|
-
list_statuses: ActorMethod<[ListStatusesArgs], Array<ListStatuses>>;
|
|
83
|
-
set_controllers: ActorMethod<[SetControllersArgs], undefined>;
|
|
84
|
-
set_cron_tab: ActorMethod<[SetCronTab], CronTab>;
|
|
85
|
-
version: ActorMethod<[], string>;
|
|
86
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
export const idlFactory = ({IDL}) => {
|
|
3
|
-
const DeleteControllersArgs = IDL.Record({
|
|
4
|
-
controllers: IDL.Vec(IDL.Principal)
|
|
5
|
-
});
|
|
6
|
-
const CronJobStatusesConfig = IDL.Record({
|
|
7
|
-
enabled: IDL.Bool,
|
|
8
|
-
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
9
|
-
});
|
|
10
|
-
const CronJobStatuses = IDL.Record({
|
|
11
|
-
mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
|
|
12
|
-
orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
13
|
-
satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
14
|
-
enabled: IDL.Bool,
|
|
15
|
-
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
16
|
-
});
|
|
17
|
-
const CronJobs = IDL.Record({
|
|
18
|
-
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
19
|
-
statuses: CronJobStatuses
|
|
20
|
-
});
|
|
21
|
-
const CronTab = IDL.Record({
|
|
22
|
-
cron_jobs: CronJobs,
|
|
23
|
-
updated_at: IDL.Nat64,
|
|
24
|
-
mission_control_id: IDL.Principal,
|
|
25
|
-
created_at: IDL.Nat64
|
|
26
|
-
});
|
|
27
|
-
const ListStatusesArgs = IDL.Record({time_delta: IDL.Opt(IDL.Nat64)});
|
|
28
|
-
const CanisterStatusType = IDL.Variant({
|
|
29
|
-
stopped: IDL.Null,
|
|
30
|
-
stopping: IDL.Null,
|
|
31
|
-
running: IDL.Null
|
|
32
|
-
});
|
|
33
|
-
const DefiniteCanisterSettings = IDL.Record({
|
|
34
|
-
freezing_threshold: IDL.Nat,
|
|
35
|
-
controllers: IDL.Vec(IDL.Principal),
|
|
36
|
-
memory_allocation: IDL.Nat,
|
|
37
|
-
compute_allocation: IDL.Nat
|
|
38
|
-
});
|
|
39
|
-
const CanisterStatusResponse = IDL.Record({
|
|
40
|
-
status: CanisterStatusType,
|
|
41
|
-
memory_size: IDL.Nat,
|
|
42
|
-
cycles: IDL.Nat,
|
|
43
|
-
settings: DefiniteCanisterSettings,
|
|
44
|
-
idle_cycles_burned_per_day: IDL.Nat,
|
|
45
|
-
module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
46
|
-
});
|
|
47
|
-
const SegmentStatus = IDL.Record({
|
|
48
|
-
id: IDL.Principal,
|
|
49
|
-
status: CanisterStatusResponse,
|
|
50
|
-
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
51
|
-
status_at: IDL.Nat64
|
|
52
|
-
});
|
|
53
|
-
const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
|
|
54
|
-
const SegmentsStatuses = IDL.Record({
|
|
55
|
-
orbiters: IDL.Opt(IDL.Vec(Result)),
|
|
56
|
-
satellites: IDL.Opt(IDL.Vec(Result)),
|
|
57
|
-
mission_control: Result
|
|
58
|
-
});
|
|
59
|
-
const Result_1 = IDL.Variant({Ok: SegmentsStatuses, Err: IDL.Text});
|
|
60
|
-
const ListStatuses = IDL.Record({
|
|
61
|
-
cron_jobs: CronJobs,
|
|
62
|
-
statuses: Result_1,
|
|
63
|
-
timestamp: IDL.Nat64
|
|
64
|
-
});
|
|
65
|
-
const ControllerScope = IDL.Variant({
|
|
66
|
-
Write: IDL.Null,
|
|
67
|
-
Admin: IDL.Null
|
|
68
|
-
});
|
|
69
|
-
const SetController = IDL.Record({
|
|
70
|
-
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
71
|
-
scope: ControllerScope,
|
|
72
|
-
expires_at: IDL.Opt(IDL.Nat64)
|
|
73
|
-
});
|
|
74
|
-
const SetControllersArgs = IDL.Record({
|
|
75
|
-
controller: SetController,
|
|
76
|
-
controllers: IDL.Vec(IDL.Principal)
|
|
77
|
-
});
|
|
78
|
-
const SetCronTab = IDL.Record({
|
|
79
|
-
cron_jobs: CronJobs,
|
|
80
|
-
updated_at: IDL.Opt(IDL.Nat64),
|
|
81
|
-
mission_control_id: IDL.Principal
|
|
82
|
-
});
|
|
83
|
-
return IDL.Service({
|
|
84
|
-
del_controllers: IDL.Func([DeleteControllersArgs], [], []),
|
|
85
|
-
get_cron_tab: IDL.Func([], [IDL.Opt(CronTab)], ['query']),
|
|
86
|
-
list_statuses: IDL.Func([ListStatusesArgs], [IDL.Vec(ListStatuses)], ['query']),
|
|
87
|
-
set_controllers: IDL.Func([SetControllersArgs], [], []),
|
|
88
|
-
set_cron_tab: IDL.Func([SetCronTab], [CronTab], []),
|
|
89
|
-
version: IDL.Func([], [IDL.Text], ['query'])
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
// @ts-ignore
|
|
93
|
-
export const init = ({IDL}) => {
|
|
94
|
-
return [];
|
|
95
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
export const idlFactory = ({IDL}) => {
|
|
3
|
-
const DeleteControllersArgs = IDL.Record({
|
|
4
|
-
controllers: IDL.Vec(IDL.Principal)
|
|
5
|
-
});
|
|
6
|
-
const CronJobStatusesConfig = IDL.Record({
|
|
7
|
-
enabled: IDL.Bool,
|
|
8
|
-
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
9
|
-
});
|
|
10
|
-
const CronJobStatuses = IDL.Record({
|
|
11
|
-
mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
|
|
12
|
-
orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
13
|
-
satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
14
|
-
enabled: IDL.Bool,
|
|
15
|
-
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
16
|
-
});
|
|
17
|
-
const CronJobs = IDL.Record({
|
|
18
|
-
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
19
|
-
statuses: CronJobStatuses
|
|
20
|
-
});
|
|
21
|
-
const CronTab = IDL.Record({
|
|
22
|
-
cron_jobs: CronJobs,
|
|
23
|
-
updated_at: IDL.Nat64,
|
|
24
|
-
mission_control_id: IDL.Principal,
|
|
25
|
-
created_at: IDL.Nat64
|
|
26
|
-
});
|
|
27
|
-
const ListStatusesArgs = IDL.Record({time_delta: IDL.Opt(IDL.Nat64)});
|
|
28
|
-
const CanisterStatusType = IDL.Variant({
|
|
29
|
-
stopped: IDL.Null,
|
|
30
|
-
stopping: IDL.Null,
|
|
31
|
-
running: IDL.Null
|
|
32
|
-
});
|
|
33
|
-
const DefiniteCanisterSettings = IDL.Record({
|
|
34
|
-
freezing_threshold: IDL.Nat,
|
|
35
|
-
controllers: IDL.Vec(IDL.Principal),
|
|
36
|
-
memory_allocation: IDL.Nat,
|
|
37
|
-
compute_allocation: IDL.Nat
|
|
38
|
-
});
|
|
39
|
-
const CanisterStatusResponse = IDL.Record({
|
|
40
|
-
status: CanisterStatusType,
|
|
41
|
-
memory_size: IDL.Nat,
|
|
42
|
-
cycles: IDL.Nat,
|
|
43
|
-
settings: DefiniteCanisterSettings,
|
|
44
|
-
idle_cycles_burned_per_day: IDL.Nat,
|
|
45
|
-
module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
46
|
-
});
|
|
47
|
-
const SegmentStatus = IDL.Record({
|
|
48
|
-
id: IDL.Principal,
|
|
49
|
-
status: CanisterStatusResponse,
|
|
50
|
-
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
51
|
-
status_at: IDL.Nat64
|
|
52
|
-
});
|
|
53
|
-
const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
|
|
54
|
-
const SegmentsStatuses = IDL.Record({
|
|
55
|
-
orbiters: IDL.Opt(IDL.Vec(Result)),
|
|
56
|
-
satellites: IDL.Opt(IDL.Vec(Result)),
|
|
57
|
-
mission_control: Result
|
|
58
|
-
});
|
|
59
|
-
const Result_1 = IDL.Variant({Ok: SegmentsStatuses, Err: IDL.Text});
|
|
60
|
-
const ListStatuses = IDL.Record({
|
|
61
|
-
cron_jobs: CronJobs,
|
|
62
|
-
statuses: Result_1,
|
|
63
|
-
timestamp: IDL.Nat64
|
|
64
|
-
});
|
|
65
|
-
const ControllerScope = IDL.Variant({
|
|
66
|
-
Write: IDL.Null,
|
|
67
|
-
Admin: IDL.Null
|
|
68
|
-
});
|
|
69
|
-
const SetController = IDL.Record({
|
|
70
|
-
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
71
|
-
scope: ControllerScope,
|
|
72
|
-
expires_at: IDL.Opt(IDL.Nat64)
|
|
73
|
-
});
|
|
74
|
-
const SetControllersArgs = IDL.Record({
|
|
75
|
-
controller: SetController,
|
|
76
|
-
controllers: IDL.Vec(IDL.Principal)
|
|
77
|
-
});
|
|
78
|
-
const SetCronTab = IDL.Record({
|
|
79
|
-
cron_jobs: CronJobs,
|
|
80
|
-
updated_at: IDL.Opt(IDL.Nat64),
|
|
81
|
-
mission_control_id: IDL.Principal
|
|
82
|
-
});
|
|
83
|
-
return IDL.Service({
|
|
84
|
-
del_controllers: IDL.Func([DeleteControllersArgs], [], []),
|
|
85
|
-
get_cron_tab: IDL.Func([], [IDL.Opt(CronTab)], ['query']),
|
|
86
|
-
list_statuses: IDL.Func([ListStatusesArgs], [IDL.Vec(ListStatuses)], ['query']),
|
|
87
|
-
set_controllers: IDL.Func([SetControllersArgs], [], []),
|
|
88
|
-
set_cron_tab: IDL.Func([SetCronTab], [CronTab], []),
|
|
89
|
-
version: IDL.Func([], [IDL.Text], ['query'])
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
// @ts-ignore
|
|
93
|
-
export const init = ({IDL}) => {
|
|
94
|
-
return [];
|
|
95
|
-
};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
type Cycles = nat;
|
|
2
|
-
type BlockIndex = nat64;
|
|
3
|
-
|
|
4
|
-
// The argument of the [notify_top_up] method.
|
|
5
|
-
type NotifyTopUpArg = record {
|
|
6
|
-
// Index of the block on the ICP ledger that contains the payment.
|
|
7
|
-
block_index : BlockIndex;
|
|
8
|
-
|
|
9
|
-
// The canister to top up.
|
|
10
|
-
canister_id : principal;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
// The argument of the [notify_create_canister] method.
|
|
14
|
-
type NotifyCreateCanisterArg = record {
|
|
15
|
-
// Index of the block on the ICP ledger that contains the payment.
|
|
16
|
-
block_index : BlockIndex;
|
|
17
|
-
|
|
18
|
-
// The controller of canister to create.
|
|
19
|
-
controller : principal;
|
|
20
|
-
|
|
21
|
-
// An optional subnet type that, if set, determines what type of subnet
|
|
22
|
-
// the new canister will be created on.
|
|
23
|
-
subnet_type: opt text;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
type NotifyError = variant {
|
|
27
|
-
// The payment processing failed and the payment was returned the caller.
|
|
28
|
-
// This is a non-retriable error.
|
|
29
|
-
Refunded : record {
|
|
30
|
-
// The reason for the refund.
|
|
31
|
-
reason : text;
|
|
32
|
-
// The index of the block containing the refund.
|
|
33
|
-
block_index : opt BlockIndex;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// The same payment is already being processed by a concurrent request.
|
|
37
|
-
// This is a retriable error.
|
|
38
|
-
Processing;
|
|
39
|
-
|
|
40
|
-
// The payment was too old to be processed.
|
|
41
|
-
// The value of the variant is the oldest block index that can still be processed.
|
|
42
|
-
// This a non-retriable error.
|
|
43
|
-
TransactionTooOld : BlockIndex;
|
|
44
|
-
|
|
45
|
-
// The transaction does not satisfy the cycle minting canister payment protocol.
|
|
46
|
-
// The text contains the description of the problem.
|
|
47
|
-
// This is a non-retriable error.
|
|
48
|
-
InvalidTransaction : text;
|
|
49
|
-
|
|
50
|
-
// Other error.
|
|
51
|
-
Other : record { error_code : nat64; error_message : text };
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
type NotifyTopUpResult = variant {
|
|
55
|
-
// The amount of cycles sent to the specified canister.
|
|
56
|
-
Ok : Cycles;
|
|
57
|
-
Err : NotifyError;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
type NotifyCreateCanisterResult = variant {
|
|
61
|
-
// The principal of the newly created canister.
|
|
62
|
-
Ok : principal;
|
|
63
|
-
Err : NotifyError;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
type IcpXdrConversionRate = record {
|
|
67
|
-
// The time for which the market data was queried, expressed in UNIX epoch
|
|
68
|
-
// time in seconds.
|
|
69
|
-
timestamp_seconds : nat64;
|
|
70
|
-
|
|
71
|
-
// The number of 10,000ths of IMF SDR (currency code XDR) that corresponds
|
|
72
|
-
// to 1 ICP. This value reflects the current market price of one ICP token.
|
|
73
|
-
xdr_permyriad_per_icp : nat64;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
type IcpXdrConversionRateResponse = record {
|
|
78
|
-
// The latest ICP/XDR conversion rate.
|
|
79
|
-
data : IcpXdrConversionRate;
|
|
80
|
-
|
|
81
|
-
// CBOR-serialized hash tree as specified in
|
|
82
|
-
// https://smartcontracts.org/docs/interface-spec/index.html#certification-encoding.
|
|
83
|
-
// The hash tree is used for certification and hash the following structure:
|
|
84
|
-
// ```
|
|
85
|
-
// *
|
|
86
|
-
// |
|
|
87
|
-
// +-- ICP_XDR_CONVERSION_RATE -- [ Candid encoded IcpXdrConversionRate ]
|
|
88
|
-
// |
|
|
89
|
-
// `-- AVERAGE_ICP_XDR_CONVERSION_RATE -- [ Candid encoded IcpXdrConversionRate ]
|
|
90
|
-
// ```
|
|
91
|
-
hash_tree : blob;
|
|
92
|
-
|
|
93
|
-
// System certificate as specified in
|
|
94
|
-
// https://smartcontracts.org/docs/interface-spec/index.html#certification-encoding
|
|
95
|
-
certificate : blob;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
type SubnetTypesToSubnetsResponse = record {
|
|
99
|
-
data: vec record { text; vec principal };
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
type CyclesCanisterInitPayload = record {
|
|
103
|
-
governance_canister_id : principal;
|
|
104
|
-
minting_account_id : opt text;
|
|
105
|
-
ledger_canister_id : principal;
|
|
106
|
-
last_purged_notification: opt BlockIndex;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
service: (CyclesCanisterInitPayload) -> {
|
|
110
|
-
// Propmts the cycles minting canister to process a payment by converting ICP
|
|
111
|
-
// into cycles and sending the cycles the specified canister.
|
|
112
|
-
notify_top_up : (NotifyTopUpArg) -> (NotifyTopUpResult);
|
|
113
|
-
|
|
114
|
-
// Prompts the cycles minting canister to process a payment for canister creation.
|
|
115
|
-
notify_create_canister : (NotifyCreateCanisterArg) -> (NotifyCreateCanisterResult);
|
|
116
|
-
|
|
117
|
-
// Returns the ICP/XDR conversion rate.
|
|
118
|
-
get_icp_xdr_conversion_rate : () -> (IcpXdrConversionRateResponse) query;
|
|
119
|
-
|
|
120
|
-
// Returns the current mapping of subnet types to subnets.
|
|
121
|
-
get_subnet_types_to_subnets : () -> (SubnetTypesToSubnetsResponse) query;
|
|
122
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
-
import type {Principal} from '@dfinity/principal';
|
|
3
|
-
|
|
4
|
-
export type BlockIndex = bigint;
|
|
5
|
-
export type Cycles = bigint;
|
|
6
|
-
export interface CyclesCanisterInitPayload {
|
|
7
|
-
last_purged_notification: [] | [BlockIndex];
|
|
8
|
-
governance_canister_id: Principal;
|
|
9
|
-
minting_account_id: [] | [string];
|
|
10
|
-
ledger_canister_id: Principal;
|
|
11
|
-
}
|
|
12
|
-
export interface IcpXdrConversionRate {
|
|
13
|
-
xdr_permyriad_per_icp: bigint;
|
|
14
|
-
timestamp_seconds: bigint;
|
|
15
|
-
}
|
|
16
|
-
export interface IcpXdrConversionRateResponse {
|
|
17
|
-
certificate: Uint8Array | number[];
|
|
18
|
-
data: IcpXdrConversionRate;
|
|
19
|
-
hash_tree: Uint8Array | number[];
|
|
20
|
-
}
|
|
21
|
-
export interface NotifyCreateCanisterArg {
|
|
22
|
-
controller: Principal;
|
|
23
|
-
block_index: BlockIndex;
|
|
24
|
-
subnet_type: [] | [string];
|
|
25
|
-
}
|
|
26
|
-
export type NotifyCreateCanisterResult = {Ok: Principal} | {Err: NotifyError};
|
|
27
|
-
export type NotifyError =
|
|
28
|
-
| {
|
|
29
|
-
Refunded: {block_index: [] | [BlockIndex]; reason: string};
|
|
30
|
-
}
|
|
31
|
-
| {InvalidTransaction: string}
|
|
32
|
-
| {Other: {error_message: string; error_code: bigint}}
|
|
33
|
-
| {Processing: null}
|
|
34
|
-
| {TransactionTooOld: BlockIndex};
|
|
35
|
-
export interface NotifyTopUpArg {
|
|
36
|
-
block_index: BlockIndex;
|
|
37
|
-
canister_id: Principal;
|
|
38
|
-
}
|
|
39
|
-
export type NotifyTopUpResult = {Ok: Cycles} | {Err: NotifyError};
|
|
40
|
-
export interface SubnetTypesToSubnetsResponse {
|
|
41
|
-
data: Array<[string, Array<Principal>]>;
|
|
42
|
-
}
|
|
43
|
-
export interface _SERVICE {
|
|
44
|
-
get_icp_xdr_conversion_rate: ActorMethod<[], IcpXdrConversionRateResponse>;
|
|
45
|
-
get_subnet_types_to_subnets: ActorMethod<[], SubnetTypesToSubnetsResponse>;
|
|
46
|
-
notify_create_canister: ActorMethod<[NotifyCreateCanisterArg], NotifyCreateCanisterResult>;
|
|
47
|
-
notify_top_up: ActorMethod<[NotifyTopUpArg], NotifyTopUpResult>;
|
|
48
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
export const idlFactory = ({IDL}) => {
|
|
3
|
-
const BlockIndex = IDL.Nat64;
|
|
4
|
-
const CyclesCanisterInitPayload = IDL.Record({
|
|
5
|
-
last_purged_notification: IDL.Opt(BlockIndex),
|
|
6
|
-
governance_canister_id: IDL.Principal,
|
|
7
|
-
minting_account_id: IDL.Opt(IDL.Text),
|
|
8
|
-
ledger_canister_id: IDL.Principal
|
|
9
|
-
});
|
|
10
|
-
const IcpXdrConversionRate = IDL.Record({
|
|
11
|
-
xdr_permyriad_per_icp: IDL.Nat64,
|
|
12
|
-
timestamp_seconds: IDL.Nat64
|
|
13
|
-
});
|
|
14
|
-
const IcpXdrConversionRateResponse = IDL.Record({
|
|
15
|
-
certificate: IDL.Vec(IDL.Nat8),
|
|
16
|
-
data: IcpXdrConversionRate,
|
|
17
|
-
hash_tree: IDL.Vec(IDL.Nat8)
|
|
18
|
-
});
|
|
19
|
-
const SubnetTypesToSubnetsResponse = IDL.Record({
|
|
20
|
-
data: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Principal)))
|
|
21
|
-
});
|
|
22
|
-
const NotifyCreateCanisterArg = IDL.Record({
|
|
23
|
-
controller: IDL.Principal,
|
|
24
|
-
block_index: BlockIndex,
|
|
25
|
-
subnet_type: IDL.Opt(IDL.Text)
|
|
26
|
-
});
|
|
27
|
-
const NotifyError = IDL.Variant({
|
|
28
|
-
Refunded: IDL.Record({
|
|
29
|
-
block_index: IDL.Opt(BlockIndex),
|
|
30
|
-
reason: IDL.Text
|
|
31
|
-
}),
|
|
32
|
-
InvalidTransaction: IDL.Text,
|
|
33
|
-
Other: IDL.Record({
|
|
34
|
-
error_message: IDL.Text,
|
|
35
|
-
error_code: IDL.Nat64
|
|
36
|
-
}),
|
|
37
|
-
Processing: IDL.Null,
|
|
38
|
-
TransactionTooOld: BlockIndex
|
|
39
|
-
});
|
|
40
|
-
const NotifyCreateCanisterResult = IDL.Variant({
|
|
41
|
-
Ok: IDL.Principal,
|
|
42
|
-
Err: NotifyError
|
|
43
|
-
});
|
|
44
|
-
const NotifyTopUpArg = IDL.Record({
|
|
45
|
-
block_index: BlockIndex,
|
|
46
|
-
canister_id: IDL.Principal
|
|
47
|
-
});
|
|
48
|
-
const Cycles = IDL.Nat;
|
|
49
|
-
const NotifyTopUpResult = IDL.Variant({Ok: Cycles, Err: NotifyError});
|
|
50
|
-
return IDL.Service({
|
|
51
|
-
get_icp_xdr_conversion_rate: IDL.Func([], [IcpXdrConversionRateResponse], ['query']),
|
|
52
|
-
get_subnet_types_to_subnets: IDL.Func([], [SubnetTypesToSubnetsResponse], ['query']),
|
|
53
|
-
notify_create_canister: IDL.Func([NotifyCreateCanisterArg], [NotifyCreateCanisterResult], []),
|
|
54
|
-
notify_top_up: IDL.Func([NotifyTopUpArg], [NotifyTopUpResult], [])
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
export const init = ({IDL}) => {
|
|
59
|
-
const BlockIndex = IDL.Nat64;
|
|
60
|
-
const CyclesCanisterInitPayload = IDL.Record({
|
|
61
|
-
last_purged_notification: IDL.Opt(BlockIndex),
|
|
62
|
-
governance_canister_id: IDL.Principal,
|
|
63
|
-
minting_account_id: IDL.Opt(IDL.Text),
|
|
64
|
-
ledger_canister_id: IDL.Principal
|
|
65
|
-
});
|
|
66
|
-
return [CyclesCanisterInitPayload];
|
|
67
|
-
};
|