@prosopo/keyring 2.9.59 → 2.9.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const util = require("@polkadot/util");
4
- const utilCrypto = require("@prosopo/util-crypto");
5
- const defaults = require("./defaults.cjs");
6
- const SEED_OFFSET = defaults.PAIR_HDR.length;
1
+ const require_defaults = require("./defaults.cjs");
2
+ let _prosopo_util_crypto = require("@prosopo/util-crypto");
3
+ let _polkadot_util = require("@polkadot/util");
4
+ //#region src/pair/decode.ts
5
+ var SEED_OFFSET = require_defaults.PAIR_HDR.length;
6
+ /**
7
+ * Decode a pair, taking into account the generation-specific formats and headers
8
+ *
9
+ * For divisor/headers, don't rely on the magic being static. These will
10
+ * change between generations, aka with the long-awaited 4th generation
11
+ * of the format. The external decode interface is the only way to use and decode these.
12
+ **/
7
13
  function decodePair(passphrase, encrypted, _encType) {
8
- const encType = Array.isArray(_encType) || _encType === void 0 ? _encType : [_encType];
9
- const decrypted = utilCrypto.jsonDecryptData(encrypted, passphrase, encType);
10
- const header = decrypted.subarray(0, defaults.PAIR_HDR.length);
11
- if (!util.u8aEq(header, defaults.PAIR_HDR)) {
12
- throw new Error("Invalid encoding header found in body");
13
- }
14
- let secretKey = decrypted.subarray(SEED_OFFSET, SEED_OFFSET + defaults.SEC_LENGTH);
15
- let divOffset = SEED_OFFSET + defaults.SEC_LENGTH;
16
- let divider = decrypted.subarray(divOffset, divOffset + defaults.PAIR_DIV.length);
17
- if (!util.u8aEq(divider, defaults.PAIR_DIV)) {
18
- divOffset = SEED_OFFSET + defaults.SEED_LENGTH;
19
- secretKey = decrypted.subarray(SEED_OFFSET, divOffset);
20
- divider = decrypted.subarray(divOffset, divOffset + defaults.PAIR_DIV.length);
21
- if (!util.u8aEq(divider, defaults.PAIR_DIV)) {
22
- throw new Error("Invalid encoding divider found in body");
23
- }
24
- }
25
- const pubOffset = divOffset + defaults.PAIR_DIV.length;
26
- const publicKey = decrypted.subarray(pubOffset, pubOffset + defaults.PUB_LENGTH);
27
- return {
28
- publicKey,
29
- secretKey
30
- };
14
+ const encType = Array.isArray(_encType) || _encType === void 0 ? _encType : [_encType];
15
+ const decrypted = (0, _prosopo_util_crypto.jsonDecryptData)(encrypted, passphrase, encType);
16
+ const header = decrypted.subarray(0, require_defaults.PAIR_HDR.length);
17
+ if (!(0, _polkadot_util.u8aEq)(header, require_defaults.PAIR_HDR)) throw new Error("Invalid encoding header found in body");
18
+ let secretKey = decrypted.subarray(SEED_OFFSET, SEED_OFFSET + 64);
19
+ let divOffset = SEED_OFFSET + 64;
20
+ let divider = decrypted.subarray(divOffset, divOffset + require_defaults.PAIR_DIV.length);
21
+ if (!(0, _polkadot_util.u8aEq)(divider, require_defaults.PAIR_DIV)) {
22
+ divOffset = SEED_OFFSET + 32;
23
+ secretKey = decrypted.subarray(SEED_OFFSET, divOffset);
24
+ divider = decrypted.subarray(divOffset, divOffset + require_defaults.PAIR_DIV.length);
25
+ if (!(0, _polkadot_util.u8aEq)(divider, require_defaults.PAIR_DIV)) throw new Error("Invalid encoding divider found in body");
26
+ }
27
+ const pubOffset = divOffset + require_defaults.PAIR_DIV.length;
28
+ return {
29
+ publicKey: decrypted.subarray(pubOffset, pubOffset + 32),
30
+ secretKey
31
+ };
31
32
  }
33
+ //#endregion
32
34
  exports.decodePair = decodePair;
@@ -1,31 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const PAIR_DIV = new Uint8Array([161, 35, 3, 33, 0]);
4
- const PAIR_HDR = new Uint8Array([
5
- 48,
6
- 83,
7
- 2,
8
- 1,
9
- 1,
10
- 48,
11
- 5,
12
- 6,
13
- 3,
14
- 43,
15
- 101,
16
- 112,
17
- 4,
18
- 34,
19
- 4,
20
- 32
1
+ //#region src/pair/defaults.ts
2
+ /** public/secret section divider (generation 1-3, will change in 4, don't rely on value) */
3
+ var PAIR_DIV = new Uint8Array([
4
+ 161,
5
+ 35,
6
+ 3,
7
+ 33,
8
+ 0
21
9
  ]);
22
- const PUB_LENGTH = 32;
23
- const SALT_LENGTH = 32;
24
- const SEC_LENGTH = 64;
25
- const SEED_LENGTH = 32;
10
+ /** public/secret start block (generation 1-3, will change in 4, don't rely on value) */
11
+ var PAIR_HDR = new Uint8Array([
12
+ 48,
13
+ 83,
14
+ 2,
15
+ 1,
16
+ 1,
17
+ 48,
18
+ 5,
19
+ 6,
20
+ 3,
21
+ 43,
22
+ 101,
23
+ 112,
24
+ 4,
25
+ 34,
26
+ 4,
27
+ 32
28
+ ]);
29
+ //#endregion
26
30
  exports.PAIR_DIV = PAIR_DIV;
27
31
  exports.PAIR_HDR = PAIR_HDR;
28
- exports.PUB_LENGTH = PUB_LENGTH;
29
- exports.SALT_LENGTH = SALT_LENGTH;
30
- exports.SEC_LENGTH = SEC_LENGTH;
31
- exports.SEED_LENGTH = SEED_LENGTH;
@@ -1,18 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const util = require("@polkadot/util");
4
- const utilCrypto = require("@prosopo/util-crypto");
5
- const defaults = require("./defaults.cjs");
1
+ const require_defaults = require("./defaults.cjs");
2
+ let _prosopo_util_crypto = require("@prosopo/util-crypto");
3
+ let _polkadot_util = require("@polkadot/util");
4
+ //#region src/pair/encode.ts
5
+ /**
6
+ * Encode a pair with the latest generation format (generation 3)
7
+ **/
6
8
  function encodePair({ publicKey, secretKey }, passphrase) {
7
- if (!secretKey) {
8
- throw new Error("Expected a valid secretKey to be passed to encode");
9
- }
10
- const encoded = util.u8aConcat(defaults.PAIR_HDR, secretKey, defaults.PAIR_DIV, publicKey);
11
- if (!passphrase) {
12
- return encoded;
13
- }
14
- const { params, password, salt } = utilCrypto.scryptEncode(passphrase);
15
- const { encrypted, nonce } = utilCrypto.naclEncrypt(encoded, password.subarray(0, 32));
16
- return util.u8aConcat(utilCrypto.scryptToU8a(salt, params), nonce, encrypted);
9
+ if (!secretKey) throw new Error("Expected a valid secretKey to be passed to encode");
10
+ const encoded = (0, _polkadot_util.u8aConcat)(require_defaults.PAIR_HDR, secretKey, require_defaults.PAIR_DIV, publicKey);
11
+ if (!passphrase) return encoded;
12
+ const { params, password, salt } = (0, _prosopo_util_crypto.scryptEncode)(passphrase);
13
+ const { encrypted, nonce } = (0, _prosopo_util_crypto.naclEncrypt)(encoded, password.subarray(0, 32));
14
+ return (0, _polkadot_util.u8aConcat)((0, _prosopo_util_crypto.scryptToU8a)(salt, params), nonce, encrypted);
17
15
  }
16
+ //#endregion
18
17
  exports.encodePair = encodePair;
@@ -1,177 +1,201 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const util = require("@polkadot/util");
4
- const utilCrypto = require("@prosopo/util-crypto");
5
- const decode = require("./decode.cjs");
6
- const encode = require("./encode.cjs");
7
- const toJson = require("./toJson.cjs");
8
- const SIG_TYPE_NONE = new Uint8Array([]);
9
- const TYPE_FROM_SEED = {
10
- sr25519: utilCrypto.sr25519FromSeed,
11
- ed25519: () => {
12
- throw new Error("Not Implemented");
13
- },
14
- ecdsa: () => {
15
- throw new Error("Not Implemented");
16
- },
17
- ethereum: () => {
18
- throw new Error("Not Implemented");
19
- }
1
+ const require_decode = require("./decode.cjs");
2
+ const require_encode = require("./encode.cjs");
3
+ const require_toJson = require("./toJson.cjs");
4
+ let _prosopo_util_crypto = require("@prosopo/util-crypto");
5
+ let _polkadot_util = require("@polkadot/util");
6
+ //#region src/pair/index.ts
7
+ var SIG_TYPE_NONE = new Uint8Array([]);
8
+ var TYPE_FROM_SEED = {
9
+ sr25519: _prosopo_util_crypto.sr25519FromSeed,
10
+ ed25519: () => {
11
+ throw new Error("Not Implemented");
12
+ },
13
+ ecdsa: () => {
14
+ throw new Error("Not Implemented");
15
+ },
16
+ ethereum: () => {
17
+ throw new Error("Not Implemented");
18
+ }
20
19
  };
21
- const TYPE_PREFIX = {
22
- ecdsa: new Uint8Array([2]),
23
- ed25519: new Uint8Array([0]),
24
- ethereum: new Uint8Array([2]),
25
- sr25519: new Uint8Array([1])
20
+ var TYPE_PREFIX = {
21
+ ecdsa: new Uint8Array([2]),
22
+ ed25519: new Uint8Array([0]),
23
+ ethereum: new Uint8Array([2]),
24
+ sr25519: new Uint8Array([1])
26
25
  };
27
- const TYPE_SIGNATURE = {
28
- sr25519: utilCrypto.sr25519Sign,
29
- ed25519: () => {
30
- throw new Error("Not Implemented");
31
- },
32
- ecdsa: () => {
33
- throw new Error("Not Implemented");
34
- },
35
- ethereum: () => {
36
- throw new Error("Not Implemented");
37
- }
26
+ var TYPE_SIGNATURE = {
27
+ sr25519: _prosopo_util_crypto.sr25519Sign,
28
+ ed25519: () => {
29
+ throw new Error("Not Implemented");
30
+ },
31
+ ecdsa: () => {
32
+ throw new Error("Not Implemented");
33
+ },
34
+ ethereum: () => {
35
+ throw new Error("Not Implemented");
36
+ }
38
37
  };
39
- const TYPE_JWT_ISSUE = {
40
- sr25519: utilCrypto.sr25519jwtIssue,
41
- ed25519: () => {
42
- throw new Error("Not Implemented");
43
- },
44
- ecdsa: () => {
45
- throw new Error("Not Implemented");
46
- },
47
- ethereum: () => {
48
- throw new Error("Not Implemented");
49
- }
38
+ var TYPE_JWT_ISSUE = {
39
+ sr25519: _prosopo_util_crypto.sr25519jwtIssue,
40
+ ed25519: () => {
41
+ throw new Error("Not Implemented");
42
+ },
43
+ ecdsa: () => {
44
+ throw new Error("Not Implemented");
45
+ },
46
+ ethereum: () => {
47
+ throw new Error("Not Implemented");
48
+ }
50
49
  };
51
- const TYPE_ADDRESS = {
52
- sr25519: (p) => p,
53
- ed25519: () => {
54
- throw new Error("Not Implemented");
55
- },
56
- ecdsa: () => {
57
- throw new Error("Not Implemented");
58
- },
59
- ethereum: () => {
60
- throw new Error("Not Implemented");
61
- }
50
+ var TYPE_ADDRESS = {
51
+ sr25519: (p) => p,
52
+ ed25519: () => {
53
+ throw new Error("Not Implemented");
54
+ },
55
+ ecdsa: () => {
56
+ throw new Error("Not Implemented");
57
+ },
58
+ ethereum: () => {
59
+ throw new Error("Not Implemented");
60
+ }
62
61
  };
63
62
  function isLocked(secretKey) {
64
- return !secretKey || util.u8aEmpty(secretKey);
65
- }
66
- function vrfHash(proof, context, extra) {
67
- return utilCrypto.blake2AsU8a(util.u8aConcat(context || "", extra || "", proof));
63
+ return !secretKey || (0, _polkadot_util.u8aEmpty)(secretKey);
68
64
  }
65
+ /**
66
+ * @name createPair
67
+ * @summary Creates a keyring pair object
68
+ * @description Creates a keyring pair object with provided account public key, metadata, and encoded arguments.
69
+ * The keyring pair stores the account state including the encoded address and associated metadata.
70
+ *
71
+ * It has properties whose values are functions that may be called to perform account actions:
72
+ *
73
+ * - `address` function retrieves the address associated with the account.
74
+ * - `decodedPkcs8` function is called with the account passphrase and account encoded public key.
75
+ * It decodes the encoded public key using the passphrase provided to obtain the decoded account public key
76
+ * and associated secret key that are then available in memory, and changes the account address stored in the
77
+ * state of the pair to correspond to the address of the decoded public key.
78
+ * - `encodePkcs8` function when provided with the correct passphrase associated with the account pair
79
+ * and when the secret key is in memory (when the account pair is not locked) it returns an encoded
80
+ * public key of the account.
81
+ * - `meta` is the metadata that is stored in the state of the pair, either when it was originally
82
+ * created or set via `setMeta`.
83
+ * - `publicKey` returns the public key stored in memory for the pair.
84
+ * - `sign` may be used to return a signature by signing a provided message with the secret
85
+ * key (if it is in memory) using Nacl.
86
+ * - `toJson` calls another `toJson` function and provides the state of the pair,
87
+ * it generates arguments to be passed to the other `toJson` function including an encoded public key of the account
88
+ * that it generates using the secret key from memory (if it has been made available in memory)
89
+ * and the optionally provided passphrase argument. It passes a third boolean argument to `toJson`
90
+ * indicating whether the public key has been encoded or not (if a passphrase argument was provided then it is encoded).
91
+ * The `toJson` function that it calls returns a JSON object with properties including the `address`
92
+ * and `meta` that are assigned with the values stored in the corresponding state variables of the account pair,
93
+ * an `encoded` property that is assigned with the encoded public key in hex format, and an `encoding`
94
+ * property that indicates whether the public key value of the `encoded` property is encoded or not.
95
+ */
69
96
  function createPair({ toSS58, type }, { publicKey, secretKey }, meta = {}, encoded = null, encTypes) {
70
- const decodePkcs8 = (passphrase, userEncoded) => {
71
- const decoded = decode.decodePair(passphrase, userEncoded || encoded, encTypes);
72
- if (decoded.secretKey.length === 64) {
73
- publicKey = decoded.publicKey;
74
- secretKey = decoded.secretKey;
75
- } else {
76
- const pair = TYPE_FROM_SEED[type](decoded.secretKey);
77
- publicKey = pair.publicKey;
78
- secretKey = pair.secretKey;
79
- }
80
- };
81
- const recode = (passphrase) => {
82
- isLocked(secretKey) && encoded && decodePkcs8(passphrase, encoded);
83
- encoded = encode.encodePair({ publicKey, secretKey }, passphrase);
84
- encTypes = void 0;
85
- return encoded;
86
- };
87
- const encodeAddress = () => {
88
- const raw = TYPE_ADDRESS[type](publicKey);
89
- return toSS58(raw);
90
- };
91
- return {
92
- get address() {
93
- return encodeAddress();
94
- },
95
- get addressRaw() {
96
- return TYPE_ADDRESS[type](publicKey);
97
- },
98
- get isLocked() {
99
- return isLocked(secretKey);
100
- },
101
- get meta() {
102
- return meta;
103
- },
104
- get publicKey() {
105
- return publicKey;
106
- },
107
- get type() {
108
- return type;
109
- },
110
- // eslint-disable-next-line sort-keys
111
- decodePkcs8,
112
- derive: (suri, meta2) => {
113
- if (isLocked(secretKey)) {
114
- throw new Error("Cannot derive on a locked keypair");
115
- }
116
- const { path } = utilCrypto.keyExtractPath(suri);
117
- const derived = utilCrypto.keyFromPath({ publicKey, secretKey }, path, type);
118
- return createPair({ toSS58, type }, derived, meta2, null);
119
- },
120
- encodePkcs8: (passphrase) => {
121
- return recode(passphrase);
122
- },
123
- jwtIssue: (options, message) => {
124
- if (isLocked(secretKey)) {
125
- throw new Error("Cannot sign with a locked key pair");
126
- }
127
- return TYPE_JWT_ISSUE[type]({ publicKey, secretKey }, options, message);
128
- },
129
- jwtVerify: (jwt) => {
130
- return utilCrypto.jwtVerify(jwt, publicKey);
131
- },
132
- lock: () => {
133
- secretKey = new Uint8Array([]);
134
- },
135
- setMeta: (additional) => {
136
- meta = util.objectSpread({}, meta, additional);
137
- },
138
- sign: (message, options = {}) => {
139
- if (isLocked(secretKey)) {
140
- throw new Error("Cannot sign with a locked key pair");
141
- }
142
- return util.u8aConcat(
143
- options.withType ? TYPE_PREFIX[type] : SIG_TYPE_NONE,
144
- TYPE_SIGNATURE[type](util.u8aToU8a(message), { publicKey, secretKey })
145
- );
146
- },
147
- toJson: (passphrase) => {
148
- const address = ["ecdsa", "ethereum"].includes(type) ? publicKey.length === 20 ? util.u8aToHex(publicKey) : util.u8aToHex(utilCrypto.secp256k1Compress(publicKey)) : encodeAddress();
149
- return toJson.pairToJson(
150
- type,
151
- { address, meta },
152
- recode(passphrase),
153
- !!passphrase
154
- );
155
- },
156
- unlock: (passphrase) => {
157
- decodePkcs8(passphrase);
158
- },
159
- verify: (message, signature, signerPublic) => {
160
- return utilCrypto.signatureVerify(
161
- message,
162
- signature,
163
- TYPE_ADDRESS[type](util.u8aToU8a(signerPublic))
164
- ).isValid;
165
- },
166
- vrfSign: (message, context, extra) => {
167
- if (isLocked(secretKey)) {
168
- throw new Error("Cannot sign with a locked key pair");
169
- }
170
- return utilCrypto.sr25519VrfSign(message, { secretKey }, context, extra);
171
- },
172
- vrfVerify: (message, vrfResult, signerPublic, context, extra) => {
173
- return utilCrypto.sr25519VrfVerify(message, vrfResult, publicKey, context, extra);
174
- }
175
- };
97
+ const decodePkcs8 = (passphrase, userEncoded) => {
98
+ const decoded = require_decode.decodePair(passphrase, userEncoded || encoded, encTypes);
99
+ if (decoded.secretKey.length === 64) {
100
+ publicKey = decoded.publicKey;
101
+ secretKey = decoded.secretKey;
102
+ } else {
103
+ const pair = TYPE_FROM_SEED[type](decoded.secretKey);
104
+ publicKey = pair.publicKey;
105
+ secretKey = pair.secretKey;
106
+ }
107
+ };
108
+ const recode = (passphrase) => {
109
+ isLocked(secretKey) && encoded && decodePkcs8(passphrase, encoded);
110
+ encoded = require_encode.encodePair({
111
+ publicKey,
112
+ secretKey
113
+ }, passphrase);
114
+ encTypes = void 0;
115
+ return encoded;
116
+ };
117
+ const encodeAddress = () => {
118
+ return toSS58(TYPE_ADDRESS[type](publicKey));
119
+ };
120
+ return {
121
+ get address() {
122
+ return encodeAddress();
123
+ },
124
+ get addressRaw() {
125
+ return TYPE_ADDRESS[type](publicKey);
126
+ },
127
+ get isLocked() {
128
+ return isLocked(secretKey);
129
+ },
130
+ get meta() {
131
+ return meta;
132
+ },
133
+ get publicKey() {
134
+ return publicKey;
135
+ },
136
+ get type() {
137
+ return type;
138
+ },
139
+ decodePkcs8,
140
+ derive: (suri, meta) => {
141
+ if (isLocked(secretKey)) throw new Error("Cannot derive on a locked keypair");
142
+ const { path } = (0, _prosopo_util_crypto.keyExtractPath)(suri);
143
+ const derived = (0, _prosopo_util_crypto.keyFromPath)({
144
+ publicKey,
145
+ secretKey
146
+ }, path, type);
147
+ return createPair({
148
+ toSS58,
149
+ type
150
+ }, derived, meta, null);
151
+ },
152
+ encodePkcs8: (passphrase) => {
153
+ return recode(passphrase);
154
+ },
155
+ jwtIssue: (options, message) => {
156
+ if (isLocked(secretKey)) throw new Error("Cannot sign with a locked key pair");
157
+ return TYPE_JWT_ISSUE[type]({
158
+ publicKey,
159
+ secretKey
160
+ }, options, message);
161
+ },
162
+ jwtVerify: (jwt) => {
163
+ return (0, _prosopo_util_crypto.jwtVerify)(jwt, publicKey);
164
+ },
165
+ lock: () => {
166
+ secretKey = new Uint8Array([]);
167
+ },
168
+ setMeta: (additional) => {
169
+ meta = (0, _polkadot_util.objectSpread)({}, meta, additional);
170
+ },
171
+ sign: (message, options = {}) => {
172
+ if (isLocked(secretKey)) throw new Error("Cannot sign with a locked key pair");
173
+ return (0, _polkadot_util.u8aConcat)(options.withType ? TYPE_PREFIX[type] : SIG_TYPE_NONE, TYPE_SIGNATURE[type]((0, _polkadot_util.u8aToU8a)(message), {
174
+ publicKey,
175
+ secretKey
176
+ }));
177
+ },
178
+ toJson: (passphrase) => {
179
+ const address = ["ecdsa", "ethereum"].includes(type) ? publicKey.length === 20 ? (0, _polkadot_util.u8aToHex)(publicKey) : (0, _polkadot_util.u8aToHex)((0, _prosopo_util_crypto.secp256k1Compress)(publicKey)) : encodeAddress();
180
+ return require_toJson.pairToJson(type, {
181
+ address,
182
+ meta
183
+ }, recode(passphrase), !!passphrase);
184
+ },
185
+ unlock: (passphrase) => {
186
+ decodePkcs8(passphrase);
187
+ },
188
+ verify: (message, signature, signerPublic) => {
189
+ return (0, _prosopo_util_crypto.signatureVerify)(message, signature, TYPE_ADDRESS[type]((0, _polkadot_util.u8aToU8a)(signerPublic))).isValid;
190
+ },
191
+ vrfSign: (message, context, extra) => {
192
+ if (isLocked(secretKey)) throw new Error("Cannot sign with a locked key pair");
193
+ return (0, _prosopo_util_crypto.sr25519VrfSign)(message, { secretKey }, context, extra);
194
+ },
195
+ vrfVerify: (message, vrfResult, signerPublic, context, extra) => {
196
+ return (0, _prosopo_util_crypto.sr25519VrfVerify)(message, vrfResult, publicKey, context, extra);
197
+ }
198
+ };
176
199
  }
200
+ //#endregion
177
201
  exports.createPair = createPair;
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const util = require("@polkadot/util");
4
- const utilCrypto = require("@prosopo/util-crypto");
1
+ let _prosopo_util_crypto = require("@prosopo/util-crypto");
2
+ let _polkadot_util = require("@polkadot/util");
3
+ //#region src/pair/toJson.ts
5
4
  function pairToJson(type, { address, meta }, encoded, isEncrypted) {
6
- return util.objectSpread(
7
- utilCrypto.jsonEncryptFormat(encoded, ["pkcs8", type], isEncrypted),
8
- {
9
- address,
10
- meta
11
- }
12
- );
5
+ return (0, _polkadot_util.objectSpread)((0, _prosopo_util_crypto.jsonEncryptFormat)(encoded, ["pkcs8", type], isEncrypted), {
6
+ address,
7
+ meta
8
+ });
13
9
  }
10
+ //#endregion
14
11
  exports.pairToJson = pairToJson;
package/dist/index.js CHANGED
@@ -1,19 +1,8 @@
1
- import "./accounts/index.js";
2
- import "./keyring/index.js";
1
+ import "./_virtual/_rolldown/runtime.js";
3
2
  import { createPair } from "./pair/index.js";
3
+ import { Pairs } from "./keyring/pairs.js";
4
+ import { DEV_PHRASE, Keyring } from "./keyring/keyring.js";
4
5
  import { generateMiniSecret, generateMnemonic } from "./accounts/mnemonic.js";
5
6
  import { getPair } from "./accounts/getPair.js";
6
7
  import { getDefaultProviders, getDefaultSiteKeys } from "./accounts/testAccounts.js";
7
- import { DEV_PHRASE, Keyring } from "./keyring/keyring.js";
8
- import { Pairs } from "./keyring/pairs.js";
9
- export {
10
- DEV_PHRASE,
11
- Keyring,
12
- Pairs,
13
- createPair,
14
- generateMiniSecret,
15
- generateMnemonic,
16
- getDefaultProviders,
17
- getDefaultSiteKeys,
18
- getPair
19
- };
8
+ export { DEV_PHRASE, Keyring, Pairs, createPair, generateMiniSecret, generateMnemonic, getDefaultProviders, getDefaultSiteKeys, getPair };
@@ -1,7 +1,3 @@
1
- import { DEV_PHRASE, Keyring } from "./keyring.js";
2
1
  import { Pairs } from "./pairs.js";
3
- export {
4
- DEV_PHRASE,
5
- Keyring,
6
- Pairs
7
- };
2
+ import { DEV_PHRASE, Keyring } from "./keyring.js";
3
+ export { DEV_PHRASE, Keyring, Pairs };