@shapeshiftoss/hdwallet-native 1.62.8 → 1.62.10-alpha.1

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/util.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as core from "@shapeshiftoss/hdwallet-core";
2
- import { BTCScriptType } from "./bitcoin";
3
2
  import * as Isolation from "./crypto/isolation";
4
- export declare function getKeyPair(node: Isolation.Core.BIP32.Node, addressNList: number[], coin: core.Coin, scriptType?: BTCScriptType): Promise<Isolation.Adapters.BIP32>;
3
+ export declare function getKeyPair(node: Isolation.Core.BIP32.Node, addressNList: number[], coin: core.Coin, scriptType?: core.BTCScriptType): Promise<Isolation.Adapters.BIP32>;
5
4
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAGhD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAC/B,YAAY,EAAE,MAAM,EAAE,EACtB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,UAAU,CAAC,EAAE,aAAa,GACzB,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAKnC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAErD,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAEhD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAC/B,YAAY,EAAE,MAAM,EAAE,EACtB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,UAAU,CAAC,EAAE,IAAI,CAAC,aAAa,GAC9B,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAKnC"}
package/dist/util.js CHANGED
@@ -35,10 +35,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.getKeyPair = getKeyPair;
36
36
  const core = __importStar(require("@shapeshiftoss/hdwallet-core"));
37
37
  const Isolation = __importStar(require("./crypto/isolation"));
38
- const networks_1 = require("./networks");
39
38
  function getKeyPair(node, addressNList, coin, scriptType) {
40
39
  return __awaiter(this, void 0, void 0, function* () {
41
- const network = (0, networks_1.getNetwork)(coin, scriptType);
40
+ const network = core.getNetwork(coin, scriptType !== null && scriptType !== void 0 ? scriptType : core.BTCOutputScriptType.PayToMultisig);
42
41
  const wallet = yield Isolation.Adapters.BIP32.create(node, network);
43
42
  const path = core.addressNListToBIP32(addressNList);
44
43
  return yield wallet.derivePath(path);
package/dist/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,gCAUC;AAhBD,mEAAqD;AAGrD,8DAAgD;AAChD,yCAAwC;AAExC,SAAsB,UAAU,CAC9B,IAA+B,EAC/B,YAAsB,EACtB,IAAe,EACf,UAA0B;;QAE1B,MAAM,OAAO,GAAG,IAAA,qBAAU,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpE,MAAM,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACpD,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CAAA"}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,gCAUC;AAdD,mEAAqD;AAErD,8DAAgD;AAEhD,SAAsB,UAAU,CAC9B,IAA+B,EAC/B,YAAsB,EACtB,IAAe,EACf,UAA+B;;QAE/B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;QAC5F,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpE,MAAM,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACpD,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/hdwallet-native",
3
- "version": "1.62.8",
3
+ "version": "1.62.10-alpha.1",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,14 +10,14 @@
10
10
  "types": "dist/index.d.ts",
11
11
  "scripts": {
12
12
  "build": "tsc --build",
13
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
14
- "prepublishOnly": "yarn clean && yarn build"
13
+ "clean": "rm -rf dist node_modules",
14
+ "prepublishOnly": "rm -rf dist && yarn build"
15
15
  },
16
16
  "dependencies": {
17
17
  "@bitcoinerlab/secp256k1": "^1.1.1",
18
18
  "@noble/curves": "^1.4.0",
19
19
  "@shapeshiftoss/bitcoinjs-lib": "7.0.0-shapeshift.0",
20
- "@shapeshiftoss/hdwallet-core": "1.62.8",
20
+ "@shapeshiftoss/hdwallet-core": "1.62.10-alpha.1",
21
21
  "@shapeshiftoss/proto-tx-builder": "0.10.0",
22
22
  "@zxing/text-encoding": "^0.9.0",
23
23
  "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": "73a5990e596dcfe45ee9e7853669d48353537721"
60
+ "gitHead": "86c4f311d027cbd873538328071c83e37620dba1"
61
61
  }
@@ -1,4 +0,0 @@
1
- import * as bitcoin from "@shapeshiftoss/bitcoinjs-lib";
2
- import { BTCScriptType } from "./bitcoin";
3
- export declare function getNetwork(coin: string, scriptType?: BTCScriptType): bitcoin.Network;
4
- //# sourceMappingURL=networks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../src/networks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAiL1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAgBpF"}
package/dist/networks.js DELETED
@@ -1,191 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
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);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getNetwork = getNetwork;
27
- const core = __importStar(require("@shapeshiftoss/hdwallet-core"));
28
- const bip32BTC = {
29
- p2sh: {
30
- bip32: {
31
- public: 0x0488b21e,
32
- private: 0x0488ade4,
33
- },
34
- },
35
- p2pkh: {
36
- bip32: {
37
- public: 0x0488b21e,
38
- private: 0x0488ade4,
39
- },
40
- },
41
- "p2sh-p2wpkh": {
42
- bip32: {
43
- public: 0x049d7cb2,
44
- private: 0x049d7878,
45
- },
46
- },
47
- p2wpkh: {
48
- bip32: {
49
- public: 0x04b24746,
50
- private: 0x04b2430c,
51
- },
52
- },
53
- };
54
- const networks = {
55
- bitcoin: Object.assign({ base: {
56
- messagePrefix: "\x18Bitcoin Signed Message:\n",
57
- bech32: "bc",
58
- pubKeyHash: 0x00,
59
- scriptHash: 0x05,
60
- wif: 0x80,
61
- } }, bip32BTC),
62
- dash: {
63
- base: {
64
- messagePrefix: "unused",
65
- bech32: "",
66
- pubKeyHash: 0x4c,
67
- scriptHash: 0x10,
68
- wif: 0xcc,
69
- },
70
- p2sh: bip32BTC.p2sh,
71
- p2pkh: bip32BTC.p2pkh,
72
- },
73
- digibyte: Object.assign({ base: {
74
- messagePrefix: "\x19Digibyte Signed Message:\n",
75
- bech32: "dgb",
76
- pubKeyHash: 0x1e,
77
- scriptHash: 0x3f,
78
- wif: 0x80,
79
- } }, bip32BTC),
80
- dogecoin: {
81
- base: {
82
- messagePrefix: "\x19Dogecoin Signed Message:\n",
83
- bech32: "",
84
- pubKeyHash: 0x1e,
85
- scriptHash: 0x16,
86
- wif: 0x9e,
87
- },
88
- p2sh: {
89
- bip32: {
90
- public: 0x02facafd,
91
- private: 0x02fac398,
92
- },
93
- },
94
- p2pkh: {
95
- bip32: {
96
- public: 0x02facafd,
97
- private: 0x02fac398,
98
- },
99
- },
100
- },
101
- litecoin: {
102
- base: {
103
- messagePrefix: "\x19Litecoin Signed Message:\n",
104
- bech32: "ltc",
105
- pubKeyHash: 0x30,
106
- scriptHash: 0x32,
107
- wif: 0xb0,
108
- },
109
- p2sh: {
110
- bip32: {
111
- public: 0x019da462,
112
- private: 0x019d9cfe,
113
- },
114
- },
115
- p2pkh: {
116
- bip32: {
117
- public: 0x019da462,
118
- private: 0x019d9cfe,
119
- },
120
- },
121
- "p2sh-p2wpkh": {
122
- bip32: {
123
- public: 0x01b26ef6,
124
- private: 0x01b26792,
125
- },
126
- },
127
- p2wpkh: bip32BTC.p2wpkh,
128
- },
129
- testnet: {
130
- base: {
131
- messagePrefix: "\x18Bitcoin Signed Message:\n",
132
- bech32: "tb",
133
- pubKeyHash: 0x6f,
134
- scriptHash: 0xc4,
135
- wif: 0xef,
136
- },
137
- p2sh: {
138
- bip32: {
139
- public: 0x043587cf,
140
- private: 0x04358394,
141
- },
142
- },
143
- p2pkh: {
144
- bip32: {
145
- public: 0x043587cf,
146
- private: 0x04358394,
147
- },
148
- },
149
- "p2sh-p2wpkh": {
150
- bip32: {
151
- public: 0x044a5262,
152
- private: 0x044a4e28,
153
- },
154
- },
155
- p2wpkh: {
156
- bip32: {
157
- public: 0x045f1cf6,
158
- private: 0x045f18bc,
159
- },
160
- },
161
- },
162
- };
163
- //TODO: all below are missing network data
164
- for (const coin of [
165
- "arkeo",
166
- "binance",
167
- "bitcoincash",
168
- "cardano",
169
- "cosmos",
170
- "ethereum",
171
- "kava",
172
- "mayachain",
173
- "osmosis",
174
- "secret",
175
- "terra",
176
- "thorchain",
177
- ])
178
- networks[coin] = networks.bitcoin;
179
- function getNetwork(coin, scriptType) {
180
- coin = coin.toLowerCase();
181
- scriptType = scriptType || core.BTCOutputScriptType.PayToMultisig;
182
- if (!(coin in networks))
183
- throw new Error(`${coin} network not supported`);
184
- const network = networks[coin];
185
- const bip32 = network[scriptType];
186
- if (!bip32) {
187
- throw new Error(`${scriptType} not supported for ${coin} network`);
188
- }
189
- return Object.assign(Object.assign({}, network.base), bip32);
190
- }
191
- //# sourceMappingURL=networks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"networks.js","sourceRoot":"","sources":["../src/networks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoLA,gCAgBC;AAnMD,mEAAqD;AAarD,MAAM,QAAQ,GAAsB;IAClC,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,UAAU;SACpB;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,UAAU;SACpB;KACF;IACD,aAAa,EAAE;QACb,KAAK,EAAE;YACL,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,UAAU;SACpB;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,UAAU;SACpB;KACF;CACF,CAAC;AAQF,MAAM,QAAQ,GAAa;IACzB,OAAO,kBACL,IAAI,EAAE;YACJ,aAAa,EAAE,+BAA+B;YAC9C,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE,IAAI;SACV,IACE,QAAQ,CACZ;IACD,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,aAAa,EAAE,QAAQ;YACvB,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE,IAAI;SACV;QACD,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;KACtB;IACD,QAAQ,kBACN,IAAI,EAAE;YACJ,aAAa,EAAE,gCAAgC;YAC/C,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE,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