@junobuild/admin 0.0.20 → 0.0.21

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 (73) hide show
  1. package/declarations/cmc/index.js +6 -1
  2. package/declarations/console/console.did.d.ts +5 -4
  3. package/declarations/console/console.factory.did.js +3 -2
  4. package/declarations/console/console.factory.did.mjs +3 -2
  5. package/declarations/console/index.js +6 -1
  6. package/declarations/ic/ic.did +131 -18
  7. package/declarations/ic/ic.did.d.ts +184 -53
  8. package/declarations/ic/ic.factory.did.js +167 -24
  9. package/declarations/mission_control/index.js +7 -1
  10. package/declarations/mission_control/mission_control.did.d.ts +1 -0
  11. package/declarations/mission_control/mission_control.factory.did.js +5 -0
  12. package/declarations/observatory/index.js +7 -1
  13. package/declarations/satellite/index.js +6 -1
  14. package/declarations/satellite/satellite.did.d.ts +1 -0
  15. package/declarations/satellite/satellite.factory.did.js +1 -0
  16. package/declarations/satellite/satellite.factory.did.mjs +1 -0
  17. package/dist/browser/index.js +15 -15
  18. package/dist/browser/index.js.map +4 -4
  19. package/dist/declarations/cmc/index.js +6 -1
  20. package/dist/declarations/console/console.did.d.ts +5 -4
  21. package/dist/declarations/console/console.factory.did.js +3 -2
  22. package/dist/declarations/console/console.factory.did.mjs +3 -2
  23. package/dist/declarations/console/index.js +6 -1
  24. package/dist/declarations/ic/ic.did +131 -18
  25. package/dist/declarations/ic/ic.did.d.ts +184 -53
  26. package/dist/declarations/ic/ic.factory.did.js +167 -24
  27. package/dist/declarations/mission_control/index.js +7 -1
  28. package/dist/declarations/mission_control/mission_control.did.d.ts +1 -0
  29. package/dist/declarations/mission_control/mission_control.factory.did.js +5 -0
  30. package/dist/declarations/observatory/index.js +7 -1
  31. package/dist/declarations/satellite/index.js +6 -1
  32. package/dist/declarations/satellite/satellite.did.d.ts +1 -0
  33. package/dist/declarations/satellite/satellite.factory.did.js +1 -0
  34. package/dist/declarations/satellite/satellite.factory.did.mjs +1 -0
  35. package/dist/node/index.mjs +19 -19
  36. package/dist/node/index.mjs.map +4 -4
  37. package/dist/types/api/ic.api.d.ts +1 -1
  38. package/dist/types/constants/config.constants.d.ts +2 -0
  39. package/dist/types/services/mission-control.services.d.ts +1 -1
  40. package/dist/types/services/satellite.services.d.ts +2 -2
  41. package/dist/types/types/config.types.d.ts +9 -3
  42. package/dist/types/types/ic.types.d.ts +2 -1
  43. package/package.json +1 -1
  44. package/declarations/frontend/frontend.did +0 -188
  45. package/declarations/frontend/frontend.did.d.ts +0 -172
  46. package/declarations/frontend/frontend.factory.did.js +0 -210
  47. package/declarations/frontend/index.d.ts +0 -45
  48. package/declarations/frontend/index.js +0 -32
  49. package/declarations/internet_identity/index.d.ts +0 -45
  50. package/declarations/internet_identity/index.js +0 -32
  51. package/declarations/internet_identity/internet_identity.did +0 -378
  52. package/declarations/internet_identity/internet_identity.did.d.ts +0 -231
  53. package/declarations/internet_identity/internet_identity.factory.did.js +0 -277
  54. package/declarations/ledger/index.d.ts +0 -45
  55. package/declarations/ledger/index.js +0 -32
  56. package/declarations/ledger/ledger.did +0 -266
  57. package/declarations/ledger/ledger.did.d.ts +0 -117
  58. package/declarations/ledger/ledger.factory.did.js +0 -115
  59. package/dist/declarations/frontend/frontend.did +0 -188
  60. package/dist/declarations/frontend/frontend.did.d.ts +0 -172
  61. package/dist/declarations/frontend/frontend.factory.did.js +0 -210
  62. package/dist/declarations/frontend/index.d.ts +0 -45
  63. package/dist/declarations/frontend/index.js +0 -32
  64. package/dist/declarations/internet_identity/index.d.ts +0 -45
  65. package/dist/declarations/internet_identity/index.js +0 -32
  66. package/dist/declarations/internet_identity/internet_identity.did +0 -378
  67. package/dist/declarations/internet_identity/internet_identity.did.d.ts +0 -231
  68. package/dist/declarations/internet_identity/internet_identity.factory.did.js +0 -277
  69. package/dist/declarations/ledger/index.d.ts +0 -45
  70. package/dist/declarations/ledger/index.js +0 -32
  71. package/dist/declarations/ledger/ledger.did +0 -266
  72. package/dist/declarations/ledger/ledger.did.d.ts +0 -117
  73. package/dist/declarations/ledger/ledger.factory.did.js +0 -115
@@ -1,231 +0,0 @@
1
- import type {ActorMethod} from '@dfinity/agent';
2
- import type {Principal} from '@dfinity/principal';
3
-
4
- export interface ActiveAnchorCounter {
5
- counter: bigint;
6
- start_timestamp: Timestamp;
7
- }
8
- export interface ActiveAnchorStatistics {
9
- completed: CompletedActiveAnchorStats;
10
- ongoing: OngoingActiveAnchorStats;
11
- }
12
- export type AddTentativeDeviceResponse =
13
- | {
14
- device_registration_mode_off: null;
15
- }
16
- | {another_device_tentatively_added: null}
17
- | {
18
- added_tentatively: {
19
- verification_code: string;
20
- device_registration_timeout: Timestamp;
21
- };
22
- };
23
- export interface AnchorCredentials {
24
- recovery_phrases: Array<PublicKey>;
25
- credentials: Array<WebAuthnCredential>;
26
- recovery_credentials: Array<WebAuthnCredential>;
27
- }
28
- export interface ArchiveConfig {
29
- polling_interval_ns: bigint;
30
- entries_buffer_limit: bigint;
31
- module_hash: Uint8Array | number[];
32
- entries_fetch_limit: number;
33
- }
34
- export interface ArchiveInfo {
35
- archive_config: [] | [ArchiveConfig];
36
- archive_canister: [] | [Principal];
37
- }
38
- export interface BufferedArchiveEntry {
39
- sequence_number: bigint;
40
- entry: Uint8Array | number[];
41
- anchor_number: UserNumber;
42
- timestamp: Timestamp;
43
- }
44
- export interface Challenge {
45
- png_base64: string;
46
- challenge_key: ChallengeKey;
47
- }
48
- export type ChallengeKey = string;
49
- export interface ChallengeResult {
50
- key: ChallengeKey;
51
- chars: string;
52
- }
53
- export interface CompletedActiveAnchorStats {
54
- monthly_active_anchors: [] | [ActiveAnchorCounter];
55
- daily_active_anchors: [] | [ActiveAnchorCounter];
56
- }
57
- export type CredentialId = Uint8Array | number[];
58
- export interface Delegation {
59
- pubkey: PublicKey;
60
- targets: [] | [Array<Principal>];
61
- expiration: Timestamp;
62
- }
63
- export type DeployArchiveResult =
64
- | {creation_in_progress: null}
65
- | {success: Principal}
66
- | {failed: string};
67
- export interface DeviceData {
68
- alias: string;
69
- metadata: [] | [MetadataMap];
70
- origin: [] | [string];
71
- protection: DeviceProtection;
72
- pubkey: DeviceKey;
73
- key_type: KeyType;
74
- purpose: Purpose;
75
- credential_id: [] | [CredentialId];
76
- }
77
- export type DeviceKey = PublicKey;
78
- export type DeviceProtection = {unprotected: null} | {protected: null};
79
- export interface DeviceRegistrationInfo {
80
- tentative_device: [] | [DeviceData];
81
- expiration: Timestamp;
82
- }
83
- export interface DeviceWithUsage {
84
- alias: string;
85
- last_usage: [] | [Timestamp];
86
- metadata: [] | [MetadataMap];
87
- origin: [] | [string];
88
- protection: DeviceProtection;
89
- pubkey: DeviceKey;
90
- key_type: KeyType;
91
- purpose: Purpose;
92
- credential_id: [] | [CredentialId];
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
- }
112
- export type FrontendHostname = string;
113
- export type GetDelegationResponse =
114
- | {no_such_delegation: null}
115
- | {signed_delegation: SignedDelegation};
116
- export type HeaderField = [string, string];
117
- export interface HttpRequest {
118
- url: string;
119
- method: string;
120
- body: Uint8Array | number[];
121
- headers: Array<HeaderField>;
122
- }
123
- export interface HttpResponse {
124
- body: Uint8Array | number[];
125
- headers: Array<HeaderField>;
126
- upgrade: [] | [boolean];
127
- streaming_strategy: [] | [StreamingStrategy];
128
- status_code: number;
129
- }
130
- export interface IdentityAnchorInfo {
131
- devices: Array<DeviceWithUsage>;
132
- device_registration: [] | [DeviceRegistrationInfo];
133
- }
134
- export interface InternetIdentityInit {
135
- max_num_latest_delegation_origins: [] | [bigint];
136
- assigned_user_number_range: [] | [[bigint, bigint]];
137
- archive_config: [] | [ArchiveConfig];
138
- canister_creation_cycles_cost: [] | [bigint];
139
- register_rate_limit: [] | [RateLimitConfig];
140
- }
141
- export interface InternetIdentityStats {
142
- storage_layout_version: number;
143
- users_registered: bigint;
144
- domain_active_anchor_stats: [] | [DomainActiveAnchorStatistics];
145
- max_num_latest_delegation_origins: bigint;
146
- assigned_user_number_range: [bigint, bigint];
147
- latest_delegation_origins: Array<FrontendHostname>;
148
- archive_info: ArchiveInfo;
149
- canister_creation_cycles_cost: bigint;
150
- active_anchor_stats: [] | [ActiveAnchorStatistics];
151
- }
152
- export type KeyType =
153
- | {platform: null}
154
- | {seed_phrase: null}
155
- | {cross_platform: null}
156
- | {unknown: null};
157
- export type MetadataMap = Array<
158
- [string, {map: MetadataMap} | {string: string} | {bytes: Uint8Array | number[]}]
159
- >;
160
- export interface OngoingActiveAnchorStats {
161
- monthly_active_anchors: Array<ActiveAnchorCounter>;
162
- daily_active_anchors: ActiveAnchorCounter;
163
- }
164
- export type PublicKey = Uint8Array | number[];
165
- export type Purpose = {authentication: null} | {recovery: null};
166
- export interface RateLimitConfig {
167
- max_tokens: bigint;
168
- time_per_token_ns: bigint;
169
- }
170
- export type RegisterResponse =
171
- | {bad_challenge: null}
172
- | {canister_full: null}
173
- | {registered: {user_number: UserNumber}};
174
- export type SessionKey = PublicKey;
175
- export interface SignedDelegation {
176
- signature: Uint8Array | number[];
177
- delegation: Delegation;
178
- }
179
- export interface StreamingCallbackHttpResponse {
180
- token: [] | [Token];
181
- body: Uint8Array | number[];
182
- }
183
- export type StreamingStrategy = {
184
- Callback: {token: Token; callback: [Principal, string]};
185
- };
186
- export type Timestamp = bigint;
187
- export type Token = {};
188
- export type UserKey = PublicKey;
189
- export type UserNumber = bigint;
190
- export type VerifyTentativeDeviceResponse =
191
- | {
192
- device_registration_mode_off: null;
193
- }
194
- | {verified: null}
195
- | {wrong_code: {retries_left: number}}
196
- | {no_device_to_verify: null};
197
- export interface WebAuthnCredential {
198
- pubkey: PublicKey;
199
- credential_id: CredentialId;
200
- }
201
- export interface _SERVICE {
202
- acknowledge_entries: ActorMethod<[bigint], undefined>;
203
- add: ActorMethod<[UserNumber, DeviceData], undefined>;
204
- add_tentative_device: ActorMethod<[UserNumber, DeviceData], AddTentativeDeviceResponse>;
205
- create_challenge: ActorMethod<[], Challenge>;
206
- deploy_archive: ActorMethod<[Uint8Array | number[]], DeployArchiveResult>;
207
- enter_device_registration_mode: ActorMethod<[UserNumber], Timestamp>;
208
- exit_device_registration_mode: ActorMethod<[UserNumber], undefined>;
209
- fetch_entries: ActorMethod<[], Array<BufferedArchiveEntry>>;
210
- get_anchor_credentials: ActorMethod<[UserNumber], AnchorCredentials>;
211
- get_anchor_info: ActorMethod<[UserNumber], IdentityAnchorInfo>;
212
- get_delegation: ActorMethod<
213
- [UserNumber, FrontendHostname, SessionKey, Timestamp],
214
- GetDelegationResponse
215
- >;
216
- get_principal: ActorMethod<[UserNumber, FrontendHostname], Principal>;
217
- http_request: ActorMethod<[HttpRequest], HttpResponse>;
218
- http_request_update: ActorMethod<[HttpRequest], HttpResponse>;
219
- init_salt: ActorMethod<[], undefined>;
220
- lookup: ActorMethod<[UserNumber], Array<DeviceData>>;
221
- prepare_delegation: ActorMethod<
222
- [UserNumber, FrontendHostname, SessionKey, [] | [bigint]],
223
- [UserKey, Timestamp]
224
- >;
225
- register: ActorMethod<[DeviceData, ChallengeResult, [] | [Principal]], RegisterResponse>;
226
- remove: ActorMethod<[UserNumber, DeviceKey], undefined>;
227
- replace: ActorMethod<[UserNumber, DeviceKey, DeviceData], undefined>;
228
- stats: ActorMethod<[], InternetIdentityStats>;
229
- update: ActorMethod<[UserNumber, DeviceKey, DeviceData], undefined>;
230
- verify_tentative_device: ActorMethod<[UserNumber, string], VerifyTentativeDeviceResponse>;
231
- }
@@ -1,277 +0,0 @@
1
- // @ts-ignore
2
- export const idlFactory = ({IDL}) => {
3
- const MetadataMap = IDL.Rec();
4
- const ArchiveConfig = IDL.Record({
5
- polling_interval_ns: IDL.Nat64,
6
- entries_buffer_limit: IDL.Nat64,
7
- module_hash: IDL.Vec(IDL.Nat8),
8
- entries_fetch_limit: IDL.Nat16
9
- });
10
- const RateLimitConfig = IDL.Record({
11
- max_tokens: IDL.Nat64,
12
- time_per_token_ns: IDL.Nat64
13
- });
14
- const InternetIdentityInit = IDL.Record({
15
- max_num_latest_delegation_origins: IDL.Opt(IDL.Nat64),
16
- assigned_user_number_range: IDL.Opt(IDL.Tuple(IDL.Nat64, IDL.Nat64)),
17
- archive_config: IDL.Opt(ArchiveConfig),
18
- canister_creation_cycles_cost: IDL.Opt(IDL.Nat64),
19
- register_rate_limit: IDL.Opt(RateLimitConfig)
20
- });
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
- );
34
- const DeviceProtection = IDL.Variant({
35
- unprotected: IDL.Null,
36
- protected: IDL.Null
37
- });
38
- const PublicKey = IDL.Vec(IDL.Nat8);
39
- const DeviceKey = PublicKey;
40
- const KeyType = IDL.Variant({
41
- platform: IDL.Null,
42
- seed_phrase: IDL.Null,
43
- cross_platform: IDL.Null,
44
- unknown: IDL.Null
45
- });
46
- const Purpose = IDL.Variant({
47
- authentication: IDL.Null,
48
- recovery: IDL.Null
49
- });
50
- const CredentialId = IDL.Vec(IDL.Nat8);
51
- const DeviceData = IDL.Record({
52
- alias: IDL.Text,
53
- metadata: IDL.Opt(MetadataMap),
54
- origin: IDL.Opt(IDL.Text),
55
- protection: DeviceProtection,
56
- pubkey: DeviceKey,
57
- key_type: KeyType,
58
- purpose: Purpose,
59
- credential_id: IDL.Opt(CredentialId)
60
- });
61
- const Timestamp = IDL.Nat64;
62
- const AddTentativeDeviceResponse = IDL.Variant({
63
- device_registration_mode_off: IDL.Null,
64
- another_device_tentatively_added: IDL.Null,
65
- added_tentatively: IDL.Record({
66
- verification_code: IDL.Text,
67
- device_registration_timeout: Timestamp
68
- })
69
- });
70
- const ChallengeKey = IDL.Text;
71
- const Challenge = IDL.Record({
72
- png_base64: IDL.Text,
73
- challenge_key: ChallengeKey
74
- });
75
- const DeployArchiveResult = IDL.Variant({
76
- creation_in_progress: IDL.Null,
77
- success: IDL.Principal,
78
- failed: IDL.Text
79
- });
80
- const BufferedArchiveEntry = IDL.Record({
81
- sequence_number: IDL.Nat64,
82
- entry: IDL.Vec(IDL.Nat8),
83
- anchor_number: UserNumber,
84
- timestamp: Timestamp
85
- });
86
- const WebAuthnCredential = IDL.Record({
87
- pubkey: PublicKey,
88
- credential_id: CredentialId
89
- });
90
- const AnchorCredentials = IDL.Record({
91
- recovery_phrases: IDL.Vec(PublicKey),
92
- credentials: IDL.Vec(WebAuthnCredential),
93
- recovery_credentials: IDL.Vec(WebAuthnCredential)
94
- });
95
- const DeviceWithUsage = IDL.Record({
96
- alias: IDL.Text,
97
- last_usage: IDL.Opt(Timestamp),
98
- metadata: IDL.Opt(MetadataMap),
99
- origin: IDL.Opt(IDL.Text),
100
- protection: DeviceProtection,
101
- pubkey: DeviceKey,
102
- key_type: KeyType,
103
- purpose: Purpose,
104
- credential_id: IDL.Opt(CredentialId)
105
- });
106
- const DeviceRegistrationInfo = IDL.Record({
107
- tentative_device: IDL.Opt(DeviceData),
108
- expiration: Timestamp
109
- });
110
- const IdentityAnchorInfo = IDL.Record({
111
- devices: IDL.Vec(DeviceWithUsage),
112
- device_registration: IDL.Opt(DeviceRegistrationInfo)
113
- });
114
- const FrontendHostname = IDL.Text;
115
- const SessionKey = PublicKey;
116
- const Delegation = IDL.Record({
117
- pubkey: PublicKey,
118
- targets: IDL.Opt(IDL.Vec(IDL.Principal)),
119
- expiration: Timestamp
120
- });
121
- const SignedDelegation = IDL.Record({
122
- signature: IDL.Vec(IDL.Nat8),
123
- delegation: Delegation
124
- });
125
- const GetDelegationResponse = IDL.Variant({
126
- no_such_delegation: IDL.Null,
127
- signed_delegation: SignedDelegation
128
- });
129
- const HeaderField = IDL.Tuple(IDL.Text, IDL.Text);
130
- const HttpRequest = IDL.Record({
131
- url: IDL.Text,
132
- method: IDL.Text,
133
- body: IDL.Vec(IDL.Nat8),
134
- headers: IDL.Vec(HeaderField)
135
- });
136
- const Token = IDL.Record({});
137
- const StreamingCallbackHttpResponse = IDL.Record({
138
- token: IDL.Opt(Token),
139
- body: IDL.Vec(IDL.Nat8)
140
- });
141
- const StreamingStrategy = IDL.Variant({
142
- Callback: IDL.Record({
143
- token: Token,
144
- callback: IDL.Func([Token], [StreamingCallbackHttpResponse], ['query'])
145
- })
146
- });
147
- const HttpResponse = IDL.Record({
148
- body: IDL.Vec(IDL.Nat8),
149
- headers: IDL.Vec(HeaderField),
150
- upgrade: IDL.Opt(IDL.Bool),
151
- streaming_strategy: IDL.Opt(StreamingStrategy),
152
- status_code: IDL.Nat16
153
- });
154
- const UserKey = PublicKey;
155
- const ChallengeResult = IDL.Record({
156
- key: ChallengeKey,
157
- chars: IDL.Text
158
- });
159
- const RegisterResponse = IDL.Variant({
160
- bad_challenge: IDL.Null,
161
- canister_full: IDL.Null,
162
- registered: IDL.Record({user_number: UserNumber})
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
- });
182
- const ArchiveInfo = IDL.Record({
183
- archive_config: IDL.Opt(ArchiveConfig),
184
- archive_canister: IDL.Opt(IDL.Principal)
185
- });
186
- const ActiveAnchorCounter = IDL.Record({
187
- counter: IDL.Nat64,
188
- start_timestamp: Timestamp
189
- });
190
- const CompletedActiveAnchorStats = IDL.Record({
191
- monthly_active_anchors: IDL.Opt(ActiveAnchorCounter),
192
- daily_active_anchors: IDL.Opt(ActiveAnchorCounter)
193
- });
194
- const OngoingActiveAnchorStats = IDL.Record({
195
- monthly_active_anchors: IDL.Vec(ActiveAnchorCounter),
196
- daily_active_anchors: ActiveAnchorCounter
197
- });
198
- const ActiveAnchorStatistics = IDL.Record({
199
- completed: CompletedActiveAnchorStats,
200
- ongoing: OngoingActiveAnchorStats
201
- });
202
- const InternetIdentityStats = IDL.Record({
203
- storage_layout_version: IDL.Nat8,
204
- users_registered: IDL.Nat64,
205
- domain_active_anchor_stats: IDL.Opt(DomainActiveAnchorStatistics),
206
- max_num_latest_delegation_origins: IDL.Nat64,
207
- assigned_user_number_range: IDL.Tuple(IDL.Nat64, IDL.Nat64),
208
- latest_delegation_origins: IDL.Vec(FrontendHostname),
209
- archive_info: ArchiveInfo,
210
- canister_creation_cycles_cost: IDL.Nat64,
211
- active_anchor_stats: IDL.Opt(ActiveAnchorStatistics)
212
- });
213
- const VerifyTentativeDeviceResponse = IDL.Variant({
214
- device_registration_mode_off: IDL.Null,
215
- verified: IDL.Null,
216
- wrong_code: IDL.Record({retries_left: IDL.Nat8}),
217
- no_device_to_verify: IDL.Null
218
- });
219
- return IDL.Service({
220
- acknowledge_entries: IDL.Func([IDL.Nat64], [], []),
221
- add: IDL.Func([UserNumber, DeviceData], [], []),
222
- add_tentative_device: IDL.Func([UserNumber, DeviceData], [AddTentativeDeviceResponse], []),
223
- create_challenge: IDL.Func([], [Challenge], []),
224
- deploy_archive: IDL.Func([IDL.Vec(IDL.Nat8)], [DeployArchiveResult], []),
225
- enter_device_registration_mode: IDL.Func([UserNumber], [Timestamp], []),
226
- exit_device_registration_mode: IDL.Func([UserNumber], [], []),
227
- fetch_entries: IDL.Func([], [IDL.Vec(BufferedArchiveEntry)], []),
228
- get_anchor_credentials: IDL.Func([UserNumber], [AnchorCredentials], ['query']),
229
- get_anchor_info: IDL.Func([UserNumber], [IdentityAnchorInfo], []),
230
- get_delegation: IDL.Func(
231
- [UserNumber, FrontendHostname, SessionKey, Timestamp],
232
- [GetDelegationResponse],
233
- ['query']
234
- ),
235
- get_principal: IDL.Func([UserNumber, FrontendHostname], [IDL.Principal], ['query']),
236
- http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
237
- http_request_update: IDL.Func([HttpRequest], [HttpResponse], []),
238
- init_salt: IDL.Func([], [], []),
239
- lookup: IDL.Func([UserNumber], [IDL.Vec(DeviceData)], ['query']),
240
- prepare_delegation: IDL.Func(
241
- [UserNumber, FrontendHostname, SessionKey, IDL.Opt(IDL.Nat64)],
242
- [UserKey, Timestamp],
243
- []
244
- ),
245
- register: IDL.Func(
246
- [DeviceData, ChallengeResult, IDL.Opt(IDL.Principal)],
247
- [RegisterResponse],
248
- []
249
- ),
250
- remove: IDL.Func([UserNumber, DeviceKey], [], []),
251
- replace: IDL.Func([UserNumber, DeviceKey, DeviceData], [], []),
252
- stats: IDL.Func([], [InternetIdentityStats], ['query']),
253
- update: IDL.Func([UserNumber, DeviceKey, DeviceData], [], []),
254
- verify_tentative_device: IDL.Func([UserNumber, IDL.Text], [VerifyTentativeDeviceResponse], [])
255
- });
256
- };
257
- // @ts-ignore
258
- export const init = ({IDL}) => {
259
- const ArchiveConfig = IDL.Record({
260
- polling_interval_ns: IDL.Nat64,
261
- entries_buffer_limit: IDL.Nat64,
262
- module_hash: IDL.Vec(IDL.Nat8),
263
- entries_fetch_limit: IDL.Nat16
264
- });
265
- const RateLimitConfig = IDL.Record({
266
- max_tokens: IDL.Nat64,
267
- time_per_token_ns: IDL.Nat64
268
- });
269
- const InternetIdentityInit = IDL.Record({
270
- max_num_latest_delegation_origins: IDL.Opt(IDL.Nat64),
271
- assigned_user_number_range: IDL.Opt(IDL.Tuple(IDL.Nat64, IDL.Nat64)),
272
- archive_config: IDL.Opt(ArchiveConfig),
273
- canister_creation_cycles_cost: IDL.Opt(IDL.Nat64),
274
- register_rate_limit: IDL.Opt(RateLimitConfig)
275
- });
276
- return [IDL.Opt(InternetIdentityInit)];
277
- };
@@ -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 './ledger.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 ledger: ActorSubclass<_SERVICE>;
@@ -1,32 +0,0 @@
1
- import {Actor, HttpAgent} from '@dfinity/agent';
2
-
3
- // Imports and re-exports candid interface
4
- import {idlFactory} from './ledger.did.js';
5
- export {idlFactory} from './ledger.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
- };