@junobuild/admin 0.0.13 → 0.0.15

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 (49) hide show
  1. package/declarations/cmc/cmc.factory.did.js +2 -0
  2. package/declarations/console/console.did.d.ts +8 -1
  3. package/declarations/console/console.factory.did.js +13 -1
  4. package/declarations/console/console.factory.did.mjs +13 -1
  5. package/declarations/frontend/frontend.factory.did.js +2 -0
  6. package/declarations/ic/ic.factory.did.js +3 -0
  7. package/declarations/internet_identity/internet_identity.did +49 -1
  8. package/declarations/internet_identity/internet_identity.did.d.ts +28 -1
  9. package/declarations/internet_identity/internet_identity.factory.did.js +45 -1
  10. package/declarations/ledger/ledger.did +22 -5
  11. package/declarations/ledger/ledger.did.d.ts +18 -1
  12. package/declarations/ledger/ledger.factory.did.js +18 -1
  13. package/declarations/mission_control/mission_control.did.d.ts +42 -0
  14. package/declarations/mission_control/mission_control.factory.did.js +55 -0
  15. package/declarations/observatory/index.d.ts +45 -0
  16. package/declarations/observatory/index.js +32 -0
  17. package/declarations/observatory/observatory.did.d.ts +84 -0
  18. package/declarations/observatory/observatory.factory.did.js +93 -0
  19. package/declarations/observatory/observatory.factory.did.mjs +93 -0
  20. package/declarations/satellite/satellite.did.d.ts +19 -3
  21. package/declarations/satellite/satellite.factory.did.js +26 -7
  22. package/declarations/satellite/satellite.factory.did.mjs +28 -7
  23. package/dist/browser/index.js +12 -12
  24. package/dist/browser/index.js.map +3 -3
  25. package/dist/declarations/cmc/cmc.factory.did.js +2 -0
  26. package/dist/declarations/console/console.did.d.ts +8 -1
  27. package/dist/declarations/console/console.factory.did.js +13 -1
  28. package/dist/declarations/console/console.factory.did.mjs +13 -1
  29. package/dist/declarations/frontend/frontend.factory.did.js +2 -0
  30. package/dist/declarations/ic/ic.factory.did.js +3 -0
  31. package/dist/declarations/internet_identity/internet_identity.did +49 -1
  32. package/dist/declarations/internet_identity/internet_identity.did.d.ts +28 -1
  33. package/dist/declarations/internet_identity/internet_identity.factory.did.js +45 -1
  34. package/dist/declarations/ledger/ledger.did +22 -5
  35. package/dist/declarations/ledger/ledger.did.d.ts +18 -1
  36. package/dist/declarations/ledger/ledger.factory.did.js +18 -1
  37. package/dist/declarations/mission_control/mission_control.did.d.ts +42 -0
  38. package/dist/declarations/mission_control/mission_control.factory.did.js +55 -0
  39. package/dist/declarations/observatory/index.d.ts +45 -0
  40. package/dist/declarations/observatory/index.js +32 -0
  41. package/dist/declarations/observatory/observatory.did.d.ts +84 -0
  42. package/dist/declarations/observatory/observatory.factory.did.js +93 -0
  43. package/dist/declarations/observatory/observatory.factory.did.mjs +93 -0
  44. package/dist/declarations/satellite/satellite.did.d.ts +19 -3
  45. package/dist/declarations/satellite/satellite.factory.did.js +26 -7
  46. package/dist/declarations/satellite/satellite.factory.did.mjs +28 -7
  47. package/dist/node/index.mjs +18 -18
  48. package/dist/node/index.mjs.map +3 -3
  49. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  export const idlFactory = ({IDL}) => {
2
3
  const BlockIndex = IDL.Nat64;
3
4
  const CyclesCanisterInitPayload = IDL.Record({
@@ -53,6 +54,7 @@ export const idlFactory = ({IDL}) => {
53
54
  notify_top_up: IDL.Func([NotifyTopUpArg], [NotifyTopUpResult], [])
54
55
  });
55
56
  };
57
+ // @ts-ignore
56
58
  export const init = ({IDL}) => {
57
59
  const BlockIndex = IDL.Nat64;
58
60
  const CyclesCanisterInitPayload = IDL.Record({
@@ -1,6 +1,11 @@
1
1
  import type {ActorMethod} from '@dfinity/agent';
2
2
  import type {Principal} from '@dfinity/principal';
3
3
 
4
+ export interface AssertMissionControlCenterArgs {
5
+ mission_control_id: Principal;
6
+ user: Principal;
7
+ }
8
+ export type ControllerScope = {Write: null} | {Admin: null};
4
9
  export interface CreateSatelliteArgs {
5
10
  block_index: [] | [bigint];
6
11
  user: Principal;
@@ -33,6 +38,7 @@ export interface ReleasesVersion {
33
38
  export type Segment = {MissionControl: null} | {Satellite: null};
34
39
  export interface SetController {
35
40
  metadata: Array<[string, string]>;
41
+ scope: ControllerScope;
36
42
  expires_at: [] | [bigint];
37
43
  }
38
44
  export interface SetControllersArgs {
@@ -44,13 +50,14 @@ export interface Tokens {
44
50
  }
45
51
  export interface _SERVICE {
46
52
  add_invitation_code: ActorMethod<[string], undefined>;
53
+ assert_mission_control_center: ActorMethod<[AssertMissionControlCenterArgs], undefined>;
47
54
  create_satellite: ActorMethod<[CreateSatelliteArgs], Principal>;
48
55
  del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
49
56
  get_create_satellite_fee: ActorMethod<[GetCreateSatelliteFeeArgs], [] | [Tokens]>;
50
57
  get_credits: ActorMethod<[], Tokens>;
51
58
  get_releases_version: ActorMethod<[], ReleasesVersion>;
52
59
  get_user_mission_control_center: ActorMethod<[], [] | [MissionControl]>;
53
- init_user_mission_control_center: ActorMethod<[[] | [string]], MissionControl>;
60
+ init_user_mission_control_center: ActorMethod<[], MissionControl>;
54
61
  list_user_mission_control_centers: ActorMethod<[], Array<[Principal, MissionControl]>>;
55
62
  load_release: ActorMethod<[Segment, Uint8Array | number[], string], LoadRelease>;
56
63
  reset_release: ActorMethod<[Segment], undefined>;
@@ -1,4 +1,9 @@
1
+ // @ts-ignore
1
2
  export const idlFactory = ({IDL}) => {
3
+ const AssertMissionControlCenterArgs = IDL.Record({
4
+ mission_control_id: IDL.Principal,
5
+ user: IDL.Principal
6
+ });
2
7
  const CreateSatelliteArgs = IDL.Record({
3
8
  block_index: IDL.Opt(IDL.Nat64),
4
9
  user: IDL.Principal
@@ -24,8 +29,13 @@ export const idlFactory = ({IDL}) => {
24
29
  Satellite: IDL.Null
25
30
  });
26
31
  const LoadRelease = IDL.Record({total: IDL.Nat64, chunks: IDL.Nat64});
32
+ const ControllerScope = IDL.Variant({
33
+ Write: IDL.Null,
34
+ Admin: IDL.Null
35
+ });
27
36
  const SetController = IDL.Record({
28
37
  metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
38
+ scope: ControllerScope,
29
39
  expires_at: IDL.Opt(IDL.Nat64)
30
40
  });
31
41
  const SetControllersArgs = IDL.Record({
@@ -38,13 +48,14 @@ export const idlFactory = ({IDL}) => {
38
48
  });
39
49
  return IDL.Service({
40
50
  add_invitation_code: IDL.Func([IDL.Text], [], []),
51
+ assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
41
52
  create_satellite: IDL.Func([CreateSatelliteArgs], [IDL.Principal], []),
42
53
  del_controllers: IDL.Func([DeleteControllersArgs], [], []),
43
54
  get_create_satellite_fee: IDL.Func([GetCreateSatelliteFeeArgs], [IDL.Opt(Tokens)], ['query']),
44
55
  get_credits: IDL.Func([], [Tokens], ['query']),
45
56
  get_releases_version: IDL.Func([], [ReleasesVersion], ['query']),
46
57
  get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['query']),
47
- init_user_mission_control_center: IDL.Func([IDL.Opt(IDL.Text)], [MissionControl], []),
58
+ init_user_mission_control_center: IDL.Func([], [MissionControl], []),
48
59
  list_user_mission_control_centers: IDL.Func(
49
60
  [],
50
61
  [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],
@@ -57,6 +68,7 @@ export const idlFactory = ({IDL}) => {
57
68
  version: IDL.Func([], [IDL.Text], ['query'])
58
69
  });
59
70
  };
71
+ // @ts-ignore
60
72
  export const init = ({IDL}) => {
61
73
  return [];
62
74
  };
@@ -1,4 +1,9 @@
1
+ // @ts-ignore
1
2
  export const idlFactory = ({IDL}) => {
3
+ const AssertMissionControlCenterArgs = IDL.Record({
4
+ mission_control_id: IDL.Principal,
5
+ user: IDL.Principal
6
+ });
2
7
  const CreateSatelliteArgs = IDL.Record({
3
8
  block_index: IDL.Opt(IDL.Nat64),
4
9
  user: IDL.Principal
@@ -24,8 +29,13 @@ export const idlFactory = ({IDL}) => {
24
29
  Satellite: IDL.Null
25
30
  });
26
31
  const LoadRelease = IDL.Record({total: IDL.Nat64, chunks: IDL.Nat64});
32
+ const ControllerScope = IDL.Variant({
33
+ Write: IDL.Null,
34
+ Admin: IDL.Null
35
+ });
27
36
  const SetController = IDL.Record({
28
37
  metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
38
+ scope: ControllerScope,
29
39
  expires_at: IDL.Opt(IDL.Nat64)
30
40
  });
31
41
  const SetControllersArgs = IDL.Record({
@@ -38,13 +48,14 @@ export const idlFactory = ({IDL}) => {
38
48
  });
39
49
  return IDL.Service({
40
50
  add_invitation_code: IDL.Func([IDL.Text], [], []),
51
+ assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
41
52
  create_satellite: IDL.Func([CreateSatelliteArgs], [IDL.Principal], []),
42
53
  del_controllers: IDL.Func([DeleteControllersArgs], [], []),
43
54
  get_create_satellite_fee: IDL.Func([GetCreateSatelliteFeeArgs], [IDL.Opt(Tokens)], ['query']),
44
55
  get_credits: IDL.Func([], [Tokens], ['query']),
45
56
  get_releases_version: IDL.Func([], [ReleasesVersion], ['query']),
46
57
  get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['query']),
47
- init_user_mission_control_center: IDL.Func([IDL.Opt(IDL.Text)], [MissionControl], []),
58
+ init_user_mission_control_center: IDL.Func([], [MissionControl], []),
48
59
  list_user_mission_control_centers: IDL.Func(
49
60
  [],
50
61
  [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],
@@ -57,6 +68,7 @@ export const idlFactory = ({IDL}) => {
57
68
  version: IDL.Func([], [IDL.Text], ['query'])
58
69
  });
59
70
  };
71
+ // @ts-ignore
60
72
  export const init = ({IDL}) => {
61
73
  return [];
62
74
  };
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  export const idlFactory = ({IDL}) => {
2
3
  const ClearArguments = IDL.Record({});
3
4
  const BatchId = IDL.Nat;
@@ -203,6 +204,7 @@ export const idlFactory = ({IDL}) => {
203
204
  validate_revoke_permission: IDL.Func([RevokePermission], [ValidationResult], [])
204
205
  });
205
206
  };
207
+ // @ts-ignore
206
208
  export const init = ({IDL}) => {
207
209
  return [];
208
210
  };
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  export const idlFactory = ({IDL}) => {
2
3
  const canister_id = IDL.Principal;
3
4
  const definite_canister_settings = IDL.Record({
@@ -123,6 +124,8 @@ export const idlFactory = ({IDL}) => {
123
124
  )
124
125
  });
125
126
  };
127
+
128
+ // @ts-ignore
126
129
  export const init = ({IDL}) => {
127
130
  return [];
128
131
  };
@@ -74,6 +74,12 @@ type DeviceData = record {
74
74
  key_type: KeyType;
75
75
  protection: DeviceProtection;
76
76
  origin: opt text;
77
+ // Metadata map for additional device information.
78
+ //
79
+ // Note: some fields above will be moved to the metadata map in the future.
80
+ // All field names of `DeviceData` (such as 'alias', 'origin, etc.) are
81
+ // reserved and cannot be written.
82
+ metadata: opt MetadataMap;
77
83
  };
78
84
 
79
85
  // The same as `DeviceData` but with the `last_usage` field.
@@ -87,6 +93,14 @@ type DeviceWithUsage = record {
87
93
  protection: DeviceProtection;
88
94
  origin: opt text;
89
95
  last_usage: opt Timestamp;
96
+ metadata: opt MetadataMap;
97
+ };
98
+
99
+ // Map with some variants for the value type.
100
+ // Note, due to the Candid mapping this must be a tuple type thus we cannot name the fields `key` and `value`.
101
+ type MetadataMap = vec record {
102
+ text;
103
+ variant { map : MetadataMap; string : text; bytes : vec nat8 };
90
104
  };
91
105
 
92
106
  type RegisterResponse = variant {
@@ -155,6 +169,9 @@ type InternetIdentityStats = record {
155
169
  archive_info: ArchiveInfo;
156
170
  canister_creation_cycles_cost: nat64;
157
171
  active_anchor_stats: opt ActiveAnchorStatistics;
172
+ domain_active_anchor_stats: opt DomainActiveAnchorStatistics;
173
+ max_num_latest_delegation_origins: nat64;
174
+ latest_delegation_origins: vec FrontendHostname
158
175
  };
159
176
 
160
177
  // Configuration parameters related to the archive.
@@ -216,6 +233,34 @@ type ActiveAnchorCounter = record {
216
233
  counter: nat64;
217
234
  };
218
235
 
236
+ type DomainActiveAnchorStatistics = record {
237
+ // Stats for the last completed collection period for daily and monthly active anchors
238
+ completed: DomainCompletedActiveAnchorStats;
239
+ // ongoing periods for daily and monthly active anchors
240
+ ongoing: DomainOngoingActiveAnchorStats;
241
+ };
242
+
243
+ type DomainCompletedActiveAnchorStats = record {
244
+ daily_active_anchors: opt DomainActiveAnchorCounter;
245
+ monthly_active_anchors: opt DomainActiveAnchorCounter;
246
+ };
247
+
248
+ type DomainOngoingActiveAnchorStats = record {
249
+ // Ongoing active anchor counter for the current 24 h time bucket.
250
+ daily_active_anchors: DomainActiveAnchorCounter;
251
+ // Monthly active users are collected using 30-day sliding windows.
252
+ // This vec contains up to 30 30-day active windows each offset by one day.
253
+ // The vec is sorted, new collection windows are added at the end.
254
+ monthly_active_anchors: vec DomainActiveAnchorCounter;
255
+ };
256
+
257
+ type DomainActiveAnchorCounter = record {
258
+ start_timestamp: Timestamp;
259
+ ic0_app_counter: nat64;
260
+ internetcomputer_org_counter: nat64;
261
+ both_ii_domains_counter: nat64;
262
+ };
263
+
219
264
  // Init arguments of II which can be supplied on install and upgrade.
220
265
  // Setting a value to null keeps the previous value.
221
266
  type InternetIdentityInit = record {
@@ -235,6 +280,9 @@ type InternetIdentityInit = record {
235
280
  canister_creation_cycles_cost : opt nat64;
236
281
  // Rate limit for the `register` call.
237
282
  register_rate_limit : opt RateLimitConfig;
283
+ // Maximum number of latest delegation origins to track.
284
+ // Default: 1000
285
+ max_num_latest_delegation_origins : opt nat64;
238
286
  };
239
287
 
240
288
  type ChallengeKey = text;
@@ -295,7 +343,7 @@ type BufferedArchiveEntry = record {
295
343
  service : (opt InternetIdentityInit) -> {
296
344
  init_salt: () -> ();
297
345
  create_challenge : () -> (Challenge);
298
- register : (DeviceData, ChallengeResult) -> (RegisterResponse);
346
+ register : (DeviceData, ChallengeResult, opt principal) -> (RegisterResponse);
299
347
  add : (UserNumber, DeviceData) -> ();
300
348
  update : (UserNumber, DeviceKey, DeviceData) -> ();
301
349
  // Atomically replace device matching the device key with the new device data
@@ -66,6 +66,7 @@ export type DeployArchiveResult =
66
66
  | {failed: string};
67
67
  export interface DeviceData {
68
68
  alias: string;
69
+ metadata: [] | [MetadataMap];
69
70
  origin: [] | [string];
70
71
  protection: DeviceProtection;
71
72
  pubkey: DeviceKey;
@@ -82,6 +83,7 @@ export interface DeviceRegistrationInfo {
82
83
  export interface DeviceWithUsage {
83
84
  alias: string;
84
85
  last_usage: [] | [Timestamp];
86
+ metadata: [] | [MetadataMap];
85
87
  origin: [] | [string];
86
88
  protection: DeviceProtection;
87
89
  pubkey: DeviceKey;
@@ -89,6 +91,24 @@ export interface DeviceWithUsage {
89
91
  purpose: Purpose;
90
92
  credential_id: [] | [CredentialId];
91
93
  }
94
+ export interface DomainActiveAnchorCounter {
95
+ start_timestamp: Timestamp;
96
+ internetcomputer_org_counter: bigint;
97
+ ic0_app_counter: bigint;
98
+ both_ii_domains_counter: bigint;
99
+ }
100
+ export interface DomainActiveAnchorStatistics {
101
+ completed: DomainCompletedActiveAnchorStats;
102
+ ongoing: DomainOngoingActiveAnchorStats;
103
+ }
104
+ export interface DomainCompletedActiveAnchorStats {
105
+ monthly_active_anchors: [] | [DomainActiveAnchorCounter];
106
+ daily_active_anchors: [] | [DomainActiveAnchorCounter];
107
+ }
108
+ export interface DomainOngoingActiveAnchorStats {
109
+ monthly_active_anchors: Array<DomainActiveAnchorCounter>;
110
+ daily_active_anchors: DomainActiveAnchorCounter;
111
+ }
92
112
  export type FrontendHostname = string;
93
113
  export type GetDelegationResponse =
94
114
  | {no_such_delegation: null}
@@ -112,6 +132,7 @@ export interface IdentityAnchorInfo {
112
132
  device_registration: [] | [DeviceRegistrationInfo];
113
133
  }
114
134
  export interface InternetIdentityInit {
135
+ max_num_latest_delegation_origins: [] | [bigint];
115
136
  assigned_user_number_range: [] | [[bigint, bigint]];
116
137
  archive_config: [] | [ArchiveConfig];
117
138
  canister_creation_cycles_cost: [] | [bigint];
@@ -120,7 +141,10 @@ export interface InternetIdentityInit {
120
141
  export interface InternetIdentityStats {
121
142
  storage_layout_version: number;
122
143
  users_registered: bigint;
144
+ domain_active_anchor_stats: [] | [DomainActiveAnchorStatistics];
145
+ max_num_latest_delegation_origins: bigint;
123
146
  assigned_user_number_range: [bigint, bigint];
147
+ latest_delegation_origins: Array<FrontendHostname>;
124
148
  archive_info: ArchiveInfo;
125
149
  canister_creation_cycles_cost: bigint;
126
150
  active_anchor_stats: [] | [ActiveAnchorStatistics];
@@ -130,6 +154,9 @@ export type KeyType =
130
154
  | {seed_phrase: null}
131
155
  | {cross_platform: null}
132
156
  | {unknown: null};
157
+ export type MetadataMap = Array<
158
+ [string, {map: MetadataMap} | {string: string} | {bytes: Uint8Array | number[]}]
159
+ >;
133
160
  export interface OngoingActiveAnchorStats {
134
161
  monthly_active_anchors: Array<ActiveAnchorCounter>;
135
162
  daily_active_anchors: ActiveAnchorCounter;
@@ -195,7 +222,7 @@ export interface _SERVICE {
195
222
  [UserNumber, FrontendHostname, SessionKey, [] | [bigint]],
196
223
  [UserKey, Timestamp]
197
224
  >;
198
- register: ActorMethod<[DeviceData, ChallengeResult], RegisterResponse>;
225
+ register: ActorMethod<[DeviceData, ChallengeResult, [] | [Principal]], RegisterResponse>;
199
226
  remove: ActorMethod<[UserNumber, DeviceKey], undefined>;
200
227
  replace: ActorMethod<[UserNumber, DeviceKey, DeviceData], undefined>;
201
228
  stats: ActorMethod<[], InternetIdentityStats>;
@@ -1,4 +1,6 @@
1
+ // @ts-ignore
1
2
  export const idlFactory = ({IDL}) => {
3
+ const MetadataMap = IDL.Rec();
2
4
  const ArchiveConfig = IDL.Record({
3
5
  polling_interval_ns: IDL.Nat64,
4
6
  entries_buffer_limit: IDL.Nat64,
@@ -10,12 +12,25 @@ export const idlFactory = ({IDL}) => {
10
12
  time_per_token_ns: IDL.Nat64
11
13
  });
12
14
  const InternetIdentityInit = IDL.Record({
15
+ max_num_latest_delegation_origins: IDL.Opt(IDL.Nat64),
13
16
  assigned_user_number_range: IDL.Opt(IDL.Tuple(IDL.Nat64, IDL.Nat64)),
14
17
  archive_config: IDL.Opt(ArchiveConfig),
15
18
  canister_creation_cycles_cost: IDL.Opt(IDL.Nat64),
16
19
  register_rate_limit: IDL.Opt(RateLimitConfig)
17
20
  });
18
21
  const UserNumber = IDL.Nat64;
22
+ MetadataMap.fill(
23
+ IDL.Vec(
24
+ IDL.Tuple(
25
+ IDL.Text,
26
+ IDL.Variant({
27
+ map: MetadataMap,
28
+ string: IDL.Text,
29
+ bytes: IDL.Vec(IDL.Nat8)
30
+ })
31
+ )
32
+ )
33
+ );
19
34
  const DeviceProtection = IDL.Variant({
20
35
  unprotected: IDL.Null,
21
36
  protected: IDL.Null
@@ -35,6 +50,7 @@ export const idlFactory = ({IDL}) => {
35
50
  const CredentialId = IDL.Vec(IDL.Nat8);
36
51
  const DeviceData = IDL.Record({
37
52
  alias: IDL.Text,
53
+ metadata: IDL.Opt(MetadataMap),
38
54
  origin: IDL.Opt(IDL.Text),
39
55
  protection: DeviceProtection,
40
56
  pubkey: DeviceKey,
@@ -79,6 +95,7 @@ export const idlFactory = ({IDL}) => {
79
95
  const DeviceWithUsage = IDL.Record({
80
96
  alias: IDL.Text,
81
97
  last_usage: IDL.Opt(Timestamp),
98
+ metadata: IDL.Opt(MetadataMap),
82
99
  origin: IDL.Opt(IDL.Text),
83
100
  protection: DeviceProtection,
84
101
  pubkey: DeviceKey,
@@ -144,6 +161,24 @@ export const idlFactory = ({IDL}) => {
144
161
  canister_full: IDL.Null,
145
162
  registered: IDL.Record({user_number: UserNumber})
146
163
  });
164
+ const DomainActiveAnchorCounter = IDL.Record({
165
+ start_timestamp: Timestamp,
166
+ internetcomputer_org_counter: IDL.Nat64,
167
+ ic0_app_counter: IDL.Nat64,
168
+ both_ii_domains_counter: IDL.Nat64
169
+ });
170
+ const DomainCompletedActiveAnchorStats = IDL.Record({
171
+ monthly_active_anchors: IDL.Opt(DomainActiveAnchorCounter),
172
+ daily_active_anchors: IDL.Opt(DomainActiveAnchorCounter)
173
+ });
174
+ const DomainOngoingActiveAnchorStats = IDL.Record({
175
+ monthly_active_anchors: IDL.Vec(DomainActiveAnchorCounter),
176
+ daily_active_anchors: DomainActiveAnchorCounter
177
+ });
178
+ const DomainActiveAnchorStatistics = IDL.Record({
179
+ completed: DomainCompletedActiveAnchorStats,
180
+ ongoing: DomainOngoingActiveAnchorStats
181
+ });
147
182
  const ArchiveInfo = IDL.Record({
148
183
  archive_config: IDL.Opt(ArchiveConfig),
149
184
  archive_canister: IDL.Opt(IDL.Principal)
@@ -167,7 +202,10 @@ export const idlFactory = ({IDL}) => {
167
202
  const InternetIdentityStats = IDL.Record({
168
203
  storage_layout_version: IDL.Nat8,
169
204
  users_registered: IDL.Nat64,
205
+ domain_active_anchor_stats: IDL.Opt(DomainActiveAnchorStatistics),
206
+ max_num_latest_delegation_origins: IDL.Nat64,
170
207
  assigned_user_number_range: IDL.Tuple(IDL.Nat64, IDL.Nat64),
208
+ latest_delegation_origins: IDL.Vec(FrontendHostname),
171
209
  archive_info: ArchiveInfo,
172
210
  canister_creation_cycles_cost: IDL.Nat64,
173
211
  active_anchor_stats: IDL.Opt(ActiveAnchorStatistics)
@@ -204,7 +242,11 @@ export const idlFactory = ({IDL}) => {
204
242
  [UserKey, Timestamp],
205
243
  []
206
244
  ),
207
- register: IDL.Func([DeviceData, ChallengeResult], [RegisterResponse], []),
245
+ register: IDL.Func(
246
+ [DeviceData, ChallengeResult, IDL.Opt(IDL.Principal)],
247
+ [RegisterResponse],
248
+ []
249
+ ),
208
250
  remove: IDL.Func([UserNumber, DeviceKey], [], []),
209
251
  replace: IDL.Func([UserNumber, DeviceKey, DeviceData], [], []),
210
252
  stats: IDL.Func([], [InternetIdentityStats], ['query']),
@@ -212,6 +254,7 @@ export const idlFactory = ({IDL}) => {
212
254
  verify_tentative_device: IDL.Func([UserNumber, IDL.Text], [VerifyTentativeDeviceResponse], [])
213
255
  });
214
256
  };
257
+ // @ts-ignore
215
258
  export const init = ({IDL}) => {
216
259
  const ArchiveConfig = IDL.Record({
217
260
  polling_interval_ns: IDL.Nat64,
@@ -224,6 +267,7 @@ export const init = ({IDL}) => {
224
267
  time_per_token_ns: IDL.Nat64
225
268
  });
226
269
  const InternetIdentityInit = IDL.Record({
270
+ max_num_latest_delegation_origins: IDL.Opt(IDL.Nat64),
227
271
  assigned_user_number_range: IDL.Opt(IDL.Tuple(IDL.Nat64, IDL.Nat64)),
228
272
  archive_config: IDL.Opt(ArchiveConfig),
229
273
  canister_creation_cycles_cost: IDL.Opt(IDL.Nat64),
@@ -22,6 +22,13 @@ type SubAccount = blob;
22
22
  // Sequence number of a block produced by the ledger.
23
23
  type BlockIndex = nat64;
24
24
 
25
+ type Transaction = record {
26
+ memo : Memo;
27
+ icrc1_memo: opt blob;
28
+ operation : opt Operation;
29
+ created_at_time : TimeStamp;
30
+ };
31
+
25
32
  // An arbitrary number associated with a transaction.
26
33
  // The caller can set it in a `transfer` call as a correlation identifier.
27
34
  type Memo = nat64;
@@ -105,13 +112,23 @@ type Operation = variant {
105
112
  amount : Tokens;
106
113
  fee : Tokens;
107
114
  };
115
+ Approve : record {
116
+ from : AccountIdentifier;
117
+ spender : AccountIdentifier;
118
+ allowance_e8s : int;
119
+ fee : Tokens;
120
+ expires_at : opt TimeStamp;
121
+ };
122
+ TransferFrom : record {
123
+ from : AccountIdentifier;
124
+ to : AccountIdentifier;
125
+ spender : AccountIdentifier;
126
+ amount : Tokens;
127
+ fee : Tokens;
128
+ };
108
129
  };
109
130
 
110
- type Transaction = record {
111
- memo : Memo;
112
- operation : opt Operation;
113
- created_at_time : TimeStamp;
114
- };
131
+
115
132
 
116
133
  type Block = record {
117
134
  parent_hash : opt blob;
@@ -27,8 +27,15 @@ export interface GetBlocksArgs {
27
27
  export type Memo = bigint;
28
28
  export type Operation =
29
29
  | {
30
- Burn: {from: AccountIdentifier; amount: Tokens};
30
+ Approve: {
31
+ fee: Tokens;
32
+ from: AccountIdentifier;
33
+ allowance_e8s: bigint;
34
+ expires_at: [] | [TimeStamp];
35
+ spender: AccountIdentifier;
36
+ };
31
37
  }
38
+ | {Burn: {from: AccountIdentifier; amount: Tokens}}
32
39
  | {Mint: {to: AccountIdentifier; amount: Tokens}}
33
40
  | {
34
41
  Transfer: {
@@ -37,6 +44,15 @@ export type Operation =
37
44
  from: AccountIdentifier;
38
45
  amount: Tokens;
39
46
  };
47
+ }
48
+ | {
49
+ TransferFrom: {
50
+ to: AccountIdentifier;
51
+ fee: Tokens;
52
+ from: AccountIdentifier;
53
+ amount: Tokens;
54
+ spender: AccountIdentifier;
55
+ };
40
56
  };
41
57
  export type QueryArchiveError =
42
58
  | {
@@ -64,6 +80,7 @@ export interface Tokens {
64
80
  }
65
81
  export interface Transaction {
66
82
  memo: Memo;
83
+ icrc1_memo: [] | [Uint8Array | number[]];
67
84
  operation: [] | [Operation];
68
85
  created_at_time: TimeStamp;
69
86
  }
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  export const idlFactory = ({IDL}) => {
2
3
  const AccountIdentifier = IDL.Vec(IDL.Nat8);
3
4
  const AccountBalanceArgs = IDL.Record({account: AccountIdentifier});
@@ -10,7 +11,15 @@ export const idlFactory = ({IDL}) => {
10
11
  length: IDL.Nat64
11
12
  });
12
13
  const Memo = IDL.Nat64;
14
+ const TimeStamp = IDL.Record({timestamp_nanos: IDL.Nat64});
13
15
  const Operation = IDL.Variant({
16
+ Approve: IDL.Record({
17
+ fee: Tokens,
18
+ from: AccountIdentifier,
19
+ allowance_e8s: IDL.Int,
20
+ expires_at: IDL.Opt(TimeStamp),
21
+ spender: AccountIdentifier
22
+ }),
14
23
  Burn: IDL.Record({from: AccountIdentifier, amount: Tokens}),
15
24
  Mint: IDL.Record({to: AccountIdentifier, amount: Tokens}),
16
25
  Transfer: IDL.Record({
@@ -18,11 +27,18 @@ export const idlFactory = ({IDL}) => {
18
27
  fee: Tokens,
19
28
  from: AccountIdentifier,
20
29
  amount: Tokens
30
+ }),
31
+ TransferFrom: IDL.Record({
32
+ to: AccountIdentifier,
33
+ fee: Tokens,
34
+ from: AccountIdentifier,
35
+ amount: Tokens,
36
+ spender: AccountIdentifier
21
37
  })
22
38
  });
23
- const TimeStamp = IDL.Record({timestamp_nanos: IDL.Nat64});
24
39
  const Transaction = IDL.Record({
25
40
  memo: Memo,
41
+ icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
26
42
  operation: IDL.Opt(Operation),
27
43
  created_at_time: TimeStamp
28
44
  });
@@ -93,6 +109,7 @@ export const idlFactory = ({IDL}) => {
93
109
  transfer_fee: IDL.Func([TransferFeeArg], [TransferFee], ['query'])
94
110
  });
95
111
  };
112
+ // @ts-ignore
96
113
  export const init = ({IDL}) => {
97
114
  return [];
98
115
  };
@@ -1,22 +1,60 @@
1
1
  import type {ActorMethod} from '@dfinity/agent';
2
2
  import type {Principal} from '@dfinity/principal';
3
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};
4
13
  export interface Controller {
5
14
  updated_at: bigint;
6
15
  metadata: Array<[string, string]>;
7
16
  created_at: bigint;
17
+ scope: ControllerScope;
8
18
  expires_at: [] | [bigint];
9
19
  }
20
+ export type ControllerScope = {Write: null} | {Admin: null};
21
+ export interface CronJobStatusesSatelliteConfig {
22
+ enabled: boolean;
23
+ cycles_threshold: [] | [bigint];
24
+ }
25
+ export interface DefiniteCanisterSettings {
26
+ freezing_threshold: bigint;
27
+ controllers: Array<Principal>;
28
+ memory_allocation: bigint;
29
+ compute_allocation: bigint;
30
+ }
31
+ export type Result = {Ok: SegmentStatus} | {Err: string};
10
32
  export interface Satellite {
11
33
  updated_at: bigint;
12
34
  metadata: Array<[string, string]>;
13
35
  created_at: bigint;
14
36
  satellite_id: Principal;
15
37
  }
38
+ export interface SegmentStatus {
39
+ id: Principal;
40
+ status: CanisterStatusResponse;
41
+ metadata: [] | [Array<[string, string]>];
42
+ status_at: bigint;
43
+ }
44
+ export interface SegmentsStatuses {
45
+ satellites: [] | [Array<Result>];
46
+ mission_control: Result;
47
+ }
16
48
  export interface SetController {
17
49
  metadata: Array<[string, string]>;
50
+ scope: ControllerScope;
18
51
  expires_at: [] | [bigint];
19
52
  }
53
+ export interface StatusesArgs {
54
+ mission_control_cycles_threshold: [] | [bigint];
55
+ satellites: Array<[Principal, CronJobStatusesSatelliteConfig]>;
56
+ cycles_threshold: [] | [bigint];
57
+ }
20
58
  export interface Tokens {
21
59
  e8s: bigint;
22
60
  }
@@ -28,14 +66,18 @@ export interface _SERVICE {
28
66
  del_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
29
67
  get_user: ActorMethod<[], Principal>;
30
68
  list_mission_control_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
69
+ list_mission_control_statuses: ActorMethod<[], Array<[bigint, Result]>>;
70
+ list_satellite_statuses: ActorMethod<[Principal], [] | [Array<[bigint, Result]>]>;
31
71
  list_satellites: ActorMethod<[], Array<[Principal, Satellite]>>;
32
72
  remove_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
33
73
  remove_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
74
+ set_metadata: ActorMethod<[Array<[string, string]>], undefined>;
34
75
  set_mission_control_controllers: ActorMethod<[Array<Principal>, SetController], undefined>;
35
76
  set_satellites_controllers: ActorMethod<
36
77
  [Array<Principal>, Array<Principal>, SetController],
37
78
  undefined
38
79
  >;
80
+ status: ActorMethod<[StatusesArgs], SegmentsStatuses>;
39
81
  top_up: ActorMethod<[Principal, Tokens], undefined>;
40
82
  version: ActorMethod<[], string>;
41
83
  }