@junobuild/admin 0.0.3 → 0.0.5

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 (57) hide show
  1. package/dist/browser/canisterStatus-D52DQGXX.js +2 -0
  2. package/dist/browser/chunk-CAKYEEJ6.js +35 -0
  3. package/dist/browser/chunk-CAKYEEJ6.js.map +7 -0
  4. package/dist/browser/index.js +32 -0
  5. package/dist/browser/index.js.map +7 -0
  6. package/dist/declarations/cmc/cmc.did +122 -0
  7. package/dist/declarations/cmc/cmc.did.d.ts +48 -0
  8. package/dist/declarations/cmc/cmc.factory.did.js +65 -0
  9. package/dist/declarations/cmc/index.d.ts +45 -0
  10. package/dist/declarations/cmc/index.js +32 -0
  11. package/dist/declarations/console/console.did.d.ts +47 -0
  12. package/dist/declarations/console/console.factory.did.js +49 -0
  13. package/dist/declarations/console/console.factory.did.mjs +49 -0
  14. package/dist/declarations/console/index.d.ts +45 -0
  15. package/dist/declarations/console/index.js +32 -0
  16. package/dist/declarations/frontend/frontend.did +188 -0
  17. package/dist/declarations/frontend/frontend.did.d.ts +172 -0
  18. package/dist/declarations/frontend/frontend.factory.did.js +208 -0
  19. package/dist/declarations/frontend/index.d.ts +45 -0
  20. package/dist/declarations/frontend/index.js +32 -0
  21. package/dist/declarations/ic/ic.did +82 -0
  22. package/dist/declarations/ic/ic.did.d.ts +77 -0
  23. package/dist/declarations/ic/ic.factory.did.js +128 -0
  24. package/dist/declarations/internet_identity/index.d.ts +45 -0
  25. package/dist/declarations/internet_identity/index.js +32 -0
  26. package/dist/declarations/internet_identity/internet_identity.did +271 -0
  27. package/dist/declarations/internet_identity/internet_identity.did.d.ts +161 -0
  28. package/dist/declarations/internet_identity/internet_identity.factory.did.js +187 -0
  29. package/dist/declarations/ledger/index.d.ts +45 -0
  30. package/dist/declarations/ledger/index.js +32 -0
  31. package/dist/declarations/ledger/ledger.did +249 -0
  32. package/dist/declarations/ledger/ledger.did.d.ts +100 -0
  33. package/dist/declarations/ledger/ledger.factory.did.js +98 -0
  34. package/dist/declarations/mission_control/index.d.ts +45 -0
  35. package/dist/declarations/mission_control/index.js +32 -0
  36. package/dist/declarations/mission_control/mission_control.did.d.ts +24 -0
  37. package/dist/declarations/mission_control/mission_control.factory.did.js +28 -0
  38. package/dist/declarations/satellite/index.d.ts +45 -0
  39. package/dist/declarations/satellite/index.js +32 -0
  40. package/dist/declarations/satellite/satellite.did.d.ts +168 -0
  41. package/dist/declarations/satellite/satellite.factory.did.js +169 -0
  42. package/dist/declarations/satellite/satellite.factory.did.mjs +169 -0
  43. package/dist/node/index.mjs +72 -0
  44. package/dist/node/index.mjs.map +7 -0
  45. package/dist/types/api/actor.api.d.ts +4 -4
  46. package/dist/types/api/satellite.api.d.ts +1 -1
  47. package/dist/types/types/ic.types.d.ts +1 -1
  48. package/package.json +12 -5
  49. package/dist/cjs/index.cjs.js +0 -70
  50. package/dist/cjs/index.cjs.js.map +0 -7
  51. package/dist/esm/canisterStatus-XJAXQVDF.js +0 -2
  52. package/dist/esm/chunk-RNCSYUTB.js +0 -63
  53. package/dist/esm/chunk-RNCSYUTB.js.map +0 -7
  54. package/dist/esm/index.js +0 -2
  55. package/dist/esm/index.js.map +0 -7
  56. package/dist/types/utils/did.utils.d.ts +0 -4
  57. /package/dist/{esm/canisterStatus-XJAXQVDF.js.map → browser/canisterStatus-D52DQGXX.js.map} +0 -0
@@ -0,0 +1,82 @@
1
+ type canister_id = principal;
2
+ type user_id = principal;
3
+ type wasm_module = blob;
4
+
5
+ type canister_settings = record {
6
+ controllers : opt vec principal;
7
+ compute_allocation : opt nat;
8
+ memory_allocation : opt nat;
9
+ freezing_threshold : opt nat;
10
+ };
11
+
12
+ type definite_canister_settings = record {
13
+ controllers : vec principal;
14
+ compute_allocation : nat;
15
+ memory_allocation : nat;
16
+ freezing_threshold : nat;
17
+ };
18
+
19
+ type http_header = record { name: text; value: text };
20
+
21
+ type http_response = record {
22
+ status: nat;
23
+ headers: vec http_header;
24
+ body: blob;
25
+ };
26
+
27
+ type http_request_error = variant {
28
+ no_consensus;
29
+ timeout;
30
+ bad_tls;
31
+ invalid_url;
32
+ transform_error;
33
+ dns_error;
34
+ unreachable;
35
+ conn_timeout;
36
+ };
37
+
38
+ service ic : {
39
+ create_canister : (record {
40
+ settings : opt canister_settings
41
+ }) -> (record {canister_id : canister_id});
42
+ update_settings : (record {
43
+ canister_id : principal;
44
+ settings : canister_settings
45
+ }) -> ();
46
+ install_code : (record {
47
+ mode : variant {install; reinstall; upgrade};
48
+ canister_id : canister_id;
49
+ wasm_module : wasm_module;
50
+ arg : blob;
51
+ }) -> ();
52
+ uninstall_code : (record {canister_id : canister_id}) -> ();
53
+ start_canister : (record {canister_id : canister_id}) -> ();
54
+ stop_canister : (record {canister_id : canister_id}) -> ();
55
+ canister_status : (record {canister_id : canister_id}) -> (record {
56
+ status : variant { running; stopping; stopped };
57
+ settings: definite_canister_settings;
58
+ module_hash: opt blob;
59
+ memory_size: nat;
60
+ cycles: nat;
61
+ });
62
+ delete_canister : (record {canister_id : canister_id}) -> ();
63
+ deposit_cycles : (record {canister_id : canister_id}) -> ();
64
+ raw_rand : () -> (blob);
65
+ http_request : (record {
66
+ url : text;
67
+ method : variant { get };
68
+ headers: vec http_header;
69
+ body : opt blob;
70
+ transform : opt variant {
71
+ function: func (http_response) -> (http_response) query
72
+ };
73
+ }) -> (variant { Ok : http_response; Err: opt http_request_error });
74
+
75
+ // provisional interfaces for the pre-ledger world
76
+ provisional_create_canister_with_cycles : (record {
77
+ amount: opt nat;
78
+ settings : opt canister_settings
79
+ }) -> (record {canister_id : canister_id});
80
+ provisional_top_up_canister :
81
+ (record { canister_id: canister_id; amount: nat }) -> ();
82
+ }
@@ -0,0 +1,77 @@
1
+ import type {Principal} from '@dfinity/principal';
2
+ export type canister_id = Principal;
3
+ export interface canister_settings {
4
+ freezing_threshold: [] | [bigint];
5
+ controllers: [] | [Array<Principal>];
6
+ memory_allocation: [] | [bigint];
7
+ compute_allocation: [] | [bigint];
8
+ }
9
+ export interface definite_canister_settings {
10
+ freezing_threshold: bigint;
11
+ controllers: Array<Principal>;
12
+ memory_allocation: bigint;
13
+ compute_allocation: bigint;
14
+ }
15
+ export interface http_header {
16
+ value: string;
17
+ name: string;
18
+ }
19
+ export type http_request_error =
20
+ | {dns_error: null}
21
+ | {no_consensus: null}
22
+ | {transform_error: null}
23
+ | {unreachable: null}
24
+ | {bad_tls: null}
25
+ | {conn_timeout: null}
26
+ | {invalid_url: null}
27
+ | {timeout: null};
28
+ export interface http_response {
29
+ status: bigint;
30
+ body: Array<number>;
31
+ headers: Array<http_header>;
32
+ }
33
+ export type user_id = Principal;
34
+ export type wasm_module = Array<number>;
35
+ export interface _SERVICE {
36
+ canister_status: (arg_0: {canister_id: canister_id}) => Promise<{
37
+ status: {stopped: null} | {stopping: null} | {running: null};
38
+ memory_size: bigint;
39
+ cycles: bigint;
40
+ settings: definite_canister_settings;
41
+ module_hash: [] | [Array<number>];
42
+ }>;
43
+ create_canister: (arg_0: {
44
+ settings: [] | [canister_settings];
45
+ }) => Promise<{canister_id: canister_id}>;
46
+ delete_canister: (arg_0: {canister_id: canister_id}) => Promise<undefined>;
47
+ deposit_cycles: (arg_0: {canister_id: canister_id}) => Promise<undefined>;
48
+ http_request: (arg_0: {
49
+ url: string;
50
+ method: {get: null};
51
+ body: [] | [Array<number>];
52
+ transform: [] | [{function: [Principal, string]}];
53
+ headers: Array<http_header>;
54
+ }) => Promise<{Ok: http_response} | {Err: [] | [http_request_error]}>;
55
+ install_code: (arg_0: {
56
+ arg: Array<number>;
57
+ wasm_module: wasm_module;
58
+ mode: {reinstall: null} | {upgrade: null} | {install: null};
59
+ canister_id: canister_id;
60
+ }) => Promise<undefined>;
61
+ provisional_create_canister_with_cycles: (arg_0: {
62
+ settings: [] | [canister_settings];
63
+ amount: [] | [bigint];
64
+ }) => Promise<{canister_id: canister_id}>;
65
+ provisional_top_up_canister: (arg_0: {
66
+ canister_id: canister_id;
67
+ amount: bigint;
68
+ }) => Promise<undefined>;
69
+ raw_rand: () => Promise<Array<number>>;
70
+ start_canister: (arg_0: {canister_id: canister_id}) => Promise<undefined>;
71
+ stop_canister: (arg_0: {canister_id: canister_id}) => Promise<undefined>;
72
+ uninstall_code: (arg_0: {canister_id: canister_id}) => Promise<undefined>;
73
+ update_settings: (arg_0: {
74
+ canister_id: Principal;
75
+ settings: canister_settings;
76
+ }) => Promise<undefined>;
77
+ }
@@ -0,0 +1,128 @@
1
+ export const idlFactory = ({IDL}) => {
2
+ const canister_id = IDL.Principal;
3
+ const definite_canister_settings = IDL.Record({
4
+ freezing_threshold: IDL.Nat,
5
+ controllers: IDL.Vec(IDL.Principal),
6
+ memory_allocation: IDL.Nat,
7
+ compute_allocation: IDL.Nat
8
+ });
9
+ const canister_settings = IDL.Record({
10
+ freezing_threshold: IDL.Opt(IDL.Nat),
11
+ controllers: IDL.Opt(IDL.Vec(IDL.Principal)),
12
+ memory_allocation: IDL.Opt(IDL.Nat),
13
+ compute_allocation: IDL.Opt(IDL.Nat)
14
+ });
15
+ const http_header = IDL.Record({value: IDL.Text, name: IDL.Text});
16
+ const http_response = IDL.Record({
17
+ status: IDL.Nat,
18
+ body: IDL.Vec(IDL.Nat8),
19
+ headers: IDL.Vec(http_header)
20
+ });
21
+ const http_request_error = IDL.Variant({
22
+ dns_error: IDL.Null,
23
+ no_consensus: IDL.Null,
24
+ transform_error: IDL.Null,
25
+ unreachable: IDL.Null,
26
+ bad_tls: IDL.Null,
27
+ conn_timeout: IDL.Null,
28
+ invalid_url: IDL.Null,
29
+ timeout: IDL.Null
30
+ });
31
+ const wasm_module = IDL.Vec(IDL.Nat8);
32
+ return IDL.Service({
33
+ canister_status: IDL.Func(
34
+ [IDL.Record({canister_id: canister_id})],
35
+ [
36
+ IDL.Record({
37
+ status: IDL.Variant({
38
+ stopped: IDL.Null,
39
+ stopping: IDL.Null,
40
+ running: IDL.Null
41
+ }),
42
+ memory_size: IDL.Nat,
43
+ cycles: IDL.Nat,
44
+ settings: definite_canister_settings,
45
+ module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
46
+ })
47
+ ],
48
+ []
49
+ ),
50
+ create_canister: IDL.Func(
51
+ [IDL.Record({settings: IDL.Opt(canister_settings)})],
52
+ [IDL.Record({canister_id: canister_id})],
53
+ []
54
+ ),
55
+ delete_canister: IDL.Func([IDL.Record({canister_id: canister_id})], [], []),
56
+ deposit_cycles: IDL.Func([IDL.Record({canister_id: canister_id})], [], []),
57
+ http_request: IDL.Func(
58
+ [
59
+ IDL.Record({
60
+ url: IDL.Text,
61
+ method: IDL.Variant({get: IDL.Null}),
62
+ body: IDL.Opt(IDL.Vec(IDL.Nat8)),
63
+ transform: IDL.Opt(
64
+ IDL.Variant({
65
+ function: IDL.Func([http_response], [http_response], ['query'])
66
+ })
67
+ ),
68
+ headers: IDL.Vec(http_header)
69
+ })
70
+ ],
71
+ [
72
+ IDL.Variant({
73
+ Ok: http_response,
74
+ Err: IDL.Opt(http_request_error)
75
+ })
76
+ ],
77
+ []
78
+ ),
79
+ install_code: IDL.Func(
80
+ [
81
+ IDL.Record({
82
+ arg: IDL.Vec(IDL.Nat8),
83
+ wasm_module: wasm_module,
84
+ mode: IDL.Variant({
85
+ reinstall: IDL.Null,
86
+ upgrade: IDL.Null,
87
+ install: IDL.Null
88
+ }),
89
+ canister_id: canister_id
90
+ })
91
+ ],
92
+ [],
93
+ []
94
+ ),
95
+ provisional_create_canister_with_cycles: IDL.Func(
96
+ [
97
+ IDL.Record({
98
+ settings: IDL.Opt(canister_settings),
99
+ amount: IDL.Opt(IDL.Nat)
100
+ })
101
+ ],
102
+ [IDL.Record({canister_id: canister_id})],
103
+ []
104
+ ),
105
+ provisional_top_up_canister: IDL.Func(
106
+ [IDL.Record({canister_id: canister_id, amount: IDL.Nat})],
107
+ [],
108
+ []
109
+ ),
110
+ raw_rand: IDL.Func([], [IDL.Vec(IDL.Nat8)], []),
111
+ start_canister: IDL.Func([IDL.Record({canister_id: canister_id})], [], []),
112
+ stop_canister: IDL.Func([IDL.Record({canister_id: canister_id})], [], []),
113
+ uninstall_code: IDL.Func([IDL.Record({canister_id: canister_id})], [], []),
114
+ update_settings: IDL.Func(
115
+ [
116
+ IDL.Record({
117
+ canister_id: IDL.Principal,
118
+ settings: canister_settings
119
+ })
120
+ ],
121
+ [],
122
+ []
123
+ )
124
+ });
125
+ };
126
+ export const init = ({IDL}) => {
127
+ return [];
128
+ };
@@ -0,0 +1,45 @@
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>;
@@ -0,0 +1,32 @@
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
+ };
@@ -0,0 +1,271 @@
1
+ type UserNumber = nat64;
2
+ type PublicKey = blob;
3
+ type CredentialId = blob;
4
+ type DeviceKey = PublicKey;
5
+ type UserKey = PublicKey;
6
+ type SessionKey = PublicKey;
7
+ type FrontendHostname = text;
8
+ type Timestamp = nat64;
9
+
10
+ type HeaderField = record {
11
+ text;
12
+ text;
13
+ };
14
+
15
+ type HttpRequest = record {
16
+ method: text;
17
+ url: text;
18
+ headers: vec HeaderField;
19
+ body: blob;
20
+ };
21
+
22
+ type HttpResponse = record {
23
+ status_code: nat16;
24
+ headers: vec HeaderField;
25
+ body: blob;
26
+ streaming_strategy: opt StreamingStrategy;
27
+ };
28
+
29
+ type StreamingCallbackHttpResponse = record {
30
+ body: blob;
31
+ token: opt Token;
32
+ };
33
+
34
+ type Token = record {};
35
+
36
+ type StreamingStrategy = variant {
37
+ Callback: record {
38
+ callback: func (Token) -> (StreamingCallbackHttpResponse) query;
39
+ token: Token;
40
+ };
41
+ };
42
+
43
+ type Purpose = variant {
44
+ recovery;
45
+ authentication;
46
+ };
47
+
48
+ type KeyType = variant {
49
+ unknown;
50
+ platform;
51
+ cross_platform;
52
+ seed_phrase;
53
+ };
54
+
55
+ // This describes whether a device is "protected" or not.
56
+ // When protected, a device can only be updated or removed if the
57
+ // user is authenticated with that very device.
58
+ type DeviceProtection = variant {
59
+ protected;
60
+ unprotected;
61
+ };
62
+
63
+ type Challenge = record {
64
+ png_base64: text;
65
+ challenge_key: ChallengeKey;
66
+ };
67
+
68
+ type DeviceData = record {
69
+ pubkey : DeviceKey;
70
+ alias : text;
71
+ credential_id : opt CredentialId;
72
+ purpose: Purpose;
73
+ key_type: KeyType;
74
+ protection: DeviceProtection;
75
+ };
76
+
77
+ type RegisterResponse = variant {
78
+ // A new user was successfully registered.
79
+ registered: record {
80
+ user_number: UserNumber;
81
+ };
82
+ // No more registrations are possible in this instance of the II service canister.
83
+ canister_full;
84
+ // The challenge was not successful.
85
+ bad_challenge;
86
+ };
87
+
88
+ type AddTentativeDeviceResponse = variant {
89
+ // The device was tentatively added.
90
+ added_tentatively: record {
91
+ verification_code: text;
92
+ device_registration_timeout: Timestamp;
93
+ };
94
+ // Device registration mode is off, either due to timeout or because it was never enabled.
95
+ device_registration_mode_off;
96
+ // There is another device already added tentatively
97
+ another_device_tentatively_added;
98
+ };
99
+
100
+ type VerifyTentativeDeviceResponse = variant {
101
+ // The device was successfully verified.
102
+ verified;
103
+ // Wrong verification code entered. Retry with correct code.
104
+ wrong_code: record {
105
+ retries_left: nat8
106
+ };
107
+ // Device registration mode is off, either due to timeout or because it was never enabled.
108
+ device_registration_mode_off;
109
+ // There is no tentative device to be verified.
110
+ no_device_to_verify;
111
+ };
112
+
113
+ type Delegation = record {
114
+ pubkey: PublicKey;
115
+ expiration: Timestamp;
116
+ targets: opt vec principal;
117
+ };
118
+
119
+ type SignedDelegation = record {
120
+ delegation: Delegation;
121
+ signature: blob;
122
+ };
123
+
124
+ type GetDelegationResponse = variant {
125
+ // The signed delegation was successfully retrieved.
126
+ signed_delegation: SignedDelegation;
127
+
128
+ // The signature is not ready. Maybe retry by calling `prepare_delegation`
129
+ no_such_delegation
130
+ };
131
+
132
+ type InternetIdentityStats = record {
133
+ users_registered: nat64;
134
+ storage_layout_version: nat8;
135
+ assigned_user_number_range: record {
136
+ nat64;
137
+ nat64;
138
+ };
139
+ archive_info: ArchiveInfo;
140
+ canister_creation_cycles_cost: nat64;
141
+ };
142
+
143
+ // Configuration parameters related to the archive.
144
+ type ArchiveConfig = record {
145
+ // The allowed module hash of the archive canister.
146
+ // Changing this parameter does _not_ deploy the archive, but enable archive deployments with the
147
+ // corresponding wasm module.
148
+ module_hash : blob;
149
+ // Buffered archive entries limit. If reached, II will stop accepting new anchor operations
150
+ // until the buffered operations are acknowledged by the archive.
151
+ // Currently unused: in preparation of switching the archive integration to pull.
152
+ // Configured value will be discarded for storage_layout_version < 6.
153
+ entries_buffer_limit: nat64;
154
+ // The maximum number of entries to be transferred to the archive per call.
155
+ // Currently unused: in preparation of switching the archive integration to pull.
156
+ // Configured value will be discarded for storage_layout_version < 6.
157
+ entries_fetch_limit: nat16;
158
+ // Polling interval to fetch new entries from II (in nanoseconds).
159
+ // Changes to this parameter will only take effect after an archive deployment.
160
+ // Currently unused: in preparation of switching the archive integration to pull.
161
+ // Configured value will be discarded for storage_layout_version < 6.
162
+ polling_interval_ns: nat64;
163
+
164
+ // How the entries get transferred to the archive.
165
+ // This is opt, so that the config parameter can be removed after switching from push to pull.
166
+ // Configured value will be discarded for storage_layout_version < 6.
167
+ archive_integration: opt variant {
168
+ // II pushes the entries to the archive (legacy variant).
169
+ push;
170
+ // The archive pulls the entries from II.
171
+ pull;
172
+ }
173
+ };
174
+
175
+ // Information about the archive.
176
+ type ArchiveInfo = record {
177
+ // Canister id of the archive or empty if no archive has been deployed yet.
178
+ archive_canister : opt principal;
179
+ // Configuration parameters related to the II archive.
180
+ archive_config: opt ArchiveConfig;
181
+ };
182
+
183
+ // Init arguments of II which can be supplied on install and upgrade.
184
+ // Setting a value to null keeps the previous value.
185
+ type InternetIdentityInit = record {
186
+ // Set lowest and highest anchor
187
+ assigned_user_number_range : opt record {
188
+ nat64;
189
+ nat64;
190
+ };
191
+ // Configuration parameters related to the II archive.
192
+ // Note: some parameters changes (like the polling interval) will only take effect after an archive deployment.
193
+ // See ArchiveConfig for details.
194
+ archive_config: opt ArchiveConfig;
195
+ // Set the amounts of cycles sent with the create canister message.
196
+ // This is configurable because in the staging environment cycles are required.
197
+ // The canister creation cost on mainnet is currently 100'000'000'000 cycles. If this value is higher thant the
198
+ // canister creation cost, the newly created canister will keep extra cycles.
199
+ canister_creation_cycles_cost : opt nat64;
200
+ // Config flag to upgrade the persistent state. If set to opt true it will migrate the storage layout to version 6.
201
+ upgrade_persistent_state: opt bool;
202
+ };
203
+
204
+ type ChallengeKey = text;
205
+
206
+ type ChallengeResult = record {
207
+ key : ChallengeKey;
208
+ chars : text;
209
+ };
210
+
211
+ type DeviceRegistrationInfo = record {
212
+ tentative_device : opt DeviceData;
213
+ expiration: Timestamp;
214
+ };
215
+
216
+ type IdentityAnchorInfo = record {
217
+ devices : vec DeviceData;
218
+ device_registration: opt DeviceRegistrationInfo;
219
+ };
220
+
221
+ type DeployArchiveResult = variant {
222
+ // The archive was deployed successfully and the supplied wasm module has been installed. The principal of the archive
223
+ // canister is returned.
224
+ success: principal;
225
+ // Initial archive creation is already in progress.
226
+ creation_in_progress;
227
+ // Archive deployment failed. An error description is returned.
228
+ failed: text;
229
+ };
230
+
231
+ type BufferedArchiveEntry = record {
232
+ anchor_number: UserNumber;
233
+ timestamp: Timestamp;
234
+ sequence_number: nat64;
235
+ entry: blob;
236
+ };
237
+
238
+
239
+ service : (opt InternetIdentityInit) -> {
240
+ init_salt: () -> ();
241
+ create_challenge : () -> (Challenge);
242
+ register : (DeviceData, ChallengeResult) -> (RegisterResponse);
243
+ add : (UserNumber, DeviceData) -> ();
244
+ update : (UserNumber, DeviceKey, DeviceData) -> ();
245
+ // Atomically replace device matching the device key with the new device data
246
+ replace : (UserNumber, DeviceKey, DeviceData) -> ();
247
+ remove : (UserNumber, DeviceKey) -> ();
248
+ // Returns all devices of the user (authentication and recovery) but no information about device registrations.
249
+ // Note: Will be changed in the future to be more consistent with get_anchor_info.
250
+ lookup : (UserNumber) -> (vec DeviceData) query;
251
+ get_anchor_info : (UserNumber) -> (IdentityAnchorInfo);
252
+ get_principal : (UserNumber, FrontendHostname) -> (principal) query;
253
+ stats : () -> (InternetIdentityStats) query;
254
+
255
+ enter_device_registration_mode : (UserNumber) -> (Timestamp);
256
+ exit_device_registration_mode : (UserNumber) -> ();
257
+ add_tentative_device : (UserNumber, DeviceData) -> (AddTentativeDeviceResponse);
258
+ verify_tentative_device : (UserNumber, verification_code: text) -> (VerifyTentativeDeviceResponse);
259
+
260
+ prepare_delegation : (UserNumber, FrontendHostname, SessionKey, maxTimeToLive : opt nat64) -> (UserKey, Timestamp);
261
+ get_delegation: (UserNumber, FrontendHostname, SessionKey, Timestamp) -> (GetDelegationResponse) query;
262
+
263
+ http_request: (request: HttpRequest) -> (HttpResponse) query;
264
+
265
+ deploy_archive: (wasm: blob) -> (DeployArchiveResult);
266
+ /// Returns a batch of entries _sorted by sequence number_ to be archived.
267
+ /// This is an update call because the archive information _must_ be certified.
268
+ /// Only callable by this IIs archive canister.
269
+ fetch_entries: () -> (vec BufferedArchiveEntry);
270
+ acknowledge_entries: (sequence_number: nat64) -> ();
271
+ }