@shapeshiftoss/hdwallet-ledger 1.55.2 → 1.55.4-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/bitcoin.js +177 -243
- package/dist/bitcoin.js.map +1 -1
- package/dist/cosmos.d.ts.map +1 -1
- package/dist/cosmos.js +38 -82
- package/dist/cosmos.js.map +1 -1
- package/dist/currencies.js +1 -4
- package/dist/currencies.js.map +1 -1
- package/dist/ethereum.d.ts.map +1 -1
- package/dist/ethereum.js +143 -202
- package/dist/ethereum.js.map +1 -1
- package/dist/index.js +6 -22
- package/dist/index.js.map +1 -1
- package/dist/ledger.js +183 -284
- package/dist/ledger.js.map +1 -1
- package/dist/thorchain/common.js +11 -16
- package/dist/thorchain/common.js.map +1 -1
- package/dist/thorchain/hw-app-thor.d.ts +2 -3
- package/dist/thorchain/hw-app-thor.d.ts.map +1 -1
- package/dist/thorchain/hw-app-thor.js +125 -146
- package/dist/thorchain/hw-app-thor.js.map +1 -1
- package/dist/thorchain/index.d.ts.map +1 -1
- package/dist/thorchain/index.js +39 -86
- package/dist/thorchain/index.js.map +1 -1
- package/dist/transport.js +4 -29
- package/dist/transport.js.map +1 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +13 -49
- package/dist/utils.js.map +1 -1
- package/dist/utxoUtils.js +67 -73
- package/dist/utxoUtils.js.map +1 -1
- package/package.json +7 -7
package/dist/bitcoin.js
CHANGED
|
@@ -1,126 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.btcIsSameAccount = exports.btcGetAccountPaths = exports.btcVerifyMessage = exports.btcSignMessage = exports.btcSupportsNativeShapeShift = exports.btcSupportsSecureTransfer = exports.btcSignTx = exports.btcGetPublicKeys = exports.btcGetAddress = exports.btcSupportsScriptType = exports.btcSupportsCoin = exports.supportedCoins = void 0;
|
|
39
|
-
const core = __importStar(require("@shapeshiftoss/hdwallet-core"));
|
|
40
|
-
const base64_js_1 = __importDefault(require("base64-js"));
|
|
41
|
-
const bchAddr = __importStar(require("bchaddrjs"));
|
|
42
|
-
const bitcoin = __importStar(require("bitcoinjs-lib"));
|
|
43
|
-
const bitcoinMsg = __importStar(require("bitcoinjs-message"));
|
|
44
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
45
|
-
const currencies_1 = require("./currencies");
|
|
46
|
-
const utils_1 = require("./utils");
|
|
47
|
-
const utxoUtils_1 = require("./utxoUtils");
|
|
48
|
-
exports.supportedCoins = ["Testnet", "Bitcoin", "BitcoinCash", "Litecoin", "Dash", "DigiByte", "Dogecoin"];
|
|
1
|
+
import * as core from "@shapeshiftoss/hdwallet-core";
|
|
2
|
+
import Base64 from "base64-js";
|
|
3
|
+
import * as bchAddr from "bchaddrjs";
|
|
4
|
+
import * as bitcoin from "bitcoinjs-lib";
|
|
5
|
+
import * as bitcoinMsg from "bitcoinjs-message";
|
|
6
|
+
import _ from "lodash";
|
|
7
|
+
import { currencies } from "./currencies";
|
|
8
|
+
import { handleError, networksUtil, translateScriptType } from "./utils";
|
|
9
|
+
import { convertXpubVersion, scriptTypeToAccountType } from "./utxoUtils";
|
|
10
|
+
export const supportedCoins = ["Testnet", "Bitcoin", "BitcoinCash", "Litecoin", "Dash", "DigiByte", "Dogecoin"];
|
|
49
11
|
const segwitCoins = ["Bitcoin", "DigiByte", "Litecoin", "BitcoinGold", "Testnet"];
|
|
50
|
-
function btcSupportsCoin(coin) {
|
|
51
|
-
return
|
|
52
|
-
return exports.supportedCoins.includes(coin);
|
|
53
|
-
});
|
|
12
|
+
export async function btcSupportsCoin(coin) {
|
|
13
|
+
return supportedCoins.includes(coin);
|
|
54
14
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const scriptTypes = supported[coin];
|
|
67
|
-
return !!scriptTypes && !!scriptType && scriptTypes.includes(scriptType);
|
|
68
|
-
});
|
|
15
|
+
export async function btcSupportsScriptType(coin, scriptType) {
|
|
16
|
+
const supported = {
|
|
17
|
+
Bitcoin: [
|
|
18
|
+
core.BTCInputScriptType.SpendAddress,
|
|
19
|
+
core.BTCInputScriptType.SpendWitness,
|
|
20
|
+
core.BTCInputScriptType.SpendP2SHWitness,
|
|
21
|
+
],
|
|
22
|
+
BitcoinCash: [core.BTCInputScriptType.SpendAddress],
|
|
23
|
+
};
|
|
24
|
+
const scriptTypes = supported[coin];
|
|
25
|
+
return !!scriptTypes && !!scriptType && scriptTypes.includes(scriptType);
|
|
69
26
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const address = res.payload.bitcoinAddress;
|
|
88
|
-
return msg.coin.toLowerCase() === "bitcoincash" ? bchAddr.toCashAddress(address) : address;
|
|
89
|
-
});
|
|
27
|
+
export async function btcGetAddress(transport, msg) {
|
|
28
|
+
const bip32path = core.addressNListToBIP32(msg.addressNList);
|
|
29
|
+
const scriptTypeish = (() => {
|
|
30
|
+
if (msg.coin === "BitcoinCash")
|
|
31
|
+
return core.BTCInputScriptType.CashAddr;
|
|
32
|
+
if (msg.scriptType)
|
|
33
|
+
return msg.scriptType;
|
|
34
|
+
return core.BTCInputScriptType.SpendAddress;
|
|
35
|
+
})();
|
|
36
|
+
const opts = {
|
|
37
|
+
verify: !!msg.showDisplay,
|
|
38
|
+
format: translateScriptType(scriptTypeish),
|
|
39
|
+
};
|
|
40
|
+
const res = await transport.call("Btc", "getWalletPublicKey", bip32path, opts);
|
|
41
|
+
handleError(res, transport, "Unable to obtain BTC address from device");
|
|
42
|
+
const address = res.payload.bitcoinAddress;
|
|
43
|
+
return msg.coin.toLowerCase() === "bitcoincash" ? bchAddr.toCashAddress(address) : address;
|
|
90
44
|
}
|
|
91
|
-
exports.btcGetAddress = btcGetAddress;
|
|
92
45
|
// Adapted from https://github.com/LedgerHQ/ledger-wallet-webtool
|
|
93
|
-
function btcGetPublicKeys(transport, msg) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return xpubs;
|
|
121
|
-
});
|
|
46
|
+
export async function btcGetPublicKeys(transport, msg) {
|
|
47
|
+
const xpubs = [];
|
|
48
|
+
for (const getPublicKey of msg) {
|
|
49
|
+
const { addressNList, coin } = getPublicKey;
|
|
50
|
+
if (!coin)
|
|
51
|
+
throw new Error("coin is required");
|
|
52
|
+
if (!getPublicKey.scriptType)
|
|
53
|
+
throw new Error("scriptType is required");
|
|
54
|
+
const parentBip32path = core.addressNListToBIP32(addressNList);
|
|
55
|
+
const getWalletXpubResponse = await transport.call("Btc", "getWalletXpub", {
|
|
56
|
+
path: parentBip32path,
|
|
57
|
+
xpubVersion: currencies[getPublicKey.coin].xpubVersion,
|
|
58
|
+
});
|
|
59
|
+
handleError(getWalletXpubResponse, transport, "Unable to obtain public key from device.");
|
|
60
|
+
const { payload: _xpub } = getWalletXpubResponse;
|
|
61
|
+
// Ledger returns
|
|
62
|
+
// - LTC pubkeys in Ltub format for all scriptTypes.
|
|
63
|
+
// - BTC pubkeys in xpub format for all scriptTypes
|
|
64
|
+
// - Doge pubkeys in xpub format instead of dgub
|
|
65
|
+
// They *are* the correct accounts, but not in the format we want.
|
|
66
|
+
// We need to convert SegWit pubkeys to Mtubs/ypubs, and SegWit native to zpubs, and Doge xpubs to dgubs.
|
|
67
|
+
const xpub = convertXpubVersion(_xpub, scriptTypeToAccountType[getPublicKey.scriptType], getPublicKey.coin);
|
|
68
|
+
xpubs.push({
|
|
69
|
+
xpub,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return xpubs;
|
|
122
73
|
}
|
|
123
|
-
exports.btcGetPublicKeys = btcGetPublicKeys;
|
|
124
74
|
/*
|
|
125
75
|
Sign Transaction UTXO's
|
|
126
76
|
(Utilizing bitcoinjs-lib TxBuilder object)
|
|
@@ -162,140 +112,126 @@ Parameters
|
|
|
162
112
|
* expiryHeight is an optional Buffer for zec overwinter / sapling Txs
|
|
163
113
|
* useTrustedInputForSegwit trust inputs for segwit transactions
|
|
164
114
|
*/
|
|
165
|
-
function btcSignTx(wallet, transport, msg) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
outputAddress = maybeOutputAddress;
|
|
185
|
-
}
|
|
186
|
-
else if (output.addressNList !== undefined &&
|
|
187
|
-
output.addressType === core.BTCOutputAddressType.Transfer &&
|
|
188
|
-
!supportsSecureTransfer) {
|
|
189
|
-
throw new Error("Ledger does not support SecureTransfer");
|
|
190
|
-
}
|
|
191
|
-
else if (output.address !== undefined) {
|
|
192
|
-
outputAddress = output.address;
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
throw new Error("could not determine output address");
|
|
196
|
-
}
|
|
197
|
-
if (msg.coin === "BitcoinCash" && bchAddr.isCashAddress(outputAddress)) {
|
|
198
|
-
outputAddress = bchAddr.toLegacyAddress(outputAddress);
|
|
199
|
-
}
|
|
200
|
-
txBuilder.addOutput(outputAddress, Number(output.amount));
|
|
115
|
+
export async function btcSignTx(wallet, transport, msg) {
|
|
116
|
+
const supportsSecureTransfer = await wallet.btcSupportsSecureTransfer();
|
|
117
|
+
const slip44 = core.mustBeDefined(core.slip44ByCoin(msg.coin));
|
|
118
|
+
const txBuilder = new bitcoin.TransactionBuilder(networksUtil[slip44].bitcoinjs);
|
|
119
|
+
const indexes = [];
|
|
120
|
+
const txs = [];
|
|
121
|
+
const associatedKeysets = [];
|
|
122
|
+
let segwit = false;
|
|
123
|
+
for (const output of msg.outputs) {
|
|
124
|
+
let outputAddress;
|
|
125
|
+
if (output.addressNList !== undefined && output.isChange) {
|
|
126
|
+
const maybeOutputAddress = await wallet.btcGetAddress({
|
|
127
|
+
addressNList: output.addressNList,
|
|
128
|
+
scriptType: output.scriptType,
|
|
129
|
+
coin: msg.coin,
|
|
130
|
+
});
|
|
131
|
+
if (!maybeOutputAddress)
|
|
132
|
+
throw new Error("could not determine output address from addressNList");
|
|
133
|
+
outputAddress = maybeOutputAddress;
|
|
201
134
|
}
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
const ret = bitcoin.script.compile([bitcoin.opcodes.OP_RETURN, Buffer.from(msg.opReturnData)]);
|
|
207
|
-
txBuilder.addOutput(ret, 0);
|
|
135
|
+
else if (output.addressNList !== undefined &&
|
|
136
|
+
output.addressType === core.BTCOutputAddressType.Transfer &&
|
|
137
|
+
!supportsSecureTransfer) {
|
|
138
|
+
throw new Error("Ledger does not support SecureTransfer");
|
|
208
139
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
(0, utils_1.handleError)(splitTxRes, transport, "splitTransaction failed");
|
|
212
|
-
const outputScriptRes = yield transport.call("Btc", "serializeTransactionOutputs", splitTxRes.payload);
|
|
213
|
-
(0, utils_1.handleError)(outputScriptRes, transport, "serializeTransactionOutputs failed");
|
|
214
|
-
const outputScriptHex = outputScriptRes.payload.toString("hex");
|
|
215
|
-
for (let i = 0; i < msg.inputs.length; i++) {
|
|
216
|
-
if (msg.inputs[i].scriptType === core.BTCInputScriptType.SpendWitness ||
|
|
217
|
-
msg.inputs[i].scriptType === core.BTCInputScriptType.SpendP2SHWitness)
|
|
218
|
-
segwit = true;
|
|
219
|
-
const keySet = core.addressNListToBIP32(msg.inputs[i].addressNList).replace(/^m\//, "");
|
|
220
|
-
const vout = msg.inputs[i].vout;
|
|
221
|
-
const tx = yield transport.call("Btc", "splitTransaction", msg.inputs[i].hex, utils_1.networksUtil[slip44].isSegwitSupported, utils_1.networksUtil[slip44].areTransactionTimestamped);
|
|
222
|
-
(0, utils_1.handleError)(tx, transport, "splitTransaction failed");
|
|
223
|
-
indexes.push(vout);
|
|
224
|
-
txs.push(tx.payload);
|
|
225
|
-
associatedKeysets.push(keySet);
|
|
140
|
+
else if (output.address !== undefined) {
|
|
141
|
+
outputAddress = output.address;
|
|
226
142
|
}
|
|
227
|
-
|
|
228
|
-
throw new Error("
|
|
229
|
-
const inputs = lodash_1.default.zip(txs, indexes, [], []);
|
|
230
|
-
const txArgs = {
|
|
231
|
-
inputs,
|
|
232
|
-
associatedKeysets,
|
|
233
|
-
outputScriptHex,
|
|
234
|
-
additionals: (() => {
|
|
235
|
-
if (msg.coin === "BitcoinCash")
|
|
236
|
-
return ["abc"];
|
|
237
|
-
if (msg.inputs.some((input) => input.scriptType === core.BTCInputScriptType.SpendWitness))
|
|
238
|
-
return ["bech32"];
|
|
239
|
-
return [];
|
|
240
|
-
})(),
|
|
241
|
-
segwit,
|
|
242
|
-
useTrustedInputForSegwit: Boolean(segwit),
|
|
243
|
-
};
|
|
244
|
-
// "invalid data received" error from Ledger if not done this way:
|
|
245
|
-
if (utils_1.networksUtil[slip44].sigHash) {
|
|
246
|
-
txArgs.sigHashType = utils_1.networksUtil[slip44].sigHash;
|
|
143
|
+
else {
|
|
144
|
+
throw new Error("could not determine output address");
|
|
247
145
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
146
|
+
if (msg.coin === "BitcoinCash" && bchAddr.isCashAddress(outputAddress)) {
|
|
147
|
+
outputAddress = bchAddr.toLegacyAddress(outputAddress);
|
|
148
|
+
}
|
|
149
|
+
txBuilder.addOutput(outputAddress, Number(output.amount));
|
|
150
|
+
}
|
|
151
|
+
if (msg.opReturnData) {
|
|
152
|
+
if (msg.opReturnData.length > 80) {
|
|
153
|
+
throw new Error("OP_RETURN data must be less than 80 chars.");
|
|
154
|
+
}
|
|
155
|
+
const ret = bitcoin.script.compile([bitcoin.opcodes.OP_RETURN, Buffer.from(msg.opReturnData)]);
|
|
156
|
+
txBuilder.addOutput(ret, 0);
|
|
157
|
+
}
|
|
158
|
+
const unsignedHex = txBuilder.buildIncomplete().toHex();
|
|
159
|
+
const splitTxRes = await transport.call("Btc", "splitTransaction", unsignedHex);
|
|
160
|
+
handleError(splitTxRes, transport, "splitTransaction failed");
|
|
161
|
+
const outputScriptRes = await transport.call("Btc", "serializeTransactionOutputs", splitTxRes.payload);
|
|
162
|
+
handleError(outputScriptRes, transport, "serializeTransactionOutputs failed");
|
|
163
|
+
const outputScriptHex = outputScriptRes.payload.toString("hex");
|
|
164
|
+
for (let i = 0; i < msg.inputs.length; i++) {
|
|
165
|
+
if (msg.inputs[i].scriptType === core.BTCInputScriptType.SpendWitness ||
|
|
166
|
+
msg.inputs[i].scriptType === core.BTCInputScriptType.SpendP2SHWitness)
|
|
167
|
+
segwit = true;
|
|
168
|
+
const keySet = core.addressNListToBIP32(msg.inputs[i].addressNList).replace(/^m\//, "");
|
|
169
|
+
const vout = msg.inputs[i].vout;
|
|
170
|
+
const tx = await transport.call("Btc", "splitTransaction", msg.inputs[i].hex, networksUtil[slip44].isSegwitSupported, networksUtil[slip44].areTransactionTimestamped);
|
|
171
|
+
handleError(tx, transport, "splitTransaction failed");
|
|
172
|
+
indexes.push(vout);
|
|
173
|
+
txs.push(tx.payload);
|
|
174
|
+
associatedKeysets.push(keySet);
|
|
175
|
+
}
|
|
176
|
+
if (txs.length !== indexes.length)
|
|
177
|
+
throw new Error("tx/index array length mismatch");
|
|
178
|
+
const inputs = _.zip(txs, indexes, [], []);
|
|
179
|
+
const txArgs = {
|
|
180
|
+
inputs,
|
|
181
|
+
associatedKeysets,
|
|
182
|
+
outputScriptHex,
|
|
183
|
+
additionals: (() => {
|
|
184
|
+
if (msg.coin === "BitcoinCash")
|
|
185
|
+
return ["abc"];
|
|
186
|
+
if (msg.inputs.some((input) => input.scriptType === core.BTCInputScriptType.SpendWitness))
|
|
187
|
+
return ["bech32"];
|
|
188
|
+
return [];
|
|
189
|
+
})(),
|
|
190
|
+
segwit,
|
|
191
|
+
useTrustedInputForSegwit: Boolean(segwit),
|
|
192
|
+
};
|
|
193
|
+
// "invalid data received" error from Ledger if not done this way:
|
|
194
|
+
if (networksUtil[slip44].sigHash) {
|
|
195
|
+
txArgs.sigHashType = networksUtil[slip44].sigHash;
|
|
196
|
+
}
|
|
197
|
+
const signedTx = await transport.call("Btc", "createPaymentTransaction", txArgs);
|
|
198
|
+
handleError(signedTx, transport, "Could not sign transaction with device");
|
|
199
|
+
return {
|
|
200
|
+
serializedTx: signedTx.payload,
|
|
201
|
+
signatures: [],
|
|
202
|
+
};
|
|
255
203
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
-
return false;
|
|
260
|
-
});
|
|
204
|
+
export async function btcSupportsSecureTransfer() {
|
|
205
|
+
return false;
|
|
261
206
|
}
|
|
262
|
-
|
|
263
|
-
function btcSupportsNativeShapeShift() {
|
|
207
|
+
export function btcSupportsNativeShapeShift() {
|
|
264
208
|
return false;
|
|
265
209
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
coin,
|
|
281
|
-
showDisplay: false,
|
|
282
|
-
scriptType: (_a = msg.scriptType) !== null && _a !== void 0 ? _a : core.BTCInputScriptType.SpendAddress,
|
|
283
|
-
});
|
|
284
|
-
return {
|
|
285
|
-
address,
|
|
286
|
-
signature,
|
|
287
|
-
};
|
|
210
|
+
export async function btcSignMessage(wallet, transport, msg) {
|
|
211
|
+
const bip32path = core.addressNListToBIP32(msg.addressNList);
|
|
212
|
+
const res = await transport.call("Btc", "signMessage", bip32path, Buffer.from(msg.message).toString("hex"));
|
|
213
|
+
handleError(res, transport, "Could not sign message with device");
|
|
214
|
+
const v = res.payload["v"] + 27 + 4;
|
|
215
|
+
const signature = Buffer.from(v.toString(16) + res.payload["r"] + res.payload["s"], "hex").toString("hex");
|
|
216
|
+
const coin = msg.coin;
|
|
217
|
+
if (!coin)
|
|
218
|
+
throw new Error("could not determine type of coin");
|
|
219
|
+
const address = await btcGetAddress(transport, {
|
|
220
|
+
addressNList: msg.addressNList,
|
|
221
|
+
coin,
|
|
222
|
+
showDisplay: false,
|
|
223
|
+
scriptType: msg.scriptType ?? core.BTCInputScriptType.SpendAddress,
|
|
288
224
|
});
|
|
225
|
+
return {
|
|
226
|
+
address,
|
|
227
|
+
signature,
|
|
228
|
+
};
|
|
289
229
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
return
|
|
293
|
-
const signature = base64_js_1.default.fromByteArray(core.fromHexString(msg.signature));
|
|
294
|
-
return bitcoinMsg.verify(msg.message, msg.address, signature);
|
|
295
|
-
});
|
|
230
|
+
export async function btcVerifyMessage(msg) {
|
|
231
|
+
const signature = Base64.fromByteArray(core.fromHexString(msg.signature));
|
|
232
|
+
return bitcoinMsg.verify(msg.message, msg.address, signature);
|
|
296
233
|
}
|
|
297
|
-
|
|
298
|
-
function btcGetAccountPaths(msg) {
|
|
234
|
+
export function btcGetAccountPaths(msg) {
|
|
299
235
|
const slip44 = core.slip44ByCoin(msg.coin);
|
|
300
236
|
if (slip44 === undefined)
|
|
301
237
|
return [];
|
|
@@ -325,11 +261,9 @@ function btcGetAccountPaths(msg) {
|
|
|
325
261
|
});
|
|
326
262
|
return paths;
|
|
327
263
|
}
|
|
328
|
-
exports.btcGetAccountPaths = btcGetAccountPaths;
|
|
329
264
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
330
|
-
function btcIsSameAccount(msg) {
|
|
265
|
+
export function btcIsSameAccount(msg) {
|
|
331
266
|
// TODO: There's no way this is correct.
|
|
332
267
|
return true;
|
|
333
268
|
}
|
|
334
|
-
exports.btcIsSameAccount = btcIsSameAccount;
|
|
335
269
|
//# sourceMappingURL=bitcoin.js.map
|
package/dist/bitcoin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitcoin.js","sourceRoot":"","sources":["../src/bitcoin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitcoin.js","sourceRoot":"","sources":["../src/bitcoin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAErD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE1E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAEhH,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;AAElF,MA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AG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;;QAC7D,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;IAErB,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS;QAC9B,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5B,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU,CAAC;QAC5C,CAAC,CAAC,CAAC;IAEL,OAAO,KAAK,CAAC;AACf,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,gBAAgB,CAAC,GAA+B;IAC9D,wCAAwC;IACxC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/cosmos.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../src/cosmos.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAIrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO9C,eAAO,MAAM,gBAAgB,cAAqB,eAAe,OAAO,
|
|
1
|
+
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../src/cosmos.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAIrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO9C,eAAO,MAAM,gBAAgB,cAAqB,eAAe,OAAO,IAAI,CAAC,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAO7G,CAAC;AAEF,eAAO,MAAM,YAAY,cACZ,eAAe,OACrB,IAAI,CAAC,YAAY,KACrB,OAAO,CAAC,IAAI,CAAC,cAAc,CA2D7B,CAAC"}
|