@shapeshiftoss/hdwallet-native 1.52.4 → 1.52.6
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,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { Seed as SeedType } from "../../core/bip32";
|
|
2
|
+
import type { Mnemonic as Bip39Mnemonic } from "../../core/bip39";
|
|
3
3
|
export * from "../../core/bip39";
|
|
4
4
|
declare const Mnemonic_base: {
|
|
5
5
|
new (...args: any[]): {
|
|
@@ -11,10 +11,10 @@ declare const Mnemonic_base: {
|
|
|
11
11
|
} & {
|
|
12
12
|
new (): {};
|
|
13
13
|
};
|
|
14
|
-
export declare class Mnemonic extends Mnemonic_base implements
|
|
14
|
+
export declare class Mnemonic extends Mnemonic_base implements Bip39Mnemonic {
|
|
15
15
|
#private;
|
|
16
16
|
protected constructor(mnemonic: string);
|
|
17
|
-
static create(mnemonic: string): Promise<
|
|
18
|
-
toSeed(passphrase?: string): Promise<
|
|
17
|
+
static create(mnemonic: string): Promise<Bip39Mnemonic>;
|
|
18
|
+
toSeed(passphrase?: string): Promise<SeedType>;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=bip39.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bip39.d.ts","sourceRoot":"","sources":["../../../../../src/crypto/isolation/engines/default/bip39.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bip39.d.ts","sourceRoot":"","sources":["../../../../../src/crypto/isolation/engines/default/bip39.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIlE,cAAc,kBAAkB,CAAC;;;;;;;;;;;AAEjC,qBAAa,QAAS,SAAQ,aAAoB,YAAW,aAAa;;IAGxE,SAAS,aAAa,QAAQ,EAAE,MAAM;WAKzB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKvD,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAmBrD"}
|
|
@@ -11,18 +11,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
11
11
|
if (k2 === undefined) k2 = k;
|
|
12
12
|
o[k2] = m[k];
|
|
13
13
|
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
14
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
27
15
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
16
|
};
|
|
@@ -49,32 +37,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
49
37
|
var _Mnemonic_mnemonic;
|
|
50
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
39
|
exports.Mnemonic = void 0;
|
|
52
|
-
const
|
|
53
|
-
const bip32crypto = __importStar(require("bip32/src/crypto"));
|
|
40
|
+
const hash_wasm_1 = require("hash-wasm");
|
|
54
41
|
const web_encoding_1 = require("web-encoding");
|
|
55
|
-
const
|
|
56
|
-
const BIP32Engine = __importStar(require("./bip32"));
|
|
42
|
+
const bip32_1 = require("./bip32");
|
|
57
43
|
const revocable_1 = require("./revocable");
|
|
58
44
|
__exportStar(require("../../core/bip39"), exports);
|
|
59
|
-
// Poor man's single-block PBKDF2 implementation
|
|
60
|
-
//TODO: get something better
|
|
61
|
-
function pbkdf2_sha512_singleblock(password, salt, iterations) {
|
|
62
|
-
function be32Buf(index) {
|
|
63
|
-
const indexBE = Buffer.alloc(4);
|
|
64
|
-
indexBE.writeUInt32BE(index);
|
|
65
|
-
return indexBE;
|
|
66
|
-
}
|
|
67
|
-
const pwBuffer = (0, types_1.safeBufferFrom)(new web_encoding_1.TextEncoder().encode(password));
|
|
68
|
-
const out = bip32crypto.hmacSHA512(pwBuffer, core.compatibleBufferConcat([salt, be32Buf(1)]));
|
|
69
|
-
let lastU = out;
|
|
70
|
-
for (let i = 2; i <= iterations; i++) {
|
|
71
|
-
const newU = bip32crypto.hmacSHA512(pwBuffer, lastU);
|
|
72
|
-
for (let j = 0; j < out.length; j++)
|
|
73
|
-
out[j] ^= newU[j];
|
|
74
|
-
lastU = newU;
|
|
75
|
-
}
|
|
76
|
-
return out;
|
|
77
|
-
}
|
|
78
45
|
class Mnemonic extends (0, revocable_1.Revocable)(class {
|
|
79
46
|
}) {
|
|
80
47
|
constructor(mnemonic) {
|
|
@@ -90,11 +57,16 @@ class Mnemonic extends (0, revocable_1.Revocable)(class {
|
|
|
90
57
|
}
|
|
91
58
|
toSeed(passphrase) {
|
|
92
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
if (passphrase !== undefined && typeof passphrase !== "string")
|
|
94
|
-
throw new Error("bad passphrase type");
|
|
95
60
|
const mnemonic = __classPrivateFieldGet(this, _Mnemonic_mnemonic, "f");
|
|
96
61
|
const salt = new web_encoding_1.TextEncoder().encode(`mnemonic${passphrase !== null && passphrase !== void 0 ? passphrase : ""}`.normalize("NFKD"));
|
|
97
|
-
const out = yield
|
|
62
|
+
const out = yield bip32_1.Seed.create(Buffer.from(yield (0, hash_wasm_1.pbkdf2)({
|
|
63
|
+
password: mnemonic,
|
|
64
|
+
salt,
|
|
65
|
+
iterations: 2048,
|
|
66
|
+
hashLength: 64,
|
|
67
|
+
hashFunction: (0, hash_wasm_1.createSHA512)(),
|
|
68
|
+
outputType: "binary",
|
|
69
|
+
})));
|
|
98
70
|
this.addRevoker(() => { var _a; return (_a = out.revoke) === null || _a === void 0 ? void 0 : _a.call(out); });
|
|
99
71
|
return out;
|
|
100
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bip39.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/engines/default/bip39.ts"],"names":[],"mappings":";AAAA,4CAA4C
|
|
1
|
+
{"version":3,"file":"bip39.js","sourceRoot":"","sources":["../../../../../src/crypto/isolation/engines/default/bip39.ts"],"names":[],"mappings":";AAAA,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5C,yCAAiD;AACjD,+CAA2C;AAI3C,mCAA+B;AAC/B,2CAAmD;AAEnD,mDAAiC;AAEjC,MAAa,QAAS,SAAQ,IAAA,qBAAS,EAAC;CAAQ,CAAC;IAG/C,YAAsB,QAAgB;QACpC,KAAK,EAAE,CAAC;QAHD,qCAAkB;QAIzB,uBAAA,IAAI,sBAAa,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,MAAA,CAAC;IAC9C,CAAC;IAED,MAAM,CAAO,MAAM,CAAC,QAAgB;;YAClC,MAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,IAAA,qBAAS,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;KAAA;IAEK,MAAM,CAAC,UAAmB;;YAC9B,MAAM,QAAQ,GAAG,uBAAA,IAAI,0BAAU,CAAC;YAChC,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC,MAAM,CAAC,WAAW,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YAEvF,MAAM,GAAG,GAAG,MAAM,YAAI,CAAC,MAAM,CAC3B,MAAM,CAAC,IAAI,CACT,MAAM,IAAA,kBAAM,EAAC;gBACX,QAAQ,EAAE,QAAQ;gBAClB,IAAI;gBACJ,UAAU,EAAE,IAAI;gBAChB,UAAU,EAAE,EAAE;gBACd,YAAY,EAAE,IAAA,wBAAY,GAAE;gBAC5B,UAAU,EAAE,QAAQ;aACrB,CAAC,CACH,CACF,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,WAAC,OAAA,MAAA,GAAG,CAAC,MAAM,mDAAI,CAAA,EAAA,CAAC,CAAC;YACtC,OAAO,GAAG,CAAC;QACb,CAAC;KAAA;CACF;AAhCD,4BAgCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/hdwallet-native",
|
|
3
|
-
"version": "1.52.
|
|
3
|
+
"version": "1.52.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@shapeshiftoss/bitcoinjs-lib": "5.2.0-shapeshift.2",
|
|
18
18
|
"@shapeshiftoss/fiosdk": "1.2.1-shapeshift.6",
|
|
19
|
-
"@shapeshiftoss/hdwallet-core": "1.52.
|
|
19
|
+
"@shapeshiftoss/hdwallet-core": "1.52.6",
|
|
20
20
|
"@shapeshiftoss/proto-tx-builder": "^0.8.0",
|
|
21
21
|
"@zxing/text-encoding": "^0.9.0",
|
|
22
22
|
"bchaddrjs": "^0.4.9",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"cosmjs-types": "^0.4.1",
|
|
58
58
|
"msw": "^0.27.1"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "68054446a64d1671e3be7b82f602d8b2df6880d0"
|
|
61
61
|
}
|