@prosopo/keyring 2.8.6 → 2.8.8
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/CHANGELOG.md +38 -0
- package/dist/accounts/getPair.js +33 -32
- package/dist/accounts/index.js +10 -4
- package/dist/accounts/mnemonic.js +15 -12
- package/dist/accounts/testAccounts.js +41 -35
- package/dist/cjs/accounts/getPair.cjs +2 -2
- package/dist/cjs/accounts/mnemonic.cjs +1 -2
- package/dist/index.js +19 -4
- package/dist/keyring/index.js +7 -3
- package/dist/keyring/keyring.js +255 -130
- package/dist/keyring/pairs.js +24 -27
- package/dist/pair/decode.js +26 -24
- package/dist/pair/defaults.js +30 -8
- package/dist/pair/encode.js +16 -14
- package/dist/pair/index.js +139 -134
- package/dist/pair/toJson.js +11 -6
- package/package.json +18 -14
- package/vite.cjs.config.ts +4 -1
- package/vite.esm.config.ts +20 -0
- package/vite.test.config.ts +32 -0
- package/dist/accounts/getPair.d.ts +0 -5
- package/dist/accounts/getPair.d.ts.map +0 -1
- package/dist/accounts/getPair.js.map +0 -1
- package/dist/accounts/index.d.ts +0 -4
- package/dist/accounts/index.d.ts.map +0 -1
- package/dist/accounts/index.js.map +0 -1
- package/dist/accounts/mnemonic.d.ts +0 -5
- package/dist/accounts/mnemonic.d.ts.map +0 -1
- package/dist/accounts/mnemonic.js.map +0 -1
- package/dist/accounts/testAccounts.d.ts +0 -4
- package/dist/accounts/testAccounts.d.ts.map +0 -1
- package/dist/accounts/testAccounts.js.map +0 -1
- package/dist/cjs/dist/accounts/getPair.cjs +0 -41
- package/dist/cjs/dist/accounts/index.cjs +0 -10
- package/dist/cjs/dist/accounts/mnemonic.cjs +0 -19
- package/dist/cjs/dist/accounts/testAccounts.cjs +0 -42
- package/dist/cjs/dist/index.cjs +0 -6
- package/dist/cjs/dist/keyring/index.cjs +0 -7
- package/dist/cjs/dist/keyring/keyring.cjs +0 -138
- package/dist/cjs/dist/keyring/pairs.cjs +0 -31
- package/dist/cjs/dist/pair/decode.cjs +0 -32
- package/dist/cjs/dist/pair/defaults.cjs +0 -31
- package/dist/cjs/dist/pair/encode.cjs +0 -18
- package/dist/cjs/dist/pair/index.cjs +0 -143
- package/dist/cjs/dist/pair/toJson.cjs +0 -11
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keyring/index.d.ts +0 -3
- package/dist/keyring/index.d.ts.map +0 -1
- package/dist/keyring/index.js.map +0 -1
- package/dist/keyring/keyring.d.ts +0 -36
- package/dist/keyring/keyring.d.ts.map +0 -1
- package/dist/keyring/keyring.js.map +0 -1
- package/dist/keyring/pairs.d.ts +0 -9
- package/dist/keyring/pairs.d.ts.map +0 -1
- package/dist/keyring/pairs.js.map +0 -1
- package/dist/keyring/testing.d.ts +0 -14
- package/dist/keyring/testing.d.ts.map +0 -1
- package/dist/keyring/testing.js +0 -76
- package/dist/keyring/testing.js.map +0 -1
- package/dist/keyring/testingPairs.d.ts +0 -26
- package/dist/keyring/testingPairs.d.ts.map +0 -1
- package/dist/keyring/testingPairs.js +0 -14
- package/dist/keyring/testingPairs.js.map +0 -1
- package/dist/pair/decode.d.ts +0 -6
- package/dist/pair/decode.d.ts.map +0 -1
- package/dist/pair/decode.js.map +0 -1
- package/dist/pair/decode.spec.d.ts +0 -2
- package/dist/pair/decode.spec.d.ts.map +0 -1
- package/dist/pair/decode.spec.js +0 -13
- package/dist/pair/decode.spec.js.map +0 -1
- package/dist/pair/defaults.d.ts +0 -7
- package/dist/pair/defaults.d.ts.map +0 -1
- package/dist/pair/defaults.js.map +0 -1
- package/dist/pair/encode.d.ts +0 -3
- package/dist/pair/encode.d.ts.map +0 -1
- package/dist/pair/encode.js.map +0 -1
- package/dist/pair/encode.spec.d.ts +0 -2
- package/dist/pair/encode.spec.d.ts.map +0 -1
- package/dist/pair/encode.spec.js +0 -16
- package/dist/pair/encode.spec.js.map +0 -1
- package/dist/pair/index.d.ts +0 -11
- package/dist/pair/index.d.ts.map +0 -1
- package/dist/pair/index.js.map +0 -1
- package/dist/pair/nobody.d.ts +0 -3
- package/dist/pair/nobody.d.ts.map +0 -1
- package/dist/pair/nobody.js +0 -40
- package/dist/pair/nobody.js.map +0 -1
- package/dist/pair/toJson.d.ts +0 -9
- package/dist/pair/toJson.d.ts.map +0 -1
- package/dist/pair/toJson.js.map +0 -1
- package/dist/pair/toJson.spec.d.ts +0 -2
- package/dist/pair/toJson.spec.d.ts.map +0 -1
- package/dist/pair/toJson.spec.js +0 -33
- package/dist/pair/toJson.spec.js.map +0 -1
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const tslib = require("tslib");
|
|
4
|
-
const util = require("@polkadot/util");
|
|
5
|
-
const hex = require("@polkadot/util/hex");
|
|
6
|
-
const is = require("@polkadot/util/is");
|
|
7
|
-
const utilCrypto = require("@prosopo/util-crypto");
|
|
8
|
-
const index = require("../pair/index.cjs");
|
|
9
|
-
const pairs = require("./pairs.cjs");
|
|
10
|
-
var _Keyring_pairs, _Keyring_type, _Keyring_ss58;
|
|
11
|
-
const DEV_PHRASE = "bottom drive obey lake curtain smoke basket hold race lonely fit walk";
|
|
12
|
-
const PairFromSeed = {
|
|
13
|
-
sr25519: (seed) => utilCrypto.sr25519FromSeed(seed),
|
|
14
|
-
ed25519: () => {
|
|
15
|
-
throw new Error("Not Implemented");
|
|
16
|
-
},
|
|
17
|
-
ecdsa: () => {
|
|
18
|
-
throw new Error("Not Implemented");
|
|
19
|
-
},
|
|
20
|
-
ethereum: () => {
|
|
21
|
-
throw new Error("Not Implemented");
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
function pairToPublic({ publicKey }) {
|
|
25
|
-
return publicKey;
|
|
26
|
-
}
|
|
27
|
-
class Keyring {
|
|
28
|
-
constructor(options = {}) {
|
|
29
|
-
_Keyring_pairs.set(this, void 0);
|
|
30
|
-
_Keyring_type.set(this, void 0);
|
|
31
|
-
_Keyring_ss58.set(this, void 0);
|
|
32
|
-
this.decodeAddress = utilCrypto.decodeAddress;
|
|
33
|
-
this.encodeAddress = (address, ss58Format) => {
|
|
34
|
-
return utilCrypto.encodeAddress(address, ss58Format ?? tslib.__classPrivateFieldGet(this, _Keyring_ss58, "f"));
|
|
35
|
-
};
|
|
36
|
-
options.type = options.type || "sr25519";
|
|
37
|
-
if (!["sr25519"].includes(options.type || "undefined")) {
|
|
38
|
-
throw new Error(`Expected a keyring type of either 'sr25519', found '${options.type || "unknown"}`);
|
|
39
|
-
}
|
|
40
|
-
tslib.__classPrivateFieldSet(this, _Keyring_pairs, new pairs.Pairs(), "f");
|
|
41
|
-
tslib.__classPrivateFieldSet(this, _Keyring_ss58, options.ss58Format, "f");
|
|
42
|
-
tslib.__classPrivateFieldSet(this, _Keyring_type, options.type, "f");
|
|
43
|
-
}
|
|
44
|
-
get pairs() {
|
|
45
|
-
return this.getPairs();
|
|
46
|
-
}
|
|
47
|
-
get publicKeys() {
|
|
48
|
-
return this.getPublicKeys();
|
|
49
|
-
}
|
|
50
|
-
get type() {
|
|
51
|
-
return tslib.__classPrivateFieldGet(this, _Keyring_type, "f");
|
|
52
|
-
}
|
|
53
|
-
addPair(pair) {
|
|
54
|
-
return tslib.__classPrivateFieldGet(this, _Keyring_pairs, "f").add(pair);
|
|
55
|
-
}
|
|
56
|
-
addFromAddress(address, meta = {}, encoded = null, type = this.type, ignoreChecksum, encType) {
|
|
57
|
-
const publicKey = this.decodeAddress(address, ignoreChecksum);
|
|
58
|
-
return this.addPair(index.createPair({ toSS58: this.encodeAddress, type }, { publicKey, secretKey: new Uint8Array() }, meta, encoded, encType));
|
|
59
|
-
}
|
|
60
|
-
addFromJson(json, ignoreChecksum) {
|
|
61
|
-
return this.addPair(this.createFromJson(json, ignoreChecksum));
|
|
62
|
-
}
|
|
63
|
-
addFromMnemonic(mnemonic, meta = {}, type = this.type) {
|
|
64
|
-
return this.addFromUri(mnemonic, meta, type);
|
|
65
|
-
}
|
|
66
|
-
addFromPair(pair, meta = {}, type = this.type) {
|
|
67
|
-
return this.addPair(this.createFromPair(pair, meta, type));
|
|
68
|
-
}
|
|
69
|
-
addFromSeed(seed, meta = {}, type = this.type) {
|
|
70
|
-
return this.addPair(index.createPair({ toSS58: this.encodeAddress, type }, PairFromSeed[type](seed), meta, null));
|
|
71
|
-
}
|
|
72
|
-
addFromUri(suri, meta = {}, type = this.type) {
|
|
73
|
-
return this.addPair(this.createFromUri(suri, meta, type));
|
|
74
|
-
}
|
|
75
|
-
createFromJson({ address, encoded, encoding: { content, type, version }, meta }, ignoreChecksum) {
|
|
76
|
-
if (version === "3" && content[0] !== "pkcs8") {
|
|
77
|
-
throw new Error(`Unable to decode non-pkcs8 type, [${content.join(",")}] found}`);
|
|
78
|
-
}
|
|
79
|
-
const cryptoType = version === "0" || !Array.isArray(content) ? this.type : content[1];
|
|
80
|
-
if (!cryptoType) {
|
|
81
|
-
throw new Error("cryptoType is undefined");
|
|
82
|
-
}
|
|
83
|
-
const encType = !Array.isArray(type) ? [type] : type;
|
|
84
|
-
if (!["sr25519"].includes(cryptoType)) {
|
|
85
|
-
throw new Error(`Unknown crypto type ${cryptoType}`);
|
|
86
|
-
}
|
|
87
|
-
const publicKey = is.isHex(address) ? hex.hexToU8a(address) : this.decodeAddress(address, ignoreChecksum);
|
|
88
|
-
const decoded = is.isHex(encoded) ? hex.hexToU8a(encoded) : utilCrypto.base64Decode(encoded);
|
|
89
|
-
return index.createPair({ toSS58: this.encodeAddress, type: cryptoType }, { publicKey, secretKey: new Uint8Array() }, meta, decoded, encType);
|
|
90
|
-
}
|
|
91
|
-
createFromPair(pair, meta = {}, type = this.type) {
|
|
92
|
-
return index.createPair({ toSS58: this.encodeAddress, type }, pair, meta, null);
|
|
93
|
-
}
|
|
94
|
-
createFromUri(_suri, meta = {}, type = this.type) {
|
|
95
|
-
const suri = _suri.startsWith("//") ? `${DEV_PHRASE}${_suri}` : _suri;
|
|
96
|
-
const { derivePath, password, path, phrase } = utilCrypto.keyExtractSuri(suri);
|
|
97
|
-
let seed;
|
|
98
|
-
const isPhraseHex = is.isHex(phrase, 256);
|
|
99
|
-
if (isPhraseHex) {
|
|
100
|
-
seed = hex.hexToU8a(phrase);
|
|
101
|
-
} else {
|
|
102
|
-
const parts = phrase.split(" ");
|
|
103
|
-
if ([12, 15, 18, 21, 24].includes(parts.length)) {
|
|
104
|
-
seed = type === "ethereum" ? (() => {
|
|
105
|
-
throw new Error("Not implemented - Prosopo Keyring supports sr25519 only");
|
|
106
|
-
})() : utilCrypto.mnemonicToMiniSecret(phrase, password);
|
|
107
|
-
} else {
|
|
108
|
-
if (phrase.length > 32) {
|
|
109
|
-
throw new Error("specified phrase is not a valid mnemonic and is invalid as a raw seed at > 32 bytes");
|
|
110
|
-
}
|
|
111
|
-
seed = util.stringToU8a(phrase.padEnd(32));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const derived = utilCrypto.keyFromPath(PairFromSeed[type](seed), path, type);
|
|
115
|
-
return index.createPair({ toSS58: this.encodeAddress, type }, derived, meta, null);
|
|
116
|
-
}
|
|
117
|
-
getPair(address) {
|
|
118
|
-
return tslib.__classPrivateFieldGet(this, _Keyring_pairs, "f").get(address);
|
|
119
|
-
}
|
|
120
|
-
getPairs() {
|
|
121
|
-
return tslib.__classPrivateFieldGet(this, _Keyring_pairs, "f").all();
|
|
122
|
-
}
|
|
123
|
-
getPublicKeys() {
|
|
124
|
-
return tslib.__classPrivateFieldGet(this, _Keyring_pairs, "f").all().map(pairToPublic);
|
|
125
|
-
}
|
|
126
|
-
removePair(address) {
|
|
127
|
-
tslib.__classPrivateFieldGet(this, _Keyring_pairs, "f").remove(address);
|
|
128
|
-
}
|
|
129
|
-
setSS58Format(ss58) {
|
|
130
|
-
tslib.__classPrivateFieldSet(this, _Keyring_ss58, ss58, "f");
|
|
131
|
-
}
|
|
132
|
-
toJson(address, passphrase) {
|
|
133
|
-
return tslib.__classPrivateFieldGet(this, _Keyring_pairs, "f").get(address).toJson(passphrase);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
_Keyring_pairs = /* @__PURE__ */ new WeakMap(), _Keyring_type = /* @__PURE__ */ new WeakMap(), _Keyring_ss58 = /* @__PURE__ */ new WeakMap();
|
|
137
|
-
exports.DEV_PHRASE = DEV_PHRASE;
|
|
138
|
-
exports.Keyring = Keyring;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const tslib = require("tslib");
|
|
4
|
-
const util$1 = require("@polkadot/util");
|
|
5
|
-
const util = require("@prosopo/util");
|
|
6
|
-
const utilCrypto = require("@prosopo/util-crypto");
|
|
7
|
-
var _Pairs_map;
|
|
8
|
-
class Pairs {
|
|
9
|
-
constructor() {
|
|
10
|
-
_Pairs_map.set(this, {});
|
|
11
|
-
}
|
|
12
|
-
add(pair) {
|
|
13
|
-
tslib.__classPrivateFieldGet(this, _Pairs_map, "f")[utilCrypto.decodeAddress(pair.address).toString()] = pair;
|
|
14
|
-
return pair;
|
|
15
|
-
}
|
|
16
|
-
all() {
|
|
17
|
-
return Object.values(tslib.__classPrivateFieldGet(this, _Pairs_map, "f"));
|
|
18
|
-
}
|
|
19
|
-
get(address) {
|
|
20
|
-
const pair = tslib.__classPrivateFieldGet(this, _Pairs_map, "f")[utilCrypto.decodeAddress(address).toString()];
|
|
21
|
-
if (!pair) {
|
|
22
|
-
throw new Error(`Unable to retrieve keypair '${util$1.isU8a(address) || util$1.isHex(address) ? util.u8aToHex(util$1.u8aToU8a(address)) : address}'`);
|
|
23
|
-
}
|
|
24
|
-
return pair;
|
|
25
|
-
}
|
|
26
|
-
remove(address) {
|
|
27
|
-
delete tslib.__classPrivateFieldGet(this, _Pairs_map, "f")[utilCrypto.decodeAddress(address).toString()];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
_Pairs_map = /* @__PURE__ */ new WeakMap();
|
|
31
|
-
exports.Pairs = Pairs;
|
|
@@ -1,32 +0,0 @@
|
|
|
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;
|
|
7
|
-
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
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.decodePair = decodePair;
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
|
21
|
-
]);
|
|
22
|
-
const PUB_LENGTH = 32;
|
|
23
|
-
const SALT_LENGTH = 32;
|
|
24
|
-
const SEC_LENGTH = 64;
|
|
25
|
-
const SEED_LENGTH = 32;
|
|
26
|
-
exports.PAIR_DIV = PAIR_DIV;
|
|
27
|
-
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 +0,0 @@
|
|
|
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
|
-
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);
|
|
17
|
-
}
|
|
18
|
-
exports.encodePair = encodePair;
|
|
@@ -1,143 +0,0 @@
|
|
|
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
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const TYPE_PREFIX = {
|
|
22
|
-
ecdsa: new Uint8Array([2]),
|
|
23
|
-
ed25519: new Uint8Array([0]),
|
|
24
|
-
ethereum: new Uint8Array([2]),
|
|
25
|
-
sr25519: new Uint8Array([1])
|
|
26
|
-
};
|
|
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
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const TYPE_ADDRESS = {
|
|
40
|
-
sr25519: (p) => p,
|
|
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
|
-
}
|
|
50
|
-
};
|
|
51
|
-
function isLocked(secretKey) {
|
|
52
|
-
return !secretKey || util.u8aEmpty(secretKey);
|
|
53
|
-
}
|
|
54
|
-
function vrfHash(proof, context, extra) {
|
|
55
|
-
return utilCrypto.blake2AsU8a(util.u8aConcat(context || "", extra || "", proof));
|
|
56
|
-
}
|
|
57
|
-
function createPair({ toSS58, type }, { publicKey, secretKey }, meta = {}, encoded = null, encTypes) {
|
|
58
|
-
const decodePkcs8 = (passphrase, userEncoded) => {
|
|
59
|
-
const decoded = decode.decodePair(passphrase, userEncoded || encoded, encTypes);
|
|
60
|
-
if (decoded.secretKey.length === 64) {
|
|
61
|
-
publicKey = decoded.publicKey;
|
|
62
|
-
secretKey = decoded.secretKey;
|
|
63
|
-
} else {
|
|
64
|
-
const pair = TYPE_FROM_SEED[type](decoded.secretKey);
|
|
65
|
-
publicKey = pair.publicKey;
|
|
66
|
-
secretKey = pair.secretKey;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
const recode = (passphrase) => {
|
|
70
|
-
isLocked(secretKey) && encoded && decodePkcs8(passphrase, encoded);
|
|
71
|
-
encoded = encode.encodePair({ publicKey, secretKey }, passphrase);
|
|
72
|
-
encTypes = void 0;
|
|
73
|
-
return encoded;
|
|
74
|
-
};
|
|
75
|
-
const encodeAddress = () => {
|
|
76
|
-
const raw = TYPE_ADDRESS[type](publicKey);
|
|
77
|
-
return toSS58(raw);
|
|
78
|
-
};
|
|
79
|
-
return {
|
|
80
|
-
get address() {
|
|
81
|
-
return encodeAddress();
|
|
82
|
-
},
|
|
83
|
-
get addressRaw() {
|
|
84
|
-
return TYPE_ADDRESS[type](publicKey);
|
|
85
|
-
},
|
|
86
|
-
get isLocked() {
|
|
87
|
-
return isLocked(secretKey);
|
|
88
|
-
},
|
|
89
|
-
get meta() {
|
|
90
|
-
return meta;
|
|
91
|
-
},
|
|
92
|
-
get publicKey() {
|
|
93
|
-
return publicKey;
|
|
94
|
-
},
|
|
95
|
-
get type() {
|
|
96
|
-
return type;
|
|
97
|
-
},
|
|
98
|
-
decodePkcs8,
|
|
99
|
-
derive: (suri, meta2) => {
|
|
100
|
-
if (isLocked(secretKey)) {
|
|
101
|
-
throw new Error("Cannot derive on a locked keypair");
|
|
102
|
-
}
|
|
103
|
-
const { path } = utilCrypto.keyExtractPath(suri);
|
|
104
|
-
const derived = utilCrypto.keyFromPath({ publicKey, secretKey }, path, type);
|
|
105
|
-
return createPair({ toSS58, type }, derived, meta2, null);
|
|
106
|
-
},
|
|
107
|
-
encodePkcs8: (passphrase) => {
|
|
108
|
-
return recode(passphrase);
|
|
109
|
-
},
|
|
110
|
-
lock: () => {
|
|
111
|
-
secretKey = new Uint8Array([]);
|
|
112
|
-
},
|
|
113
|
-
setMeta: (additional) => {
|
|
114
|
-
meta = util.objectSpread({}, meta, additional);
|
|
115
|
-
},
|
|
116
|
-
sign: (message, options = {}) => {
|
|
117
|
-
if (isLocked(secretKey)) {
|
|
118
|
-
throw new Error("Cannot sign with a locked key pair");
|
|
119
|
-
}
|
|
120
|
-
return util.u8aConcat(options.withType ? TYPE_PREFIX[type] : SIG_TYPE_NONE, TYPE_SIGNATURE[type](util.u8aToU8a(message), { publicKey, secretKey }));
|
|
121
|
-
},
|
|
122
|
-
toJson: (passphrase) => {
|
|
123
|
-
const address = ["ecdsa", "ethereum"].includes(type) ? publicKey.length === 20 ? util.u8aToHex(publicKey) : util.u8aToHex(utilCrypto.secp256k1Compress(publicKey)) : encodeAddress();
|
|
124
|
-
return toJson.pairToJson(type, { address, meta }, recode(passphrase), !!passphrase);
|
|
125
|
-
},
|
|
126
|
-
unlock: (passphrase) => {
|
|
127
|
-
decodePkcs8(passphrase);
|
|
128
|
-
},
|
|
129
|
-
verify: (message, signature, signerPublic) => {
|
|
130
|
-
return utilCrypto.signatureVerify(message, signature, TYPE_ADDRESS[type](util.u8aToU8a(signerPublic))).isValid;
|
|
131
|
-
},
|
|
132
|
-
vrfSign: (message, context, extra) => {
|
|
133
|
-
if (isLocked(secretKey)) {
|
|
134
|
-
throw new Error("Cannot sign with a locked key pair");
|
|
135
|
-
}
|
|
136
|
-
return utilCrypto.sr25519VrfSign(message, { secretKey }, context, extra);
|
|
137
|
-
},
|
|
138
|
-
vrfVerify: (message, vrfResult, signerPublic, context, extra) => {
|
|
139
|
-
return utilCrypto.sr25519VrfVerify(message, vrfResult, publicKey, context, extra);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
exports.createPair = createPair;
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
function pairToJson(type, { address, meta }, encoded, isEncrypted) {
|
|
6
|
-
return util.objectSpread(utilCrypto.jsonEncryptFormat(encoded, ["pkcs8", type], isEncrypted), {
|
|
7
|
-
address,
|
|
8
|
-
meta
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
exports.pairToJson = pairToJson;
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|
package/dist/keyring/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { KeyringPair$Json, KeyringPair$Meta } from "@prosopo/types";
|
|
2
|
-
import type { KeyringInstance, KeyringPair } from "@prosopo/types";
|
|
3
|
-
import { decodeAddress } from "@prosopo/util-crypto";
|
|
4
|
-
import type { EncryptedJsonEncoding, Keypair, KeypairType } from "@prosopo/util-crypto";
|
|
5
|
-
export declare const DEV_PHRASE = "bottom drive obey lake curtain smoke basket hold race lonely fit walk";
|
|
6
|
-
interface KeyringOptions {
|
|
7
|
-
type?: KeypairType;
|
|
8
|
-
ss58Format?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare class Keyring implements KeyringInstance {
|
|
11
|
-
#private;
|
|
12
|
-
decodeAddress: typeof decodeAddress;
|
|
13
|
-
constructor(options?: KeyringOptions);
|
|
14
|
-
get pairs(): KeyringPair[];
|
|
15
|
-
get publicKeys(): Uint8Array[];
|
|
16
|
-
get type(): KeypairType;
|
|
17
|
-
addPair(pair: KeyringPair): KeyringPair;
|
|
18
|
-
addFromAddress(address: string | Uint8Array, meta?: KeyringPair$Meta, encoded?: Uint8Array | null, type?: KeypairType, ignoreChecksum?: boolean, encType?: EncryptedJsonEncoding[]): KeyringPair;
|
|
19
|
-
addFromJson(json: KeyringPair$Json, ignoreChecksum?: boolean): KeyringPair;
|
|
20
|
-
addFromMnemonic(mnemonic: string, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
21
|
-
addFromPair(pair: Keypair, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
22
|
-
addFromSeed(seed: Uint8Array, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
23
|
-
addFromUri(suri: string, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
24
|
-
createFromJson({ address, encoded, encoding: { content, type, version }, meta, }: KeyringPair$Json, ignoreChecksum?: boolean): KeyringPair;
|
|
25
|
-
createFromPair(pair: Keypair, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
26
|
-
createFromUri(_suri: string, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
27
|
-
encodeAddress: (address: Uint8Array | string, ss58Format?: number) => string;
|
|
28
|
-
getPair(address: string | Uint8Array): KeyringPair;
|
|
29
|
-
getPairs(): KeyringPair[];
|
|
30
|
-
getPublicKeys(): Uint8Array[];
|
|
31
|
-
removePair(address: string | Uint8Array): void;
|
|
32
|
-
setSS58Format(ss58: number): void;
|
|
33
|
-
toJson(address: string | Uint8Array, passphrase?: string): KeyringPair$Json;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=keyring.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.ts","sourceRoot":"","sources":["../../src/keyring/keyring.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE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IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,EACpC,OAAO,EACP,IAAI,EACJ,IAAI,CACJ,CAAC;IACH,CAAC;IAmBM,OAAO,CAAC,OAA4B;QAC1C,OAAO,uBAAA,IAAI,sBAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAOM,QAAQ;QACd,OAAO,uBAAA,IAAI,sBAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,CAAC;IAOM,aAAa;QACnB,OAAO,uBAAA,IAAI,sBAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5C,CAAC;IAMM,UAAU,CAAC,OAA4B;QAC7C,uBAAA,IAAI,sBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAMM,aAAa,CAAC,IAAY;QAChC,uBAAA,IAAI,iBAAS,IAAI,MAAA,CAAC;IACnB,CAAC;IAUM,MAAM,CACZ,OAA4B,EAC5B,UAAmB;QAEnB,OAAO,uBAAA,IAAI,sBAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACpD,CAAC;CACD"}
|
package/dist/keyring/pairs.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { KeyringPair, KeyringPairs } from "@prosopo/types";
|
|
2
|
-
export declare class Pairs implements KeyringPairs {
|
|
3
|
-
#private;
|
|
4
|
-
add(pair: KeyringPair): KeyringPair;
|
|
5
|
-
all(): KeyringPair[];
|
|
6
|
-
get(address: string | Uint8Array): KeyringPair;
|
|
7
|
-
remove(address: string | Uint8Array): void;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=pairs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pairs.d.ts","sourceRoot":"","sources":["../../src/keyring/pairs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,M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J,GAAG,CACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM,CAAC,OAA4B;QACzC,OAAO,uBAAA,IAAI,kBAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC;CACD"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { HexString } from "@polkadot/util/types";
|
|
2
|
-
import type { KeyringInstance, KeyringOptions } from "@prosopo/types";
|
|
3
|
-
import type { KeypairType } from "@prosopo/util-crypto";
|
|
4
|
-
interface PairDef {
|
|
5
|
-
name?: string;
|
|
6
|
-
p: HexString;
|
|
7
|
-
s: HexString;
|
|
8
|
-
seed?: string;
|
|
9
|
-
type: KeypairType;
|
|
10
|
-
}
|
|
11
|
-
export declare const PAIRSSR25519: PairDef[];
|
|
12
|
-
export declare function createTestKeyring(options?: KeyringOptions, isDerived?: boolean): KeyringInstance;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/keyring/testing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAItE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,UAAU,OAAO;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,SAAS,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;CAClB;AAMD,eAAO,MAAM,YAAY,EAAE,OAAO,EAiDjC,CAAC;AAmBF,wBAAgB,iBAAiB,CAChC,OAAO,GAAE,cAAmB,EAC5B,SAAS,UAAO,GACd,eAAe,CAuBjB"}
|
package/dist/keyring/testing.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { hexToU8a } from "@polkadot/util";
|
|
2
|
-
import { createPair } from "../pair/index.js";
|
|
3
|
-
import { Keyring } from "./keyring.js";
|
|
4
|
-
export const PAIRSSR25519 = [
|
|
5
|
-
{
|
|
6
|
-
p: "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
|
|
7
|
-
s: "0x98319d4ff8a9508c4bb0cf0b5a78d760a0b2082c02775e6e82370816fedfff48925a225d97aa00682d6a59b95b18780c10d7032336e88f3442b42361f4a66011",
|
|
8
|
-
seed: "Alice",
|
|
9
|
-
type: "sr25519",
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
p: "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
|
|
13
|
-
s: "0xe8da6c9d810e020f5e3c7f5af2dea314cbeaa0d72bc6421e92c0808a0c584a6046ab28e97c3ffc77fe12b5a4d37e8cd4afbfebbf2391ffc7cb07c0f38c023efd",
|
|
14
|
-
seed: "Alice//stash",
|
|
15
|
-
type: "sr25519",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
p: "0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48",
|
|
19
|
-
s: "0x081ff694633e255136bdb456c20a5fc8fed21f8b964c11bb17ff534ce80ebd5941ae88f85d0c1bfc37be41c904e1dfc01de8c8067b0d6d5df25dd1ac0894a325",
|
|
20
|
-
seed: "Bob",
|
|
21
|
-
type: "sr25519",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
p: "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
|
|
25
|
-
s: "0xc006507cdfc267a21532394c49ca9b754ca71de21e15a1cdf807c7ceab6d0b6c3ed408d9d35311540dcd54931933e67cf1ea10d46f75408f82b789d9bd212fde",
|
|
26
|
-
seed: "Bob//stash",
|
|
27
|
-
type: "sr25519",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
p: "0x90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22",
|
|
31
|
-
s: "0xa8f2d83016052e5d6d77b2f6fd5d59418922a09024cda701b3c34369ec43a7668faf12ff39cd4e5d92bb773972f41a7a5279ebc2ed92264bed8f47d344f8f18c",
|
|
32
|
-
seed: "Charlie",
|
|
33
|
-
type: "sr25519",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
p: "0x306721211d5404bd9da88e0204360a1a9ab8b87c66c1bc2fcdd37f3c2222cc20",
|
|
37
|
-
s: "0x20e05482ca4677e0edbc58ae9a3a59f6ed3b1a9484ba17e64d6fe8688b2b7b5d108c4487b9323b98b11fe36cb301b084e920f7b7895536809a6d62a451b25568",
|
|
38
|
-
seed: "Dave",
|
|
39
|
-
type: "sr25519",
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
p: "0xe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4e",
|
|
43
|
-
s: "0x683576abfd5dc35273e4264c23095a1bf21c14517bece57c7f0cc5c0ed4ce06a3dbf386b7828f348abe15d76973a72009e6ef86a5c91db2990cb36bb657c6587",
|
|
44
|
-
seed: "Eve",
|
|
45
|
-
type: "sr25519",
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
p: "0x1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c",
|
|
49
|
-
s: "0xb835c20f450079cf4f513900ae9faf8df06ad86c681884122c752a4b2bf74d4303e4f21bc6cc62bb4eeed5a9cce642c25e2d2ac1464093b50f6196d78e3a7426",
|
|
50
|
-
seed: "Ferdie",
|
|
51
|
-
type: "sr25519",
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
function createMeta(name, seed) {
|
|
55
|
-
if (!name && !seed) {
|
|
56
|
-
throw new Error("Testing pair should have either a name or a seed");
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
isTesting: true,
|
|
60
|
-
name: name || seed?.replace("//", "_").toLowerCase(),
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export function createTestKeyring(options = {}, isDerived = true) {
|
|
64
|
-
const keyring = new Keyring(options);
|
|
65
|
-
const pairs = PAIRSSR25519;
|
|
66
|
-
for (const { name, p, s, seed, type } of pairs) {
|
|
67
|
-
const meta = createMeta(name, seed);
|
|
68
|
-
const pair = !isDerived && !name && seed
|
|
69
|
-
? keyring.addFromUri(seed, meta, options.type)
|
|
70
|
-
: keyring.addPair(createPair({ toSS58: keyring.encodeAddress, type }, { publicKey: hexToU8a(p), secretKey: hexToU8a(s) }, meta));
|
|
71
|
-
pair.lock = () => {
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
return keyring;
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=testing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/keyring/testing.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAcvC,MAAM,CAAC,MAAM,YAAY,GAAc;IACtC;QACC,CAAC,EAAE,oEAAoE;QACvE,CAAC,EAAE,oIAAoI;QACvI,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,SAAS;KACf;IACD;QACC,CAAC,EAAE,oEAAoE;QACvE,CAAC,EAAE,oIAAoI;QACvI,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;KACf;IACD;QACC,CAAC,EAAE,oEAAoE;QACvE,CAAC,EAAE,oIAAoI;QACvI,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,SAAS;KACf;IACD;QACC,CAAC,EAAE,oEAAoE;QACvE,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I,IAAI;YAC1B,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC;YAC9C,CAAC,CAAC,OAAO,CAAC,OAAO,CACf,UAAU,CACT,EAAE,MAAM,EAAE,OAAO,CAAC,aAAa,EAAE,IAAI,EAAE,EACvC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EAClD,IAAI,CACJ,CACD,CAAC;QAEL,IAAI,CAAC,IAAI,GAAG,GAAS,EAAE;QAEvB,CAAC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { KeyringOptions, KeyringPair } from "@prosopo/types";
|
|
2
|
-
import type { KeypairType } from "@prosopo/util-crypto";
|
|
3
|
-
export interface TestKeyringMap {
|
|
4
|
-
nobody: KeyringPair;
|
|
5
|
-
[index: string]: KeyringPair;
|
|
6
|
-
}
|
|
7
|
-
export interface TestKeyringMapSubstrate extends TestKeyringMap {
|
|
8
|
-
alice: KeyringPair;
|
|
9
|
-
bob: KeyringPair;
|
|
10
|
-
charlie: KeyringPair;
|
|
11
|
-
dave: KeyringPair;
|
|
12
|
-
eve: KeyringPair;
|
|
13
|
-
ferdie: KeyringPair;
|
|
14
|
-
}
|
|
15
|
-
export interface TestKeyringMapEthereum extends TestKeyringMap {
|
|
16
|
-
Alith: KeyringPair;
|
|
17
|
-
Baltathar: KeyringPair;
|
|
18
|
-
Charleth: KeyringPair;
|
|
19
|
-
Dorothy: KeyringPair;
|
|
20
|
-
Ethan: KeyringPair;
|
|
21
|
-
Faith: KeyringPair;
|
|
22
|
-
}
|
|
23
|
-
export type DetectMap<O extends KeyringOptions | undefined> = DetectPairType<O> extends "ethereum" ? TestKeyringMapEthereum : TestKeyringMapSubstrate;
|
|
24
|
-
export type DetectPairType<O extends KeyringOptions | undefined> = O extends KeyringOptions ? O["type"] extends KeypairType ? O["type"] : "sr25519" : "sr25519";
|
|
25
|
-
export declare function createTestPairs<O extends KeyringOptions, M = DetectMap<O>>(options?: O, isDerived?: boolean): M;
|
|
26
|
-
//# sourceMappingURL=testingPairs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testingPairs.d.ts","sourceRoot":"","sources":["../../src/keyring/testingPairs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKxD,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,WAAW,CAAC;IAEpB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC9D,KAAK,EAAE,WAAW,CAAC;IACnB,GAAG,EAAE,WAAW,CAAC;IACjB,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,WAAW,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC7D,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,cAAc,GAAG,SAAS,IACzD,cAAc,CAAC,CAAC,CAAC,SAAS,UAAU,GACjC,sBAAsB,GACtB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,cAAc,GAAG,SAAS,IAC9D,CAAC,SAAS,cAAc,GACrB,CAAC,CAAC,MAAM,CAAC,S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