@ledgerhq/hw-app-btc 6.24.2-monorepo.0 → 6.24.2-monorepo.4
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/.turbo/turbo-build.log +5 -1
- package/CHANGELOG.md +36 -0
- package/lib/Btc.d.ts +149 -0
- package/lib/Btc.d.ts.map +1 -0
- package/lib/Btc.js +357 -0
- package/lib/Btc.js.map +1 -0
- package/lib/BtcNew.d.ts +122 -0
- package/lib/BtcNew.d.ts.map +1 -0
- package/lib/BtcNew.js +451 -0
- package/lib/BtcNew.js.map +1 -0
- package/lib/BtcOld.d.ts +120 -0
- package/lib/BtcOld.d.ts.map +1 -0
- package/lib/BtcOld.js +263 -0
- package/lib/BtcOld.js.map +1 -0
- package/lib/bip32.d.ts +13 -0
- package/lib/bip32.d.ts.map +1 -0
- package/lib/bip32.js +57 -0
- package/lib/bip32.js.map +1 -0
- package/lib/buffertools.d.ts +30 -0
- package/lib/buffertools.d.ts.map +1 -0
- package/lib/buffertools.js +132 -0
- package/lib/buffertools.js.map +1 -0
- package/lib/compressPublicKey.d.ts +3 -0
- package/lib/compressPublicKey.d.ts.map +1 -0
- package/lib/compressPublicKey.js +11 -0
- package/lib/compressPublicKey.js.map +1 -0
- package/lib/constants.d.ts +13 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +17 -0
- package/lib/constants.js.map +1 -0
- package/lib/createTransaction.d.ts +35 -0
- package/lib/createTransaction.d.ts.map +1 -0
- package/lib/createTransaction.js +411 -0
- package/lib/createTransaction.js.map +1 -0
- package/lib/debug.d.ts +4 -0
- package/lib/debug.d.ts.map +1 -0
- package/lib/debug.js +45 -0
- package/lib/debug.js.map +1 -0
- package/lib/finalizeInput.d.ts +5 -0
- package/lib/finalizeInput.d.ts.map +1 -0
- package/lib/finalizeInput.js +81 -0
- package/lib/finalizeInput.js.map +1 -0
- package/lib/getAppAndVersion.d.ts +9 -0
- package/lib/getAppAndVersion.d.ts.map +1 -0
- package/lib/getAppAndVersion.js +69 -0
- package/lib/getAppAndVersion.js.map +1 -0
- package/lib/getTrustedInput.d.ts +6 -0
- package/lib/getTrustedInput.d.ts.map +1 -0
- package/lib/getTrustedInput.js +275 -0
- package/lib/getTrustedInput.js.map +1 -0
- package/lib/getTrustedInputBIP143.d.ts +4 -0
- package/lib/getTrustedInputBIP143.d.ts.map +1 -0
- package/lib/getTrustedInputBIP143.js +34 -0
- package/lib/getTrustedInputBIP143.js.map +1 -0
- package/lib/getWalletPublicKey.d.ts +15 -0
- package/lib/getWalletPublicKey.d.ts.map +1 -0
- package/lib/getWalletPublicKey.js +93 -0
- package/lib/getWalletPublicKey.js.map +1 -0
- package/lib/hashPublicKey.d.ts +3 -0
- package/lib/hashPublicKey.d.ts.map +1 -0
- package/lib/hashPublicKey.js +13 -0
- package/lib/hashPublicKey.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/newops/accounttype.d.ts +110 -0
- package/lib/newops/accounttype.d.ts.map +1 -0
- package/lib/newops/accounttype.js +236 -0
- package/lib/newops/accounttype.js.map +1 -0
- package/lib/newops/appClient.d.ts +18 -0
- package/lib/newops/appClient.d.ts.map +1 -0
- package/lib/newops/appClient.js +243 -0
- package/lib/newops/appClient.js.map +1 -0
- package/lib/newops/clientCommands.d.ts +77 -0
- package/lib/newops/clientCommands.d.ts.map +1 -0
- package/lib/newops/clientCommands.js +353 -0
- package/lib/newops/clientCommands.js.map +1 -0
- package/lib/newops/merkelizedPsbt.d.ts +26 -0
- package/lib/newops/merkelizedPsbt.d.ts.map +1 -0
- package/lib/newops/merkelizedPsbt.js +102 -0
- package/lib/newops/merkelizedPsbt.js.map +1 -0
- package/lib/newops/merkle.d.ts +34 -0
- package/lib/newops/merkle.d.ts.map +1 -0
- package/lib/newops/merkle.js +138 -0
- package/lib/newops/merkle.js.map +1 -0
- package/lib/newops/merkleMap.d.ts +25 -0
- package/lib/newops/merkleMap.d.ts.map +1 -0
- package/lib/newops/merkleMap.js +47 -0
- package/lib/newops/merkleMap.js.map +1 -0
- package/lib/newops/policy.d.ts +22 -0
- package/lib/newops/policy.d.ts.map +1 -0
- package/lib/newops/policy.js +48 -0
- package/lib/newops/policy.js.map +1 -0
- package/lib/newops/psbtExtractor.d.ts +10 -0
- package/lib/newops/psbtExtractor.d.ts.map +1 -0
- package/lib/newops/psbtExtractor.js +42 -0
- package/lib/newops/psbtExtractor.js.map +1 -0
- package/lib/newops/psbtFinalizer.d.ts +17 -0
- package/lib/newops/psbtFinalizer.d.ts.map +1 -0
- package/lib/newops/psbtFinalizer.js +135 -0
- package/lib/newops/psbtFinalizer.js.map +1 -0
- package/lib/newops/psbtv2.d.ts +149 -0
- package/lib/newops/psbtv2.d.ts.map +1 -0
- package/lib/newops/psbtv2.js +506 -0
- package/lib/newops/psbtv2.js.map +1 -0
- package/lib/serializeTransaction.d.ts +10 -0
- package/lib/serializeTransaction.d.ts.map +1 -0
- package/lib/serializeTransaction.js +72 -0
- package/lib/serializeTransaction.js.map +1 -0
- package/lib/shouldUseTrustedInputForSegwit.d.ts +5 -0
- package/lib/shouldUseTrustedInputForSegwit.d.ts.map +1 -0
- package/lib/shouldUseTrustedInputForSegwit.js +17 -0
- package/lib/shouldUseTrustedInputForSegwit.js.map +1 -0
- package/lib/signMessage.d.ts +10 -0
- package/lib/signMessage.d.ts.map +1 -0
- package/lib/signMessage.js +118 -0
- package/lib/signMessage.js.map +1 -0
- package/lib/signP2SHTransaction.d.ts +21 -0
- package/lib/signP2SHTransaction.d.ts.map +1 -0
- package/lib/signP2SHTransaction.js +208 -0
- package/lib/signP2SHTransaction.js.map +1 -0
- package/lib/signTransaction.d.ts +4 -0
- package/lib/signTransaction.d.ts.map +1 -0
- package/lib/signTransaction.js +36 -0
- package/lib/signTransaction.js.map +1 -0
- package/lib/splitTransaction.d.ts +3 -0
- package/lib/splitTransaction.d.ts.map +1 -0
- package/lib/splitTransaction.js +142 -0
- package/lib/splitTransaction.js.map +1 -0
- package/lib/startUntrustedHashTransactionInput.d.ts +9 -0
- package/lib/startUntrustedHashTransactionInput.d.ts.map +1 -0
- package/lib/startUntrustedHashTransactionInput.js +197 -0
- package/lib/startUntrustedHashTransactionInput.js.map +1 -0
- package/lib/types.d.ts +34 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/varint.d.ts +4 -0
- package/lib/varint.d.ts.map +1 -0
- package/lib/varint.js +45 -0
- package/lib/varint.js.map +1 -0
- package/lib-es/Btc.d.ts +149 -0
- package/lib-es/Btc.d.ts.map +1 -0
- package/lib-es/Btc.js +329 -0
- package/lib-es/Btc.js.map +1 -0
- package/lib-es/BtcNew.d.ts +122 -0
- package/lib-es/BtcNew.d.ts.map +1 -0
- package/lib-es/BtcNew.js +444 -0
- package/lib-es/BtcNew.js.map +1 -0
- package/lib-es/BtcOld.d.ts +120 -0
- package/lib-es/BtcOld.d.ts.map +1 -0
- package/lib-es/BtcOld.js +258 -0
- package/lib-es/BtcOld.js.map +1 -0
- package/lib-es/bip32.d.ts +13 -0
- package/lib-es/bip32.d.ts.map +1 -0
- package/lib-es/bip32.js +44 -0
- package/lib-es/bip32.js.map +1 -0
- package/lib-es/buffertools.d.ts +30 -0
- package/lib-es/buffertools.d.ts.map +1 -0
- package/lib-es/buffertools.js +124 -0
- package/lib-es/buffertools.js.map +1 -0
- package/lib-es/compressPublicKey.d.ts +3 -0
- package/lib-es/compressPublicKey.d.ts.map +1 -0
- package/lib-es/compressPublicKey.js +7 -0
- package/lib-es/compressPublicKey.js.map +1 -0
- package/lib-es/constants.d.ts +13 -0
- package/lib-es/constants.d.ts.map +1 -0
- package/lib-es/constants.js +14 -0
- package/lib-es/constants.js.map +1 -0
- package/lib-es/createTransaction.d.ts +35 -0
- package/lib-es/createTransaction.d.ts.map +1 -0
- package/lib-es/createTransaction.js +407 -0
- package/lib-es/createTransaction.js.map +1 -0
- package/lib-es/debug.d.ts +4 -0
- package/lib-es/debug.d.ts.map +1 -0
- package/lib-es/debug.js +40 -0
- package/lib-es/debug.js.map +1 -0
- package/lib-es/finalizeInput.d.ts +5 -0
- package/lib-es/finalizeInput.d.ts.map +1 -0
- package/lib-es/finalizeInput.js +76 -0
- package/lib-es/finalizeInput.js.map +1 -0
- package/lib-es/getAppAndVersion.d.ts +9 -0
- package/lib-es/getAppAndVersion.d.ts.map +1 -0
- package/lib-es/getAppAndVersion.js +62 -0
- package/lib-es/getAppAndVersion.js.map +1 -0
- package/lib-es/getTrustedInput.d.ts +6 -0
- package/lib-es/getTrustedInput.d.ts.map +1 -0
- package/lib-es/getTrustedInput.js +267 -0
- package/lib-es/getTrustedInput.js.map +1 -0
- package/lib-es/getTrustedInputBIP143.d.ts +4 -0
- package/lib-es/getTrustedInputBIP143.d.ts.map +1 -0
- package/lib-es/getTrustedInputBIP143.js +27 -0
- package/lib-es/getTrustedInputBIP143.js.map +1 -0
- package/lib-es/getWalletPublicKey.d.ts +15 -0
- package/lib-es/getWalletPublicKey.d.ts.map +1 -0
- package/lib-es/getWalletPublicKey.js +89 -0
- package/lib-es/getWalletPublicKey.js.map +1 -0
- package/lib-es/hashPublicKey.d.ts +3 -0
- package/lib-es/hashPublicKey.d.ts.map +1 -0
- package/lib-es/hashPublicKey.js +6 -0
- package/lib-es/hashPublicKey.js.map +1 -0
- package/lib-es/index.d.ts +3 -0
- package/lib-es/index.d.ts.map +1 -0
- package/lib-es/index.js +3 -0
- package/lib-es/index.js.map +1 -0
- package/lib-es/newops/accounttype.d.ts +110 -0
- package/lib-es/newops/accounttype.d.ts.map +1 -0
- package/lib-es/newops/accounttype.js +233 -0
- package/lib-es/newops/accounttype.js.map +1 -0
- package/lib-es/newops/appClient.d.ts +18 -0
- package/lib-es/newops/appClient.d.ts.map +1 -0
- package/lib-es/newops/appClient.js +240 -0
- package/lib-es/newops/appClient.js.map +1 -0
- package/lib-es/newops/clientCommands.d.ts +77 -0
- package/lib-es/newops/clientCommands.d.ts.map +1 -0
- package/lib-es/newops/clientCommands.js +350 -0
- package/lib-es/newops/clientCommands.js.map +1 -0
- package/lib-es/newops/merkelizedPsbt.d.ts +26 -0
- package/lib-es/newops/merkelizedPsbt.d.ts.map +1 -0
- package/lib-es/newops/merkelizedPsbt.js +99 -0
- package/lib-es/newops/merkelizedPsbt.js.map +1 -0
- package/lib-es/newops/merkle.d.ts +34 -0
- package/lib-es/newops/merkle.d.ts.map +1 -0
- package/lib-es/newops/merkle.js +134 -0
- package/lib-es/newops/merkle.js.map +1 -0
- package/lib-es/newops/merkleMap.d.ts +25 -0
- package/lib-es/newops/merkleMap.d.ts.map +1 -0
- package/lib-es/newops/merkleMap.js +44 -0
- package/lib-es/newops/merkleMap.js.map +1 -0
- package/lib-es/newops/policy.d.ts +22 -0
- package/lib-es/newops/policy.d.ts.map +1 -0
- package/lib-es/newops/policy.js +44 -0
- package/lib-es/newops/policy.js.map +1 -0
- package/lib-es/newops/psbtExtractor.d.ts +10 -0
- package/lib-es/newops/psbtExtractor.d.ts.map +1 -0
- package/lib-es/newops/psbtExtractor.js +38 -0
- package/lib-es/newops/psbtExtractor.js.map +1 -0
- package/lib-es/newops/psbtFinalizer.d.ts +17 -0
- package/lib-es/newops/psbtFinalizer.d.ts.map +1 -0
- package/lib-es/newops/psbtFinalizer.js +131 -0
- package/lib-es/newops/psbtFinalizer.js.map +1 -0
- package/lib-es/newops/psbtv2.d.ts +149 -0
- package/lib-es/newops/psbtv2.d.ts.map +1 -0
- package/lib-es/newops/psbtv2.js +503 -0
- package/lib-es/newops/psbtv2.js.map +1 -0
- package/lib-es/serializeTransaction.d.ts +10 -0
- package/lib-es/serializeTransaction.d.ts.map +1 -0
- package/lib-es/serializeTransaction.js +67 -0
- package/lib-es/serializeTransaction.js.map +1 -0
- package/lib-es/shouldUseTrustedInputForSegwit.d.ts +5 -0
- package/lib-es/shouldUseTrustedInputForSegwit.d.ts.map +1 -0
- package/lib-es/shouldUseTrustedInputForSegwit.js +10 -0
- package/lib-es/shouldUseTrustedInputForSegwit.js.map +1 -0
- package/lib-es/signMessage.d.ts +10 -0
- package/lib-es/signMessage.d.ts.map +1 -0
- package/lib-es/signMessage.js +111 -0
- package/lib-es/signMessage.js.map +1 -0
- package/lib-es/signP2SHTransaction.d.ts +21 -0
- package/lib-es/signP2SHTransaction.d.ts.map +1 -0
- package/lib-es/signP2SHTransaction.js +204 -0
- package/lib-es/signP2SHTransaction.js.map +1 -0
- package/lib-es/signTransaction.d.ts +4 -0
- package/lib-es/signTransaction.d.ts.map +1 -0
- package/lib-es/signTransaction.js +32 -0
- package/lib-es/signTransaction.js.map +1 -0
- package/lib-es/splitTransaction.d.ts +3 -0
- package/lib-es/splitTransaction.d.ts.map +1 -0
- package/lib-es/splitTransaction.js +138 -0
- package/lib-es/splitTransaction.js.map +1 -0
- package/lib-es/startUntrustedHashTransactionInput.d.ts +9 -0
- package/lib-es/startUntrustedHashTransactionInput.d.ts.map +1 -0
- package/lib-es/startUntrustedHashTransactionInput.js +192 -0
- package/lib-es/startUntrustedHashTransactionInput.js.map +1 -0
- package/lib-es/types.d.ts +34 -0
- package/lib-es/types.d.ts.map +1 -0
- package/lib-es/types.js +2 -0
- package/lib-es/types.js.map +1 -0
- package/lib-es/varint.d.ts +4 -0
- package/lib-es/varint.d.ts.map +1 -0
- package/lib-es/varint.js +40 -0
- package/lib-es/varint.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import invariant from "invariant";
|
|
38
|
+
export var getAppAndVersion = function (transport) { return __awaiter(void 0, void 0, void 0, function () {
|
|
39
|
+
var r, i, format, nameLength, name, versionLength, version, flagLength, flags;
|
|
40
|
+
return __generator(this, function (_a) {
|
|
41
|
+
switch (_a.label) {
|
|
42
|
+
case 0: return [4 /*yield*/, transport.send(0xb0, 0x01, 0x00, 0x00)];
|
|
43
|
+
case 1:
|
|
44
|
+
r = _a.sent();
|
|
45
|
+
i = 0;
|
|
46
|
+
format = r[i++];
|
|
47
|
+
invariant(format === 1, "getAppAndVersion: format not supported");
|
|
48
|
+
nameLength = r[i++];
|
|
49
|
+
name = r.slice(i, (i += nameLength)).toString("ascii");
|
|
50
|
+
versionLength = r[i++];
|
|
51
|
+
version = r.slice(i, (i += versionLength)).toString("ascii");
|
|
52
|
+
flagLength = r[i++];
|
|
53
|
+
flags = r.slice(i, (i += flagLength));
|
|
54
|
+
return [2 /*return*/, {
|
|
55
|
+
name: name,
|
|
56
|
+
version: version,
|
|
57
|
+
flags: flags
|
|
58
|
+
}];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}); };
|
|
62
|
+
//# sourceMappingURL=getAppAndVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAppAndVersion.js","sourceRoot":"","sources":["../src/getAppAndVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AASlC,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAC9B,SAAoB;;;;oBAEV,qBAAM,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAA;;gBAAhD,CAAC,GAAG,SAA4C;gBAClD,CAAC,GAAG,CAAC,CAAC;gBACJ,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBACtB,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,wCAAwC,CAAC,CAAC;gBAC5D,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBACpB,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACvD,aAAa,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBACvB,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBAC7D,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBACpB,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;gBAC5C,sBAAO;wBACL,IAAI,MAAA;wBACJ,OAAO,SAAA;wBACP,KAAK,OAAA;qBACN,EAAC;;;KACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type Transport from "@ledgerhq/hw-transport";
|
|
3
|
+
import type { Transaction } from "./types";
|
|
4
|
+
export declare function getTrustedInputRaw(transport: Transport, transactionData: Buffer, indexLookup?: number | null | undefined): Promise<string>;
|
|
5
|
+
export declare function getTrustedInput(transport: Transport, indexLookup: number, transaction: Transaction, additionals?: Array<string>): Promise<string>;
|
|
6
|
+
//# sourceMappingURL=getTrustedInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTrustedInput.d.ts","sourceRoot":"","sources":["../src/getTrustedInput.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACtC,OAAO,CAAC,MAAM,CAAC,CAsBjB;AACD,wBAAsB,eAAe,CACnC,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,WAAW,EACxB,WAAW,GAAE,KAAK,CAAC,MAAM,CAAM,GAC9B,OAAO,CAAC,MAAM,CAAC,CA0HjB"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var __values = (this && this.__values) || function(o) {
|
|
38
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
39
|
+
if (m) return m.call(o);
|
|
40
|
+
if (o && typeof o.length === "number") return {
|
|
41
|
+
next: function () {
|
|
42
|
+
if (o && i >= o.length) o = void 0;
|
|
43
|
+
return { value: o && o[i++], done: !o };
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
47
|
+
};
|
|
48
|
+
import invariant from "invariant";
|
|
49
|
+
import { MAX_SCRIPT_BLOCK } from "./constants";
|
|
50
|
+
import { createVarint } from "./varint";
|
|
51
|
+
export function getTrustedInputRaw(transport, transactionData, indexLookup) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
+
var data, firstRound, prefix, trustedInput, res;
|
|
54
|
+
return __generator(this, function (_a) {
|
|
55
|
+
switch (_a.label) {
|
|
56
|
+
case 0:
|
|
57
|
+
firstRound = false;
|
|
58
|
+
if (typeof indexLookup === "number") {
|
|
59
|
+
firstRound = true;
|
|
60
|
+
prefix = Buffer.alloc(4);
|
|
61
|
+
prefix.writeUInt32BE(indexLookup, 0);
|
|
62
|
+
data = Buffer.concat([prefix, transactionData], transactionData.length + 4);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
data = transactionData;
|
|
66
|
+
}
|
|
67
|
+
return [4 /*yield*/, transport.send(0xe0, 0x42, firstRound ? 0x00 : 0x80, 0x00, data)];
|
|
68
|
+
case 1:
|
|
69
|
+
trustedInput = _a.sent();
|
|
70
|
+
res = trustedInput.slice(0, trustedInput.length - 2).toString("hex");
|
|
71
|
+
return [2 /*return*/, res];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export function getTrustedInput(transport, indexLookup, transaction, additionals) {
|
|
77
|
+
if (additionals === void 0) { additionals = []; }
|
|
78
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
+
var version, inputs, outputs, locktime, nExpiryHeight, extraData, isDecred, isXST, processScriptBlocks, processWholeScriptBlock, inputs_1, inputs_1_1, input, isXSTV2, treeField, data, e_1_1, outputs_1, outputs_1_1, output, data, e_2_1, endData, extraPart, data, res;
|
|
80
|
+
var e_1, _a, e_2, _b;
|
|
81
|
+
var _this = this;
|
|
82
|
+
return __generator(this, function (_c) {
|
|
83
|
+
switch (_c.label) {
|
|
84
|
+
case 0:
|
|
85
|
+
version = transaction.version, inputs = transaction.inputs, outputs = transaction.outputs, locktime = transaction.locktime, nExpiryHeight = transaction.nExpiryHeight, extraData = transaction.extraData;
|
|
86
|
+
if (!outputs || !locktime) {
|
|
87
|
+
throw new Error("getTrustedInput: locktime & outputs is expected");
|
|
88
|
+
}
|
|
89
|
+
isDecred = additionals.includes("decred");
|
|
90
|
+
isXST = additionals.includes("stealthcoin");
|
|
91
|
+
processScriptBlocks = function (script, sequence) { return __awaiter(_this, void 0, void 0, function () {
|
|
92
|
+
var seq, scriptBlocks, offset, blockSize, res, scriptBlocks_1, scriptBlocks_1_1, scriptBlock, e_3_1;
|
|
93
|
+
var e_3, _a;
|
|
94
|
+
return __generator(this, function (_b) {
|
|
95
|
+
switch (_b.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
seq = sequence || Buffer.alloc(0);
|
|
98
|
+
scriptBlocks = [];
|
|
99
|
+
offset = 0;
|
|
100
|
+
while (offset !== script.length) {
|
|
101
|
+
blockSize = script.length - offset > MAX_SCRIPT_BLOCK
|
|
102
|
+
? MAX_SCRIPT_BLOCK
|
|
103
|
+
: script.length - offset;
|
|
104
|
+
if (offset + blockSize !== script.length) {
|
|
105
|
+
scriptBlocks.push(script.slice(offset, offset + blockSize));
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
scriptBlocks.push(Buffer.concat([script.slice(offset, offset + blockSize), seq]));
|
|
109
|
+
}
|
|
110
|
+
offset += blockSize;
|
|
111
|
+
}
|
|
112
|
+
// Handle case when no script length: we still want to pass the sequence
|
|
113
|
+
// relatable: https://github.com/LedgerHQ/ledger-live-desktop/issues/1386
|
|
114
|
+
if (script.length === 0) {
|
|
115
|
+
scriptBlocks.push(seq);
|
|
116
|
+
}
|
|
117
|
+
_b.label = 1;
|
|
118
|
+
case 1:
|
|
119
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
120
|
+
scriptBlocks_1 = __values(scriptBlocks), scriptBlocks_1_1 = scriptBlocks_1.next();
|
|
121
|
+
_b.label = 2;
|
|
122
|
+
case 2:
|
|
123
|
+
if (!!scriptBlocks_1_1.done) return [3 /*break*/, 5];
|
|
124
|
+
scriptBlock = scriptBlocks_1_1.value;
|
|
125
|
+
return [4 /*yield*/, getTrustedInputRaw(transport, scriptBlock)];
|
|
126
|
+
case 3:
|
|
127
|
+
res = _b.sent();
|
|
128
|
+
_b.label = 4;
|
|
129
|
+
case 4:
|
|
130
|
+
scriptBlocks_1_1 = scriptBlocks_1.next();
|
|
131
|
+
return [3 /*break*/, 2];
|
|
132
|
+
case 5: return [3 /*break*/, 8];
|
|
133
|
+
case 6:
|
|
134
|
+
e_3_1 = _b.sent();
|
|
135
|
+
e_3 = { error: e_3_1 };
|
|
136
|
+
return [3 /*break*/, 8];
|
|
137
|
+
case 7:
|
|
138
|
+
try {
|
|
139
|
+
if (scriptBlocks_1_1 && !scriptBlocks_1_1.done && (_a = scriptBlocks_1["return"])) _a.call(scriptBlocks_1);
|
|
140
|
+
}
|
|
141
|
+
finally { if (e_3) throw e_3.error; }
|
|
142
|
+
return [7 /*endfinally*/];
|
|
143
|
+
case 8: return [2 /*return*/, res];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}); };
|
|
147
|
+
processWholeScriptBlock = function (block) {
|
|
148
|
+
return getTrustedInputRaw(transport, block);
|
|
149
|
+
};
|
|
150
|
+
return [4 /*yield*/, getTrustedInputRaw(transport, Buffer.concat([
|
|
151
|
+
transaction.version,
|
|
152
|
+
transaction.timestamp || Buffer.alloc(0),
|
|
153
|
+
transaction.nVersionGroupId || Buffer.alloc(0),
|
|
154
|
+
createVarint(inputs.length),
|
|
155
|
+
]), indexLookup)];
|
|
156
|
+
case 1:
|
|
157
|
+
_c.sent();
|
|
158
|
+
_c.label = 2;
|
|
159
|
+
case 2:
|
|
160
|
+
_c.trys.push([2, 8, 9, 10]);
|
|
161
|
+
inputs_1 = __values(inputs), inputs_1_1 = inputs_1.next();
|
|
162
|
+
_c.label = 3;
|
|
163
|
+
case 3:
|
|
164
|
+
if (!!inputs_1_1.done) return [3 /*break*/, 7];
|
|
165
|
+
input = inputs_1_1.value;
|
|
166
|
+
isXSTV2 = isXST &&
|
|
167
|
+
Buffer.compare(version, Buffer.from([0x02, 0x00, 0x00, 0x00])) === 0;
|
|
168
|
+
treeField = isDecred
|
|
169
|
+
? input.tree || Buffer.from([0x00])
|
|
170
|
+
: Buffer.alloc(0);
|
|
171
|
+
data = Buffer.concat([
|
|
172
|
+
input.prevout,
|
|
173
|
+
treeField,
|
|
174
|
+
isXSTV2 ? Buffer.from([0x00]) : createVarint(input.script.length),
|
|
175
|
+
]);
|
|
176
|
+
return [4 /*yield*/, getTrustedInputRaw(transport, data)];
|
|
177
|
+
case 4:
|
|
178
|
+
_c.sent();
|
|
179
|
+
// iteration (eachSeries) ended
|
|
180
|
+
// TODO notify progress
|
|
181
|
+
// deferred.notify("input");
|
|
182
|
+
// Reference: https://github.com/StealthSend/Stealth/commit/5be35d6c2c500b32ed82e5d6913d66d18a4b0a7f#diff-e8db9b851adc2422aadfffca88f14c91R566
|
|
183
|
+
return [4 /*yield*/, (isDecred
|
|
184
|
+
? processWholeScriptBlock(Buffer.concat([input.script, input.sequence]))
|
|
185
|
+
: isXSTV2
|
|
186
|
+
? processWholeScriptBlock(input.sequence)
|
|
187
|
+
: processScriptBlocks(input.script, input.sequence))];
|
|
188
|
+
case 5:
|
|
189
|
+
// iteration (eachSeries) ended
|
|
190
|
+
// TODO notify progress
|
|
191
|
+
// deferred.notify("input");
|
|
192
|
+
// Reference: https://github.com/StealthSend/Stealth/commit/5be35d6c2c500b32ed82e5d6913d66d18a4b0a7f#diff-e8db9b851adc2422aadfffca88f14c91R566
|
|
193
|
+
_c.sent();
|
|
194
|
+
_c.label = 6;
|
|
195
|
+
case 6:
|
|
196
|
+
inputs_1_1 = inputs_1.next();
|
|
197
|
+
return [3 /*break*/, 3];
|
|
198
|
+
case 7: return [3 /*break*/, 10];
|
|
199
|
+
case 8:
|
|
200
|
+
e_1_1 = _c.sent();
|
|
201
|
+
e_1 = { error: e_1_1 };
|
|
202
|
+
return [3 /*break*/, 10];
|
|
203
|
+
case 9:
|
|
204
|
+
try {
|
|
205
|
+
if (inputs_1_1 && !inputs_1_1.done && (_a = inputs_1["return"])) _a.call(inputs_1);
|
|
206
|
+
}
|
|
207
|
+
finally { if (e_1) throw e_1.error; }
|
|
208
|
+
return [7 /*endfinally*/];
|
|
209
|
+
case 10: return [4 /*yield*/, getTrustedInputRaw(transport, createVarint(outputs.length))];
|
|
210
|
+
case 11:
|
|
211
|
+
_c.sent();
|
|
212
|
+
_c.label = 12;
|
|
213
|
+
case 12:
|
|
214
|
+
_c.trys.push([12, 17, 18, 19]);
|
|
215
|
+
outputs_1 = __values(outputs), outputs_1_1 = outputs_1.next();
|
|
216
|
+
_c.label = 13;
|
|
217
|
+
case 13:
|
|
218
|
+
if (!!outputs_1_1.done) return [3 /*break*/, 16];
|
|
219
|
+
output = outputs_1_1.value;
|
|
220
|
+
data = Buffer.concat([
|
|
221
|
+
output.amount,
|
|
222
|
+
isDecred ? Buffer.from([0x00, 0x00]) : Buffer.alloc(0),
|
|
223
|
+
createVarint(output.script.length),
|
|
224
|
+
output.script,
|
|
225
|
+
]);
|
|
226
|
+
return [4 /*yield*/, getTrustedInputRaw(transport, data)];
|
|
227
|
+
case 14:
|
|
228
|
+
_c.sent();
|
|
229
|
+
_c.label = 15;
|
|
230
|
+
case 15:
|
|
231
|
+
outputs_1_1 = outputs_1.next();
|
|
232
|
+
return [3 /*break*/, 13];
|
|
233
|
+
case 16: return [3 /*break*/, 19];
|
|
234
|
+
case 17:
|
|
235
|
+
e_2_1 = _c.sent();
|
|
236
|
+
e_2 = { error: e_2_1 };
|
|
237
|
+
return [3 /*break*/, 19];
|
|
238
|
+
case 18:
|
|
239
|
+
try {
|
|
240
|
+
if (outputs_1_1 && !outputs_1_1.done && (_b = outputs_1["return"])) _b.call(outputs_1);
|
|
241
|
+
}
|
|
242
|
+
finally { if (e_2) throw e_2.error; }
|
|
243
|
+
return [7 /*endfinally*/];
|
|
244
|
+
case 19:
|
|
245
|
+
endData = [];
|
|
246
|
+
if (nExpiryHeight && nExpiryHeight.length > 0) {
|
|
247
|
+
endData.push(nExpiryHeight);
|
|
248
|
+
}
|
|
249
|
+
if (extraData && extraData.length > 0) {
|
|
250
|
+
endData.push(extraData);
|
|
251
|
+
}
|
|
252
|
+
if (endData.length) {
|
|
253
|
+
data = Buffer.concat(endData);
|
|
254
|
+
extraPart = isDecred
|
|
255
|
+
? data
|
|
256
|
+
: Buffer.concat([createVarint(data.length), data]);
|
|
257
|
+
}
|
|
258
|
+
return [4 /*yield*/, processScriptBlocks(Buffer.concat([locktime, extraPart || Buffer.alloc(0)]))];
|
|
259
|
+
case 20:
|
|
260
|
+
res = _c.sent();
|
|
261
|
+
invariant(res, "missing result in processScriptBlocks");
|
|
262
|
+
return [2 /*return*/, res];
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
//# sourceMappingURL=getTrustedInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTrustedInput.js","sourceRoot":"","sources":["../src/getTrustedInput.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAGlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,MAAM,UAAgB,kBAAkB,CACtC,SAAoB,EACpB,eAAuB,EACvB,WAAuC;;;;;;oBAGnC,UAAU,GAAG,KAAK,CAAC;oBAEvB,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;wBACnC,UAAU,GAAG,IAAI,CAAC;wBACZ,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;wBAC/B,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;wBACrC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,M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B,CACnC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CACxD,EAAA;;oBAFK,GAAG,GAAG,SAEX;oBACD,SAAS,CAAC,GAAG,EAAE,uCAAuC,CAAC,CAAC;oBACxD,sBAAO,GAAG,EAAC;;;;CACZ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Transport from "@ledgerhq/hw-transport";
|
|
2
|
+
import type { Transaction } from "./types";
|
|
3
|
+
export declare function getTrustedInputBIP143(transport: Transport, indexLookup: number, transaction: Transaction, additionals?: Array<string>): string;
|
|
4
|
+
//# sourceMappingURL=getTrustedInputBIP143.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTrustedInputBIP143.d.ts","sourceRoot":"","sources":["../src/getTrustedInputBIP143.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,WAAW,EACxB,WAAW,GAAE,KAAK,CAAC,MAAM,CAAM,GAC9B,MAAM,CA8BR"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import shajs from "sha.js";
|
|
2
|
+
import { serializeTransaction } from "./serializeTransaction";
|
|
3
|
+
export function getTrustedInputBIP143(transport, indexLookup, transaction, additionals) {
|
|
4
|
+
if (additionals === void 0) { additionals = []; }
|
|
5
|
+
if (!transaction) {
|
|
6
|
+
throw new Error("getTrustedInputBIP143: missing tx");
|
|
7
|
+
}
|
|
8
|
+
var isDecred = additionals.includes("decred");
|
|
9
|
+
if (isDecred) {
|
|
10
|
+
throw new Error("Decred does not implement BIP143");
|
|
11
|
+
}
|
|
12
|
+
var hash = shajs("sha256")
|
|
13
|
+
.update(shajs("sha256").update(serializeTransaction(transaction, true)).digest())
|
|
14
|
+
.digest();
|
|
15
|
+
var data = Buffer.alloc(4);
|
|
16
|
+
data.writeUInt32LE(indexLookup, 0);
|
|
17
|
+
var outputs = transaction.outputs, locktime = transaction.locktime;
|
|
18
|
+
if (!outputs || !locktime) {
|
|
19
|
+
throw new Error("getTrustedInputBIP143: locktime & outputs is expected");
|
|
20
|
+
}
|
|
21
|
+
if (!outputs[indexLookup]) {
|
|
22
|
+
throw new Error("getTrustedInputBIP143: wrong index");
|
|
23
|
+
}
|
|
24
|
+
hash = Buffer.concat([hash, data, outputs[indexLookup].amount]);
|
|
25
|
+
return hash.toString("hex");
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=getTrustedInputBIP143.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTrustedInputBIP143.js","sourceRoot":"","sources":["../src/getTrustedInputBIP143.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,MAAM,UAAU,qBAAqB,CACnC,SAAoB,EACpB,WAAmB,EACnB,WAAwB,EACxB,WAA+B;IAA/B,4BAAA,EAAA,gBAA+B;IAE/B,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACtD;IAED,IAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEhD,IAAI,QAAQ,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;KACrD;IAED,IAAI,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC;SACvB,MAAM,CACL,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CACzE;SACA,MAAM,EAAE,CAAC;IACZ,IAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAC3B,IAAA,OAAO,GAAe,WAAW,QAA1B,EAAE,QAAQ,GAAK,WAAW,SAAhB,CAAiB;IAE1C,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;KAC1E;IAED,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACvD;IAED,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type Transport from "@ledgerhq/hw-transport";
|
|
2
|
+
/**
|
|
3
|
+
* address format is one of legacy | p2sh | bech32 | cashaddr
|
|
4
|
+
*/
|
|
5
|
+
export declare type AddressFormat = "legacy" | "p2sh" | "bech32" | "bech32m" | "cashaddr";
|
|
6
|
+
export declare function getWalletPublicKey(transport: Transport, options: {
|
|
7
|
+
path: string;
|
|
8
|
+
verify?: boolean;
|
|
9
|
+
format?: AddressFormat;
|
|
10
|
+
}): Promise<{
|
|
11
|
+
publicKey: string;
|
|
12
|
+
bitcoinAddress: string;
|
|
13
|
+
chainCode: string;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=getWalletPublicKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWalletPublicKey.d.ts","sourceRoot":"","sources":["../src/getWalletPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AAGpD;;GAEG;AACH,oBAAY,aAAa,GACrB,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,SAAS,GACT,UAAU,CAAC;AAOf,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GACA,OAAO,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC,CAgCD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { bip32asBuffer } from "./bip32";
|
|
49
|
+
var addressFormatMap = {
|
|
50
|
+
legacy: 0,
|
|
51
|
+
p2sh: 1,
|
|
52
|
+
bech32: 2,
|
|
53
|
+
cashaddr: 3
|
|
54
|
+
};
|
|
55
|
+
export function getWalletPublicKey(transport, options) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
var _a, path, verify, format, buffer, p1, p2, response, publicKeyLength, addressLength, publicKey, bitcoinAddress, chainCode;
|
|
58
|
+
return __generator(this, function (_b) {
|
|
59
|
+
switch (_b.label) {
|
|
60
|
+
case 0:
|
|
61
|
+
_a = __assign({ verify: false, format: "legacy" }, options), path = _a.path, verify = _a.verify, format = _a.format;
|
|
62
|
+
if (!(format in addressFormatMap)) {
|
|
63
|
+
throw new Error("btc.getWalletPublicKey invalid format=" + format);
|
|
64
|
+
}
|
|
65
|
+
buffer = bip32asBuffer(path);
|
|
66
|
+
p1 = verify ? 1 : 0;
|
|
67
|
+
p2 = addressFormatMap[format];
|
|
68
|
+
return [4 /*yield*/, transport.send(0xe0, 0x40, p1, p2, buffer)];
|
|
69
|
+
case 1:
|
|
70
|
+
response = _b.sent();
|
|
71
|
+
publicKeyLength = response[0];
|
|
72
|
+
addressLength = response[1 + publicKeyLength];
|
|
73
|
+
publicKey = response.slice(1, 1 + publicKeyLength).toString("hex");
|
|
74
|
+
bitcoinAddress = response
|
|
75
|
+
.slice(1 + publicKeyLength + 1, 1 + publicKeyLength + 1 + addressLength)
|
|
76
|
+
.toString("ascii");
|
|
77
|
+
chainCode = response
|
|
78
|
+
.slice(1 + publicKeyLength + 1 + addressLength, 1 + publicKeyLength + 1 + addressLength + 32)
|
|
79
|
+
.toString("hex");
|
|
80
|
+
return [2 /*return*/, {
|
|
81
|
+
publicKey: publicKey,
|
|
82
|
+
bitcoinAddress: bitcoinAddress,
|
|
83
|
+
chainCode: chainCode
|
|
84
|
+
}];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=getWalletPublicKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,GAAG,eAAe,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,GAAG,CAAC,GAAG,aAAa,CAAC;yBACvE,QAAQ,CAAC,OAAO,CAAC,CAAC;oBACf,SAAS,GAAG,QAAQ;yBACvB,KAAK,CACJ,CAAC,GAAG,eAAe,GAAG,CAAC,GAAG,aAAa,EACvC,CAAC,GAAG,eAAe,GAAG,CAAC,GAAG,aAAa,GAAG,EAAE,CAC7C;yBACA,QAAQ,CAAC,KAAK,CAAC,CAAC;oBACnB,sBAAO;4BACL,SAAS,WAAA;4BACT,cAAc,gBAAA;4BACd,SAAS,WAAA;yBACV,EAAC;;;;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashPublicKey.d.ts","sourceRoot":"","sources":["../src/hashPublicKey.ts"],"names":[],"mappings":";AAEA,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashPublicKey.js","sourceRoot":"","sources":["../src/hashPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,IAAI,SAAS,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,eAAe,GAAG,CAAC"}
|
package/lib-es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,eAAe,GAAG,CAAC"}
|