@shapeshiftoss/hdwallet-native 1.50.5-alpha.0 → 1.50.5-alpha.46
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/dist/adapter.d.ts +1 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +5 -1
- package/dist/adapter.js.map +1 -1
- package/dist/adapter.test.js +5 -1
- package/dist/adapter.test.js.map +1 -1
- package/dist/arkeo.js +5 -1
- package/dist/arkeo.js.map +1 -1
- package/dist/arkeo.test.js +5 -1
- package/dist/arkeo.test.js.map +1 -1
- package/dist/binance.d.ts +1 -1
- package/dist/binance.d.ts.map +1 -1
- package/dist/binance.js +5 -1
- package/dist/binance.js.map +1 -1
- package/dist/binance.test.js +5 -1
- package/dist/binance.test.js.map +1 -1
- package/dist/bitcoin.d.ts +9 -9
- package/dist/bitcoin.d.ts.map +1 -1
- package/dist/bitcoin.js +6 -2
- package/dist/bitcoin.js.map +1 -1
- package/dist/bitcoin.test.js +7 -3
- package/dist/bitcoin.test.js.map +1 -1
- package/dist/cosmos.js +5 -1
- package/dist/cosmos.js.map +1 -1
- package/dist/cosmos.test.js +5 -1
- package/dist/cosmos.test.js.map +1 -1
- package/dist/crypto/CryptoHelper.js +5 -1
- package/dist/crypto/CryptoHelper.js.map +1 -1
- package/dist/crypto/CryptoHelper.test.js +5 -1
- package/dist/crypto/CryptoHelper.test.js.map +1 -1
- package/dist/crypto/EncryptedWallet.js +5 -1
- package/dist/crypto/EncryptedWallet.js.map +1 -1
- package/dist/crypto/EncryptedWallet.test.js +5 -1
- package/dist/crypto/EncryptedWallet.test.js.map +1 -1
- package/dist/crypto/classes/cipherString.js +6 -6
- package/dist/crypto/classes/cipherString.js.map +1 -1
- package/dist/crypto/classes/symmetricCryptoKey.js +3 -3
- package/dist/crypto/classes/symmetricCryptoKey.js.map +1 -1
- package/dist/crypto/engines/index.js +5 -1
- package/dist/crypto/engines/index.js.map +1 -1
- package/dist/crypto/engines/web-crypto.js +5 -1
- package/dist/crypto/engines/web-crypto.js.map +1 -1
- package/dist/crypto/engines/web-crypto.test.js +5 -1
- package/dist/crypto/engines/web-crypto.test.js.map +1 -1
- package/dist/crypto/index.js +5 -1
- package/dist/crypto/index.js.map +1 -1
- package/dist/crypto/isolation/adapters/binance.d.ts +1 -1
- package/dist/crypto/isolation/adapters/binance.d.ts.map +1 -1
- package/dist/crypto/isolation/adapters/binance.js +5 -1
- package/dist/crypto/isolation/adapters/binance.js.map +1 -1
- package/dist/crypto/isolation/adapters/bip32.d.ts +1 -1
- package/dist/crypto/isolation/adapters/bip32.d.ts.map +1 -1
- package/dist/crypto/isolation/adapters/bip32.js +6 -2
- package/dist/crypto/isolation/adapters/bip32.js.map +1 -1
- package/dist/crypto/isolation/adapters/bitcoin.d.ts +9 -9
- package/dist/crypto/isolation/adapters/bitcoin.d.ts.map +1 -1
- package/dist/crypto/isolation/adapters/bitcoin.js +7 -3
- package/dist/crypto/isolation/adapters/bitcoin.js.map +1 -1
- package/dist/crypto/isolation/adapters/cosmosDirect.js +5 -1
- package/dist/crypto/isolation/adapters/cosmosDirect.js.map +1 -1
- package/dist/crypto/isolation/adapters/ethereum.js +7 -3
- package/dist/crypto/isolation/adapters/ethereum.js.map +1 -1
- package/dist/crypto/isolation/adapters/fio.d.ts +1 -1
- package/dist/crypto/isolation/adapters/fio.d.ts.map +1 -1
- package/dist/crypto/isolation/adapters/fio.js +6 -2
- package/dist/crypto/isolation/adapters/fio.js.map +1 -1
- package/dist/crypto/isolation/core/bip32/index.d.ts.map +1 -1
- package/dist/crypto/isolation/core/bip32/index.js +6 -1
- package/dist/crypto/isolation/core/bip32/index.js.map +1 -1
- package/dist/crypto/isolation/core/bip32/interfaces.js +5 -1
- package/dist/crypto/isolation/core/bip32/interfaces.js.map +1 -1
- package/dist/crypto/isolation/core/bip32/types.d.ts +2 -2
- package/dist/crypto/isolation/core/bip32/types.d.ts.map +1 -1
- package/dist/crypto/isolation/core/bip32/types.js +2 -2
- package/dist/crypto/isolation/core/bip32/types.js.map +1 -1
- package/dist/crypto/isolation/core/bip39/index.js +5 -1
- package/dist/crypto/isolation/core/bip39/index.js.map +1 -1
- package/dist/crypto/isolation/core/digest/index.js +5 -1
- package/dist/crypto/isolation/core/digest/index.js.map +1 -1
- package/dist/crypto/isolation/core/digest/index.test.js +2 -2
- package/dist/crypto/isolation/core/digest/index.test.js.map +1 -1
- package/dist/crypto/isolation/core/digest/types.d.ts +6 -6
- package/dist/crypto/isolation/core/digest/types.d.ts.map +1 -1
- package/dist/crypto/isolation/core/digest/types.js +11 -10
- package/dist/crypto/isolation/core/digest/types.js.map +1 -1
- package/dist/crypto/isolation/core/index.js +5 -1
- package/dist/crypto/isolation/core/index.js.map +1 -1
- package/dist/crypto/isolation/core/secp256k1/index.js +5 -1
- package/dist/crypto/isolation/core/secp256k1/index.js.map +1 -1
- package/dist/crypto/isolation/core/secp256k1/types.d.ts +32 -32
- package/dist/crypto/isolation/core/secp256k1/types.d.ts.map +1 -1
- package/dist/crypto/isolation/core/secp256k1/types.js +39 -35
- package/dist/crypto/isolation/core/secp256k1/types.js.map +1 -1
- package/dist/crypto/isolation/engines/default/bip32.d.ts.map +1 -1
- package/dist/crypto/isolation/engines/default/bip32.js +22 -17
- package/dist/crypto/isolation/engines/default/bip32.js.map +1 -1
- package/dist/crypto/isolation/engines/default/bip39.js +8 -4
- package/dist/crypto/isolation/engines/default/bip39.js.map +1 -1
- package/dist/crypto/isolation/engines/default/index.js +5 -1
- package/dist/crypto/isolation/engines/default/index.js.map +1 -1
- package/dist/crypto/isolation/engines/default/index.test.js +5 -1
- package/dist/crypto/isolation/engines/default/index.test.js.map +1 -1
- package/dist/crypto/isolation/engines/dummy/bip32.js +10 -6
- package/dist/crypto/isolation/engines/dummy/bip32.js.map +1 -1
- package/dist/crypto/isolation/engines/dummy/bip39.js +9 -5
- package/dist/crypto/isolation/engines/dummy/bip39.js.map +1 -1
- package/dist/crypto/isolation/engines/dummy/index.js +5 -1
- package/dist/crypto/isolation/engines/dummy/index.js.map +1 -1
- package/dist/crypto/isolation/engines/dummy/index.test.js +5 -1
- package/dist/crypto/isolation/engines/dummy/index.test.js.map +1 -1
- package/dist/crypto/isolation/engines/dummy/types.d.ts +1 -1
- package/dist/crypto/isolation/engines/dummy/types.d.ts.map +1 -1
- package/dist/crypto/isolation/engines/index.js +5 -1
- package/dist/crypto/isolation/engines/index.js.map +1 -1
- package/dist/crypto/isolation/index.js +5 -1
- package/dist/crypto/isolation/index.js.map +1 -1
- package/dist/crypto/isolation/types.d.ts +18 -18
- package/dist/crypto/isolation/types.d.ts.map +1 -1
- package/dist/crypto/isolation/types.js +5 -5
- package/dist/crypto/isolation/types.js.map +1 -1
- package/dist/crypto/utils.test.js +5 -1
- package/dist/crypto/utils.test.js.map +1 -1
- package/dist/ethereum.js +6 -2
- package/dist/ethereum.js.map +1 -1
- package/dist/ethereum.test.js +5 -1
- package/dist/ethereum.test.js.map +1 -1
- package/dist/fio.js +6 -2
- package/dist/fio.js.map +1 -1
- package/dist/fio.test.js +5 -1
- package/dist/fio.test.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +5 -1
- package/dist/index.test.js.map +1 -1
- package/dist/kava.js +5 -1
- package/dist/kava.js.map +1 -1
- package/dist/kava.test.js +5 -1
- package/dist/kava.test.js.map +1 -1
- package/dist/native.d.ts +1 -1
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +9 -5
- package/dist/native.js.map +1 -1
- package/dist/native.test.js +11 -7
- package/dist/native.test.js.map +1 -1
- package/dist/networks.js +5 -1
- package/dist/networks.js.map +1 -1
- package/dist/networks.test.js +4 -4
- package/dist/networks.test.js.map +1 -1
- package/dist/osmosis.js +5 -1
- package/dist/osmosis.js.map +1 -1
- package/dist/osmosis.test.js +5 -1
- package/dist/osmosis.test.js.map +1 -1
- package/dist/secret.js +5 -1
- package/dist/secret.js.map +1 -1
- package/dist/secret.test.js +5 -1
- package/dist/secret.test.js.map +1 -1
- package/dist/terra.js +5 -1
- package/dist/terra.js.map +1 -1
- package/dist/terra.test.js +5 -1
- package/dist/terra.test.js.map +1 -1
- package/dist/thorchain.js +5 -1
- package/dist/thorchain.js.map +1 -1
- package/dist/thorchain.test.js +5 -1
- package/dist/thorchain.test.js.map +1 -1
- package/dist/util.js +6 -2
- package/dist/util.js.map +1 -1
- package/dist/util.test.js +5 -1
- package/dist/util.test.js.map +1 -1
- package/package.json +5 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ExternalPrivateKey as FIOExternalPrivateKey } from "@shapeshiftoss/fiojs";
|
|
3
3
|
import { SecP256K1 } from "../core";
|
|
4
4
|
import { CurvePoint } from "../core/secp256k1";
|
|
5
|
-
|
|
5
|
+
type IsolatedKey = SecP256K1.ECDSAKey & SecP256K1.ECDHKey;
|
|
6
6
|
export declare class ExternalSignerAdapter implements FIOExternalPrivateKey {
|
|
7
7
|
protected readonly _isolatedKey: IsolatedKey;
|
|
8
8
|
readonly _publicKey: CurvePoint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fio.d.ts","sourceRoot":"","sources":["../../../../src/crypto/isolation/adapters/fio.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,IAAI,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAInF,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAwB,MAAM,mBAAmB,CAAC;AASrE,
|
|
1
|
+
{"version":3,"file":"fio.d.ts","sourceRoot":"","sources":["../../../../src/crypto/isolation/adapters/fio.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,IAAI,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAInF,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAwB,MAAM,mBAAmB,CAAC;AASrE,KAAK,WAAW,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC;AAC1D,qBAAa,qBAAsB,YAAW,qBAAqB;IACjE,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEhC,SAAS,aAAa,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU;WAKxD,MAAM,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI7E,IAAI,SAAS,IAAI,MAAM,CAGtB;IAEK,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAU1C,eAAe,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;CAKvD;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -70,7 +74,7 @@ class ExternalSignerAdapter {
|
|
|
70
74
|
}
|
|
71
75
|
getSharedSecret(publicKey) {
|
|
72
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
return Buffer.from(Digest.Algorithms["sha512"](yield this._isolatedKey.ecdh(types_1.checkType(core_1.SecP256K1.CurvePoint, publicKey.toBuffer()))));
|
|
77
|
+
return Buffer.from(Digest.Algorithms["sha512"](yield this._isolatedKey.ecdh((0, types_1.checkType)(core_1.SecP256K1.CurvePoint, publicKey.toBuffer()))));
|
|
74
78
|
});
|
|
75
79
|
}
|
|
76
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fio.js","sourceRoot":"","sources":["../../../../src/crypto/isolation/adapters/fio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fio.js","sourceRoot":"","sources":["../../../../src/crypto/isolation/adapters/fio.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mEAAqD;AACrD,gDAAwB;AAExB,kCAAoC;AACpC,uDAAyC;AACzC,iDAAqE;AACrE,oCAAqC;AAErC,SAAS,aAAa,CAAC,GAAe,EAAE,OAAO,GAAG,EAAE;IAClD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzG,OAAO,cAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;AAGD,MAAa,qBAAqB;IAIhC,YAAsB,WAAwB,EAAE,SAAqB;QACnE,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED,MAAM,CAAO,MAAM,CAAC,WAAwB;;YAC1C,OAAO,IAAI,qBAAqB,CAAC,WAAW,EAAE,MAAM,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;QAClF,CAAC;KAAA;IAED,IAAI,SAAS;QACX,MAAM,GAAG,GAAG,gBAAS,C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,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED,wBAAsB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,UAAU,SAAS;IACjB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED,wBAAsB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAqBrF"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -34,6 +38,7 @@ function derivePath(node, path) {
|
|
|
34
38
|
const endIndex = splitPath.lastIndexOf("");
|
|
35
39
|
if (endIndex >= 0)
|
|
36
40
|
splitPath = splitPath.slice(0, endIndex);
|
|
41
|
+
// @ts-ignore FIXME
|
|
37
42
|
return yield splitPath.reduce((prevHd, indexStr) => __awaiter(this, void 0, void 0, function* () {
|
|
38
43
|
let index;
|
|
39
44
|
if (indexStr.slice(-1) === `'`) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+CAA6B;AAE7B,mCAA+B;AAM/B,SAAsB,UAAU,CAAsB,IAAO,EAAE,IAAU;;QACvE,kEAAkE;QAClE,YAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAElB,IAAI,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACxB,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAChC;QACD,MAAM,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAC3C,IAAI,QAAQ,IAAI,CAAC;YAAE,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC5D,mBAAmB;QACnB,OAAO,MAAM,SAAS,CAAC,MAAM,CAAC,CAAO,MAAM,EAAE,QAAQ,EAAE,EAAE;YACvD,IAAI,KAAK,CAAC;YACV,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;gBAC9B,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC5C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC;aAClD;iBAAM;gBACL,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAC/B,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACrC;QACH,CAAC,CAAA,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5B,CAAC;CAAA;AArBD,gCAqBC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/interfaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAqD;AAiBrD,SAAgB,gBAAgB,CAAiB,CAAI;IACnD,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;AAC5E,CAAC;AAFD,4CAEC"}
|
|
@@ -2,7 +2,7 @@ import { Static } from "funtypes";
|
|
|
2
2
|
declare const chainCodeBase: import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, import("funtypes/lib/types/Object").Object<{
|
|
3
3
|
length: import("funtypes").Literal<32>;
|
|
4
4
|
}, false>]>;
|
|
5
|
-
export
|
|
5
|
+
export type ChainCode = Static<typeof chainCodeBase>;
|
|
6
6
|
declare const chainCode: import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, import("funtypes/lib/types/Object").Object<{
|
|
7
7
|
length: import("funtypes").Literal<32>;
|
|
8
8
|
}, false>]>;
|
|
@@ -10,7 +10,7 @@ export declare const ChainCode: typeof chainCode;
|
|
|
10
10
|
declare const pathBase: import("funtypes").Constraint<import("funtypes").String, string, unknown> & {
|
|
11
11
|
regex: RegExp;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type Path = Static<typeof pathBase>;
|
|
14
14
|
declare const path: import("funtypes").Constraint<import("funtypes").String, string, unknown> & {
|
|
15
15
|
regex: RegExp;
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,QAAA,MAAM,aAAa;;WAAgB,CAAC;AACpC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,QAAA,MAAM,aAAa;;WAAgB,CAAC;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAErD,QAAA,MAAM,SAAS;;WAAgD,CAAC;AAChE,eAAO,MAAM,SAAS,EAAE,OAAO,SAAqB,CAAC;AAGrD,QAAA,MAAM,QAAQ;;CAAyD,CAAC;AACxE,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE3C,QAAA,MAAM,IAAI;;CAAsC,CAAC;AACjD,eAAO,MAAM,IAAI,EAAE,OAAO,IAAW,CAAC"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Path = exports.ChainCode = void 0;
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
|
-
const chainCodeBase = types_1.ByteArray(32);
|
|
5
|
+
const chainCodeBase = (0, types_1.ByteArray)(32);
|
|
6
6
|
const chainCodeStatic = {};
|
|
7
7
|
const chainCode = Object.assign(chainCodeBase, chainCodeStatic);
|
|
8
8
|
exports.ChainCode = chainCode;
|
|
9
9
|
// https://regex101.com/r/KwmgAp/1
|
|
10
|
-
const pathBase = types_1.BoundedString(/^((m\/)?(\d+'?\/)*\d+'?)$|^(?![\s\S])/);
|
|
10
|
+
const pathBase = (0, types_1.BoundedString)(/^((m\/)?(\d+'?\/)*\d+'?)$|^(?![\s\S])/);
|
|
11
11
|
const pathStatic = {};
|
|
12
12
|
const path = Object.assign(pathBase, pathStatic);
|
|
13
13
|
exports.Path = path;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/types.ts"],"names":[],"mappings":";;;AAEA,uCAAuD;AAEvD,MAAM,aAAa,GAAG,iBAAS,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip32/types.ts"],"names":[],"mappings":";;;AAEA,uCAAuD;AAEvD,MAAM,aAAa,GAAG,IAAA,iBAAS,EAAC,EAAE,CAAC,CAAC;AAEpC,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AACnD,QAAA,SAAS,GAAqB,SAAS,CAAC;AAErD,kCAAkC;AAClC,MAAM,QAAQ,GAAG,IAAA,qBAAa,EAAC,uCAAuC,CAAC,CAAC;AAExE,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACpC,QAAA,IAAI,GAAgB,IAAI,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip39/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/bip39/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/digest/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/digest/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+CAA6B"}
|
|
@@ -6,8 +6,8 @@ describe("Digests", () => {
|
|
|
6
6
|
it("converts to/from WordArrays correctly", () => {
|
|
7
7
|
const inHex = "deadbeeffeedface";
|
|
8
8
|
const input = Buffer.from(inHex, "hex");
|
|
9
|
-
const foo = algorithms_1.toWordArray(input);
|
|
10
|
-
const bar = algorithms_1.fromWordArray(foo);
|
|
9
|
+
const foo = (0, algorithms_1.toWordArray)(input);
|
|
10
|
+
const bar = (0, algorithms_1.fromWordArray)(foo);
|
|
11
11
|
const output = Buffer.from(bar);
|
|
12
12
|
expect(output.toString("hex")).toEqual(inHex);
|
|
13
13
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/digest/index.test.ts"],"names":[],"mappings":";;AAAA,wBAA+B;AAC/B,6CAA0D;AAE1D,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,KAAK,GAAG,kBAAkB,CAAC;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACxC,MAAM,GAAG,GAAG,wBAAW,
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/digest/index.test.ts"],"names":[],"mappings":";;AAAA,wBAA+B;AAC/B,6CAA0D;AAE1D,QAAQ,CAAC,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YACnB,KAAK,IAAI,CAAC,GAAG,CAAC,GAAI,CAAC,EAAE,EAAE;gBACrB,MAAM,GAAG,GAAG,aAAU,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;gBACvC,IAAI,CAAC,KAAK,IAAI;oBAAE,OAAO,GAAG,CAAC;aAC5B;QACH,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -4,8 +4,8 @@ import { AlgorithmLength } from "./algorithms";
|
|
|
4
4
|
declare function algorithmNameBase<L extends NonNegativeInteger | undefined = undefined>(length?: L): Enum<{
|
|
5
5
|
[N in AlgorithmName<L>]: N;
|
|
6
6
|
}>;
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
type algorithmNameInner<K, L> = K extends keyof typeof AlgorithmLength ? (typeof AlgorithmLength)[K] extends L ? K : never : never;
|
|
8
|
+
export type AlgorithmName<L extends NonNegativeInteger | undefined = undefined> = L extends undefined ? keyof typeof AlgorithmLength : algorithmNameInner<keyof typeof AlgorithmLength, L>;
|
|
9
9
|
declare const algorithmName: typeof algorithmNameBase & Enum<{
|
|
10
10
|
ripemd160: "ripemd160";
|
|
11
11
|
sha1: "sha1";
|
|
@@ -19,19 +19,19 @@ declare const algorithmName: typeof algorithmNameBase & Enum<{
|
|
|
19
19
|
};
|
|
20
20
|
export declare const AlgorithmName: typeof algorithmName;
|
|
21
21
|
declare function unverifiedDigestBase<N extends AlgorithmName = AlgorithmName>(name?: N): Runtype<UnverifiedDigest<N>>;
|
|
22
|
-
|
|
22
|
+
type unverifiedDigestInner<N> = N extends keyof typeof AlgorithmLength ? ByteArray<(typeof AlgorithmLength)[N]> & {
|
|
23
23
|
preimage: ByteArray;
|
|
24
24
|
algorithm: N;
|
|
25
25
|
} : never;
|
|
26
|
-
|
|
26
|
+
type UnverifiedDigest<N extends AlgorithmName = AlgorithmName> = unverifiedDigestInner<N>;
|
|
27
27
|
declare const unverifiedDigest: typeof unverifiedDigestBase & (<T extends number | undefined = undefined>(length?: T | undefined) => T extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
28
28
|
length: Literal<T>;
|
|
29
29
|
}, false>]>) & {
|
|
30
30
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
31
31
|
};
|
|
32
32
|
declare const UnverifiedDigest: typeof unverifiedDigest;
|
|
33
|
-
export
|
|
34
|
-
export
|
|
33
|
+
export type Digest<N extends AlgorithmName> = UnverifiedDigest<N>;
|
|
34
|
+
export type Algorithm<N extends AlgorithmName = AlgorithmName> = (_: ByteArray) => Digest<N>;
|
|
35
35
|
export declare const Algorithms: {
|
|
36
36
|
readonly sha1: Algorithm<"sha1">;
|
|
37
37
|
readonly ripemd160: Algorithm<"ripemd160">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/digest/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAAE,OAAO,EAAS,MAAM,IAAI,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAElF,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAyB,eAAe,EAAE,MAAM,cAAc,CAAC;AAMtE,iBAAS,iBAAiB,CAAC,CAAC,SAAS,kBAAkB,GAAG,SAAS,GAAG,SAAS,EAC7E,MAA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AAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAK7G;AAED,KAAK,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,OAAO,eAAe,GAClE,SAAS,CAAC,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,CAAC,CAAA;CAAE,GAC9E,KAAK,CAAC;AAEV,KAAK,gBAAgB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAE1F,QAAA,MAAM,gBAAgB;;;;CAAyE,CAAC;AAIhG,QAAA,MAAM,gBAAgB,EAAE,OAAO,gBAAmC,CAAC;AAEnE,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,aAAa,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAOlE,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,CAAC,CAAC,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;AAM7F,eAAO,MAAM,UAAU;;;;;;;;CAuBnB,CAAC;AAEL,iBAAS,UAAU,CAAC,IAAI,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAOvC;AAED,QAAA,MAAM,MAAM;;;;CAA4D,CAAC;AACzE,eAAO,MAAM,MAAM,EAAE,OAAO,MAAe,CAAC"}
|
|
@@ -10,23 +10,23 @@ const algorithms_1 = require("./algorithms");
|
|
|
10
10
|
// type inference can't follow. Luckily, because the names are statically known,
|
|
11
11
|
// we can assert the type even though it can't be inferred.
|
|
12
12
|
function algorithmNameBase(length) {
|
|
13
|
-
return funtypes_1.Enum(`AlgorithmName(${length !== null && length !== void 0 ? length : ""})`, Object.entries(algorithms_1.AlgorithmLength)
|
|
13
|
+
return (0, funtypes_1.Enum)(`AlgorithmName(${length !== null && length !== void 0 ? length : ""})`, Object.entries(algorithms_1.AlgorithmLength)
|
|
14
14
|
.filter((x) => length === undefined || length === x[1])
|
|
15
15
|
.map((x) => x[0])
|
|
16
16
|
.reduce((a, x) => Object.assign(a, { [x]: x }), {}));
|
|
17
17
|
}
|
|
18
18
|
const algorithmNameStatic = {
|
|
19
19
|
forEach(callbackfn, thisarg) {
|
|
20
|
-
Object.keys(exports.AlgorithmName().enumObject).forEach(callbackfn, thisarg);
|
|
20
|
+
Object.keys((0, exports.AlgorithmName)().enumObject).forEach(callbackfn, thisarg);
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
const algorithmName = Object.assign(algorithmNameBase, algorithmNameBase(), algorithmNameStatic);
|
|
24
24
|
exports.AlgorithmName = algorithmName;
|
|
25
25
|
function specificUnverifiedDigest(name) {
|
|
26
|
-
return funtypes_1.Object({
|
|
27
|
-
preimage: types_1.ByteArray(),
|
|
28
|
-
algorithm: funtypes_1.Literal(name),
|
|
29
|
-
}).And(types_1.ByteArray(algorithms_1.AlgorithmLength[name]));
|
|
26
|
+
return (0, funtypes_1.Object)({
|
|
27
|
+
preimage: (0, types_1.ByteArray)(),
|
|
28
|
+
algorithm: (0, funtypes_1.Literal)(name),
|
|
29
|
+
}).And((0, types_1.ByteArray)(algorithms_1.AlgorithmLength[name]));
|
|
30
30
|
}
|
|
31
31
|
function unverifiedDigestBase(name) {
|
|
32
32
|
if (name !== undefined)
|
|
@@ -44,7 +44,7 @@ const UnverifiedDigest = unverifiedDigest;
|
|
|
44
44
|
const digestStatic = {};
|
|
45
45
|
// We use UnverifiedDigest instead of Digest in the contract because the result is implicitly trusted.
|
|
46
46
|
function algorithmBase(name) {
|
|
47
|
-
return funtypes_1.Contract([types_1.ByteArray()], UnverifiedDigest(name));
|
|
47
|
+
return (0, funtypes_1.Contract)([(0, types_1.ByteArray)()], UnverifiedDigest(name));
|
|
48
48
|
}
|
|
49
49
|
const algorithmStatic = {};
|
|
50
50
|
const algorithm = Object.assign(algorithmBase, algorithmStatic);
|
|
@@ -52,15 +52,16 @@ const algorithm = Object.assign(algorithmBase, algorithmStatic);
|
|
|
52
52
|
const Algorithm = algorithm;
|
|
53
53
|
exports.Algorithms = (() => {
|
|
54
54
|
const algorithms = {};
|
|
55
|
-
algorithms_1._initializeAlgorithms((name, fn) => {
|
|
55
|
+
(0, algorithms_1._initializeAlgorithms)((name, fn) => {
|
|
56
56
|
exports.AlgorithmName.assert(name);
|
|
57
57
|
if (name in algorithms)
|
|
58
58
|
throw new Error(`digest algorithm implementation already provided for ${name}`);
|
|
59
59
|
algorithms[name] = Algorithm(name).enforce((x) => {
|
|
60
|
-
|
|
60
|
+
// @ts-ignore FIXME
|
|
61
|
+
const out = (0, types_2.checkType)((0, types_1.ByteArray)(algorithms_1.AlgorithmLength[name]), fn(x));
|
|
61
62
|
out.preimage = x;
|
|
62
63
|
out.algorithm = name;
|
|
63
|
-
return types_2.checkType(UnverifiedDigest(name), out);
|
|
64
|
+
return (0, types_2.checkType)(UnverifiedDigest(name), out);
|
|
64
65
|
});
|
|
65
66
|
});
|
|
66
67
|
Object.freeze(algorithms);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/digest/types.ts"],"names":[],"mappings":";;;AAAA,uCAAkF;AAElF,uCAA4D;AAC5D,uCAAwC;AACxC,6CAAsE;AAEtE,gFAAgF;AAChF,kFAAkF;AAClF,gFAAgF;AAChF,2DAA2D;AAC3D,SAAS,iBAAiB,CACxB,MAAU;IAEV,OAAO,eAAI,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/digest/types.ts"],"names":[],"mappings":";;;AAAA,uCAAkF;AAElF,uCAA4D;AAC5D,uCAAwC;AACxC,6CAAsE;AAEtE,gFAAgF;AAChF,kFAAkF;AAClF,gFAAgF;AAChF,2DAA2D;AAC3D,SAAS,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|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/crypto/isolation/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/crypto/isolation/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiC;AACjC,iDAAiC;AACjC,mDAAmC;AACnC,yDAAyC;AAEzC,MAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,IAAY;QACtB,KAAK,CAAC,8BAA8B,IAAI,WAAW,CAAC,CAAC;IACvD,CAAC;CACF;AAJD,wCAIC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/secp256k1/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/core/secp256k1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,0CAAwB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Literal, Object as Obj, Static, Union } from "funtypes";
|
|
2
|
-
import { BigEndianInteger } from "../../types";
|
|
2
|
+
import { BigEndianInteger, Uint32 } from "../../types";
|
|
3
3
|
import * as Digest from "../digest";
|
|
4
4
|
import { ECDSAKey } from "./interfaces";
|
|
5
5
|
declare const _fieldElementBase: import("funtypes").Constraint<import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
@@ -7,7 +7,7 @@ declare const _fieldElementBase: import("funtypes").Constraint<import("funtypes"
|
|
|
7
7
|
}, false>]>, Uint8Array & {
|
|
8
8
|
length: 32;
|
|
9
9
|
}, unknown>;
|
|
10
|
-
export
|
|
10
|
+
export type FieldElement = Static<typeof _fieldElementBase>;
|
|
11
11
|
declare const _fieldElement: import("funtypes").Constraint<import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
12
12
|
length: Literal<32>;
|
|
13
13
|
}, false>]>, Uint8Array & {
|
|
@@ -36,7 +36,7 @@ declare const _uncompressedPointBase: import("funtypes").Constraint<import("funt
|
|
|
36
36
|
} & {
|
|
37
37
|
0: 4;
|
|
38
38
|
}, unknown>;
|
|
39
|
-
export
|
|
39
|
+
export type UncompressedPoint = Static<typeof _uncompressedPointBase>;
|
|
40
40
|
declare const _compressedPointBase: import("funtypes").Constraint<import("funtypes").Intersect<[import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
41
41
|
length: Literal<33>;
|
|
42
42
|
}, false>]>, Obj<{
|
|
@@ -46,7 +46,7 @@ declare const _compressedPointBase: import("funtypes").Constraint<import("funtyp
|
|
|
46
46
|
} & {
|
|
47
47
|
0: 2 | 3;
|
|
48
48
|
}, unknown>;
|
|
49
|
-
export
|
|
49
|
+
export type CompressedPoint = Static<typeof _compressedPointBase>;
|
|
50
50
|
declare const _uncompressedPoint: import("funtypes").Constraint<import("funtypes").Constraint<import("funtypes").Intersect<[import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
51
51
|
length: Literal<65>;
|
|
52
52
|
}, false>]>, Obj<{
|
|
@@ -59,8 +59,8 @@ declare const _uncompressedPoint: import("funtypes").Constraint<import("funtypes
|
|
|
59
59
|
length: 65;
|
|
60
60
|
} & {
|
|
61
61
|
0: 4;
|
|
62
|
-
}, unknown> & (<
|
|
63
|
-
length: Literal<
|
|
62
|
+
}, unknown> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
63
|
+
length: Literal<T_1>;
|
|
64
64
|
}, false>]>) & {
|
|
65
65
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
66
66
|
} & {
|
|
@@ -79,8 +79,8 @@ declare const _compressedPoint: import("funtypes").Constraint<import("funtypes")
|
|
|
79
79
|
length: 33;
|
|
80
80
|
} & {
|
|
81
81
|
0: 2 | 3;
|
|
82
|
-
}, unknown> & (<
|
|
83
|
-
length: Literal<
|
|
82
|
+
}, unknown> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
83
|
+
length: Literal<T_1>;
|
|
84
84
|
}, false>]>) & {
|
|
85
85
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
86
86
|
} & {
|
|
@@ -90,7 +90,7 @@ declare const _compressedPoint: import("funtypes").Constraint<import("funtypes")
|
|
|
90
90
|
yIsOdd: (p: CompressedPoint) => boolean;
|
|
91
91
|
};
|
|
92
92
|
export declare const CompressedPoint: typeof _compressedPoint;
|
|
93
|
-
export
|
|
93
|
+
export type CurvePoint = CompressedPoint | UncompressedPoint;
|
|
94
94
|
declare const _curvePoint: Union<[import("funtypes").Constraint<import("funtypes").Intersect<[import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
95
95
|
length: Literal<33>;
|
|
96
96
|
}, false>]>, Obj<{
|
|
@@ -99,8 +99,8 @@ declare const _curvePoint: Union<[import("funtypes").Constraint<import("funtypes
|
|
|
99
99
|
length: 33;
|
|
100
100
|
} & {
|
|
101
101
|
0: 2 | 3;
|
|
102
|
-
}, unknown> & (<
|
|
103
|
-
length: Literal<
|
|
102
|
+
}, unknown> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
103
|
+
length: Literal<T_1>;
|
|
104
104
|
}, false>]>) & {
|
|
105
105
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
106
106
|
} & {
|
|
@@ -120,8 +120,8 @@ declare const _curvePoint: Union<[import("funtypes").Constraint<import("funtypes
|
|
|
120
120
|
length: 65;
|
|
121
121
|
} & {
|
|
122
122
|
0: 4;
|
|
123
|
-
}, unknown> & (<
|
|
124
|
-
length: Literal<
|
|
123
|
+
}, unknown> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
124
|
+
length: Literal<T_1>;
|
|
125
125
|
}, false>]>) & {
|
|
126
126
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
127
127
|
} & {
|
|
@@ -137,7 +137,7 @@ declare const _curvePoint: Union<[import("funtypes").Constraint<import("funtypes
|
|
|
137
137
|
};
|
|
138
138
|
export declare const CurvePoint: typeof _curvePoint;
|
|
139
139
|
declare const _recoveryParamBase: Union<[Literal<0>, Literal<1>, Literal<2>, Literal<3>]>;
|
|
140
|
-
export
|
|
140
|
+
export type RecoveryParam = Static<typeof _recoveryParamBase>;
|
|
141
141
|
declare const _recoveryParam: Union<[Literal<0>, Literal<1>, Literal<2>, Literal<3>]>;
|
|
142
142
|
export declare const RecoveryParam: typeof _recoveryParam;
|
|
143
143
|
declare const _messageWithPreimageBase: import("funtypes").Intersect<[import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
@@ -213,7 +213,7 @@ declare const _messageWithPreimageBase: import("funtypes").Intersect<[import("fu
|
|
|
213
213
|
preimage: Uint8Array;
|
|
214
214
|
algorithm: "sha512";
|
|
215
215
|
}), unknown>]>;
|
|
216
|
-
export
|
|
216
|
+
export type MessageWithPreimage = Static<typeof _messageWithPreimageBase>;
|
|
217
217
|
declare const _messageWithPreimage: import("funtypes").Intersect<[import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
218
218
|
length: Literal<32>;
|
|
219
219
|
}, false>]>, import("funtypes").Constraint<import("funtypes").Runtype<(Uint8Array & {
|
|
@@ -286,8 +286,8 @@ declare const _messageWithPreimage: import("funtypes").Intersect<[import("funtyp
|
|
|
286
286
|
} & {
|
|
287
287
|
preimage: Uint8Array;
|
|
288
288
|
algorithm: "sha512";
|
|
289
|
-
}), unknown>]> & (<
|
|
290
|
-
length: Literal<
|
|
289
|
+
}), unknown>]> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
290
|
+
length: Literal<T_1>;
|
|
291
291
|
}, false>]>) & {
|
|
292
292
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
293
293
|
};
|
|
@@ -364,12 +364,12 @@ declare const _messageBase: Union<[import("funtypes").Intersect<[import("funtype
|
|
|
364
364
|
} & {
|
|
365
365
|
preimage: Uint8Array;
|
|
366
366
|
algorithm: "sha512";
|
|
367
|
-
}), unknown>]> & (<
|
|
368
|
-
length: Literal<
|
|
367
|
+
}), unknown>]> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
368
|
+
length: Literal<T_1>;
|
|
369
369
|
}, false>]>) & {
|
|
370
370
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
371
371
|
}, import("funtypes").InstanceOf<Uint8Array>]>;
|
|
372
|
-
export
|
|
372
|
+
export type Message = Static<typeof _messageBase>;
|
|
373
373
|
declare const _message: Union<[import("funtypes").Intersect<[import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
374
374
|
length: Literal<32>;
|
|
375
375
|
}, false>]>, import("funtypes").Constraint<import("funtypes").Runtype<(Uint8Array & {
|
|
@@ -442,12 +442,12 @@ declare const _message: Union<[import("funtypes").Intersect<[import("funtypes").
|
|
|
442
442
|
} & {
|
|
443
443
|
preimage: Uint8Array;
|
|
444
444
|
algorithm: "sha512";
|
|
445
|
-
}), unknown>]> & (<
|
|
446
|
-
length: Literal<
|
|
445
|
+
}), unknown>]> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
446
|
+
length: Literal<T_1>;
|
|
447
447
|
}, false>]>) & {
|
|
448
448
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
449
|
-
}, import("funtypes").InstanceOf<Uint8Array>]> & (<
|
|
450
|
-
length: Literal<
|
|
449
|
+
}, import("funtypes").InstanceOf<Uint8Array>]> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
450
|
+
length: Literal<T_1>;
|
|
451
451
|
}, false>]>) & {
|
|
452
452
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
453
453
|
};
|
|
@@ -459,15 +459,15 @@ declare const _signatureBase: import("funtypes").Constraint<import("funtypes").C
|
|
|
459
459
|
}, unknown>, Uint8Array & {
|
|
460
460
|
length: 64;
|
|
461
461
|
}, unknown>;
|
|
462
|
-
export
|
|
462
|
+
export type Signature = Static<typeof _signatureBase>;
|
|
463
463
|
declare const _signature: import("funtypes").Constraint<import("funtypes").Constraint<import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
464
464
|
length: Literal<64>;
|
|
465
465
|
}, false>]>, Uint8Array & {
|
|
466
466
|
length: 64;
|
|
467
467
|
}, unknown>, Uint8Array & {
|
|
468
468
|
length: 64;
|
|
469
|
-
}, unknown> & (<
|
|
470
|
-
length: Literal<
|
|
469
|
+
}, unknown> & (<T_1 extends number | undefined = undefined>(length?: T_1 | undefined) => T_1 extends undefined ? import("funtypes").InstanceOf<Uint8Array> : unknown extends T_1 ? import("funtypes").InstanceOf<Uint8Array> : import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
470
|
+
length: Literal<T_1>;
|
|
471
471
|
}, false>]>) & {
|
|
472
472
|
equal(lhs: Uint8Array, rhs: Uint8Array): boolean;
|
|
473
473
|
} & {
|
|
@@ -476,7 +476,7 @@ declare const _signature: import("funtypes").Constraint<import("funtypes").Const
|
|
|
476
476
|
isLowR: (x: Signature) => boolean;
|
|
477
477
|
isLowS: (x: Signature) => boolean;
|
|
478
478
|
isCanonical: (x: Signature) => boolean;
|
|
479
|
-
signCanonically: (x: ECDSAKey, digestAlgorithm: Digest.AlgorithmName<32> | null, message: Uint8Array, counter?:
|
|
479
|
+
signCanonically: (x: ECDSAKey, digestAlgorithm: Digest.AlgorithmName<32> | null, message: Uint8Array, counter?: Uint32) => Promise<Signature>;
|
|
480
480
|
verify: (x: Signature, digestAlgorithm: Digest.AlgorithmName<32> | null, message: Uint8Array, publicKey: CurvePoint) => boolean;
|
|
481
481
|
};
|
|
482
482
|
export declare const Signature: typeof _signature;
|
|
@@ -487,9 +487,9 @@ declare const _recoverableSignatureBase: import("funtypes").Constraint<import("f
|
|
|
487
487
|
}, false>]>, Uint8Array & {
|
|
488
488
|
length: 65;
|
|
489
489
|
} & {
|
|
490
|
-
64: 0 |
|
|
490
|
+
64: 0 | 1 | 2 | 3;
|
|
491
491
|
}, unknown>;
|
|
492
|
-
export
|
|
492
|
+
export type RecoverableSignature = Static<typeof _recoverableSignatureBase>;
|
|
493
493
|
declare const _recoverableSignature: import("funtypes").Constraint<import("funtypes").Intersect<[import("funtypes").Intersect<[import("funtypes").InstanceOf<Uint8Array>, Obj<{
|
|
494
494
|
length: Literal<65>;
|
|
495
495
|
}, false>]>, Obj<{
|
|
@@ -497,7 +497,7 @@ declare const _recoverableSignature: import("funtypes").Constraint<import("funty
|
|
|
497
497
|
}, false>]>, Uint8Array & {
|
|
498
498
|
length: 65;
|
|
499
499
|
} & {
|
|
500
|
-
64: 0 |
|
|
500
|
+
64: 0 | 1 | 2 | 3;
|
|
501
501
|
}, unknown> & {
|
|
502
502
|
from: (x: Signature, recoveryParam: RecoveryParam) => RecoverableSignature;
|
|
503
503
|
fromSignature: (x: Signature, digestAlgorithm: Digest.AlgorithmName<32> | null, message: Uint8Array, publicKey: CurvePoint) => Promise<RecoverableSignature>;
|
|
@@ -505,7 +505,7 @@ declare const _recoverableSignature: import("funtypes").Constraint<import("funty
|
|
|
505
505
|
recoveryParam: (x: RecoverableSignature) => RecoveryParam;
|
|
506
506
|
isLowRecoveryParam: (x: RecoverableSignature) => boolean;
|
|
507
507
|
isCanonical: (x: RecoverableSignature) => boolean;
|
|
508
|
-
signCanonically: (x: ECDSAKey, digestAlgorithm: Digest.AlgorithmName<32> | null, message: Uint8Array, counter?:
|
|
508
|
+
signCanonically: (x: ECDSAKey, digestAlgorithm: Digest.AlgorithmName<32> | null, message: Uint8Array, counter?: Uint32) => Promise<RecoverableSignature>;
|
|
509
509
|
recoverPublicKey: (x: RecoverableSignature, digestAlgorithm: Digest.AlgorithmName<32> | null, message: Uint8Array) => Promise<CurvePoint>;
|
|
510
510
|
r: (x: RecoverableSignature) => FieldElement;
|
|
511
511
|
s: (x: RecoverableSignature) => FieldElement;
|