@ledgerhq/hw-app-btc 6.24.2-monorepo.0 → 6.24.2-monorepo.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.
Files changed (283) hide show
  1. package/.turbo/turbo-build.log +5 -1
  2. package/CHANGELOG.md +9 -0
  3. package/lib/Btc.d.ts +149 -0
  4. package/lib/Btc.d.ts.map +1 -0
  5. package/lib/Btc.js +357 -0
  6. package/lib/Btc.js.map +1 -0
  7. package/lib/BtcNew.d.ts +122 -0
  8. package/lib/BtcNew.d.ts.map +1 -0
  9. package/lib/BtcNew.js +451 -0
  10. package/lib/BtcNew.js.map +1 -0
  11. package/lib/BtcOld.d.ts +120 -0
  12. package/lib/BtcOld.d.ts.map +1 -0
  13. package/lib/BtcOld.js +263 -0
  14. package/lib/BtcOld.js.map +1 -0
  15. package/lib/bip32.d.ts +13 -0
  16. package/lib/bip32.d.ts.map +1 -0
  17. package/lib/bip32.js +57 -0
  18. package/lib/bip32.js.map +1 -0
  19. package/lib/buffertools.d.ts +30 -0
  20. package/lib/buffertools.d.ts.map +1 -0
  21. package/lib/buffertools.js +132 -0
  22. package/lib/buffertools.js.map +1 -0
  23. package/lib/compressPublicKey.d.ts +3 -0
  24. package/lib/compressPublicKey.d.ts.map +1 -0
  25. package/lib/compressPublicKey.js +11 -0
  26. package/lib/compressPublicKey.js.map +1 -0
  27. package/lib/constants.d.ts +13 -0
  28. package/lib/constants.d.ts.map +1 -0
  29. package/lib/constants.js +17 -0
  30. package/lib/constants.js.map +1 -0
  31. package/lib/createTransaction.d.ts +35 -0
  32. package/lib/createTransaction.d.ts.map +1 -0
  33. package/lib/createTransaction.js +411 -0
  34. package/lib/createTransaction.js.map +1 -0
  35. package/lib/debug.d.ts +4 -0
  36. package/lib/debug.d.ts.map +1 -0
  37. package/lib/debug.js +45 -0
  38. package/lib/debug.js.map +1 -0
  39. package/lib/finalizeInput.d.ts +5 -0
  40. package/lib/finalizeInput.d.ts.map +1 -0
  41. package/lib/finalizeInput.js +81 -0
  42. package/lib/finalizeInput.js.map +1 -0
  43. package/lib/getAppAndVersion.d.ts +9 -0
  44. package/lib/getAppAndVersion.d.ts.map +1 -0
  45. package/lib/getAppAndVersion.js +69 -0
  46. package/lib/getAppAndVersion.js.map +1 -0
  47. package/lib/getTrustedInput.d.ts +6 -0
  48. package/lib/getTrustedInput.d.ts.map +1 -0
  49. package/lib/getTrustedInput.js +275 -0
  50. package/lib/getTrustedInput.js.map +1 -0
  51. package/lib/getTrustedInputBIP143.d.ts +4 -0
  52. package/lib/getTrustedInputBIP143.d.ts.map +1 -0
  53. package/lib/getTrustedInputBIP143.js +34 -0
  54. package/lib/getTrustedInputBIP143.js.map +1 -0
  55. package/lib/getWalletPublicKey.d.ts +15 -0
  56. package/lib/getWalletPublicKey.d.ts.map +1 -0
  57. package/lib/getWalletPublicKey.js +93 -0
  58. package/lib/getWalletPublicKey.js.map +1 -0
  59. package/lib/hashPublicKey.d.ts +3 -0
  60. package/lib/hashPublicKey.d.ts.map +1 -0
  61. package/lib/hashPublicKey.js +13 -0
  62. package/lib/hashPublicKey.js.map +1 -0
  63. package/lib/index.d.ts +3 -0
  64. package/lib/index.d.ts.map +1 -0
  65. package/lib/index.js +8 -0
  66. package/lib/index.js.map +1 -0
  67. package/lib/newops/accounttype.d.ts +110 -0
  68. package/lib/newops/accounttype.d.ts.map +1 -0
  69. package/lib/newops/accounttype.js +236 -0
  70. package/lib/newops/accounttype.js.map +1 -0
  71. package/lib/newops/appClient.d.ts +18 -0
  72. package/lib/newops/appClient.d.ts.map +1 -0
  73. package/lib/newops/appClient.js +243 -0
  74. package/lib/newops/appClient.js.map +1 -0
  75. package/lib/newops/clientCommands.d.ts +77 -0
  76. package/lib/newops/clientCommands.d.ts.map +1 -0
  77. package/lib/newops/clientCommands.js +353 -0
  78. package/lib/newops/clientCommands.js.map +1 -0
  79. package/lib/newops/merkelizedPsbt.d.ts +26 -0
  80. package/lib/newops/merkelizedPsbt.d.ts.map +1 -0
  81. package/lib/newops/merkelizedPsbt.js +102 -0
  82. package/lib/newops/merkelizedPsbt.js.map +1 -0
  83. package/lib/newops/merkle.d.ts +34 -0
  84. package/lib/newops/merkle.d.ts.map +1 -0
  85. package/lib/newops/merkle.js +138 -0
  86. package/lib/newops/merkle.js.map +1 -0
  87. package/lib/newops/merkleMap.d.ts +25 -0
  88. package/lib/newops/merkleMap.d.ts.map +1 -0
  89. package/lib/newops/merkleMap.js +47 -0
  90. package/lib/newops/merkleMap.js.map +1 -0
  91. package/lib/newops/policy.d.ts +22 -0
  92. package/lib/newops/policy.d.ts.map +1 -0
  93. package/lib/newops/policy.js +48 -0
  94. package/lib/newops/policy.js.map +1 -0
  95. package/lib/newops/psbtExtractor.d.ts +10 -0
  96. package/lib/newops/psbtExtractor.d.ts.map +1 -0
  97. package/lib/newops/psbtExtractor.js +42 -0
  98. package/lib/newops/psbtExtractor.js.map +1 -0
  99. package/lib/newops/psbtFinalizer.d.ts +17 -0
  100. package/lib/newops/psbtFinalizer.d.ts.map +1 -0
  101. package/lib/newops/psbtFinalizer.js +135 -0
  102. package/lib/newops/psbtFinalizer.js.map +1 -0
  103. package/lib/newops/psbtv2.d.ts +149 -0
  104. package/lib/newops/psbtv2.d.ts.map +1 -0
  105. package/lib/newops/psbtv2.js +506 -0
  106. package/lib/newops/psbtv2.js.map +1 -0
  107. package/lib/serializeTransaction.d.ts +10 -0
  108. package/lib/serializeTransaction.d.ts.map +1 -0
  109. package/lib/serializeTransaction.js +72 -0
  110. package/lib/serializeTransaction.js.map +1 -0
  111. package/lib/shouldUseTrustedInputForSegwit.d.ts +5 -0
  112. package/lib/shouldUseTrustedInputForSegwit.d.ts.map +1 -0
  113. package/lib/shouldUseTrustedInputForSegwit.js +17 -0
  114. package/lib/shouldUseTrustedInputForSegwit.js.map +1 -0
  115. package/lib/signMessage.d.ts +10 -0
  116. package/lib/signMessage.d.ts.map +1 -0
  117. package/lib/signMessage.js +118 -0
  118. package/lib/signMessage.js.map +1 -0
  119. package/lib/signP2SHTransaction.d.ts +21 -0
  120. package/lib/signP2SHTransaction.d.ts.map +1 -0
  121. package/lib/signP2SHTransaction.js +208 -0
  122. package/lib/signP2SHTransaction.js.map +1 -0
  123. package/lib/signTransaction.d.ts +4 -0
  124. package/lib/signTransaction.d.ts.map +1 -0
  125. package/lib/signTransaction.js +36 -0
  126. package/lib/signTransaction.js.map +1 -0
  127. package/lib/splitTransaction.d.ts +3 -0
  128. package/lib/splitTransaction.d.ts.map +1 -0
  129. package/lib/splitTransaction.js +142 -0
  130. package/lib/splitTransaction.js.map +1 -0
  131. package/lib/startUntrustedHashTransactionInput.d.ts +9 -0
  132. package/lib/startUntrustedHashTransactionInput.d.ts.map +1 -0
  133. package/lib/startUntrustedHashTransactionInput.js +197 -0
  134. package/lib/startUntrustedHashTransactionInput.js.map +1 -0
  135. package/lib/types.d.ts +34 -0
  136. package/lib/types.d.ts.map +1 -0
  137. package/lib/types.js +3 -0
  138. package/lib/types.js.map +1 -0
  139. package/lib/varint.d.ts +4 -0
  140. package/lib/varint.d.ts.map +1 -0
  141. package/lib/varint.js +45 -0
  142. package/lib/varint.js.map +1 -0
  143. package/lib-es/Btc.d.ts +149 -0
  144. package/lib-es/Btc.d.ts.map +1 -0
  145. package/lib-es/Btc.js +329 -0
  146. package/lib-es/Btc.js.map +1 -0
  147. package/lib-es/BtcNew.d.ts +122 -0
  148. package/lib-es/BtcNew.d.ts.map +1 -0
  149. package/lib-es/BtcNew.js +444 -0
  150. package/lib-es/BtcNew.js.map +1 -0
  151. package/lib-es/BtcOld.d.ts +120 -0
  152. package/lib-es/BtcOld.d.ts.map +1 -0
  153. package/lib-es/BtcOld.js +258 -0
  154. package/lib-es/BtcOld.js.map +1 -0
  155. package/lib-es/bip32.d.ts +13 -0
  156. package/lib-es/bip32.d.ts.map +1 -0
  157. package/lib-es/bip32.js +44 -0
  158. package/lib-es/bip32.js.map +1 -0
  159. package/lib-es/buffertools.d.ts +30 -0
  160. package/lib-es/buffertools.d.ts.map +1 -0
  161. package/lib-es/buffertools.js +124 -0
  162. package/lib-es/buffertools.js.map +1 -0
  163. package/lib-es/compressPublicKey.d.ts +3 -0
  164. package/lib-es/compressPublicKey.d.ts.map +1 -0
  165. package/lib-es/compressPublicKey.js +7 -0
  166. package/lib-es/compressPublicKey.js.map +1 -0
  167. package/lib-es/constants.d.ts +13 -0
  168. package/lib-es/constants.d.ts.map +1 -0
  169. package/lib-es/constants.js +14 -0
  170. package/lib-es/constants.js.map +1 -0
  171. package/lib-es/createTransaction.d.ts +35 -0
  172. package/lib-es/createTransaction.d.ts.map +1 -0
  173. package/lib-es/createTransaction.js +407 -0
  174. package/lib-es/createTransaction.js.map +1 -0
  175. package/lib-es/debug.d.ts +4 -0
  176. package/lib-es/debug.d.ts.map +1 -0
  177. package/lib-es/debug.js +40 -0
  178. package/lib-es/debug.js.map +1 -0
  179. package/lib-es/finalizeInput.d.ts +5 -0
  180. package/lib-es/finalizeInput.d.ts.map +1 -0
  181. package/lib-es/finalizeInput.js +76 -0
  182. package/lib-es/finalizeInput.js.map +1 -0
  183. package/lib-es/getAppAndVersion.d.ts +9 -0
  184. package/lib-es/getAppAndVersion.d.ts.map +1 -0
  185. package/lib-es/getAppAndVersion.js +62 -0
  186. package/lib-es/getAppAndVersion.js.map +1 -0
  187. package/lib-es/getTrustedInput.d.ts +6 -0
  188. package/lib-es/getTrustedInput.d.ts.map +1 -0
  189. package/lib-es/getTrustedInput.js +267 -0
  190. package/lib-es/getTrustedInput.js.map +1 -0
  191. package/lib-es/getTrustedInputBIP143.d.ts +4 -0
  192. package/lib-es/getTrustedInputBIP143.d.ts.map +1 -0
  193. package/lib-es/getTrustedInputBIP143.js +27 -0
  194. package/lib-es/getTrustedInputBIP143.js.map +1 -0
  195. package/lib-es/getWalletPublicKey.d.ts +15 -0
  196. package/lib-es/getWalletPublicKey.d.ts.map +1 -0
  197. package/lib-es/getWalletPublicKey.js +89 -0
  198. package/lib-es/getWalletPublicKey.js.map +1 -0
  199. package/lib-es/hashPublicKey.d.ts +3 -0
  200. package/lib-es/hashPublicKey.d.ts.map +1 -0
  201. package/lib-es/hashPublicKey.js +6 -0
  202. package/lib-es/hashPublicKey.js.map +1 -0
  203. package/lib-es/index.d.ts +3 -0
  204. package/lib-es/index.d.ts.map +1 -0
  205. package/lib-es/index.js +3 -0
  206. package/lib-es/index.js.map +1 -0
  207. package/lib-es/newops/accounttype.d.ts +110 -0
  208. package/lib-es/newops/accounttype.d.ts.map +1 -0
  209. package/lib-es/newops/accounttype.js +233 -0
  210. package/lib-es/newops/accounttype.js.map +1 -0
  211. package/lib-es/newops/appClient.d.ts +18 -0
  212. package/lib-es/newops/appClient.d.ts.map +1 -0
  213. package/lib-es/newops/appClient.js +240 -0
  214. package/lib-es/newops/appClient.js.map +1 -0
  215. package/lib-es/newops/clientCommands.d.ts +77 -0
  216. package/lib-es/newops/clientCommands.d.ts.map +1 -0
  217. package/lib-es/newops/clientCommands.js +350 -0
  218. package/lib-es/newops/clientCommands.js.map +1 -0
  219. package/lib-es/newops/merkelizedPsbt.d.ts +26 -0
  220. package/lib-es/newops/merkelizedPsbt.d.ts.map +1 -0
  221. package/lib-es/newops/merkelizedPsbt.js +99 -0
  222. package/lib-es/newops/merkelizedPsbt.js.map +1 -0
  223. package/lib-es/newops/merkle.d.ts +34 -0
  224. package/lib-es/newops/merkle.d.ts.map +1 -0
  225. package/lib-es/newops/merkle.js +134 -0
  226. package/lib-es/newops/merkle.js.map +1 -0
  227. package/lib-es/newops/merkleMap.d.ts +25 -0
  228. package/lib-es/newops/merkleMap.d.ts.map +1 -0
  229. package/lib-es/newops/merkleMap.js +44 -0
  230. package/lib-es/newops/merkleMap.js.map +1 -0
  231. package/lib-es/newops/policy.d.ts +22 -0
  232. package/lib-es/newops/policy.d.ts.map +1 -0
  233. package/lib-es/newops/policy.js +44 -0
  234. package/lib-es/newops/policy.js.map +1 -0
  235. package/lib-es/newops/psbtExtractor.d.ts +10 -0
  236. package/lib-es/newops/psbtExtractor.d.ts.map +1 -0
  237. package/lib-es/newops/psbtExtractor.js +38 -0
  238. package/lib-es/newops/psbtExtractor.js.map +1 -0
  239. package/lib-es/newops/psbtFinalizer.d.ts +17 -0
  240. package/lib-es/newops/psbtFinalizer.d.ts.map +1 -0
  241. package/lib-es/newops/psbtFinalizer.js +131 -0
  242. package/lib-es/newops/psbtFinalizer.js.map +1 -0
  243. package/lib-es/newops/psbtv2.d.ts +149 -0
  244. package/lib-es/newops/psbtv2.d.ts.map +1 -0
  245. package/lib-es/newops/psbtv2.js +503 -0
  246. package/lib-es/newops/psbtv2.js.map +1 -0
  247. package/lib-es/serializeTransaction.d.ts +10 -0
  248. package/lib-es/serializeTransaction.d.ts.map +1 -0
  249. package/lib-es/serializeTransaction.js +67 -0
  250. package/lib-es/serializeTransaction.js.map +1 -0
  251. package/lib-es/shouldUseTrustedInputForSegwit.d.ts +5 -0
  252. package/lib-es/shouldUseTrustedInputForSegwit.d.ts.map +1 -0
  253. package/lib-es/shouldUseTrustedInputForSegwit.js +10 -0
  254. package/lib-es/shouldUseTrustedInputForSegwit.js.map +1 -0
  255. package/lib-es/signMessage.d.ts +10 -0
  256. package/lib-es/signMessage.d.ts.map +1 -0
  257. package/lib-es/signMessage.js +111 -0
  258. package/lib-es/signMessage.js.map +1 -0
  259. package/lib-es/signP2SHTransaction.d.ts +21 -0
  260. package/lib-es/signP2SHTransaction.d.ts.map +1 -0
  261. package/lib-es/signP2SHTransaction.js +204 -0
  262. package/lib-es/signP2SHTransaction.js.map +1 -0
  263. package/lib-es/signTransaction.d.ts +4 -0
  264. package/lib-es/signTransaction.d.ts.map +1 -0
  265. package/lib-es/signTransaction.js +32 -0
  266. package/lib-es/signTransaction.js.map +1 -0
  267. package/lib-es/splitTransaction.d.ts +3 -0
  268. package/lib-es/splitTransaction.d.ts.map +1 -0
  269. package/lib-es/splitTransaction.js +138 -0
  270. package/lib-es/splitTransaction.js.map +1 -0
  271. package/lib-es/startUntrustedHashTransactionInput.d.ts +9 -0
  272. package/lib-es/startUntrustedHashTransactionInput.d.ts.map +1 -0
  273. package/lib-es/startUntrustedHashTransactionInput.js +192 -0
  274. package/lib-es/startUntrustedHashTransactionInput.js.map +1 -0
  275. package/lib-es/types.d.ts +34 -0
  276. package/lib-es/types.d.ts.map +1 -0
  277. package/lib-es/types.js +2 -0
  278. package/lib-es/types.js.map +1 -0
  279. package/lib-es/varint.d.ts +4 -0
  280. package/lib-es/varint.d.ts.map +1 -0
  281. package/lib-es/varint.js +40 -0
  282. package/lib-es/varint.js.map +1 -0
  283. package/package.json +5 -5
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ 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;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ exports.__esModule = true;
39
+ exports.hashOutputFull = exports.provideOutputFullChangePath = void 0;
40
+ var bip32_1 = require("./bip32");
41
+ var constants_1 = require("./constants");
42
+ function provideOutputFullChangePath(transport, path) {
43
+ var buffer = (0, bip32_1.bip32asBuffer)(path);
44
+ return transport.send(0xe0, 0x4a, 0xff, 0x00, buffer);
45
+ }
46
+ exports.provideOutputFullChangePath = provideOutputFullChangePath;
47
+ function hashOutputFull(transport, outputScript, additionals) {
48
+ if (additionals === void 0) { additionals = []; }
49
+ return __awaiter(this, void 0, void 0, function () {
50
+ var offset, p1, isDecred, blockSize, p1_1, data;
51
+ return __generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0:
54
+ offset = 0;
55
+ p1 = Number(0x80);
56
+ isDecred = additionals.includes("decred");
57
+ ///WARNING: Decred works only with one call (without chunking)
58
+ //TODO: test without this for Decred
59
+ if (isDecred) {
60
+ return [2 /*return*/, transport.send(0xe0, 0x4a, p1, 0x00, outputScript)];
61
+ }
62
+ _a.label = 1;
63
+ case 1:
64
+ if (!(offset < outputScript.length)) return [3 /*break*/, 3];
65
+ blockSize = offset + constants_1.MAX_SCRIPT_BLOCK >= outputScript.length
66
+ ? outputScript.length - offset
67
+ : constants_1.MAX_SCRIPT_BLOCK;
68
+ p1_1 = offset + blockSize === outputScript.length ? 0x80 : 0x00;
69
+ data = outputScript.slice(offset, offset + blockSize);
70
+ return [4 /*yield*/, transport.send(0xe0, 0x4a, p1_1, 0x00, data)];
71
+ case 2:
72
+ _a.sent();
73
+ offset += blockSize;
74
+ return [3 /*break*/, 1];
75
+ case 3: return [2 /*return*/];
76
+ }
77
+ });
78
+ });
79
+ }
80
+ exports.hashOutputFull = hashOutputFull;
81
+ //# sourceMappingURL=finalizeInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finalizeInput.js","sourceRoot":"","sources":["../src/finalizeInput.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iCAAwC;AACxC,yCAA+C;AAC/C,SAAgB,2BAA2B,CACzC,SAAoB,EACpB,IAAY;IAEZ,IAAM,MAAM,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC;IACnC,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC;AAND,kEAMC;AACD,SAAsB,cAAc,CAClC,SAAoB,EACpB,YAAoB,EACpB,WAA+B;IAA/B,4BAAA,EAAA,gBAA+B;;;;;;oBAE3B,MAAM,GAAG,CAAC,CAAC;oBACT,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;oBAClB,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;oBAEhD,8DAA8D;oBAC9D,oCAAoC;oBACpC,IAAI,QAAQ,EAAE;wBACZ,sBAAO,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,EAAC;qBAC3D;;;yBAEM,CAAA,MAAM,GAAG,YAAY,CAAC,MAAM,CAAA;oBAC3B,SAAS,GACb,MAAM,GAAG,4BAAgB,IAAI,YAAY,CAAC,MAAM;wBAC9C,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,MAAM;wBAC9B,CAAC,CAAC,4BAAgB,CAAC;oBACjB,OAAK,MAAM,GAAG,SAAS,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC9D,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;oBAC5D,qBAAM,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAE,EAAE,IAAI,EAAE,IAAI,CAAC,EAAA;;oBAAhD,SAAgD,CAAC;oBACjD,MAAM,IAAI,SAAS,CAAC;;;;;;CAEvB;AAzBD,wCAyBC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" />
2
+ import Transport from "@ledgerhq/hw-transport";
3
+ export declare type AppAndVersion = {
4
+ name: string;
5
+ version: string;
6
+ flags: number | Buffer;
7
+ };
8
+ export declare const getAppAndVersion: (transport: Transport) => Promise<AppAndVersion>;
9
+ //# sourceMappingURL=getAppAndVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAppAndVersion.d.ts","sourceRoot":"","sources":["../src/getAppAndVersion.ts"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,cAChB,SAAS,KACnB,QAAQ,aAAa,CAgBvB,CAAC"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ 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;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ exports.__esModule = true;
42
+ exports.getAppAndVersion = void 0;
43
+ var invariant_1 = __importDefault(require("invariant"));
44
+ var getAppAndVersion = function (transport) { return __awaiter(void 0, void 0, void 0, function () {
45
+ var r, i, format, nameLength, name, versionLength, version, flagLength, flags;
46
+ return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0: return [4 /*yield*/, transport.send(0xb0, 0x01, 0x00, 0x00)];
49
+ case 1:
50
+ r = _a.sent();
51
+ i = 0;
52
+ format = r[i++];
53
+ (0, invariant_1["default"])(format === 1, "getAppAndVersion: format not supported");
54
+ nameLength = r[i++];
55
+ name = r.slice(i, (i += nameLength)).toString("ascii");
56
+ versionLength = r[i++];
57
+ version = r.slice(i, (i += versionLength)).toString("ascii");
58
+ flagLength = r[i++];
59
+ flags = r.slice(i, (i += flagLength));
60
+ return [2 /*return*/, {
61
+ name: name,
62
+ version: version,
63
+ flags: flags
64
+ }];
65
+ }
66
+ });
67
+ }); };
68
+ exports.getAppAndVersion = getAppAndVersion;
69
+ //# sourceMappingURL=getAppAndVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAppAndVersion.js","sourceRoot":"","sources":["../src/getAppAndVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAkC;AAS3B,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,IAAA,sBAAS,EAAC,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;AAlBW,QAAA,gBAAgB,oBAkB3B"}
@@ -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,275 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ 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;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __values = (this && this.__values) || function(o) {
39
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
40
+ if (m) return m.call(o);
41
+ if (o && typeof o.length === "number") return {
42
+ next: function () {
43
+ if (o && i >= o.length) o = void 0;
44
+ return { value: o && o[i++], done: !o };
45
+ }
46
+ };
47
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
48
+ };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ exports.__esModule = true;
53
+ exports.getTrustedInput = exports.getTrustedInputRaw = void 0;
54
+ var invariant_1 = __importDefault(require("invariant"));
55
+ var constants_1 = require("./constants");
56
+ var varint_1 = require("./varint");
57
+ function getTrustedInputRaw(transport, transactionData, indexLookup) {
58
+ return __awaiter(this, void 0, void 0, function () {
59
+ var data, firstRound, prefix, trustedInput, res;
60
+ return __generator(this, function (_a) {
61
+ switch (_a.label) {
62
+ case 0:
63
+ firstRound = false;
64
+ if (typeof indexLookup === "number") {
65
+ firstRound = true;
66
+ prefix = Buffer.alloc(4);
67
+ prefix.writeUInt32BE(indexLookup, 0);
68
+ data = Buffer.concat([prefix, transactionData], transactionData.length + 4);
69
+ }
70
+ else {
71
+ data = transactionData;
72
+ }
73
+ return [4 /*yield*/, transport.send(0xe0, 0x42, firstRound ? 0x00 : 0x80, 0x00, data)];
74
+ case 1:
75
+ trustedInput = _a.sent();
76
+ res = trustedInput.slice(0, trustedInput.length - 2).toString("hex");
77
+ return [2 /*return*/, res];
78
+ }
79
+ });
80
+ });
81
+ }
82
+ exports.getTrustedInputRaw = getTrustedInputRaw;
83
+ function getTrustedInput(transport, indexLookup, transaction, additionals) {
84
+ if (additionals === void 0) { additionals = []; }
85
+ return __awaiter(this, void 0, void 0, function () {
86
+ 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;
87
+ var e_1, _a, e_2, _b;
88
+ var _this = this;
89
+ return __generator(this, function (_c) {
90
+ switch (_c.label) {
91
+ case 0:
92
+ version = transaction.version, inputs = transaction.inputs, outputs = transaction.outputs, locktime = transaction.locktime, nExpiryHeight = transaction.nExpiryHeight, extraData = transaction.extraData;
93
+ if (!outputs || !locktime) {
94
+ throw new Error("getTrustedInput: locktime & outputs is expected");
95
+ }
96
+ isDecred = additionals.includes("decred");
97
+ isXST = additionals.includes("stealthcoin");
98
+ processScriptBlocks = function (script, sequence) { return __awaiter(_this, void 0, void 0, function () {
99
+ var seq, scriptBlocks, offset, blockSize, res, scriptBlocks_1, scriptBlocks_1_1, scriptBlock, e_3_1;
100
+ var e_3, _a;
101
+ return __generator(this, function (_b) {
102
+ switch (_b.label) {
103
+ case 0:
104
+ seq = sequence || Buffer.alloc(0);
105
+ scriptBlocks = [];
106
+ offset = 0;
107
+ while (offset !== script.length) {
108
+ blockSize = script.length - offset > constants_1.MAX_SCRIPT_BLOCK
109
+ ? constants_1.MAX_SCRIPT_BLOCK
110
+ : script.length - offset;
111
+ if (offset + blockSize !== script.length) {
112
+ scriptBlocks.push(script.slice(offset, offset + blockSize));
113
+ }
114
+ else {
115
+ scriptBlocks.push(Buffer.concat([script.slice(offset, offset + blockSize), seq]));
116
+ }
117
+ offset += blockSize;
118
+ }
119
+ // Handle case when no script length: we still want to pass the sequence
120
+ // relatable: https://github.com/LedgerHQ/ledger-live-desktop/issues/1386
121
+ if (script.length === 0) {
122
+ scriptBlocks.push(seq);
123
+ }
124
+ _b.label = 1;
125
+ case 1:
126
+ _b.trys.push([1, 6, 7, 8]);
127
+ scriptBlocks_1 = __values(scriptBlocks), scriptBlocks_1_1 = scriptBlocks_1.next();
128
+ _b.label = 2;
129
+ case 2:
130
+ if (!!scriptBlocks_1_1.done) return [3 /*break*/, 5];
131
+ scriptBlock = scriptBlocks_1_1.value;
132
+ return [4 /*yield*/, getTrustedInputRaw(transport, scriptBlock)];
133
+ case 3:
134
+ res = _b.sent();
135
+ _b.label = 4;
136
+ case 4:
137
+ scriptBlocks_1_1 = scriptBlocks_1.next();
138
+ return [3 /*break*/, 2];
139
+ case 5: return [3 /*break*/, 8];
140
+ case 6:
141
+ e_3_1 = _b.sent();
142
+ e_3 = { error: e_3_1 };
143
+ return [3 /*break*/, 8];
144
+ case 7:
145
+ try {
146
+ if (scriptBlocks_1_1 && !scriptBlocks_1_1.done && (_a = scriptBlocks_1["return"])) _a.call(scriptBlocks_1);
147
+ }
148
+ finally { if (e_3) throw e_3.error; }
149
+ return [7 /*endfinally*/];
150
+ case 8: return [2 /*return*/, res];
151
+ }
152
+ });
153
+ }); };
154
+ processWholeScriptBlock = function (block) {
155
+ return getTrustedInputRaw(transport, block);
156
+ };
157
+ return [4 /*yield*/, getTrustedInputRaw(transport, Buffer.concat([
158
+ transaction.version,
159
+ transaction.timestamp || Buffer.alloc(0),
160
+ transaction.nVersionGroupId || Buffer.alloc(0),
161
+ (0, varint_1.createVarint)(inputs.length),
162
+ ]), indexLookup)];
163
+ case 1:
164
+ _c.sent();
165
+ _c.label = 2;
166
+ case 2:
167
+ _c.trys.push([2, 8, 9, 10]);
168
+ inputs_1 = __values(inputs), inputs_1_1 = inputs_1.next();
169
+ _c.label = 3;
170
+ case 3:
171
+ if (!!inputs_1_1.done) return [3 /*break*/, 7];
172
+ input = inputs_1_1.value;
173
+ isXSTV2 = isXST &&
174
+ Buffer.compare(version, Buffer.from([0x02, 0x00, 0x00, 0x00])) === 0;
175
+ treeField = isDecred
176
+ ? input.tree || Buffer.from([0x00])
177
+ : Buffer.alloc(0);
178
+ data = Buffer.concat([
179
+ input.prevout,
180
+ treeField,
181
+ isXSTV2 ? Buffer.from([0x00]) : (0, varint_1.createVarint)(input.script.length),
182
+ ]);
183
+ return [4 /*yield*/, getTrustedInputRaw(transport, data)];
184
+ case 4:
185
+ _c.sent();
186
+ // iteration (eachSeries) ended
187
+ // TODO notify progress
188
+ // deferred.notify("input");
189
+ // Reference: https://github.com/StealthSend/Stealth/commit/5be35d6c2c500b32ed82e5d6913d66d18a4b0a7f#diff-e8db9b851adc2422aadfffca88f14c91R566
190
+ return [4 /*yield*/, (isDecred
191
+ ? processWholeScriptBlock(Buffer.concat([input.script, input.sequence]))
192
+ : isXSTV2
193
+ ? processWholeScriptBlock(input.sequence)
194
+ : processScriptBlocks(input.script, input.sequence))];
195
+ case 5:
196
+ // iteration (eachSeries) ended
197
+ // TODO notify progress
198
+ // deferred.notify("input");
199
+ // Reference: https://github.com/StealthSend/Stealth/commit/5be35d6c2c500b32ed82e5d6913d66d18a4b0a7f#diff-e8db9b851adc2422aadfffca88f14c91R566
200
+ _c.sent();
201
+ _c.label = 6;
202
+ case 6:
203
+ inputs_1_1 = inputs_1.next();
204
+ return [3 /*break*/, 3];
205
+ case 7: return [3 /*break*/, 10];
206
+ case 8:
207
+ e_1_1 = _c.sent();
208
+ e_1 = { error: e_1_1 };
209
+ return [3 /*break*/, 10];
210
+ case 9:
211
+ try {
212
+ if (inputs_1_1 && !inputs_1_1.done && (_a = inputs_1["return"])) _a.call(inputs_1);
213
+ }
214
+ finally { if (e_1) throw e_1.error; }
215
+ return [7 /*endfinally*/];
216
+ case 10: return [4 /*yield*/, getTrustedInputRaw(transport, (0, varint_1.createVarint)(outputs.length))];
217
+ case 11:
218
+ _c.sent();
219
+ _c.label = 12;
220
+ case 12:
221
+ _c.trys.push([12, 17, 18, 19]);
222
+ outputs_1 = __values(outputs), outputs_1_1 = outputs_1.next();
223
+ _c.label = 13;
224
+ case 13:
225
+ if (!!outputs_1_1.done) return [3 /*break*/, 16];
226
+ output = outputs_1_1.value;
227
+ data = Buffer.concat([
228
+ output.amount,
229
+ isDecred ? Buffer.from([0x00, 0x00]) : Buffer.alloc(0),
230
+ (0, varint_1.createVarint)(output.script.length),
231
+ output.script,
232
+ ]);
233
+ return [4 /*yield*/, getTrustedInputRaw(transport, data)];
234
+ case 14:
235
+ _c.sent();
236
+ _c.label = 15;
237
+ case 15:
238
+ outputs_1_1 = outputs_1.next();
239
+ return [3 /*break*/, 13];
240
+ case 16: return [3 /*break*/, 19];
241
+ case 17:
242
+ e_2_1 = _c.sent();
243
+ e_2 = { error: e_2_1 };
244
+ return [3 /*break*/, 19];
245
+ case 18:
246
+ try {
247
+ if (outputs_1_1 && !outputs_1_1.done && (_b = outputs_1["return"])) _b.call(outputs_1);
248
+ }
249
+ finally { if (e_2) throw e_2.error; }
250
+ return [7 /*endfinally*/];
251
+ case 19:
252
+ endData = [];
253
+ if (nExpiryHeight && nExpiryHeight.length > 0) {
254
+ endData.push(nExpiryHeight);
255
+ }
256
+ if (extraData && extraData.length > 0) {
257
+ endData.push(extraData);
258
+ }
259
+ if (endData.length) {
260
+ data = Buffer.concat(endData);
261
+ extraPart = isDecred
262
+ ? data
263
+ : Buffer.concat([(0, varint_1.createVarint)(data.length), data]);
264
+ }
265
+ return [4 /*yield*/, processScriptBlocks(Buffer.concat([locktime, extraPart || Buffer.alloc(0)]))];
266
+ case 20:
267
+ res = _c.sent();
268
+ (0, invariant_1["default"])(res, "missing result in processScriptBlocks");
269
+ return [2 /*return*/, res];
270
+ }
271
+ });
272
+ });
273
+ }
274
+ exports.getTrustedInput = getTrustedInput;
275
+ //# sourceMappingURL=getTrustedInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTrustedInput.js","sourceRoot":"","sources":["../src/getTrustedInput.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAkC;AAGlC,yCAA+C;AAC/C,mCAAwC;AACxC,SAAsB,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,MAAM,EAAE,eAAe,CAAC,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;qBAC7E;yBAAM;wBACL,IAAI,GAAG,eAAe,CAAC;qBACxB;oBAEoB,qBAAM,SAAS,CAAC,IAAI,CACvC,IAAI,EACJ,IAAI,EACJ,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACxB,IAAI,EACJ,IAAI,CACL,EAAA;;oBANK,YAAY,GAAG,SAMpB;oBACK,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;oBAC3E,sBAAO,GAAG,EAAC;;;;CACZ;AA1BD,gDA0BC;AACD,SAAsB,eAAe,CACnC,SAAoB,EACpB,WAAmB,EACnB,WAAwB,EACxB,WAA+B;IAA/B,4BAAA,EAAA,gBAA+B;;;;;;;;oBAEvB,OAAO,G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;oBACH,qBAAM,kBAAkB,CAAC,SAAS,EAAE,IAAI,CAAC,EAAA;;oBAAzC,SAAyC,CAAC;;;;;;;;;;;;;;;;;oBAGtC,OAAO,GAAa,EAAE,CAAC;oBAE7B,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC7C,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;qBAC7B;oBAED,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;wBACrC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;qBACzB;oBAID,IAAI,OAAO,CAAC,MAAM,EAAE;wBACZ,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;wBACpC,SAAS,GAAG,QAAQ;4BAClB,CAAC,CAAC,IAAI;4BACN,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAA,qBAAY,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;qBACtD;oBAEW,qBAAM,mBAAmB,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,IAAA,sBAAS,EAAC,GAAG,EAAE,uCAAuC,CAAC,CAAC;oBACxD,sBAAO,GAAG,EAAC;;;;CACZ;AA/HD,0CA+HC"}
@@ -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,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ exports.__esModule = true;
6
+ exports.getTrustedInputBIP143 = void 0;
7
+ var sha_js_1 = __importDefault(require("sha.js"));
8
+ var serializeTransaction_1 = require("./serializeTransaction");
9
+ function getTrustedInputBIP143(transport, indexLookup, transaction, additionals) {
10
+ if (additionals === void 0) { additionals = []; }
11
+ if (!transaction) {
12
+ throw new Error("getTrustedInputBIP143: missing tx");
13
+ }
14
+ var isDecred = additionals.includes("decred");
15
+ if (isDecred) {
16
+ throw new Error("Decred does not implement BIP143");
17
+ }
18
+ var hash = (0, sha_js_1["default"])("sha256")
19
+ .update((0, sha_js_1["default"])("sha256").update((0, serializeTransaction_1.serializeTransaction)(transaction, true)).digest())
20
+ .digest();
21
+ var data = Buffer.alloc(4);
22
+ data.writeUInt32LE(indexLookup, 0);
23
+ var outputs = transaction.outputs, locktime = transaction.locktime;
24
+ if (!outputs || !locktime) {
25
+ throw new Error("getTrustedInputBIP143: locktime & outputs is expected");
26
+ }
27
+ if (!outputs[indexLookup]) {
28
+ throw new Error("getTrustedInputBIP143: wrong index");
29
+ }
30
+ hash = Buffer.concat([hash, data, outputs[indexLookup].amount]);
31
+ return hash.toString("hex");
32
+ }
33
+ exports.getTrustedInputBIP143 = getTrustedInputBIP143;
34
+ //# sourceMappingURL=getTrustedInputBIP143.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTrustedInputBIP143.js","sourceRoot":"","sources":["../src/getTrustedInput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C;AAnCD,sDAmCC"}
@@ -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,93 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ 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;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ exports.__esModule = true;
50
+ exports.getWalletPublicKey = void 0;
51
+ var bip32_1 = require("./bip32");
52
+ var addressFormatMap = {
53
+ legacy: 0,
54
+ p2sh: 1,
55
+ bech32: 2,
56
+ cashaddr: 3
57
+ };
58
+ function getWalletPublicKey(transport, options) {
59
+ return __awaiter(this, void 0, void 0, function () {
60
+ var _a, path, verify, format, buffer, p1, p2, response, publicKeyLength, addressLength, publicKey, bitcoinAddress, chainCode;
61
+ return __generator(this, function (_b) {
62
+ switch (_b.label) {
63
+ case 0:
64
+ _a = __assign({ verify: false, format: "legacy" }, options), path = _a.path, verify = _a.verify, format = _a.format;
65
+ if (!(format in addressFormatMap)) {
66
+ throw new Error("btc.getWalletPublicKey invalid format=" + format);
67
+ }
68
+ buffer = (0, bip32_1.bip32asBuffer)(path);
69
+ p1 = verify ? 1 : 0;
70
+ p2 = addressFormatMap[format];
71
+ return [4 /*yield*/, transport.send(0xe0, 0x40, p1, p2, buffer)];
72
+ case 1:
73
+ response = _b.sent();
74
+ publicKeyLength = response[0];
75
+ addressLength = response[1 + publicKeyLength];
76
+ publicKey = response.slice(1, 1 + publicKeyLength).toString("hex");
77
+ bitcoinAddress = response
78
+ .slice(1 + publicKeyLength + 1, 1 + publicKeyLength + 1 + addressLength)
79
+ .toString("ascii");
80
+ chainCode = response
81
+ .slice(1 + publicKeyLength + 1 + addressLength, 1 + publicKeyLength + 1 + addressLength + 32)
82
+ .toString("hex");
83
+ return [2 /*return*/, {
84
+ publicKey: publicKey,
85
+ bitcoinAddress: bitcoinAddress,
86
+ chainCode: chainCode
87
+ }];
88
+ }
89
+ });
90
+ });
91
+ }
92
+ exports.getWalletPublicKey = getWalletPublicKey;
93
+ //# sourceMappingURL=getWalletPublicKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWalletPublicKey.js","sourceRoot":"","sources":["../src/getWalletPublicKey.ts"],"names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