@ledgerhq/hw-app-btc 6.9.1-taproot.0 → 6.11.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 (133) hide show
  1. package/README.md +602 -107
  2. package/lib/Btc.d.ts +11 -7
  3. package/lib/Btc.d.ts.map +1 -1
  4. package/lib/Btc.js +113 -31
  5. package/lib/Btc.js.map +1 -1
  6. package/lib/BtcNew.d.ts +81 -32
  7. package/lib/BtcNew.d.ts.map +1 -1
  8. package/lib/BtcNew.js +296 -99
  9. package/lib/BtcNew.js.map +1 -1
  10. package/lib/BtcOld.d.ts +3 -1
  11. package/lib/BtcOld.d.ts.map +1 -1
  12. package/lib/BtcOld.js +22 -6
  13. package/lib/BtcOld.js.map +1 -1
  14. package/lib/constants.d.ts +1 -0
  15. package/lib/constants.d.ts.map +1 -1
  16. package/lib/constants.js +2 -1
  17. package/lib/constants.js.map +1 -1
  18. package/lib/getAppAndVersion.d.ts +3 -2
  19. package/lib/getAppAndVersion.d.ts.map +1 -1
  20. package/lib/getAppAndVersion.js.map +1 -1
  21. package/lib/newops/appClient.d.ts +6 -2
  22. package/lib/newops/appClient.d.ts.map +1 -1
  23. package/lib/newops/appClient.js +9 -5
  24. package/lib/newops/appClient.js.map +1 -1
  25. package/lib/newops/clientCommands.d.ts +18 -2
  26. package/lib/newops/clientCommands.d.ts.map +1 -1
  27. package/lib/newops/clientCommands.js +20 -3
  28. package/lib/newops/clientCommands.js.map +1 -1
  29. package/lib/newops/merkelizedPsbt.d.ts +11 -0
  30. package/lib/newops/merkelizedPsbt.d.ts.map +1 -1
  31. package/lib/newops/merkelizedPsbt.js +11 -0
  32. package/lib/newops/merkelizedPsbt.js.map +1 -1
  33. package/lib/newops/merkle.d.ts +5 -0
  34. package/lib/newops/merkle.d.ts.map +1 -1
  35. package/lib/newops/merkle.js +5 -0
  36. package/lib/newops/merkle.js.map +1 -1
  37. package/lib/newops/merkleMap.d.ts +10 -0
  38. package/lib/newops/merkleMap.d.ts.map +1 -1
  39. package/lib/newops/merkleMap.js +10 -0
  40. package/lib/newops/merkleMap.js.map +1 -1
  41. package/lib/newops/policy.d.ts +8 -0
  42. package/lib/newops/policy.d.ts.map +1 -1
  43. package/lib/newops/policy.js +9 -1
  44. package/lib/newops/policy.js.map +1 -1
  45. package/lib/newops/psbtExtractor.d.ts +6 -0
  46. package/lib/newops/psbtExtractor.d.ts.map +1 -1
  47. package/lib/newops/psbtExtractor.js +6 -0
  48. package/lib/newops/psbtExtractor.js.map +1 -1
  49. package/lib/newops/psbtFinalizer.d.ts +11 -1
  50. package/lib/newops/psbtFinalizer.d.ts.map +1 -1
  51. package/lib/newops/psbtFinalizer.js +28 -4
  52. package/lib/newops/psbtFinalizer.js.map +1 -1
  53. package/lib/newops/psbtv2.d.ts +22 -2
  54. package/lib/newops/psbtv2.d.ts.map +1 -1
  55. package/lib/newops/psbtv2.js +37 -8
  56. package/lib/newops/psbtv2.js.map +1 -1
  57. package/lib-es/Btc.d.ts +11 -7
  58. package/lib-es/Btc.d.ts.map +1 -1
  59. package/lib-es/Btc.js +94 -31
  60. package/lib-es/Btc.js.map +1 -1
  61. package/lib-es/BtcNew.d.ts +81 -32
  62. package/lib-es/BtcNew.d.ts.map +1 -1
  63. package/lib-es/BtcNew.js +293 -101
  64. package/lib-es/BtcNew.js.map +1 -1
  65. package/lib-es/BtcOld.d.ts +3 -1
  66. package/lib-es/BtcOld.d.ts.map +1 -1
  67. package/lib-es/BtcOld.js +22 -6
  68. package/lib-es/BtcOld.js.map +1 -1
  69. package/lib-es/constants.d.ts +1 -0
  70. package/lib-es/constants.d.ts.map +1 -1
  71. package/lib-es/constants.js +1 -0
  72. package/lib-es/constants.js.map +1 -1
  73. package/lib-es/getAppAndVersion.d.ts +3 -2
  74. package/lib-es/getAppAndVersion.d.ts.map +1 -1
  75. package/lib-es/getAppAndVersion.js.map +1 -1
  76. package/lib-es/newops/appClient.d.ts +6 -2
  77. package/lib-es/newops/appClient.d.ts.map +1 -1
  78. package/lib-es/newops/appClient.js +9 -5
  79. package/lib-es/newops/appClient.js.map +1 -1
  80. package/lib-es/newops/clientCommands.d.ts +18 -2
  81. package/lib-es/newops/clientCommands.d.ts.map +1 -1
  82. package/lib-es/newops/clientCommands.js +20 -3
  83. package/lib-es/newops/clientCommands.js.map +1 -1
  84. package/lib-es/newops/merkelizedPsbt.d.ts +11 -0
  85. package/lib-es/newops/merkelizedPsbt.d.ts.map +1 -1
  86. package/lib-es/newops/merkelizedPsbt.js +11 -0
  87. package/lib-es/newops/merkelizedPsbt.js.map +1 -1
  88. package/lib-es/newops/merkle.d.ts +5 -0
  89. package/lib-es/newops/merkle.d.ts.map +1 -1
  90. package/lib-es/newops/merkle.js +5 -0
  91. package/lib-es/newops/merkle.js.map +1 -1
  92. package/lib-es/newops/merkleMap.d.ts +10 -0
  93. package/lib-es/newops/merkleMap.d.ts.map +1 -1
  94. package/lib-es/newops/merkleMap.js +10 -0
  95. package/lib-es/newops/merkleMap.js.map +1 -1
  96. package/lib-es/newops/policy.d.ts +8 -0
  97. package/lib-es/newops/policy.d.ts.map +1 -1
  98. package/lib-es/newops/policy.js +10 -2
  99. package/lib-es/newops/policy.js.map +1 -1
  100. package/lib-es/newops/psbtExtractor.d.ts +6 -0
  101. package/lib-es/newops/psbtExtractor.d.ts.map +1 -1
  102. package/lib-es/newops/psbtExtractor.js +6 -0
  103. package/lib-es/newops/psbtExtractor.js.map +1 -1
  104. package/lib-es/newops/psbtFinalizer.d.ts +11 -1
  105. package/lib-es/newops/psbtFinalizer.d.ts.map +1 -1
  106. package/lib-es/newops/psbtFinalizer.js +28 -4
  107. package/lib-es/newops/psbtFinalizer.js.map +1 -1
  108. package/lib-es/newops/psbtv2.d.ts +22 -2
  109. package/lib-es/newops/psbtv2.d.ts.map +1 -1
  110. package/lib-es/newops/psbtv2.js +37 -8
  111. package/lib-es/newops/psbtv2.js.map +1 -1
  112. package/package.json +4 -4
  113. package/src/Btc.ts +92 -21
  114. package/src/BtcNew.ts +295 -77
  115. package/src/BtcOld.ts +13 -9
  116. package/src/bip32.ts +1 -1
  117. package/src/constants.ts +1 -0
  118. package/src/getAppAndVersion.ts +7 -4
  119. package/src/newops/appClient.ts +13 -5
  120. package/src/newops/clientCommands.ts +19 -3
  121. package/src/newops/merkelizedPsbt.ts +11 -0
  122. package/src/newops/merkle.ts +5 -0
  123. package/src/newops/merkleMap.ts +10 -0
  124. package/src/newops/policy.ts +10 -2
  125. package/src/newops/psbtExtractor.ts +6 -0
  126. package/src/newops/psbtFinalizer.ts +28 -4
  127. package/src/newops/psbtv2.ts +38 -14
  128. package/tests/Btc.integration.test.ts +125 -15
  129. package/tests/Btc.test.ts +83 -0
  130. package/tests/newops/BtcNew.test.ts +75 -508
  131. package/tests/newops/integrationtools.ts +174 -0
  132. package/tests/newops/testtx.ts +676 -0
  133. package/tests/speculosclient.ts +47 -0
package/lib-es/Btc.js CHANGED
@@ -34,8 +34,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
- import semver from "semver";
38
- import BtcNew from "./BtcNew";
37
+ import { pathStringToArray } from "./bip32";
38
+ import BtcNew, { canSupportApp } from "./BtcNew";
39
39
  import BtcOld from "./BtcOld";
40
40
  import { getAppAndVersion } from "./getAppAndVersion";
41
41
  import { getTrustedInput } from "./getTrustedInput";
@@ -53,6 +53,8 @@ import { splitTransaction } from "./splitTransaction";
53
53
  var Btc = /** @class */ (function () {
54
54
  function Btc(transport, scrambleKey) {
55
55
  if (scrambleKey === void 0) { scrambleKey = "BTC"; }
56
+ // cache the underlying implementation (only once)
57
+ this._lazyImpl = null;
56
58
  this.transport = transport;
57
59
  transport.decorateAppAPIMethods(this, [
58
60
  "getWalletXpub",
@@ -88,7 +90,7 @@ var Btc = /** @class */ (function () {
88
90
  *
89
91
  * - p2sh format with 49' paths
90
92
  *
91
- * - bech32 format with 173' paths
93
+ * - bech32 format with 84' paths
92
94
  *
93
95
  * - cashaddr in case of Bitcoin Cash
94
96
  *
@@ -97,6 +99,7 @@ var Btc = /** @class */ (function () {
97
99
  * btc.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
98
100
  */
99
101
  Btc.prototype.getWalletPublicKey = function (path, opts) {
102
+ var _this = this;
100
103
  var options;
101
104
  if (arguments.length > 2 || typeof opts === "boolean") {
102
105
  console.warn("btc.getWalletPublicKey deprecated signature used. Please switch to getWalletPublicKey(path, { format, verify })");
@@ -110,7 +113,38 @@ var Btc = /** @class */ (function () {
110
113
  options = opts || {};
111
114
  }
112
115
  return this.getCorrectImpl().then(function (impl) {
113
- return impl.getWalletPublicKey(path, options);
116
+ /**
117
+ * Definition: A "normal path" is a prefix of a standard path where all
118
+ * the hardened steps of the standard path are included. For example, the
119
+ * paths m/44'/1'/17' and m/44'/1'/17'/1 are normal paths, but m/44'/1'
120
+ * is not. m/'199/1'/17'/0/1 is not a normal path either.
121
+ *
122
+ * There's a compatiblity issue between old and new app: When exporting
123
+ * the key of a non-normal path with verify=false, the new app would
124
+ * return an error, whereas the old app would return the key.
125
+ *
126
+ * See
127
+ * https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md#get_extended_pubkey
128
+ *
129
+ * If format bech32m is used, we'll not use old, because it doesn't
130
+ * support it.
131
+ *
132
+ * When to use new (given the app supports it)
133
+ * * format is bech32m or
134
+ * * path is normal or
135
+ * * verify is true
136
+ *
137
+ * Otherwise use old.
138
+ */
139
+ if (impl instanceof BtcNew &&
140
+ options.format != "bech32m" &&
141
+ (!options.verify || options.verify == false) &&
142
+ !isPathNormal(path)) {
143
+ return _this.old().getWalletPublicKey(path, options);
144
+ }
145
+ else {
146
+ return impl.getWalletPublicKey(path, options);
147
+ }
114
148
  });
115
149
  };
116
150
  /**
@@ -135,20 +169,21 @@ var Btc = /** @class */ (function () {
135
169
  * * sequence is the sequence number to use for this input (when using RBF), or non present
136
170
  * @param associatedKeysets is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
137
171
  * @param changePath is an optional BIP 32 path pointing to the path to the public key used to compute the change address
138
- * @param outputScriptHex is the hexadecimal serialized outputs of the transaction to sign
172
+ * @param outputScriptHex is the hexadecimal serialized outputs of the transaction to sign, including leading vararg voutCount
139
173
  * @param lockTime is the optional lockTime of the transaction to sign, or default (0)
140
174
  * @param sigHashType is the hash type of the transaction to sign, or default (all)
141
- * @param segwit is an optional boolean indicating wether to use segwit or not
175
+ * @param segwit is an optional boolean indicating wether to use segwit or not. This includes wrapped segwit.
142
176
  * @param initialTimestamp is an optional timestamp of the function call to use for coins that necessitate timestamps only, (not the one that the tx will include)
143
177
  * @param additionals list of additionnal options
144
178
  *
145
179
  * - "bech32" for spending native segwit outputs
180
+ * - "bech32m" for spending segwit v1+ outputs
146
181
  * - "abc" for bch
147
182
  * - "gold" for btg
148
183
  * - "bipxxx" for using BIPxxx
149
184
  * - "sapling" to indicate a zec transaction is supporting sapling (to be set over block 419200)
150
185
  * @param expiryHeight is an optional Buffer for zec overwinter / sapling Txs
151
- * @param useTrustedInputForSegwit trust inputs for segwit transactions
186
+ * @param useTrustedInputForSegwit trust inputs for segwit transactions. If app version >= 1.4.0 this should be true.
152
187
  * @return the signed transaction ready to be broadcast
153
188
  * @example
154
189
  btc.createTransaction({
@@ -215,50 +250,78 @@ var Btc = /** @class */ (function () {
215
250
  if (additionals === void 0) { additionals = []; }
216
251
  return getTrustedInputBIP143(this.transport, indexLookup, transaction, additionals);
217
252
  };
218
- // TODO: we should save in a field what was the latest app and not ask each time in the lifecycle of a new Btc()
219
253
  Btc.prototype.getCorrectImpl = function () {
220
254
  return __awaiter(this, void 0, void 0, function () {
221
- var isNewApp;
255
+ var _lazyImpl, impl;
222
256
  return __generator(this, function (_a) {
223
257
  switch (_a.label) {
224
- case 0: return [4 /*yield*/, this.useNewApp()];
258
+ case 0:
259
+ _lazyImpl = this._lazyImpl;
260
+ if (_lazyImpl)
261
+ return [2 /*return*/, _lazyImpl];
262
+ return [4 /*yield*/, this.inferCorrectImpl()];
225
263
  case 1:
226
- isNewApp = _a.sent();
227
- if (isNewApp) {
228
- return [2 /*return*/, this["new"]()];
229
- }
230
- else {
231
- return [2 /*return*/, this.old()];
232
- }
233
- return [2 /*return*/];
264
+ impl = _a.sent();
265
+ this._lazyImpl = impl;
266
+ return [2 /*return*/, impl];
234
267
  }
235
268
  });
236
269
  });
237
270
  };
238
- Btc.prototype.old = function () {
239
- return new BtcOld(this.transport);
240
- };
241
- Btc.prototype["new"] = function () {
242
- return new BtcNew(new AppClient(this.transport));
243
- };
244
- Btc.prototype.useNewApp = function () {
271
+ Btc.prototype.inferCorrectImpl = function () {
245
272
  return __awaiter(this, void 0, void 0, function () {
246
- var a, isNewApp;
273
+ var appAndVersion, canUseNewImplementation;
247
274
  return __generator(this, function (_a) {
248
275
  switch (_a.label) {
249
276
  case 0: return [4 /*yield*/, getAppAndVersion(this.transport)];
250
277
  case 1:
251
- a = _a.sent();
252
- isNewApp = semver.major(a.version) >= 2;
253
- if ((a.name == "Bitcoin" || a.name == "Bitcoin Test") && isNewApp) {
254
- return [2 /*return*/, true];
278
+ appAndVersion = _a.sent();
279
+ canUseNewImplementation = canSupportApp(appAndVersion);
280
+ if (!canUseNewImplementation) {
281
+ return [2 /*return*/, this.old()];
255
282
  }
256
- return [2 /*return*/, false];
283
+ else {
284
+ return [2 /*return*/, this["new"]()];
285
+ }
286
+ return [2 /*return*/];
257
287
  }
258
288
  });
259
289
  });
260
290
  };
291
+ Btc.prototype.old = function () {
292
+ return new BtcOld(this.transport);
293
+ };
294
+ Btc.prototype["new"] = function () {
295
+ return new BtcNew(new AppClient(this.transport));
296
+ };
261
297
  return Btc;
262
298
  }());
263
299
  export default Btc;
300
+ function isPathNormal(path) {
301
+ //path is not deepest hardened node of a standard path or deeper, use BtcOld
302
+ var h = 0x80000000;
303
+ var pathElems = pathStringToArray(path);
304
+ var hard = function (n) { return n > h; };
305
+ var soft = function (n) { return !n || n < h; };
306
+ if (pathElems.length >= 3 &&
307
+ pathElems.length <= 5 &&
308
+ [44 + h, 49 + h, 84 + h, 86 + h].some(function (v) { return v == pathElems[0]; }) &&
309
+ [0 + h, 1 + h].some(function (v) { return v == pathElems[1]; }) &&
310
+ hard(pathElems[2]) &&
311
+ soft(pathElems[3]) &&
312
+ soft(pathElems[4])) {
313
+ return true;
314
+ }
315
+ if (pathElems.length >= 4 &&
316
+ pathElems.length <= 6 &&
317
+ 48 + h == pathElems[0] &&
318
+ [0 + h, 1 + h].some(function (v) { return v == pathElems[1]; }) &&
319
+ hard(pathElems[2]) &&
320
+ hard(pathElems[3]) &&
321
+ soft(pathElems[4]) &&
322
+ soft(pathElems[5])) {
323
+ return true;
324
+ }
325
+ return false;
326
+ }
264
327
  //# sourceMappingURL=Btc.js.map
package/lib-es/Btc.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Btc.js","sourceRoot":"","sources":["../src/Btc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;;GAMG;AAEH;IAGE,aAAY,SAAoB,EAAE,WAAmB;QAAnB,4BAAA,EAAA,mBAAmB;QACnD,IAAI,CAAC,SAAS,GAAG,S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ClB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAClB;QACA,OAAO,IAAI,CAAC;KACb;IACD,IACE,SAAS,CAAC,MAAM,IAAI,CAAC;QACrB,SAAS,CAAC,MAAM,IAAI,CAAC;QACrB,EAAE,GAAG,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC;QACtB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,EAAjB,CAAiB,CAAC;QAC7C,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAClB;QACA,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,13 +1,65 @@
1
1
  import type { CreateTransactionArg } from "./createTransaction";
2
+ import { AppAndVersion } from "./getAppAndVersion";
2
3
  import type { AddressFormat } from "./getWalletPublicKey";
3
4
  import { AppClient as Client } from "./newops/appClient";
5
+ export declare function canSupportApp(appAndVersion: AppAndVersion): boolean;
6
+ /**
7
+ * This class implements the same interface as BtcOld (formerly
8
+ * named Btc), but interacts with Bitcoin hardware app version 2+
9
+ * which uses a totally new APDU protocol. This new
10
+ * protocol is documented at
11
+ * https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md
12
+ *
13
+ * Since the interface must remain compatible with BtcOld, the methods
14
+ * of this class are quite clunky, because it needs to adapt legacy
15
+ * input data into the PSBT process. In the future, a new interface should
16
+ * be developed that exposes PSBT to the outer world, which would render
17
+ * a much cleaner implementation.
18
+ */
4
19
  export default class BtcNew {
5
20
  private client;
6
21
  constructor(client: Client);
22
+ /**
23
+ * This is a new method that allow users to get an xpub at a standard path.
24
+ * Standard paths are described at
25
+ * https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md#description
26
+ *
27
+ * This boils down to paths (N=0 for Bitcoin, N=1 for Testnet):
28
+ * M/44'/N'/x'/**
29
+ * M/48'/N'/x'/y'/**
30
+ * M/49'/N'/x'/**
31
+ * M/84'/N'/x'/**
32
+ * M/86'/N'/x'/**
33
+ *
34
+ * The method was added because of added security in the hardware app v2+. The
35
+ * new hardware app will allow export of any xpub up to and including the
36
+ * deepest hardened key of standard derivation paths, whereas the old app
37
+ * would allow export of any key.
38
+ *
39
+ * This caused an issue for callers of this class, who only had
40
+ * getWalletPublicKey() to call which means they have to constuct xpub
41
+ * themselves:
42
+ *
43
+ * Suppose a user of this class wants to create an account xpub on a standard
44
+ * path, M/44'/0'/Z'. The user must get the parent key fingerprint (see BIP32)
45
+ * by requesting the parent key M/44'/0'. The new app won't allow that, because
46
+ * it only allows exporting deepest level hardened path. So the options are to
47
+ * allow requesting M/44'/0' from the app, or to add a new function
48
+ * "getWalletXpub".
49
+ *
50
+ * We opted for adding a new function, which can greatly simplify client code.
51
+ */
7
52
  getWalletXpub({ path, xpubVersion, }: {
8
53
  path: string;
9
54
  xpubVersion: number;
10
55
  }): Promise<string>;
56
+ /**
57
+ * This method returns a public key, a bitcoin address, and and a chaincode
58
+ * for a specific derivation path.
59
+ *
60
+ * Limitation: If the path is not a leaf node of a standard path, the address
61
+ * will be the empty string "", see this.getWalletAddress() for details.
62
+ */
11
63
  getWalletPublicKey(path: string, opts?: {
12
64
  verify?: boolean;
13
65
  format?: AddressFormat;
@@ -25,7 +77,7 @@ export default class BtcNew {
25
77
  *
26
78
  * If display is false we *could* generate the address ourselves, but chose to
27
79
  * get it from the device to save development time. However, it shouldn't take
28
- * more than a few hours to implement local address generation.
80
+ * too much time to implement local address generation.
29
81
  *
30
82
  * Moreover, if the path is not for a leaf, ie accountPath+/X/Y, there is no
31
83
  * way to get the address from the device. In this case we have to create it
@@ -33,41 +85,38 @@ export default class BtcNew {
33
85
  */
34
86
  private getWalletAddress;
35
87
  /**
36
- * To sign a transaction involving standard (P2PKH) inputs, call createTransaction with the following parameters
37
- * @param inputs is an array of [ transaction, output_index, optional redeem script, optional sequence ] where
88
+ * Build and sign a transaction. See Btc.createPaymentTransactionNew for
89
+ * details on how to use this method.
38
90
  *
39
- * * transaction is the previously computed transaction object for this UTXO
40
- * * output_index is the output in the transaction used as input for this UTXO (counting from 0)
41
- * * redeem script is the optional redeem script to use when consuming a Segregated Witness input
42
- * * sequence is the sequence number to use for this input (when using RBF), or non present
43
- * @param associatedKeysets is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
44
- * @param changePath is an optional BIP 32 path pointing to the path to the public key used to compute the change address
45
- * @param outputScriptHex is the hexadecimal serialized outputs of the transaction to sign, including leading vararg voutCount
46
- * @param lockTime is the optional lockTime of the transaction to sign, or default (0)
47
- * @param sigHashType is the hash type of the transaction to sign, or default (all)
48
- * @param segwit is an optional boolean indicating wether to use segwit or not. This includes wrapped segwit.
49
- * @param initialTimestamp is an optional timestamp of the function call to use for coins that necessitate timestamps only, (not the one that the tx will include)
50
- * @param additionals list of additionnal options
51
- *
52
- * - "bech32" for spending native segwit outputs
53
- * - "bech32m" for spending segwit v1+ outptus
54
- * - "abc" for bch
55
- * - "gold" for btg
56
- * - "bipxxx" for using BIPxxx
57
- * - "sapling" to indicate a zec transaction is supporting sapling (to be set over block 419200)
58
- * @param expiryHeight is an optional Buffer for zec overwinter / sapling Txs
59
- * @param useTrustedInputForSegwit trust inputs for segwit transactions. If app version >= 1.4.0 this should be true.
60
- * @return the signed transaction ready to be broadcast
61
- * @example
62
- btc.createTransaction({
63
- inputs: [ [tx1, 1] ],
64
- associatedKeysets: ["0'/0/0"],
65
- outputScriptHex: "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
66
- }).then(res => ...);
91
+ * This method will convert the legacy arguments, CreateTransactionArg, into
92
+ * a psbt which is finally signed and finalized, and the extracted fully signed
93
+ * transaction is returned.
67
94
  */
68
95
  createPaymentTransactionNew(arg: CreateTransactionArg): Promise<string>;
96
+ /**
97
+ * Calculates an output script along with public key and possible redeemScript
98
+ * from a path and accountType. The accountPath must be a prefix of path.
99
+ *
100
+ * @returns an object with output script (property "script"), redeemScript (if
101
+ * wrapped p2wpkh), and pubkey at provided path. The values of these three
102
+ * properties depend on the accountType used.
103
+ */
104
+ private outputScriptAt;
105
+ /**
106
+ * Adds relevant data about an input to the psbt. This includes sequence,
107
+ * previous txid, output index, spent UTXO, redeem script for wrapped p2wpkh,
108
+ * public key and its derivation path.
109
+ */
69
110
  private setInput;
111
+ /**
112
+ * This implements the "Signer" role of the BIP370 transaction signing
113
+ * process.
114
+ *
115
+ * It ssks the hardware device to sign the a psbt using the specified wallet
116
+ * policy. This method assumes BIP32 derived keys are used for all inputs, see
117
+ * comment in-line. The signatures returned from the hardware device is added
118
+ * to the appropriate input fields of the PSBT.
119
+ */
70
120
  private signPsbt;
71
- private createRedeemScript;
72
121
  }
73
122
  //# sourceMappingURL=BtcNew.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BtcNew.d.ts","sourceRoot":"","sources":["../src/BtcNew.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AASzD,MAAM,CAAC,OAAO,OAAO,MAAM;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE5B,aAAa,CAAC,EAClB,IAAI,EACJ,WAAW,GACZ,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC,MAAM,CAAC;I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