@junobuild/analytics 0.0.10 → 0.0.11

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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/workers/analytics.worker.js +15 -15
  3. package/dist/workers/analytics.worker.js.gz +0 -0
  4. package/dist/workers/analytics.worker.js.map +2 -2
  5. package/package.json +3 -3
  6. package/declarations/cmc/cmc.did +0 -122
  7. package/declarations/cmc/cmc.did.d.ts +0 -48
  8. package/declarations/cmc/cmc.factory.did.js +0 -67
  9. package/declarations/cmc/index.d.ts +0 -45
  10. package/declarations/cmc/index.js +0 -37
  11. package/declarations/console/console.did.d.ts +0 -71
  12. package/declarations/console/console.factory.did.js +0 -79
  13. package/declarations/console/console.factory.did.mjs +0 -79
  14. package/declarations/console/index.d.ts +0 -45
  15. package/declarations/console/index.js +0 -37
  16. package/declarations/ic/ic.did +0 -195
  17. package/declarations/ic/ic.did.d.ts +0 -208
  18. package/declarations/ic/ic.factory.did.js +0 -274
  19. package/declarations/index/index.d.ts +0 -45
  20. package/declarations/index/index.did +0 -68
  21. package/declarations/index/index.did.d.ts +0 -97
  22. package/declarations/index/index.factory.did.js +0 -94
  23. package/declarations/index/index.js +0 -37
  24. package/declarations/mission_control/index.d.ts +0 -45
  25. package/declarations/mission_control/index.js +0 -38
  26. package/declarations/mission_control/mission_control.did.d.ts +0 -101
  27. package/declarations/mission_control/mission_control.factory.did.js +0 -136
  28. package/declarations/observatory/index.d.ts +0 -45
  29. package/declarations/observatory/index.js +0 -38
  30. package/declarations/observatory/observatory.did.d.ts +0 -86
  31. package/declarations/observatory/observatory.factory.did.js +0 -95
  32. package/declarations/observatory/observatory.factory.did.mjs +0 -95
  33. package/declarations/satellite/index.d.ts +0 -45
  34. package/declarations/satellite/index.js +0 -37
  35. package/declarations/satellite/satellite.did.d.ts +0 -201
  36. package/declarations/satellite/satellite.factory.did.js +0 -215
  37. package/declarations/satellite/satellite.factory.did.mjs +0 -215
  38. package/dist/declarations/cmc/cmc.did +0 -122
  39. package/dist/declarations/cmc/cmc.did.d.ts +0 -48
  40. package/dist/declarations/cmc/cmc.factory.did.js +0 -67
  41. package/dist/declarations/cmc/index.d.ts +0 -45
  42. package/dist/declarations/cmc/index.js +0 -37
  43. package/dist/declarations/console/console.did.d.ts +0 -71
  44. package/dist/declarations/console/console.factory.did.js +0 -79
  45. package/dist/declarations/console/console.factory.did.mjs +0 -79
  46. package/dist/declarations/console/index.d.ts +0 -45
  47. package/dist/declarations/console/index.js +0 -37
  48. package/dist/declarations/ic/ic.did +0 -195
  49. package/dist/declarations/ic/ic.did.d.ts +0 -208
  50. package/dist/declarations/ic/ic.factory.did.js +0 -274
  51. package/dist/declarations/index/index.d.ts +0 -45
  52. package/dist/declarations/index/index.did +0 -68
  53. package/dist/declarations/index/index.did.d.ts +0 -97
  54. package/dist/declarations/index/index.factory.did.js +0 -94
  55. package/dist/declarations/index/index.js +0 -37
  56. package/dist/declarations/mission_control/index.d.ts +0 -45
  57. package/dist/declarations/mission_control/index.js +0 -38
  58. package/dist/declarations/mission_control/mission_control.did.d.ts +0 -101
  59. package/dist/declarations/mission_control/mission_control.factory.did.js +0 -136
  60. package/dist/declarations/observatory/index.d.ts +0 -45
  61. package/dist/declarations/observatory/index.js +0 -38
  62. package/dist/declarations/observatory/observatory.did.d.ts +0 -86
  63. package/dist/declarations/observatory/observatory.factory.did.js +0 -95
  64. package/dist/declarations/observatory/observatory.factory.did.mjs +0 -95
  65. package/dist/declarations/satellite/index.d.ts +0 -45
  66. package/dist/declarations/satellite/index.js +0 -37
  67. package/dist/declarations/satellite/satellite.did.d.ts +0 -201
  68. package/dist/declarations/satellite/satellite.factory.did.js +0 -215
  69. package/dist/declarations/satellite/satellite.factory.did.mjs +0 -215
@@ -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 './cmc.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 cmc: 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 './cmc.did.js';
5
- export {idlFactory} from './cmc.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_CMC || process.env.CMC_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,71 +0,0 @@
1
- import type {ActorMethod} from '@dfinity/agent';
2
- import type {Principal} from '@dfinity/principal';
3
-
4
- export interface AddCreditsArgs {
5
- user: Principal;
6
- }
7
- export interface AssertMissionControlCenterArgs {
8
- mission_control_id: Principal;
9
- user: Principal;
10
- }
11
- export type ControllerScope = {Write: null} | {Admin: null};
12
- export interface CreateCanisterArgs {
13
- block_index: [] | [bigint];
14
- user: Principal;
15
- }
16
- export interface DeleteControllersArgs {
17
- controllers: Array<Principal>;
18
- }
19
- export interface LoadRelease {
20
- total: bigint;
21
- chunks: bigint;
22
- }
23
- export interface MissionControl {
24
- updated_at: bigint;
25
- credits: Tokens;
26
- mission_control_id: [] | [Principal];
27
- owner: Principal;
28
- created_at: bigint;
29
- }
30
- export interface RateConfig {
31
- max_tokens: bigint;
32
- time_per_token_ns: bigint;
33
- }
34
- export interface ReleasesVersion {
35
- satellite: [] | [string];
36
- orbiter: [] | [string];
37
- mission_control: [] | [string];
38
- }
39
- export type Segment = {Orbiter: null} | {MissionControl: null} | {Satellite: null};
40
- export interface SetController {
41
- metadata: Array<[string, string]>;
42
- scope: ControllerScope;
43
- expires_at: [] | [bigint];
44
- }
45
- export interface SetControllersArgs {
46
- controller: SetController;
47
- controllers: Array<Principal>;
48
- }
49
- export interface Tokens {
50
- e8s: bigint;
51
- }
52
- export interface _SERVICE {
53
- add_credits: ActorMethod<[AddCreditsArgs], undefined>;
54
- add_invitation_code: ActorMethod<[string], undefined>;
55
- assert_mission_control_center: ActorMethod<[AssertMissionControlCenterArgs], undefined>;
56
- create_orbiter: ActorMethod<[CreateCanisterArgs], Principal>;
57
- create_satellite: ActorMethod<[CreateCanisterArgs], Principal>;
58
- del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
59
- get_create_orbiter_fee: ActorMethod<[AddCreditsArgs], [] | [Tokens]>;
60
- get_create_satellite_fee: ActorMethod<[AddCreditsArgs], [] | [Tokens]>;
61
- get_credits: ActorMethod<[], Tokens>;
62
- get_releases_version: ActorMethod<[], ReleasesVersion>;
63
- get_user_mission_control_center: ActorMethod<[], [] | [MissionControl]>;
64
- init_user_mission_control_center: ActorMethod<[], MissionControl>;
65
- list_user_mission_control_centers: ActorMethod<[], Array<[Principal, MissionControl]>>;
66
- load_release: ActorMethod<[Segment, Uint8Array | number[], string], LoadRelease>;
67
- reset_release: ActorMethod<[Segment], undefined>;
68
- set_controllers: ActorMethod<[SetControllersArgs], undefined>;
69
- update_rate_config: ActorMethod<[Segment, RateConfig], undefined>;
70
- version: ActorMethod<[], string>;
71
- }
@@ -1,79 +0,0 @@
1
- // @ts-ignore
2
- export const idlFactory = ({IDL}) => {
3
- const AddCreditsArgs = IDL.Record({user: IDL.Principal});
4
- const AssertMissionControlCenterArgs = IDL.Record({
5
- mission_control_id: IDL.Principal,
6
- user: IDL.Principal
7
- });
8
- const CreateCanisterArgs = IDL.Record({
9
- block_index: IDL.Opt(IDL.Nat64),
10
- user: IDL.Principal
11
- });
12
- const DeleteControllersArgs = IDL.Record({
13
- controllers: IDL.Vec(IDL.Principal)
14
- });
15
- const Tokens = IDL.Record({e8s: IDL.Nat64});
16
- const ReleasesVersion = IDL.Record({
17
- satellite: IDL.Opt(IDL.Text),
18
- orbiter: IDL.Opt(IDL.Text),
19
- mission_control: IDL.Opt(IDL.Text)
20
- });
21
- const MissionControl = IDL.Record({
22
- updated_at: IDL.Nat64,
23
- credits: Tokens,
24
- mission_control_id: IDL.Opt(IDL.Principal),
25
- owner: IDL.Principal,
26
- created_at: IDL.Nat64
27
- });
28
- const Segment = IDL.Variant({
29
- Orbiter: IDL.Null,
30
- MissionControl: IDL.Null,
31
- Satellite: IDL.Null
32
- });
33
- const LoadRelease = IDL.Record({total: IDL.Nat64, chunks: IDL.Nat64});
34
- const ControllerScope = IDL.Variant({
35
- Write: IDL.Null,
36
- Admin: IDL.Null
37
- });
38
- const SetController = IDL.Record({
39
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
40
- scope: ControllerScope,
41
- expires_at: IDL.Opt(IDL.Nat64)
42
- });
43
- const SetControllersArgs = IDL.Record({
44
- controller: SetController,
45
- controllers: IDL.Vec(IDL.Principal)
46
- });
47
- const RateConfig = IDL.Record({
48
- max_tokens: IDL.Nat64,
49
- time_per_token_ns: IDL.Nat64
50
- });
51
- return IDL.Service({
52
- add_credits: IDL.Func([AddCreditsArgs], [], []),
53
- add_invitation_code: IDL.Func([IDL.Text], [], []),
54
- assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
55
- create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
56
- create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
57
- del_controllers: IDL.Func([DeleteControllersArgs], [], []),
58
- get_create_orbiter_fee: IDL.Func([AddCreditsArgs], [IDL.Opt(Tokens)], ['query']),
59
- get_create_satellite_fee: IDL.Func([AddCreditsArgs], [IDL.Opt(Tokens)], ['query']),
60
- get_credits: IDL.Func([], [Tokens], ['query']),
61
- get_releases_version: IDL.Func([], [ReleasesVersion], ['query']),
62
- get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['query']),
63
- init_user_mission_control_center: IDL.Func([], [MissionControl], []),
64
- list_user_mission_control_centers: IDL.Func(
65
- [],
66
- [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],
67
- ['query']
68
- ),
69
- load_release: IDL.Func([Segment, IDL.Vec(IDL.Nat8), IDL.Text], [LoadRelease], []),
70
- reset_release: IDL.Func([Segment], [], []),
71
- set_controllers: IDL.Func([SetControllersArgs], [], []),
72
- update_rate_config: IDL.Func([Segment, RateConfig], [], []),
73
- version: IDL.Func([], [IDL.Text], ['query'])
74
- });
75
- };
76
- // @ts-ignore
77
- export const init = ({IDL}) => {
78
- return [];
79
- };
@@ -1,79 +0,0 @@
1
- // @ts-ignore
2
- export const idlFactory = ({IDL}) => {
3
- const AddCreditsArgs = IDL.Record({user: IDL.Principal});
4
- const AssertMissionControlCenterArgs = IDL.Record({
5
- mission_control_id: IDL.Principal,
6
- user: IDL.Principal
7
- });
8
- const CreateCanisterArgs = IDL.Record({
9
- block_index: IDL.Opt(IDL.Nat64),
10
- user: IDL.Principal
11
- });
12
- const DeleteControllersArgs = IDL.Record({
13
- controllers: IDL.Vec(IDL.Principal)
14
- });
15
- const Tokens = IDL.Record({e8s: IDL.Nat64});
16
- const ReleasesVersion = IDL.Record({
17
- satellite: IDL.Opt(IDL.Text),
18
- orbiter: IDL.Opt(IDL.Text),
19
- mission_control: IDL.Opt(IDL.Text)
20
- });
21
- const MissionControl = IDL.Record({
22
- updated_at: IDL.Nat64,
23
- credits: Tokens,
24
- mission_control_id: IDL.Opt(IDL.Principal),
25
- owner: IDL.Principal,
26
- created_at: IDL.Nat64
27
- });
28
- const Segment = IDL.Variant({
29
- Orbiter: IDL.Null,
30
- MissionControl: IDL.Null,
31
- Satellite: IDL.Null
32
- });
33
- const LoadRelease = IDL.Record({total: IDL.Nat64, chunks: IDL.Nat64});
34
- const ControllerScope = IDL.Variant({
35
- Write: IDL.Null,
36
- Admin: IDL.Null
37
- });
38
- const SetController = IDL.Record({
39
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
40
- scope: ControllerScope,
41
- expires_at: IDL.Opt(IDL.Nat64)
42
- });
43
- const SetControllersArgs = IDL.Record({
44
- controller: SetController,
45
- controllers: IDL.Vec(IDL.Principal)
46
- });
47
- const RateConfig = IDL.Record({
48
- max_tokens: IDL.Nat64,
49
- time_per_token_ns: IDL.Nat64
50
- });
51
- return IDL.Service({
52
- add_credits: IDL.Func([AddCreditsArgs], [], []),
53
- add_invitation_code: IDL.Func([IDL.Text], [], []),
54
- assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
55
- create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
56
- create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
57
- del_controllers: IDL.Func([DeleteControllersArgs], [], []),
58
- get_create_orbiter_fee: IDL.Func([AddCreditsArgs], [IDL.Opt(Tokens)], ['query']),
59
- get_create_satellite_fee: IDL.Func([AddCreditsArgs], [IDL.Opt(Tokens)], ['query']),
60
- get_credits: IDL.Func([], [Tokens], ['query']),
61
- get_releases_version: IDL.Func([], [ReleasesVersion], ['query']),
62
- get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['query']),
63
- init_user_mission_control_center: IDL.Func([], [MissionControl], []),
64
- list_user_mission_control_centers: IDL.Func(
65
- [],
66
- [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],
67
- ['query']
68
- ),
69
- load_release: IDL.Func([Segment, IDL.Vec(IDL.Nat8), IDL.Text], [LoadRelease], []),
70
- reset_release: IDL.Func([Segment], [], []),
71
- set_controllers: IDL.Func([SetControllersArgs], [], []),
72
- update_rate_config: IDL.Func([Segment, RateConfig], [], []),
73
- version: IDL.Func([], [IDL.Text], ['query'])
74
- });
75
- };
76
- // @ts-ignore
77
- export const init = ({IDL}) => {
78
- return [];
79
- };
@@ -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,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
- }