@junobuild/admin 0.0.6 → 0.0.7

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.
@@ -1,13 +1,13 @@
1
1
  import type {ActorMethod} from '@dfinity/agent';
2
2
  import type {Principal} from '@dfinity/principal';
3
3
 
4
- export interface ControllersArgs {
5
- controllers: Array<Principal>;
6
- }
7
4
  export interface CreateSatelliteArgs {
8
5
  block_index: [] | [bigint];
9
6
  user: Principal;
10
7
  }
8
+ export interface DeleteControllersArgs {
9
+ controllers: Array<Principal>;
10
+ }
11
11
  export interface GetCreateSatelliteFeeArgs {
12
12
  user: Principal;
13
13
  }
@@ -22,26 +22,39 @@ export interface MissionControl {
22
22
  owner: Principal;
23
23
  created_at: bigint;
24
24
  }
25
- export type ReleaseType = {MissionControl: null} | {Satellite: null};
25
+ export interface RateConfig {
26
+ max_tokens: bigint;
27
+ time_per_token_ns: bigint;
28
+ }
26
29
  export interface ReleasesVersion {
27
30
  satellite: [] | [string];
28
31
  mission_control: [] | [string];
29
32
  }
33
+ export type Segment = {MissionControl: null} | {Satellite: null};
34
+ export interface SetController {
35
+ metadata: Array<[string, string]>;
36
+ expires_at: [] | [bigint];
37
+ }
38
+ export interface SetControllersArgs {
39
+ controller: SetController;
40
+ controllers: Array<Principal>;
41
+ }
30
42
  export interface Tokens {
31
43
  e8s: bigint;
32
44
  }
33
45
  export interface _SERVICE {
34
- add_controllers: ActorMethod<[ControllersArgs], undefined>;
35
46
  add_invitation_code: ActorMethod<[string], undefined>;
36
47
  create_satellite: ActorMethod<[CreateSatelliteArgs], Principal>;
48
+ del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
37
49
  get_create_satellite_fee: ActorMethod<[GetCreateSatelliteFeeArgs], [] | [Tokens]>;
38
50
  get_credits: ActorMethod<[], Tokens>;
39
51
  get_releases_version: ActorMethod<[], ReleasesVersion>;
40
52
  get_user_mission_control_center: ActorMethod<[], [] | [MissionControl]>;
41
53
  init_user_mission_control_center: ActorMethod<[[] | [string]], MissionControl>;
42
54
  list_user_mission_control_centers: ActorMethod<[], Array<[Principal, MissionControl]>>;
43
- load_release: ActorMethod<[ReleaseType, Uint8Array | number[], string], LoadRelease>;
44
- remove_controllers: ActorMethod<[ControllersArgs], undefined>;
45
- reset_release: ActorMethod<[ReleaseType], undefined>;
55
+ load_release: ActorMethod<[Segment, Uint8Array | number[], string], LoadRelease>;
56
+ reset_release: ActorMethod<[Segment], undefined>;
57
+ set_controllers: ActorMethod<[SetControllersArgs], undefined>;
58
+ update_rate_config: ActorMethod<[Segment, RateConfig], undefined>;
46
59
  version: ActorMethod<[], string>;
47
60
  }
@@ -1,11 +1,11 @@
1
1
  export const idlFactory = ({IDL}) => {
2
- const ControllersArgs = IDL.Record({
3
- controllers: IDL.Vec(IDL.Principal)
4
- });
5
2
  const CreateSatelliteArgs = IDL.Record({
6
3
  block_index: IDL.Opt(IDL.Nat64),
7
4
  user: IDL.Principal
8
5
  });
6
+ const DeleteControllersArgs = IDL.Record({
7
+ controllers: IDL.Vec(IDL.Principal)
8
+ });
9
9
  const GetCreateSatelliteFeeArgs = IDL.Record({user: IDL.Principal});
10
10
  const Tokens = IDL.Record({e8s: IDL.Nat64});
11
11
  const ReleasesVersion = IDL.Record({
@@ -19,15 +19,27 @@ export const idlFactory = ({IDL}) => {
19
19
  owner: IDL.Principal,
20
20
  created_at: IDL.Nat64
21
21
  });
22
- const ReleaseType = IDL.Variant({
22
+ const Segment = IDL.Variant({
23
23
  MissionControl: IDL.Null,
24
24
  Satellite: IDL.Null
25
25
  });
26
26
  const LoadRelease = IDL.Record({total: IDL.Nat64, chunks: IDL.Nat64});
27
+ const SetController = IDL.Record({
28
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
29
+ expires_at: IDL.Opt(IDL.Nat64)
30
+ });
31
+ const SetControllersArgs = IDL.Record({
32
+ controller: SetController,
33
+ controllers: IDL.Vec(IDL.Principal)
34
+ });
35
+ const RateConfig = IDL.Record({
36
+ max_tokens: IDL.Nat64,
37
+ time_per_token_ns: IDL.Nat64
38
+ });
27
39
  return IDL.Service({
28
- add_controllers: IDL.Func([ControllersArgs], [], []),
29
40
  add_invitation_code: IDL.Func([IDL.Text], [], []),
30
41
  create_satellite: IDL.Func([CreateSatelliteArgs], [IDL.Principal], []),
42
+ del_controllers: IDL.Func([DeleteControllersArgs], [], []),
31
43
  get_create_satellite_fee: IDL.Func([GetCreateSatelliteFeeArgs], [IDL.Opt(Tokens)], ['query']),
32
44
  get_credits: IDL.Func([], [Tokens], ['query']),
33
45
  get_releases_version: IDL.Func([], [ReleasesVersion], ['query']),
@@ -38,9 +50,10 @@ export const idlFactory = ({IDL}) => {
38
50
  [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],
39
51
  ['query']
40
52
  ),
41
- load_release: IDL.Func([ReleaseType, IDL.Vec(IDL.Nat8), IDL.Text], [LoadRelease], []),
42
- remove_controllers: IDL.Func([ControllersArgs], [], []),
43
- reset_release: IDL.Func([ReleaseType], [], []),
53
+ load_release: IDL.Func([Segment, IDL.Vec(IDL.Nat8), IDL.Text], [LoadRelease], []),
54
+ reset_release: IDL.Func([Segment], [], []),
55
+ set_controllers: IDL.Func([SetControllersArgs], [], []),
56
+ update_rate_config: IDL.Func([Segment, RateConfig], [], []),
44
57
  version: IDL.Func([], [IDL.Text], ['query'])
45
58
  });
46
59
  };
@@ -1,11 +1,11 @@
1
1
  export const idlFactory = ({IDL}) => {
2
- const ControllersArgs = IDL.Record({
3
- controllers: IDL.Vec(IDL.Principal)
4
- });
5
2
  const CreateSatelliteArgs = IDL.Record({
6
3
  block_index: IDL.Opt(IDL.Nat64),
7
4
  user: IDL.Principal
8
5
  });
6
+ const DeleteControllersArgs = IDL.Record({
7
+ controllers: IDL.Vec(IDL.Principal)
8
+ });
9
9
  const GetCreateSatelliteFeeArgs = IDL.Record({user: IDL.Principal});
10
10
  const Tokens = IDL.Record({e8s: IDL.Nat64});
11
11
  const ReleasesVersion = IDL.Record({
@@ -19,15 +19,27 @@ export const idlFactory = ({IDL}) => {
19
19
  owner: IDL.Principal,
20
20
  created_at: IDL.Nat64
21
21
  });
22
- const ReleaseType = IDL.Variant({
22
+ const Segment = IDL.Variant({
23
23
  MissionControl: IDL.Null,
24
24
  Satellite: IDL.Null
25
25
  });
26
26
  const LoadRelease = IDL.Record({total: IDL.Nat64, chunks: IDL.Nat64});
27
+ const SetController = IDL.Record({
28
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
29
+ expires_at: IDL.Opt(IDL.Nat64)
30
+ });
31
+ const SetControllersArgs = IDL.Record({
32
+ controller: SetController,
33
+ controllers: IDL.Vec(IDL.Principal)
34
+ });
35
+ const RateConfig = IDL.Record({
36
+ max_tokens: IDL.Nat64,
37
+ time_per_token_ns: IDL.Nat64
38
+ });
27
39
  return IDL.Service({
28
- add_controllers: IDL.Func([ControllersArgs], [], []),
29
40
  add_invitation_code: IDL.Func([IDL.Text], [], []),
30
41
  create_satellite: IDL.Func([CreateSatelliteArgs], [IDL.Principal], []),
42
+ del_controllers: IDL.Func([DeleteControllersArgs], [], []),
31
43
  get_create_satellite_fee: IDL.Func([GetCreateSatelliteFeeArgs], [IDL.Opt(Tokens)], ['query']),
32
44
  get_credits: IDL.Func([], [Tokens], ['query']),
33
45
  get_releases_version: IDL.Func([], [ReleasesVersion], ['query']),
@@ -38,9 +50,10 @@ export const idlFactory = ({IDL}) => {
38
50
  [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],
39
51
  ['query']
40
52
  ),
41
- load_release: IDL.Func([ReleaseType, IDL.Vec(IDL.Nat8), IDL.Text], [LoadRelease], []),
42
- remove_controllers: IDL.Func([ControllersArgs], [], []),
43
- reset_release: IDL.Func([ReleaseType], [], []),
53
+ load_release: IDL.Func([Segment, IDL.Vec(IDL.Nat8), IDL.Text], [LoadRelease], []),
54
+ reset_release: IDL.Func([Segment], [], []),
55
+ set_controllers: IDL.Func([SetControllersArgs], [], []),
56
+ update_rate_config: IDL.Func([Segment, RateConfig], [], []),
44
57
  version: IDL.Func([], [IDL.Text], ['query'])
45
58
  });
46
59
  };
@@ -23,6 +23,7 @@ type HttpResponse = record {
23
23
  status_code: nat16;
24
24
  headers: vec HeaderField;
25
25
  body: blob;
26
+ upgrade : opt bool;
26
27
  streaming_strategy: opt StreamingStrategy;
27
28
  };
28
29
 
@@ -72,6 +73,20 @@ type DeviceData = record {
72
73
  purpose: Purpose;
73
74
  key_type: KeyType;
74
75
  protection: DeviceProtection;
76
+ origin: opt text;
77
+ };
78
+
79
+ // The same as `DeviceData` but with the `last_usage` field.
80
+ // This field cannot be written, hence the separate type.
81
+ type DeviceWithUsage = record {
82
+ pubkey : DeviceKey;
83
+ alias : text;
84
+ credential_id : opt CredentialId;
85
+ purpose: Purpose;
86
+ key_type: KeyType;
87
+ protection: DeviceProtection;
88
+ origin: opt text;
89
+ last_usage: opt Timestamp;
75
90
  };
76
91
 
77
92
  type RegisterResponse = variant {
@@ -89,6 +104,7 @@ type AddTentativeDeviceResponse = variant {
89
104
  // The device was tentatively added.
90
105
  added_tentatively: record {
91
106
  verification_code: text;
107
+ // Expiration date, in nanos since the epoch
92
108
  device_registration_timeout: Timestamp;
93
109
  };
94
110
  // Device registration mode is off, either due to timeout or because it was never enabled.
@@ -138,6 +154,7 @@ type InternetIdentityStats = record {
138
154
  };
139
155
  archive_info: ArchiveInfo;
140
156
  canister_creation_cycles_cost: nat64;
157
+ active_anchor_stats: opt ActiveAnchorStatistics;
141
158
  };
142
159
 
143
160
  // Configuration parameters related to the archive.
@@ -148,28 +165,12 @@ type ArchiveConfig = record {
148
165
  module_hash : blob;
149
166
  // Buffered archive entries limit. If reached, II will stop accepting new anchor operations
150
167
  // 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
168
  entries_buffer_limit: nat64;
154
169
  // 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
170
  entries_fetch_limit: nat16;
158
171
  // Polling interval to fetch new entries from II (in nanoseconds).
159
172
  // 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
173
  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
  };
174
175
 
175
176
  // Information about the archive.
@@ -180,6 +181,41 @@ type ArchiveInfo = record {
180
181
  archive_config: opt ArchiveConfig;
181
182
  };
182
183
 
184
+ // Rate limit configuration.
185
+ // Currently only used for `register`.
186
+ type RateLimitConfig = record {
187
+ // Time it takes (in ns) for a rate limiting token to be replenished.
188
+ time_per_token_ns : nat64;
189
+ // How many tokens are at most generated (to accommodate peaks).
190
+ max_tokens: nat64;
191
+ };
192
+
193
+ type ActiveAnchorStatistics = record {
194
+ // Stats for the last completed collection period for daily and monthly active anchors
195
+ completed: CompletedActiveAnchorStats;
196
+ // ongoing periods for daily and monthly active anchors
197
+ ongoing: OngoingActiveAnchorStats;
198
+ };
199
+
200
+ type CompletedActiveAnchorStats = record {
201
+ daily_active_anchors: opt ActiveAnchorCounter;
202
+ monthly_active_anchors: opt ActiveAnchorCounter;
203
+ };
204
+
205
+ type OngoingActiveAnchorStats = record {
206
+ // Ongoing active anchor counter for the current 24 h time bucket.
207
+ daily_active_anchors: ActiveAnchorCounter;
208
+ // Monthly active users are collected using 30-day sliding windows.
209
+ // This vec contains up to 30 30-day active windows each offset by one day.
210
+ // The vec is sorted, new collection windows are added at the end.
211
+ monthly_active_anchors: vec ActiveAnchorCounter;
212
+ };
213
+
214
+ type ActiveAnchorCounter = record {
215
+ start_timestamp: Timestamp;
216
+ counter: nat64;
217
+ };
218
+
183
219
  // Init arguments of II which can be supplied on install and upgrade.
184
220
  // Setting a value to null keeps the previous value.
185
221
  type InternetIdentityInit = record {
@@ -197,8 +233,8 @@ type InternetIdentityInit = record {
197
233
  // The canister creation cost on mainnet is currently 100'000'000'000 cycles. If this value is higher thant the
198
234
  // canister creation cost, the newly created canister will keep extra cycles.
199
235
  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;
236
+ // Rate limit for the `register` call.
237
+ register_rate_limit : opt RateLimitConfig;
202
238
  };
203
239
 
204
240
  type ChallengeKey = text;
@@ -208,16 +244,36 @@ type ChallengeResult = record {
208
244
  chars : text;
209
245
  };
210
246
 
247
+ // Extra information about registration status for new devices
211
248
  type DeviceRegistrationInfo = record {
249
+ // If present, the user has tentatively added a new device. This
250
+ // new device needs to be verified (see relevant endpoint) before
251
+ // 'expiration'.
212
252
  tentative_device : opt DeviceData;
253
+ // The timestamp at which the anchor will turn off registration mode
254
+ // (and the tentative device will be forgotten, if any, and if not verified)
213
255
  expiration: Timestamp;
214
256
  };
215
257
 
258
+ // Information about the anchor
216
259
  type IdentityAnchorInfo = record {
217
- devices : vec DeviceData;
260
+ // All devices that can authenticate to this anchor
261
+ devices : vec DeviceWithUsage;
262
+ // Device registration status used when adding devices, see DeviceRegistrationInfo
218
263
  device_registration: opt DeviceRegistrationInfo;
219
264
  };
220
265
 
266
+ type AnchorCredentials = record {
267
+ credentials : vec WebAuthnCredential;
268
+ recovery_credentials : vec WebAuthnCredential;
269
+ recovery_phrases: vec PublicKey;
270
+ };
271
+
272
+ type WebAuthnCredential = record {
273
+ credential_id : CredentialId;
274
+ pubkey: PublicKey;
275
+ };
276
+
221
277
  type DeployArchiveResult = variant {
222
278
  // The archive was deployed successfully and the supplied wasm module has been installed. The principal of the archive
223
279
  // canister is returned.
@@ -246,8 +302,10 @@ service : (opt InternetIdentityInit) -> {
246
302
  replace : (UserNumber, DeviceKey, DeviceData) -> ();
247
303
  remove : (UserNumber, DeviceKey) -> ();
248
304
  // 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.
305
+ // Note: Clears out the 'alias' fields on the devices. Use 'get_anchor_info' to obtain the full information.
306
+ // Deprecated: Use 'get_anchor_credentials' instead.
250
307
  lookup : (UserNumber) -> (vec DeviceData) query;
308
+ get_anchor_credentials : (UserNumber) -> (AnchorCredentials) query;
251
309
  get_anchor_info : (UserNumber) -> (IdentityAnchorInfo);
252
310
  get_principal : (UserNumber, FrontendHostname) -> (principal) query;
253
311
  stats : () -> (InternetIdentityStats) query;
@@ -261,6 +319,7 @@ service : (opt InternetIdentityInit) -> {
261
319
  get_delegation: (UserNumber, FrontendHostname, SessionKey, Timestamp) -> (GetDelegationResponse) query;
262
320
 
263
321
  http_request: (request: HttpRequest) -> (HttpResponse) query;
322
+ http_request_update: (request: HttpRequest) -> (HttpResponse);
264
323
 
265
324
  deploy_archive: (wasm: blob) -> (DeployArchiveResult);
266
325
  /// Returns a batch of entries _sorted by sequence number_ to be archived.
@@ -1,6 +1,14 @@
1
1
  import type {ActorMethod} from '@dfinity/agent';
2
2
  import type {Principal} from '@dfinity/principal';
3
3
 
4
+ export interface ActiveAnchorCounter {
5
+ counter: bigint;
6
+ start_timestamp: Timestamp;
7
+ }
8
+ export interface ActiveAnchorStatistics {
9
+ completed: CompletedActiveAnchorStats;
10
+ ongoing: OngoingActiveAnchorStats;
11
+ }
4
12
  export type AddTentativeDeviceResponse =
5
13
  | {
6
14
  device_registration_mode_off: null;
@@ -12,10 +20,14 @@ export type AddTentativeDeviceResponse =
12
20
  device_registration_timeout: Timestamp;
13
21
  };
14
22
  };
23
+ export interface AnchorCredentials {
24
+ recovery_phrases: Array<PublicKey>;
25
+ credentials: Array<WebAuthnCredential>;
26
+ recovery_credentials: Array<WebAuthnCredential>;
27
+ }
15
28
  export interface ArchiveConfig {
16
29
  polling_interval_ns: bigint;
17
30
  entries_buffer_limit: bigint;
18
- archive_integration: [] | [{pull: null} | {push: null}];
19
31
  module_hash: Uint8Array | number[];
20
32
  entries_fetch_limit: number;
21
33
  }
@@ -38,6 +50,10 @@ export interface ChallengeResult {
38
50
  key: ChallengeKey;
39
51
  chars: string;
40
52
  }
53
+ export interface CompletedActiveAnchorStats {
54
+ monthly_active_anchors: [] | [ActiveAnchorCounter];
55
+ daily_active_anchors: [] | [ActiveAnchorCounter];
56
+ }
41
57
  export type CredentialId = Uint8Array | number[];
42
58
  export interface Delegation {
43
59
  pubkey: PublicKey;
@@ -50,6 +66,7 @@ export type DeployArchiveResult =
50
66
  | {failed: string};
51
67
  export interface DeviceData {
52
68
  alias: string;
69
+ origin: [] | [string];
53
70
  protection: DeviceProtection;
54
71
  pubkey: DeviceKey;
55
72
  key_type: KeyType;
@@ -62,6 +79,16 @@ export interface DeviceRegistrationInfo {
62
79
  tentative_device: [] | [DeviceData];
63
80
  expiration: Timestamp;
64
81
  }
82
+ export interface DeviceWithUsage {
83
+ alias: string;
84
+ last_usage: [] | [Timestamp];
85
+ origin: [] | [string];
86
+ protection: DeviceProtection;
87
+ pubkey: DeviceKey;
88
+ key_type: KeyType;
89
+ purpose: Purpose;
90
+ credential_id: [] | [CredentialId];
91
+ }
65
92
  export type FrontendHostname = string;
66
93
  export type GetDelegationResponse =
67
94
  | {no_such_delegation: null}
@@ -76,18 +103,19 @@ export interface HttpRequest {
76
103
  export interface HttpResponse {
77
104
  body: Uint8Array | number[];
78
105
  headers: Array<HeaderField>;
106
+ upgrade: [] | [boolean];
79
107
  streaming_strategy: [] | [StreamingStrategy];
80
108
  status_code: number;
81
109
  }
82
110
  export interface IdentityAnchorInfo {
83
- devices: Array<DeviceData>;
111
+ devices: Array<DeviceWithUsage>;
84
112
  device_registration: [] | [DeviceRegistrationInfo];
85
113
  }
86
114
  export interface InternetIdentityInit {
87
- upgrade_persistent_state: [] | [boolean];
88
115
  assigned_user_number_range: [] | [[bigint, bigint]];
89
116
  archive_config: [] | [ArchiveConfig];
90
117
  canister_creation_cycles_cost: [] | [bigint];
118
+ register_rate_limit: [] | [RateLimitConfig];
91
119
  }
92
120
  export interface InternetIdentityStats {
93
121
  storage_layout_version: number;
@@ -95,14 +123,23 @@ export interface InternetIdentityStats {
95
123
  assigned_user_number_range: [bigint, bigint];
96
124
  archive_info: ArchiveInfo;
97
125
  canister_creation_cycles_cost: bigint;
126
+ active_anchor_stats: [] | [ActiveAnchorStatistics];
98
127
  }
99
128
  export type KeyType =
100
129
  | {platform: null}
101
130
  | {seed_phrase: null}
102
131
  | {cross_platform: null}
103
132
  | {unknown: null};
133
+ export interface OngoingActiveAnchorStats {
134
+ monthly_active_anchors: Array<ActiveAnchorCounter>;
135
+ daily_active_anchors: ActiveAnchorCounter;
136
+ }
104
137
  export type PublicKey = Uint8Array | number[];
105
138
  export type Purpose = {authentication: null} | {recovery: null};
139
+ export interface RateLimitConfig {
140
+ max_tokens: bigint;
141
+ time_per_token_ns: bigint;
142
+ }
106
143
  export type RegisterResponse =
107
144
  | {bad_challenge: null}
108
145
  | {canister_full: null}
@@ -130,6 +167,10 @@ export type VerifyTentativeDeviceResponse =
130
167
  | {verified: null}
131
168
  | {wrong_code: {retries_left: number}}
132
169
  | {no_device_to_verify: null};
170
+ export interface WebAuthnCredential {
171
+ pubkey: PublicKey;
172
+ credential_id: CredentialId;
173
+ }
133
174
  export interface _SERVICE {
134
175
  acknowledge_entries: ActorMethod<[bigint], undefined>;
135
176
  add: ActorMethod<[UserNumber, DeviceData], undefined>;
@@ -139,6 +180,7 @@ export interface _SERVICE {
139
180
  enter_device_registration_mode: ActorMethod<[UserNumber], Timestamp>;
140
181
  exit_device_registration_mode: ActorMethod<[UserNumber], undefined>;
141
182
  fetch_entries: ActorMethod<[], Array<BufferedArchiveEntry>>;
183
+ get_anchor_credentials: ActorMethod<[UserNumber], AnchorCredentials>;
142
184
  get_anchor_info: ActorMethod<[UserNumber], IdentityAnchorInfo>;
143
185
  get_delegation: ActorMethod<
144
186
  [UserNumber, FrontendHostname, SessionKey, Timestamp],
@@ -146,6 +188,7 @@ export interface _SERVICE {
146
188
  >;
147
189
  get_principal: ActorMethod<[UserNumber, FrontendHostname], Principal>;
148
190
  http_request: ActorMethod<[HttpRequest], HttpResponse>;
191
+ http_request_update: ActorMethod<[HttpRequest], HttpResponse>;
149
192
  init_salt: ActorMethod<[], undefined>;
150
193
  lookup: ActorMethod<[UserNumber], Array<DeviceData>>;
151
194
  prepare_delegation: ActorMethod<
@@ -2,15 +2,18 @@ export const idlFactory = ({IDL}) => {
2
2
  const ArchiveConfig = IDL.Record({
3
3
  polling_interval_ns: IDL.Nat64,
4
4
  entries_buffer_limit: IDL.Nat64,
5
- archive_integration: IDL.Opt(IDL.Variant({pull: IDL.Null, push: IDL.Null})),
6
5
  module_hash: IDL.Vec(IDL.Nat8),
7
6
  entries_fetch_limit: IDL.Nat16
8
7
  });
8
+ const RateLimitConfig = IDL.Record({
9
+ max_tokens: IDL.Nat64,
10
+ time_per_token_ns: IDL.Nat64
11
+ });
9
12
  const InternetIdentityInit = IDL.Record({
10
- upgrade_persistent_state: IDL.Opt(IDL.Bool),
11
13
  assigned_user_number_range: IDL.Opt(IDL.Tuple(IDL.Nat64, IDL.Nat64)),
12
14
  archive_config: IDL.Opt(ArchiveConfig),
13
- canister_creation_cycles_cost: IDL.Opt(IDL.Nat64)
15
+ canister_creation_cycles_cost: IDL.Opt(IDL.Nat64),
16
+ register_rate_limit: IDL.Opt(RateLimitConfig)
14
17
  });
15
18
  const UserNumber = IDL.Nat64;
16
19
  const DeviceProtection = IDL.Variant({
@@ -32,6 +35,7 @@ export const idlFactory = ({IDL}) => {
32
35
  const CredentialId = IDL.Vec(IDL.Nat8);
33
36
  const DeviceData = IDL.Record({
34
37
  alias: IDL.Text,
38
+ origin: IDL.Opt(IDL.Text),
35
39
  protection: DeviceProtection,
36
40
  pubkey: DeviceKey,
37
41
  key_type: KeyType,
@@ -63,12 +67,31 @@ export const idlFactory = ({IDL}) => {
63
67
  anchor_number: UserNumber,
64
68
  timestamp: Timestamp
65
69
  });
70
+ const WebAuthnCredential = IDL.Record({
71
+ pubkey: PublicKey,
72
+ credential_id: CredentialId
73
+ });
74
+ const AnchorCredentials = IDL.Record({
75
+ recovery_phrases: IDL.Vec(PublicKey),
76
+ credentials: IDL.Vec(WebAuthnCredential),
77
+ recovery_credentials: IDL.Vec(WebAuthnCredential)
78
+ });
79
+ const DeviceWithUsage = IDL.Record({
80
+ alias: IDL.Text,
81
+ last_usage: IDL.Opt(Timestamp),
82
+ origin: IDL.Opt(IDL.Text),
83
+ protection: DeviceProtection,
84
+ pubkey: DeviceKey,
85
+ key_type: KeyType,
86
+ purpose: Purpose,
87
+ credential_id: IDL.Opt(CredentialId)
88
+ });
66
89
  const DeviceRegistrationInfo = IDL.Record({
67
90
  tentative_device: IDL.Opt(DeviceData),
68
91
  expiration: Timestamp
69
92
  });
70
93
  const IdentityAnchorInfo = IDL.Record({
71
- devices: IDL.Vec(DeviceData),
94
+ devices: IDL.Vec(DeviceWithUsage),
72
95
  device_registration: IDL.Opt(DeviceRegistrationInfo)
73
96
  });
74
97
  const FrontendHostname = IDL.Text;
@@ -107,6 +130,7 @@ export const idlFactory = ({IDL}) => {
107
130
  const HttpResponse = IDL.Record({
108
131
  body: IDL.Vec(IDL.Nat8),
109
132
  headers: IDL.Vec(HeaderField),
133
+ upgrade: IDL.Opt(IDL.Bool),
110
134
  streaming_strategy: IDL.Opt(StreamingStrategy),
111
135
  status_code: IDL.Nat16
112
136
  });
@@ -124,12 +148,29 @@ export const idlFactory = ({IDL}) => {
124
148
  archive_config: IDL.Opt(ArchiveConfig),
125
149
  archive_canister: IDL.Opt(IDL.Principal)
126
150
  });
151
+ const ActiveAnchorCounter = IDL.Record({
152
+ counter: IDL.Nat64,
153
+ start_timestamp: Timestamp
154
+ });
155
+ const CompletedActiveAnchorStats = IDL.Record({
156
+ monthly_active_anchors: IDL.Opt(ActiveAnchorCounter),
157
+ daily_active_anchors: IDL.Opt(ActiveAnchorCounter)
158
+ });
159
+ const OngoingActiveAnchorStats = IDL.Record({
160
+ monthly_active_anchors: IDL.Vec(ActiveAnchorCounter),
161
+ daily_active_anchors: ActiveAnchorCounter
162
+ });
163
+ const ActiveAnchorStatistics = IDL.Record({
164
+ completed: CompletedActiveAnchorStats,
165
+ ongoing: OngoingActiveAnchorStats
166
+ });
127
167
  const InternetIdentityStats = IDL.Record({
128
168
  storage_layout_version: IDL.Nat8,
129
169
  users_registered: IDL.Nat64,
130
170
  assigned_user_number_range: IDL.Tuple(IDL.Nat64, IDL.Nat64),
131
171
  archive_info: ArchiveInfo,
132
- canister_creation_cycles_cost: IDL.Nat64
172
+ canister_creation_cycles_cost: IDL.Nat64,
173
+ active_anchor_stats: IDL.Opt(ActiveAnchorStatistics)
133
174
  });
134
175
  const VerifyTentativeDeviceResponse = IDL.Variant({
135
176
  device_registration_mode_off: IDL.Null,
@@ -146,6 +187,7 @@ export const idlFactory = ({IDL}) => {
146
187
  enter_device_registration_mode: IDL.Func([UserNumber], [Timestamp], []),
147
188
  exit_device_registration_mode: IDL.Func([UserNumber], [], []),
148
189
  fetch_entries: IDL.Func([], [IDL.Vec(BufferedArchiveEntry)], []),
190
+ get_anchor_credentials: IDL.Func([UserNumber], [AnchorCredentials], ['query']),
149
191
  get_anchor_info: IDL.Func([UserNumber], [IdentityAnchorInfo], []),
150
192
  get_delegation: IDL.Func(
151
193
  [UserNumber, FrontendHostname, SessionKey, Timestamp],
@@ -154,6 +196,7 @@ export const idlFactory = ({IDL}) => {
154
196
  ),
155
197
  get_principal: IDL.Func([UserNumber, FrontendHostname], [IDL.Principal], ['query']),
156
198
  http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
199
+ http_request_update: IDL.Func([HttpRequest], [HttpResponse], []),
157
200
  init_salt: IDL.Func([], [], []),
158
201
  lookup: IDL.Func([UserNumber], [IDL.Vec(DeviceData)], ['query']),
159
202
  prepare_delegation: IDL.Func(
@@ -173,15 +216,18 @@ export const init = ({IDL}) => {
173
216
  const ArchiveConfig = IDL.Record({
174
217
  polling_interval_ns: IDL.Nat64,
175
218
  entries_buffer_limit: IDL.Nat64,
176
- archive_integration: IDL.Opt(IDL.Variant({pull: IDL.Null, push: IDL.Null})),
177
219
  module_hash: IDL.Vec(IDL.Nat8),
178
220
  entries_fetch_limit: IDL.Nat16
179
221
  });
222
+ const RateLimitConfig = IDL.Record({
223
+ max_tokens: IDL.Nat64,
224
+ time_per_token_ns: IDL.Nat64
225
+ });
180
226
  const InternetIdentityInit = IDL.Record({
181
- upgrade_persistent_state: IDL.Opt(IDL.Bool),
182
227
  assigned_user_number_range: IDL.Opt(IDL.Tuple(IDL.Nat64, IDL.Nat64)),
183
228
  archive_config: IDL.Opt(ArchiveConfig),
184
- canister_creation_cycles_cost: IDL.Opt(IDL.Nat64)
229
+ canister_creation_cycles_cost: IDL.Opt(IDL.Nat64),
230
+ register_rate_limit: IDL.Opt(RateLimitConfig)
185
231
  });
186
232
  return [IDL.Opt(InternetIdentityInit)];
187
233
  };
@@ -1,12 +1,22 @@
1
1
  import type {ActorMethod} from '@dfinity/agent';
2
2
  import type {Principal} from '@dfinity/principal';
3
3
 
4
+ export interface Controller {
5
+ updated_at: bigint;
6
+ metadata: Array<[string, string]>;
7
+ created_at: bigint;
8
+ expires_at: [] | [bigint];
9
+ }
4
10
  export interface Satellite {
5
11
  updated_at: bigint;
6
12
  metadata: Array<[string, string]>;
7
13
  created_at: bigint;
8
14
  satellite_id: Principal;
9
15
  }
16
+ export interface SetController {
17
+ metadata: Array<[string, string]>;
18
+ expires_at: [] | [bigint];
19
+ }
10
20
  export interface Tokens {
11
21
  e8s: bigint;
12
22
  }
@@ -14,11 +24,18 @@ export interface _SERVICE {
14
24
  add_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
15
25
  add_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
16
26
  create_satellite: ActorMethod<[string], Satellite>;
27
+ del_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
28
+ del_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
17
29
  get_user: ActorMethod<[], Principal>;
18
- list_mission_control_controllers: ActorMethod<[], Array<Principal>>;
30
+ list_mission_control_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
19
31
  list_satellites: ActorMethod<[], Array<[Principal, Satellite]>>;
20
32
  remove_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
21
33
  remove_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
34
+ set_mission_control_controllers: ActorMethod<[Array<Principal>, SetController], undefined>;
35
+ set_satellites_controllers: ActorMethod<
36
+ [Array<Principal>, Array<Principal>, SetController],
37
+ undefined
38
+ >;
22
39
  top_up: ActorMethod<[Principal, Tokens], undefined>;
23
40
  version: ActorMethod<[], string>;
24
41
  }