@pezkuwi/keyring 14.0.22 → 14.0.23
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.
- package/build/LICENSE +201 -0
- package/build/README.md +17 -0
- package/build/bundle.d.ts +7 -0
- package/build/bundle.js +7 -0
- package/build/cjs/bundle.d.ts +7 -0
- package/build/cjs/bundle.js +19 -0
- package/build/cjs/defaults.d.ts +2 -0
- package/build/cjs/defaults.js +5 -0
- package/build/cjs/index.d.ts +4 -0
- package/build/cjs/index.js +7 -0
- package/build/cjs/keyring.d.ts +145 -0
- package/build/cjs/keyring.js +261 -0
- package/build/cjs/package.json +3 -0
- package/build/cjs/packageDetect.d.ts +1 -0
- package/build/cjs/packageDetect.js +7 -0
- package/build/cjs/packageInfo.d.ts +6 -0
- package/build/cjs/packageInfo.js +4 -0
- package/build/cjs/pair/decode.d.ts +12 -0
- package/build/cjs/pair/decode.js +45 -0
- package/build/cjs/pair/defaults.d.ts +12 -0
- package/build/cjs/pair/defaults.js +15 -0
- package/build/cjs/pair/encode.d.ts +5 -0
- package/build/cjs/pair/encode.js +22 -0
- package/build/cjs/pair/index.d.ts +40 -0
- package/build/cjs/pair/index.js +183 -0
- package/build/cjs/pair/nobody.d.ts +2 -0
- package/build/cjs/pair/nobody.js +43 -0
- package/build/cjs/pair/toJson.d.ts +8 -0
- package/build/cjs/pair/toJson.js +11 -0
- package/build/cjs/pair/types.d.ts +5 -0
- package/build/cjs/pair/types.js +2 -0
- package/build/cjs/pairs.d.ts +8 -0
- package/build/cjs/pairs.js +28 -0
- package/build/cjs/testing.d.ts +20 -0
- package/build/cjs/testing.js +126 -0
- package/build/cjs/testingPairs.d.ts +25 -0
- package/build/cjs/testingPairs.js +16 -0
- package/build/cjs/types.d.ts +111 -0
- package/build/cjs/types.js +2 -0
- package/build/defaults.d.ts +2 -0
- package/build/defaults.js +2 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +4 -0
- package/build/keyring.d.ts +145 -0
- package/build/keyring.js +257 -0
- package/build/package.json +294 -0
- package/build/packageDetect.d.ts +1 -0
- package/build/packageDetect.js +5 -0
- package/build/packageInfo.d.ts +6 -0
- package/build/packageInfo.js +1 -0
- package/build/pair/decode.d.ts +12 -0
- package/build/pair/decode.js +42 -0
- package/build/pair/defaults.d.ts +12 -0
- package/build/pair/defaults.js +12 -0
- package/build/pair/encode.d.ts +5 -0
- package/build/pair/encode.js +19 -0
- package/build/pair/index.d.ts +40 -0
- package/build/pair/index.js +180 -0
- package/build/pair/nobody.d.ts +2 -0
- package/build/pair/nobody.js +40 -0
- package/build/pair/toJson.d.ts +8 -0
- package/build/pair/toJson.js +8 -0
- package/build/pair/types.d.ts +5 -0
- package/build/pair/types.js +1 -0
- package/build/pairs.d.ts +8 -0
- package/build/pairs.js +24 -0
- package/build/testing.d.ts +20 -0
- package/build/testing.js +122 -0
- package/build/testingPairs.d.ts +25 -0
- package/build/testingPairs.js +13 -0
- package/build/types.d.ts +111 -0
- package/build/types.js +1 -0
- package/build-deno/README.md +17 -0
- package/build-deno/bundle.ts +10 -0
- package/build-deno/defaults.ts +4 -0
- package/build-deno/index.ts +8 -0
- package/build-deno/keyring.ts +305 -0
- package/build-deno/mod.ts +2 -0
- package/build-deno/packageDetect.ts +9 -0
- package/build-deno/packageInfo.ts +3 -0
- package/build-deno/pair/decode.ts +54 -0
- package/build-deno/pair/defaults.ts +18 -0
- package/build-deno/pair/encode.ts +28 -0
- package/build-deno/pair/index.ts +218 -0
- package/build-deno/pair/nobody.ts +58 -0
- package/build-deno/pair/toJson.ts +18 -0
- package/build-deno/pair/types.ts +6 -0
- package/build-deno/pairs.ts +39 -0
- package/build-deno/testing.ts +150 -0
- package/build-deno/testingPairs.ts +54 -0
- package/build-deno/types.ts +129 -0
- package/build-tsc/bundle.d.ts +7 -0
- package/build-tsc/defaults.d.ts +2 -0
- package/build-tsc/index.d.ts +4 -0
- package/build-tsc/keyring.d.ts +145 -0
- package/build-tsc/packageDetect.d.ts +1 -0
- package/build-tsc/packageInfo.d.ts +6 -0
- package/build-tsc/pair/decode.d.ts +12 -0
- package/build-tsc/pair/defaults.d.ts +12 -0
- package/build-tsc/pair/encode.d.ts +5 -0
- package/build-tsc/pair/index.d.ts +40 -0
- package/build-tsc/pair/nobody.d.ts +2 -0
- package/build-tsc/pair/toJson.d.ts +8 -0
- package/build-tsc/pair/types.d.ts +5 -0
- package/build-tsc/pairs.d.ts +8 -0
- package/build-tsc/testing.d.ts +20 -0
- package/build-tsc/testingPairs.d.ts +25 -0
- package/build-tsc/types.d.ts +111 -0
- package/build-tsc-cjs/bundle.js +19 -0
- package/build-tsc-cjs/defaults.js +5 -0
- package/build-tsc-cjs/index.js +7 -0
- package/build-tsc-cjs/keyring.js +261 -0
- package/build-tsc-cjs/packageDetect.js +7 -0
- package/build-tsc-cjs/packageInfo.js +4 -0
- package/build-tsc-cjs/pair/decode.js +45 -0
- package/build-tsc-cjs/pair/defaults.js +15 -0
- package/build-tsc-cjs/pair/encode.js +22 -0
- package/build-tsc-cjs/pair/index.js +183 -0
- package/build-tsc-cjs/pair/nobody.js +43 -0
- package/build-tsc-cjs/pair/toJson.js +11 -0
- package/build-tsc-cjs/pair/types.js +2 -0
- package/build-tsc-cjs/pairs.js +28 -0
- package/build-tsc-cjs/testing.js +126 -0
- package/build-tsc-cjs/testingPairs.js +16 -0
- package/build-tsc-cjs/types.js +2 -0
- package/build-tsc-esm/bundle.js +7 -0
- package/build-tsc-esm/defaults.js +2 -0
- package/build-tsc-esm/index.js +4 -0
- package/build-tsc-esm/keyring.js +257 -0
- package/build-tsc-esm/packageDetect.js +5 -0
- package/build-tsc-esm/packageInfo.js +1 -0
- package/build-tsc-esm/pair/decode.js +42 -0
- package/build-tsc-esm/pair/defaults.js +12 -0
- package/build-tsc-esm/pair/encode.js +19 -0
- package/build-tsc-esm/pair/index.js +180 -0
- package/build-tsc-esm/pair/nobody.js +40 -0
- package/build-tsc-esm/pair/toJson.js +8 -0
- package/build-tsc-esm/pair/types.js +1 -0
- package/build-tsc-esm/pairs.js +24 -0
- package/build-tsc-esm/testing.js +122 -0
- package/build-tsc-esm/testingPairs.js +13 -0
- package/build-tsc-esm/types.js +1 -0
- package/bundle-pezkuwi-keyring.js +1 -1
- package/cjs/packageInfo.js +1 -1
- package/cjs/pair/defaults.d.ts +2 -2
- package/package.json +11 -11
- package/packageInfo.js +1 -1
- package/pair/defaults.d.ts +2 -2
- package/src/bundle.ts +16 -0
- package/src/defaults.ts +8 -0
- package/src/index.spec.ts +609 -0
- package/src/index.ts +10 -0
- package/src/keyring.ts +307 -0
- package/src/mod.ts +4 -0
- package/src/packageDetect.ts +13 -0
- package/src/packageInfo.ts +6 -0
- package/src/pair/decode.spec.ts +26 -0
- package/src/pair/decode.ts +56 -0
- package/src/pair/defaults.ts +20 -0
- package/src/pair/encode.spec.ts +28 -0
- package/src/pair/encode.ts +30 -0
- package/src/pair/index.spec.ts +189 -0
- package/src/pair/index.ts +220 -0
- package/src/pair/nobody.ts +62 -0
- package/src/pair/toJson.spec.ts +42 -0
- package/src/pair/toJson.ts +20 -0
- package/src/pair/types.ts +8 -0
- package/src/pair/vrf.spec.ts +47 -0
- package/src/pairs.ts +41 -0
- package/src/suri.spec.ts +109 -0
- package/src/testing.ts +156 -0
- package/src/testingPairs.spec.ts +79 -0
- package/src/testingPairs.ts +56 -0
- package/src/types.ts +131 -0
- package/tsconfig.build.json +16 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.spec.json +18 -0
- package/tsconfig.spec.tsbuildinfo +1 -0
package/build/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 [yyyy] [name of copyright owner]
|
|
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/build/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @pezkuwi/keyring
|
|
2
|
+
|
|
3
|
+
Key management of user accounts including generation and retrieval of keyring pairs from a variety of input combinations.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Installation -
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
yarn add @pezkuwi/keyring
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Classes and Functions can be imported as follows:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import Keyring from '@pezkuwi/keyring';
|
|
17
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { decodeAddress, encodeAddress, setSS58Format } from '@pezkuwi/util-crypto';
|
|
2
|
+
export { Keyring } from './keyring.js';
|
|
3
|
+
export { packageInfo } from './packageInfo.js';
|
|
4
|
+
export { createPair } from './pair/index.js';
|
|
5
|
+
export { createTestKeyring } from './testing.js';
|
|
6
|
+
export { createTestPairs } from './testingPairs.js';
|
|
7
|
+
export * from './defaults.js';
|
package/build/bundle.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { decodeAddress, encodeAddress, setSS58Format } from '@pezkuwi/util-crypto';
|
|
2
|
+
export { Keyring } from './keyring.js';
|
|
3
|
+
export { packageInfo } from './packageInfo.js';
|
|
4
|
+
export { createPair } from './pair/index.js';
|
|
5
|
+
export { createTestKeyring } from './testing.js';
|
|
6
|
+
export { createTestPairs } from './testingPairs.js';
|
|
7
|
+
export * from './defaults.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { decodeAddress, encodeAddress, setSS58Format } from '@pezkuwi/util-crypto';
|
|
2
|
+
export { Keyring } from './keyring.js';
|
|
3
|
+
export { packageInfo } from './packageInfo.js';
|
|
4
|
+
export { createPair } from './pair/index.js';
|
|
5
|
+
export { createTestKeyring } from './testing.js';
|
|
6
|
+
export { createTestPairs } from './testingPairs.js';
|
|
7
|
+
export * from './defaults.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTestPairs = exports.createTestKeyring = exports.createPair = exports.packageInfo = exports.Keyring = exports.setSS58Format = exports.encodeAddress = exports.decodeAddress = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var util_crypto_1 = require("@pezkuwi/util-crypto");
|
|
6
|
+
Object.defineProperty(exports, "decodeAddress", { enumerable: true, get: function () { return util_crypto_1.decodeAddress; } });
|
|
7
|
+
Object.defineProperty(exports, "encodeAddress", { enumerable: true, get: function () { return util_crypto_1.encodeAddress; } });
|
|
8
|
+
Object.defineProperty(exports, "setSS58Format", { enumerable: true, get: function () { return util_crypto_1.setSS58Format; } });
|
|
9
|
+
var keyring_js_1 = require("./keyring.js");
|
|
10
|
+
Object.defineProperty(exports, "Keyring", { enumerable: true, get: function () { return keyring_js_1.Keyring; } });
|
|
11
|
+
var packageInfo_js_1 = require("./packageInfo.js");
|
|
12
|
+
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
|
|
13
|
+
var index_js_1 = require("./pair/index.js");
|
|
14
|
+
Object.defineProperty(exports, "createPair", { enumerable: true, get: function () { return index_js_1.createPair; } });
|
|
15
|
+
var testing_js_1 = require("./testing.js");
|
|
16
|
+
Object.defineProperty(exports, "createTestKeyring", { enumerable: true, get: function () { return testing_js_1.createTestKeyring; } });
|
|
17
|
+
var testingPairs_js_1 = require("./testingPairs.js");
|
|
18
|
+
Object.defineProperty(exports, "createTestPairs", { enumerable: true, get: function () { return testingPairs_js_1.createTestPairs; } });
|
|
19
|
+
tslib_1.__exportStar(require("./defaults.js"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEV_SEED = exports.DEV_PHRASE = void 0;
|
|
4
|
+
exports.DEV_PHRASE = 'bottom drive obey lake curtain smoke basket hold race lonely fit walk';
|
|
5
|
+
exports.DEV_SEED = '0xfac7959dbfe72f052e5a0c3c8d6530f202b02fd8f9f5ca3580ec8deb7797479e';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
require("./packageDetect.js");
|
|
5
|
+
const bundle_js_1 = require("./bundle.js");
|
|
6
|
+
tslib_1.__exportStar(require("./bundle.js"), exports);
|
|
7
|
+
exports.default = bundle_js_1.Keyring;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { EncryptedJsonEncoding, Keypair, KeypairType } from '@pezkuwi/util-crypto/types';
|
|
2
|
+
import type { KeyringInstance, KeyringOptions, KeyringPair, KeyringPair$Json, KeyringPair$Meta } from './types.js';
|
|
3
|
+
import { decodeAddress } from '@pezkuwi/util-crypto';
|
|
4
|
+
/**
|
|
5
|
+
* # @pezkuwi/keyring
|
|
6
|
+
*
|
|
7
|
+
* ## Overview
|
|
8
|
+
*
|
|
9
|
+
* @name Keyring
|
|
10
|
+
* @summary Keyring management of user accounts
|
|
11
|
+
* @description Allows generation of keyring pairs from a variety of input combinations, such as
|
|
12
|
+
* json object containing account address or public key, account metadata, and account encoded using
|
|
13
|
+
* `addFromJson`, or by providing those values as arguments separately to `addFromAddress`,
|
|
14
|
+
* or by providing the mnemonic (seed phrase) and account metadata as arguments to `addFromMnemonic`.
|
|
15
|
+
* Stores the keyring pairs in a keyring pair dictionary. Removal of the keyring pairs from the keyring pair
|
|
16
|
+
* dictionary is achieved using `removePair`. Retrieval of all the stored pairs via `getPairs` or perform
|
|
17
|
+
* lookup of a pair for a given account address or public key using `getPair`. JSON metadata associated with
|
|
18
|
+
* an account may be obtained using `toJson` accompanied by the account passphrase.
|
|
19
|
+
*/
|
|
20
|
+
export declare class Keyring implements KeyringInstance {
|
|
21
|
+
#private;
|
|
22
|
+
decodeAddress: typeof decodeAddress;
|
|
23
|
+
constructor(options?: KeyringOptions);
|
|
24
|
+
/**
|
|
25
|
+
* @description retrieve the pairs (alias for getPairs)
|
|
26
|
+
*/
|
|
27
|
+
get pairs(): KeyringPair[];
|
|
28
|
+
/**
|
|
29
|
+
* @description retrieve the publicKeys (alias for getPublicKeys)
|
|
30
|
+
*/
|
|
31
|
+
get publicKeys(): Uint8Array[];
|
|
32
|
+
/**
|
|
33
|
+
* @description Returns the type of the keyring, ed25519, sr25519 or ecdsa
|
|
34
|
+
*/
|
|
35
|
+
get type(): KeypairType;
|
|
36
|
+
/**
|
|
37
|
+
* @name addPair
|
|
38
|
+
* @summary Stores an account, given a keyring pair, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
|
39
|
+
*/
|
|
40
|
+
addPair(pair: KeyringPair): KeyringPair;
|
|
41
|
+
/**
|
|
42
|
+
* @name addFromAddress
|
|
43
|
+
* @summary Stores an account, given an account address, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
|
44
|
+
* @description Allows user to explicitly provide separate inputs including account address or public key, and optionally
|
|
45
|
+
* the associated account metadata, and the default encoded value as arguments (that may be obtained from the json file
|
|
46
|
+
* of an account backup), and then generates a keyring pair from them that it passes to
|
|
47
|
+
* `addPair` to stores in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
|
48
|
+
*/
|
|
49
|
+
addFromAddress(address: string | Uint8Array, meta?: KeyringPair$Meta, encoded?: Uint8Array | null, type?: KeypairType, ignoreChecksum?: boolean, encType?: EncryptedJsonEncoding[]): KeyringPair;
|
|
50
|
+
/**
|
|
51
|
+
* @name addFromJson
|
|
52
|
+
* @summary Stores an account, given JSON data, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
|
53
|
+
* @description Allows user to provide a json object argument that contains account information (that may be obtained from the json file
|
|
54
|
+
* of an account backup), and then generates a keyring pair from it that it passes to
|
|
55
|
+
* `addPair` to stores in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
|
56
|
+
*/
|
|
57
|
+
addFromJson(json: KeyringPair$Json, ignoreChecksum?: boolean): KeyringPair;
|
|
58
|
+
/**
|
|
59
|
+
* @name addFromMnemonic
|
|
60
|
+
* @summary Stores an account, given a mnemonic, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
|
61
|
+
* @description Allows user to provide a mnemonic (seed phrase that is provided when account is originally created)
|
|
62
|
+
* argument and a metadata argument that contains account information (that may be obtained from the json file
|
|
63
|
+
* of an account backup), and then generates a keyring pair from it that it passes to
|
|
64
|
+
* `addPair` to stores in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
|
65
|
+
*/
|
|
66
|
+
addFromMnemonic(mnemonic: string, meta?: KeyringPair$Meta, type?: KeypairType, wordlist?: string[]): KeyringPair;
|
|
67
|
+
/**
|
|
68
|
+
* @name addFromPair
|
|
69
|
+
* @summary Stores an account created from an explicit publicKey/secreteKey combination
|
|
70
|
+
*/
|
|
71
|
+
addFromPair(pair: Keypair, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
72
|
+
/**
|
|
73
|
+
* @name addFromSeed
|
|
74
|
+
* @summary Stores an account, given seed data, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
|
75
|
+
* @description Stores in a keyring pair dictionary the public key of the pair as a key and the pair as the associated value.
|
|
76
|
+
* Allows user to provide the account seed as an argument, and then generates a keyring pair from it that it passes to
|
|
77
|
+
* `addPair` to store in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
|
78
|
+
*/
|
|
79
|
+
addFromSeed(seed: Uint8Array, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
80
|
+
/**
|
|
81
|
+
* @name addFromUri
|
|
82
|
+
* @summary Creates an account via an suri
|
|
83
|
+
* @description Extracts the phrase, path and password from a SURI format for specifying secret keys `<secret>/<soft-key>//<hard-key>///<password>` (the `///password` may be omitted, and `/<soft-key>` and `//<hard-key>` maybe repeated and mixed). The secret can be a hex string, mnemonic phrase or a string (to be padded)
|
|
84
|
+
*/
|
|
85
|
+
addFromUri(suri: string, meta?: KeyringPair$Meta, type?: KeypairType, wordlist?: string[]): KeyringPair;
|
|
86
|
+
/**
|
|
87
|
+
* @name createFromJson
|
|
88
|
+
* @description Creates a pair from a JSON keyfile
|
|
89
|
+
*/
|
|
90
|
+
createFromJson({ address, encoded, encoding: { content, type, version }, meta }: KeyringPair$Json, ignoreChecksum?: boolean): KeyringPair;
|
|
91
|
+
/**
|
|
92
|
+
* @name createFromPair
|
|
93
|
+
* @summary Creates a pair from an explicit publicKey/secreteKey combination
|
|
94
|
+
*/
|
|
95
|
+
createFromPair(pair: Keypair, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
96
|
+
/**
|
|
97
|
+
* @name createFromUri
|
|
98
|
+
* @summary Creates a Keypair from an suri
|
|
99
|
+
* @description This creates a pair from the suri, but does not add it to the keyring
|
|
100
|
+
*/
|
|
101
|
+
createFromUri(_suri: string, meta?: KeyringPair$Meta, type?: KeypairType, wordlist?: string[]): KeyringPair;
|
|
102
|
+
/**
|
|
103
|
+
* @name encodeAddress
|
|
104
|
+
* @description Encodes the input into an ss58 representation
|
|
105
|
+
*/
|
|
106
|
+
encodeAddress: (address: Uint8Array | string, ss58Format?: number) => string;
|
|
107
|
+
/**
|
|
108
|
+
* @name getPair
|
|
109
|
+
* @summary Retrieves an account keyring pair from the Keyring Pair Dictionary, given an account address
|
|
110
|
+
* @description Returns a keyring pair value from the keyring pair dictionary by performing
|
|
111
|
+
* a key lookup using the provided account address or public key (after decoding it).
|
|
112
|
+
*/
|
|
113
|
+
getPair(address: string | Uint8Array): KeyringPair;
|
|
114
|
+
/**
|
|
115
|
+
* @name getPairs
|
|
116
|
+
* @summary Retrieves all account keyring pairs from the Keyring Pair Dictionary
|
|
117
|
+
* @description Returns an array list of all the keyring pair values that are stored in the keyring pair dictionary.
|
|
118
|
+
*/
|
|
119
|
+
getPairs(): KeyringPair[];
|
|
120
|
+
/**
|
|
121
|
+
* @name getPublicKeys
|
|
122
|
+
* @summary Retrieves Public Keys of all Keyring Pairs stored in the Keyring Pair Dictionary
|
|
123
|
+
* @description Returns an array list of all the public keys associated with each of the keyring pair values that are stored in the keyring pair dictionary.
|
|
124
|
+
*/
|
|
125
|
+
getPublicKeys(): Uint8Array[];
|
|
126
|
+
/**
|
|
127
|
+
* @name removePair
|
|
128
|
+
* @description Deletes the provided input address or public key from the stored Keyring Pair Dictionary.
|
|
129
|
+
*/
|
|
130
|
+
removePair(address: string | Uint8Array): void;
|
|
131
|
+
/**
|
|
132
|
+
* @name setSS58Format;
|
|
133
|
+
* @description Sets the ss58 format for the keyring
|
|
134
|
+
*/
|
|
135
|
+
setSS58Format(ss58: number): void;
|
|
136
|
+
/**
|
|
137
|
+
* @name toJson
|
|
138
|
+
* @summary Returns a JSON object associated with the input argument that contains metadata assocated with an account
|
|
139
|
+
* @description Returns a JSON object containing the metadata associated with an account
|
|
140
|
+
* when valid address or public key and when the account passphrase is provided if the account secret
|
|
141
|
+
* is not already unlocked and available in memory. Note that in [Polkadot-JS Apps](https://github.com/polkadot-js/apps) the user
|
|
142
|
+
* may backup their account to a JSON file that contains this information.
|
|
143
|
+
*/
|
|
144
|
+
toJson(address: string | Uint8Array, passphrase?: string): KeyringPair$Json;
|
|
145
|
+
}
|