@astrox/connection 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +23 -0
- package/lib/cjs/canisters/internet_identity_idl.d.ts +7 -0
- package/lib/cjs/canisters/internet_identity_idl.js +101 -0
- package/lib/cjs/canisters/internet_identity_idl.js.map +1 -0
- package/lib/cjs/canisters/ledger.idl.d.ts +7 -0
- package/lib/cjs/canisters/ledger.idl.js +81 -0
- package/lib/cjs/canisters/ledger.idl.js.map +1 -0
- package/lib/cjs/canisters/me.idl.d.ts +7 -0
- package/lib/cjs/canisters/me.idl.js +125 -0
- package/lib/cjs/canisters/me.idl.js.map +1 -0
- package/lib/cjs/canisters/nns-dapp-cert.idl.d.ts +7 -0
- package/lib/cjs/canisters/nns-dapp-cert.idl.js +86 -0
- package/lib/cjs/canisters/nns-dapp-cert.idl.js.map +1 -0
- package/lib/cjs/canisters/nns-dapp.idl.d.ts +7 -0
- package/lib/cjs/canisters/nns-dapp.idl.js +184 -0
- package/lib/cjs/canisters/nns-dapp.idl.js.map +1 -0
- package/lib/cjs/connections/baseConnection.d.ts +52 -0
- package/lib/cjs/connections/baseConnection.js +87 -0
- package/lib/cjs/connections/baseConnection.js.map +1 -0
- package/lib/cjs/connections/ledgerConnection.d.ts +57 -0
- package/lib/cjs/connections/ledgerConnection.js +135 -0
- package/lib/cjs/connections/ledgerConnection.js.map +1 -0
- package/lib/cjs/connections/nnsConnection.d.ts +62 -0
- package/lib/cjs/connections/nnsConnection.js +166 -0
- package/lib/cjs/connections/nnsConnection.js.map +1 -0
- package/lib/cjs/ic/icAuthClient.d.ts +31 -0
- package/lib/cjs/ic/icAuthClient.js +233 -0
- package/lib/cjs/ic/icAuthClient.js.map +1 -0
- package/lib/cjs/ic/icConnect.d.ts +32 -0
- package/lib/cjs/ic/icConnect.js +181 -0
- package/lib/cjs/ic/icConnect.js.map +1 -0
- package/lib/cjs/ic/icStorage.d.ts +16 -0
- package/lib/cjs/ic/icStorage.js +49 -0
- package/lib/cjs/ic/icStorage.js.map +1 -0
- package/lib/cjs/ic/icWindow.d.ts +7 -0
- package/lib/cjs/ic/icWindow.js +20 -0
- package/lib/cjs/ic/icWindow.js.map +1 -0
- package/lib/cjs/ic/index.d.ts +2 -0
- package/lib/cjs/ic/index.js +7 -0
- package/lib/cjs/ic/index.js.map +1 -0
- package/lib/cjs/ic/types.d.ts +129 -0
- package/lib/cjs/ic/types.js +17 -0
- package/lib/cjs/ic/types.js.map +1 -0
- package/lib/cjs/index.d.ts +5 -0
- package/lib/cjs/index.js +18 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/utils/common/types.d.ts +15 -0
- package/lib/cjs/utils/common/types.js +12 -0
- package/lib/cjs/utils/common/types.js.map +1 -0
- package/lib/cjs/utils/constants.d.ts +6 -0
- package/lib/cjs/utils/constants.js +13 -0
- package/lib/cjs/utils/constants.js.map +1 -0
- package/lib/cjs/utils/converter.d.ts +32 -0
- package/lib/cjs/utils/converter.js +130 -0
- package/lib/cjs/utils/converter.js.map +1 -0
- package/lib/cjs/utils/index.d.ts +3 -0
- package/lib/cjs/utils/index.js +16 -0
- package/lib/cjs/utils/index.js.map +1 -0
- package/lib/esm/canisters/internet_identity_idl.d.ts +7 -0
- package/lib/esm/canisters/internet_identity_idl.js +98 -0
- package/lib/esm/canisters/internet_identity_idl.js.map +1 -0
- package/lib/esm/canisters/ledger.idl.d.ts +7 -0
- package/lib/esm/canisters/ledger.idl.js +78 -0
- package/lib/esm/canisters/ledger.idl.js.map +1 -0
- package/lib/esm/canisters/me.idl.d.ts +7 -0
- package/lib/esm/canisters/me.idl.js +122 -0
- package/lib/esm/canisters/me.idl.js.map +1 -0
- package/lib/esm/canisters/nns-dapp-cert.idl.d.ts +7 -0
- package/lib/esm/canisters/nns-dapp-cert.idl.js +83 -0
- package/lib/esm/canisters/nns-dapp-cert.idl.js.map +1 -0
- package/lib/esm/canisters/nns-dapp.idl.d.ts +7 -0
- package/lib/esm/canisters/nns-dapp.idl.js +181 -0
- package/lib/esm/canisters/nns-dapp.idl.js.map +1 -0
- package/lib/esm/connections/baseConnection.d.ts +52 -0
- package/lib/esm/connections/baseConnection.js +80 -0
- package/lib/esm/connections/baseConnection.js.map +1 -0
- package/lib/esm/connections/ledgerConnection.d.ts +57 -0
- package/lib/esm/connections/ledgerConnection.js +128 -0
- package/lib/esm/connections/ledgerConnection.js.map +1 -0
- package/lib/esm/connections/nnsConnection.d.ts +62 -0
- package/lib/esm/connections/nnsConnection.js +159 -0
- package/lib/esm/connections/nnsConnection.js.map +1 -0
- package/lib/esm/ic/icAuthClient.d.ts +31 -0
- package/lib/esm/ic/icAuthClient.js +229 -0
- package/lib/esm/ic/icAuthClient.js.map +1 -0
- package/lib/esm/ic/icConnect.d.ts +32 -0
- package/lib/esm/ic/icConnect.js +177 -0
- package/lib/esm/ic/icConnect.js.map +1 -0
- package/lib/esm/ic/icStorage.d.ts +16 -0
- package/lib/esm/ic/icStorage.js +44 -0
- package/lib/esm/ic/icStorage.js.map +1 -0
- package/lib/esm/ic/icWindow.d.ts +7 -0
- package/lib/esm/ic/icWindow.js +16 -0
- package/lib/esm/ic/icWindow.js.map +1 -0
- package/lib/esm/ic/index.d.ts +2 -0
- package/lib/esm/ic/index.js +3 -0
- package/lib/esm/ic/index.js.map +1 -0
- package/lib/esm/ic/types.d.ts +129 -0
- package/lib/esm/ic/types.js +14 -0
- package/lib/esm/ic/types.js.map +1 -0
- package/lib/esm/index.d.ts +5 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/utils/common/types.d.ts +15 -0
- package/lib/esm/utils/common/types.js +9 -0
- package/lib/esm/utils/common/types.js.map +1 -0
- package/lib/esm/utils/constants.d.ts +6 -0
- package/lib/esm/utils/constants.js +10 -0
- package/lib/esm/utils/constants.js.map +1 -0
- package/lib/esm/utils/converter.d.ts +32 -0
- package/lib/esm/utils/converter.js +124 -0
- package/lib/esm/utils/converter.js.map +1 -0
- package/lib/esm/utils/index.d.ts +3 -0
- package/lib/esm/utils/index.js +4 -0
- package/lib/esm/utils/index.js.map +1 -0
- package/lib/tsconfig-cjs.tsbuildinfo +2834 -0
- package/lib/tsconfig.tsbuildinfo +2833 -0
- package/package.json +53 -0
package/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2020 DFINITY LLC.
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# @astrox/candid
|
2
|
+
|
3
|
+
JavaScript and TypeScript library to work with Candid interfaces
|
4
|
+
|
5
|
+
Visit the [Dfinity Forum](https://forum.dfinity.org/) and [SDK Documentation](https://sdk.dfinity.org/docs/index.html) for more information and support building on the Internet Computer.
|
6
|
+
|
7
|
+
Additional API Documentation can be found [here](https://peacock.dev/principal-docs).
|
8
|
+
|
9
|
+
---
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Using Principal:
|
14
|
+
|
15
|
+
```
|
16
|
+
npm i --save @astrox/principal
|
17
|
+
```
|
18
|
+
|
19
|
+
### In the browser:
|
20
|
+
|
21
|
+
```
|
22
|
+
import { Principal } from "@astrox/principal";
|
23
|
+
```
|
@@ -0,0 +1,101 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.init = void 0;
|
4
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
5
|
+
exports.default = ({ IDL }) => {
|
6
|
+
const InternetIdentityInit = IDL.Record({
|
7
|
+
assigned_user_number_range: IDL.Tuple(IDL.Nat64, IDL.Nat64),
|
8
|
+
});
|
9
|
+
const UserNumber = IDL.Nat64;
|
10
|
+
const PublicKey = IDL.Vec(IDL.Nat8);
|
11
|
+
const DeviceKey = PublicKey;
|
12
|
+
const KeyType = IDL.Variant({
|
13
|
+
platform: IDL.Null,
|
14
|
+
seed_phrase: IDL.Null,
|
15
|
+
cross_platform: IDL.Null,
|
16
|
+
unknown: IDL.Null,
|
17
|
+
});
|
18
|
+
const Purpose = IDL.Variant({
|
19
|
+
authentication: IDL.Null,
|
20
|
+
recovery: IDL.Null,
|
21
|
+
});
|
22
|
+
const CredentialId = IDL.Vec(IDL.Nat8);
|
23
|
+
const DeviceData = IDL.Record({
|
24
|
+
alias: IDL.Text,
|
25
|
+
pubkey: DeviceKey,
|
26
|
+
key_type: KeyType,
|
27
|
+
purpose: Purpose,
|
28
|
+
credential_id: IDL.Opt(CredentialId),
|
29
|
+
});
|
30
|
+
const FrontendHostname = IDL.Text;
|
31
|
+
const SessionKey = PublicKey;
|
32
|
+
const Timestamp = IDL.Nat64;
|
33
|
+
const Delegation = IDL.Record({
|
34
|
+
pubkey: PublicKey,
|
35
|
+
targets: IDL.Opt(IDL.Vec(IDL.Principal)),
|
36
|
+
expiration: Timestamp,
|
37
|
+
});
|
38
|
+
const SignedDelegation = IDL.Record({
|
39
|
+
signature: IDL.Vec(IDL.Nat8),
|
40
|
+
delegation: Delegation,
|
41
|
+
});
|
42
|
+
const GetDelegationResponse = IDL.Variant({
|
43
|
+
no_such_delegation: IDL.Null,
|
44
|
+
signed_delegation: SignedDelegation,
|
45
|
+
});
|
46
|
+
const HeaderField = IDL.Tuple(IDL.Text, IDL.Text);
|
47
|
+
const HttpRequest = IDL.Record({
|
48
|
+
url: IDL.Text,
|
49
|
+
method: IDL.Text,
|
50
|
+
body: IDL.Vec(IDL.Nat8),
|
51
|
+
headers: IDL.Vec(HeaderField),
|
52
|
+
});
|
53
|
+
const Token = IDL.Record({});
|
54
|
+
const StreamingCallbackHttpResponse = IDL.Record({
|
55
|
+
token: IDL.Opt(Token),
|
56
|
+
body: IDL.Vec(IDL.Nat8),
|
57
|
+
});
|
58
|
+
const StreamingStrategy = IDL.Variant({
|
59
|
+
Callback: IDL.Record({
|
60
|
+
token: Token,
|
61
|
+
callback: IDL.Func([Token], [StreamingCallbackHttpResponse], ['query']),
|
62
|
+
}),
|
63
|
+
});
|
64
|
+
const HttpResponse = IDL.Record({
|
65
|
+
body: IDL.Vec(IDL.Nat8),
|
66
|
+
headers: IDL.Vec(HeaderField),
|
67
|
+
streaming_strategy: IDL.Opt(StreamingStrategy),
|
68
|
+
status_code: IDL.Nat16,
|
69
|
+
});
|
70
|
+
const UserKey = PublicKey;
|
71
|
+
const ProofOfWork = IDL.Record({
|
72
|
+
nonce: IDL.Nat64,
|
73
|
+
timestamp: Timestamp,
|
74
|
+
});
|
75
|
+
const RegisterResponse = IDL.Variant({
|
76
|
+
canister_full: IDL.Null,
|
77
|
+
registered: IDL.Record({ user_number: UserNumber }),
|
78
|
+
});
|
79
|
+
const InternetIdentityStats = IDL.Record({
|
80
|
+
users_registered: IDL.Nat64,
|
81
|
+
assigned_user_number_range: IDL.Tuple(IDL.Nat64, IDL.Nat64),
|
82
|
+
});
|
83
|
+
return IDL.Service({
|
84
|
+
add: IDL.Func([UserNumber, DeviceData], [], []),
|
85
|
+
get_delegation: IDL.Func([UserNumber, FrontendHostname, SessionKey, Timestamp], [GetDelegationResponse], ['query']),
|
86
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
87
|
+
init_salt: IDL.Func([], [], []),
|
88
|
+
lookup: IDL.Func([UserNumber], [IDL.Vec(DeviceData)], ['query']),
|
89
|
+
prepare_delegation: IDL.Func([UserNumber, FrontendHostname, SessionKey, IDL.Opt(IDL.Nat64)], [UserKey, Timestamp], []),
|
90
|
+
register: IDL.Func([DeviceData, ProofOfWork], [RegisterResponse], []),
|
91
|
+
remove: IDL.Func([UserNumber, DeviceKey], [], []),
|
92
|
+
stats: IDL.Func([], [InternetIdentityStats], ['query']),
|
93
|
+
});
|
94
|
+
};
|
95
|
+
exports.init = ({ IDL }) => {
|
96
|
+
const InternetIdentityInit = IDL.Record({
|
97
|
+
assigned_user_number_range: IDL.Tuple(IDL.Nat64, IDL.Nat64),
|
98
|
+
});
|
99
|
+
return [IDL.Opt(InternetIdentityInit)];
|
100
|
+
};
|
101
|
+
//# sourceMappingURL=internet_identity_idl.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"internet_identity_idl.js","sourceRoot":"","sources":["../../../src/canisters/internet_identity_idl.js"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,kBAAe,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IACzB,MAAM,oBAAoB,GAAG,GAAG,CAAC,MAAM,CAAC;QACtC,0BAA0B,EAAE,GAAG,CAAC,KAAK,CA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AAE,EAAE,EAAE,EAAE,EAAE,CAAC;QAC/B,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QAChE,kBAAkB,EAAE,GAAG,CAAC,IAAI,CAC1B,CAAC,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAC9D,CAAC,OAAO,EAAE,SAAS,CAAC,EACpB,EAAE,CACH;QACD,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC;QACrE,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC;QACjD,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;KACxD,CAAC,CAAC;AACL,CAAC,CAAC;AACW,QAAA,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IAC9B,MAAM,oBAAoB,GAAG,GAAG,CAAC,MAAM,CAAC;QACtC,0BAA0B,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC;KAC5D,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC"}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.init = void 0;
|
4
|
+
exports.default = ({ IDL }) => {
|
5
|
+
const AccountIdentifier = IDL.Text;
|
6
|
+
const Duration = IDL.Record({ secs: IDL.Nat64, nanos: IDL.Nat32 });
|
7
|
+
const ArchiveOptions = IDL.Record({
|
8
|
+
max_message_size_bytes: IDL.Opt(IDL.Nat32),
|
9
|
+
node_max_memory_size_bytes: IDL.Opt(IDL.Nat32),
|
10
|
+
controller_id: IDL.Principal,
|
11
|
+
});
|
12
|
+
const ICPTs = IDL.Record({ e8s: IDL.Nat64 });
|
13
|
+
const LedgerCanisterInitPayload = IDL.Record({
|
14
|
+
send_whitelist: IDL.Vec(IDL.Tuple(IDL.Principal)),
|
15
|
+
minting_account: AccountIdentifier,
|
16
|
+
transaction_window: IDL.Opt(Duration),
|
17
|
+
max_message_size_bytes: IDL.Opt(IDL.Nat32),
|
18
|
+
archive_options: IDL.Opt(ArchiveOptions),
|
19
|
+
initial_values: IDL.Vec(IDL.Tuple(AccountIdentifier, ICPTs)),
|
20
|
+
});
|
21
|
+
const AccountBalanceArgs = IDL.Record({ account: AccountIdentifier });
|
22
|
+
const CanisterId = IDL.Principal;
|
23
|
+
const HeaderField = IDL.Tuple(IDL.Text, IDL.Text);
|
24
|
+
const HttpRequest = IDL.Record({
|
25
|
+
url: IDL.Text,
|
26
|
+
method: IDL.Text,
|
27
|
+
body: IDL.Vec(IDL.Nat8),
|
28
|
+
headers: IDL.Vec(HeaderField),
|
29
|
+
});
|
30
|
+
const HttpResponse = IDL.Record({
|
31
|
+
body: IDL.Vec(IDL.Nat8),
|
32
|
+
headers: IDL.Vec(HeaderField),
|
33
|
+
status_code: IDL.Nat16,
|
34
|
+
});
|
35
|
+
const SubAccount = IDL.Vec(IDL.Nat8);
|
36
|
+
const BlockHeight = IDL.Nat64;
|
37
|
+
const NotifyCanisterArgs = IDL.Record({
|
38
|
+
to_subaccount: IDL.Opt(SubAccount),
|
39
|
+
from_subaccount: IDL.Opt(SubAccount),
|
40
|
+
to_canister: IDL.Principal,
|
41
|
+
max_fee: ICPTs,
|
42
|
+
block_height: BlockHeight,
|
43
|
+
});
|
44
|
+
const Memo = IDL.Nat64;
|
45
|
+
const TimeStamp = IDL.Record({ timestamp_nanos: IDL.Nat64 });
|
46
|
+
const SendArgs = IDL.Record({
|
47
|
+
to: AccountIdentifier,
|
48
|
+
fee: ICPTs,
|
49
|
+
memo: Memo,
|
50
|
+
from_subaccount: IDL.Opt(SubAccount),
|
51
|
+
created_at_time: IDL.Opt(TimeStamp),
|
52
|
+
amount: ICPTs,
|
53
|
+
});
|
54
|
+
return IDL.Service({
|
55
|
+
account_balance_dfx: IDL.Func([AccountBalanceArgs], [ICPTs], ['query']),
|
56
|
+
get_nodes: IDL.Func([], [IDL.Vec(CanisterId)], ['query']),
|
57
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
58
|
+
notify_dfx: IDL.Func([NotifyCanisterArgs], [], []),
|
59
|
+
send_dfx: IDL.Func([SendArgs], [BlockHeight], []),
|
60
|
+
});
|
61
|
+
};
|
62
|
+
exports.init = ({ IDL }) => {
|
63
|
+
const AccountIdentifier = IDL.Text;
|
64
|
+
const Duration = IDL.Record({ secs: IDL.Nat64, nanos: IDL.Nat32 });
|
65
|
+
const ArchiveOptions = IDL.Record({
|
66
|
+
max_message_size_bytes: IDL.Opt(IDL.Nat32),
|
67
|
+
node_max_memory_size_bytes: IDL.Opt(IDL.Nat32),
|
68
|
+
controller_id: IDL.Principal,
|
69
|
+
});
|
70
|
+
const ICPTs = IDL.Record({ e8s: IDL.Nat64 });
|
71
|
+
const LedgerCanisterInitPayload = IDL.Record({
|
72
|
+
send_whitelist: IDL.Vec(IDL.Tuple(IDL.Principal)),
|
73
|
+
minting_account: AccountIdentifier,
|
74
|
+
transaction_window: IDL.Opt(Duration),
|
75
|
+
max_message_size_bytes: IDL.Opt(IDL.Nat32),
|
76
|
+
archive_options: IDL.Opt(ArchiveOptions),
|
77
|
+
initial_values: IDL.Vec(IDL.Tuple(AccountIdentifier, ICPTs)),
|
78
|
+
});
|
79
|
+
return [LedgerCanisterInitPayload];
|
80
|
+
};
|
81
|
+
//# sourceMapp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AC,GAAG,CAAC,KAAK,CAAC;QAC1C,0BAA0B,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;QAC9C,aAAa,EAAE,GAAG,CAAC,SAAS;KAC7B,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;IAC7C,MAAM,yBAAyB,GAAG,GAAG,CAAC,MAAM,CAAC;QAC3C,cAAc,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACjD,eAAe,EAAE,iBAAiB;QAClC,kBAAkB,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC;QACrC,sBAAsB,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;QAC1C,eAAe,EAAE,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QACxC,cAAc,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;KAC7D,CAAC,CAAC;IACH,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.init = void 0;
|
4
|
+
exports.default = ({ IDL }) => {
|
5
|
+
const DeviceType = IDL.Variant({
|
6
|
+
'IdentityProvider': IDL.Null,
|
7
|
+
'SecurityDevice': IDL.Null,
|
8
|
+
'EthereumMetaMask': IDL.Null,
|
9
|
+
});
|
10
|
+
const Purpose = IDL.Variant({
|
11
|
+
'authentication': IDL.Null,
|
12
|
+
'recovery': IDL.Null,
|
13
|
+
});
|
14
|
+
const CredentialId = IDL.Vec(IDL.Nat8);
|
15
|
+
const DeviceDataExternal = IDL.Record({
|
16
|
+
'device_name': IDL.Text,
|
17
|
+
'device_type': DeviceType,
|
18
|
+
'pub_key': IDL.Text,
|
19
|
+
'purpose': Purpose,
|
20
|
+
'credential_id': IDL.Opt(CredentialId),
|
21
|
+
});
|
22
|
+
const DeviceAddResponse = IDL.Variant({
|
23
|
+
'added': IDL.Record({ 'user_name': IDL.Text }),
|
24
|
+
'failed': IDL.Null,
|
25
|
+
});
|
26
|
+
const PublicKey = IDL.Vec(IDL.Nat8);
|
27
|
+
const SessionKey = PublicKey;
|
28
|
+
const Timestamp = IDL.Nat64;
|
29
|
+
const Delegation = IDL.Record({
|
30
|
+
'pubkey': PublicKey,
|
31
|
+
'targets': IDL.Opt(IDL.Vec(IDL.Principal)),
|
32
|
+
'expiration': Timestamp,
|
33
|
+
});
|
34
|
+
const SignedDelegation = IDL.Record({
|
35
|
+
'signature': IDL.Vec(IDL.Nat8),
|
36
|
+
'delegation': Delegation,
|
37
|
+
});
|
38
|
+
const GetDelegationResponse = IDL.Variant({
|
39
|
+
'no_such_delegation': IDL.Null,
|
40
|
+
'signed_delegation': SignedDelegation,
|
41
|
+
});
|
42
|
+
const UserKey = PublicKey;
|
43
|
+
const GetDelegationResponseQr = IDL.Record({
|
44
|
+
'user_key': UserKey,
|
45
|
+
'extra': IDL.Text,
|
46
|
+
'get_delegation_response': GetDelegationResponse,
|
47
|
+
});
|
48
|
+
const AccountIdentifier = IDL.Text;
|
49
|
+
const HardwareWalletAccountDetails = IDL.Record({
|
50
|
+
'principal': IDL.Principal,
|
51
|
+
'name': IDL.Text,
|
52
|
+
'account_identifier': AccountIdentifier,
|
53
|
+
});
|
54
|
+
const SubAccount = IDL.Vec(IDL.Nat8);
|
55
|
+
const SubAccountDetails = IDL.Record({
|
56
|
+
'name': IDL.Text,
|
57
|
+
'sub_account': SubAccount,
|
58
|
+
'account_identifier': AccountIdentifier,
|
59
|
+
});
|
60
|
+
const AccountDetails = IDL.Record({
|
61
|
+
'principal': IDL.Principal,
|
62
|
+
'account_identifier': AccountIdentifier,
|
63
|
+
'hardware_wallet_accounts': IDL.Vec(HardwareWalletAccountDetails),
|
64
|
+
'sub_accounts': IDL.Vec(SubAccountDetails),
|
65
|
+
});
|
66
|
+
const AccountDetailsResult = IDL.Record({
|
67
|
+
'account_details': IDL.Opt(AccountDetails),
|
68
|
+
'anchor_number': IDL.Text,
|
69
|
+
});
|
70
|
+
const RoleType = IDL.Variant({ 'Sub': IDL.Null, 'Main': IDL.Null });
|
71
|
+
const DeviceKey = PublicKey;
|
72
|
+
const DeviceData = IDL.Record({
|
73
|
+
'device_name': IDL.Text,
|
74
|
+
'device_type': DeviceType,
|
75
|
+
'pub_key': DeviceKey,
|
76
|
+
'purpose': Purpose,
|
77
|
+
'credential_id': IDL.Opt(CredentialId),
|
78
|
+
});
|
79
|
+
const Profile = IDL.Record({
|
80
|
+
'user_name': IDL.Text,
|
81
|
+
'role_type': RoleType,
|
82
|
+
'devices': IDL.Vec(DeviceData),
|
83
|
+
});
|
84
|
+
const IPProfile = IDL.Record({
|
85
|
+
'user_name': IDL.Text,
|
86
|
+
'role_type': RoleType,
|
87
|
+
'devices': IDL.Vec(DeviceData),
|
88
|
+
});
|
89
|
+
const RegisterResponse = IDL.Variant({
|
90
|
+
'canister_full': IDL.Null,
|
91
|
+
'registered': IDL.Record({ 'user_name': IDL.Text }),
|
92
|
+
});
|
93
|
+
const DeviceRemoveResponse = IDL.Variant({
|
94
|
+
'failed': IDL.Null,
|
95
|
+
'removed': IDL.Null,
|
96
|
+
});
|
97
|
+
const UpdateNNSWalletResponse = IDL.Variant({
|
98
|
+
'success': IDL.Null,
|
99
|
+
'failed': IDL.Null,
|
100
|
+
});
|
101
|
+
return IDL.Service({
|
102
|
+
'add_ii_anchor_number': IDL.Func([IDL.Text, DeviceType, IDL.Text], [IDL.Vec(IDL.Text)], []),
|
103
|
+
'add_new_device': IDL.Func([DeviceDataExternal, IDL.Text, DeviceType], [DeviceAddResponse], []),
|
104
|
+
'get_delegation': IDL.Func([IDL.Text, DeviceType, IDL.Text, SessionKey, Timestamp], [GetDelegationResponse], ['query']),
|
105
|
+
'get_delegation_qr': IDL.Func([IDL.Text], [IDL.Opt(GetDelegationResponseQr)], ['query']),
|
106
|
+
'get_ii_anchor_number_by_name': IDL.Func([IDL.Text], [IDL.Vec(IDL.Text)], ['query']),
|
107
|
+
'get_nns_wallets': IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [IDL.Vec(AccountDetailsResult)], ['query']),
|
108
|
+
'get_profile_by_name': IDL.Func([IDL.Text], [IDL.Opt(Profile), IDL.Vec(Profile), IDL.Vec(IPProfile)], ['query']),
|
109
|
+
'prepare_delegation': IDL.Func([IDL.Text, DeviceType, IDL.Text, SessionKey, IDL.Opt(IDL.Nat64)], [UserKey, Timestamp], []),
|
110
|
+
'prepare_delegation_qr': IDL.Func([
|
111
|
+
IDL.Text,
|
112
|
+
IDL.Text,
|
113
|
+
DeviceType,
|
114
|
+
IDL.Text,
|
115
|
+
SessionKey,
|
116
|
+
IDL.Opt(IDL.Nat64),
|
117
|
+
IDL.Text,
|
118
|
+
], [UserKey, Timestamp], []),
|
119
|
+
'register_user_main': IDL.Func([IDL.Text, DeviceDataExternal], [RegisterResponse], []),
|
120
|
+
'unbind_device': IDL.Func([IDL.Text, IDL.Text, DeviceType], [DeviceRemoveResponse], []),
|
121
|
+
'update_nns_wallets': IDL.Func([IDL.Text, DeviceType, IDL.Text, AccountDetails], [UpdateNNSWalletResponse], []),
|
122
|
+
});
|
123
|
+
};
|
124
|
+
exports.init = ({ IDL }) => { return []; };
|
125
|
+
//# sourceMappingURL=me.idl.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"me.idl.js","sourceRoot":"","sources":["../../../src/canisters/me.idl.js"],"names":[],"mappings":";;;AAAA,kBAAe,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IACzB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC;QAC7B,kBAAkB,EAAG,GAAG,CAAC,IAAI;QAC7B,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