@ledgerhq/hw-app-btc 10.0.10-nightly.0 → 10.1.0-next.0
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/CHANGELOG.md +8 -3
- package/README.md +80 -80
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
# @ledgerhq/hw-app-btc
|
|
2
2
|
|
|
3
|
-
## 10.0
|
|
3
|
+
## 10.1.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#5430](https://github.com/LedgerHQ/ledger-live/pull/5430) [`5964e30bed`](https://github.com/LedgerHQ/ledger-live/commit/5964e30bed11d64a3b7401c6ab51ffc1ad4c427c) Thanks [@hedi-edelbloute](https://github.com/hedi-edelbloute)! - Update documentation v14 ledgerjs
|
|
4
8
|
|
|
5
9
|
### Patch Changes
|
|
6
10
|
|
|
7
|
-
- Updated dependencies []:
|
|
8
|
-
- @ledgerhq/hw-transport@6.
|
|
11
|
+
- Updated dependencies [[`5964e30bed`](https://github.com/LedgerHQ/ledger-live/commit/5964e30bed11d64a3b7401c6ab51ffc1ad4c427c)]:
|
|
12
|
+
- @ledgerhq/hw-transport@6.30.0-next.0
|
|
13
|
+
- @ledgerhq/logs@6.12.0-next.0
|
|
9
14
|
|
|
10
15
|
## 10.0.9
|
|
11
16
|
|
package/README.md
CHANGED
|
@@ -119,9 +119,9 @@ Bitcoin API.
|
|
|
119
119
|
|
|
120
120
|
#### Parameters
|
|
121
121
|
|
|
122
|
-
* `$0` **{transport: Transport, scrambleKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, currency: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?}
|
|
122
|
+
* `$0` **{transport: Transport, scrambleKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, currency: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?}** 
|
|
123
123
|
|
|
124
|
-
* `$0.transport`
|
|
124
|
+
* `$0.transport`  
|
|
125
125
|
* `$0.scrambleKey` (optional, default `"BTC"`)
|
|
126
126
|
* `$0.currency` (optional, default `"bitcoin"`)
|
|
127
127
|
|
|
@@ -148,7 +148,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
148
148
|
##### Parameters
|
|
149
149
|
|
|
150
150
|
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a BIP 32 path
|
|
151
|
-
* `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}
|
|
151
|
+
* `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}?** 
|
|
152
152
|
* `options` an object with optional these fields:* verify (boolean) will ask user to confirm the address on the device
|
|
153
153
|
|
|
154
154
|
* format ("legacy" | "p2sh" | "bech32" | "bech32m" | "cashaddr") to use different bitcoin address formatter.NB The normal usage is to use:* legacy format with 44' paths
|
|
@@ -166,7 +166,7 @@ btc.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
|
|
|
166
166
|
btc.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}
|
|
169
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
|
170
170
|
|
|
171
171
|
#### signMessage
|
|
172
172
|
|
|
@@ -174,8 +174,8 @@ You can sign a message according to the Bitcoin Signature format and retrieve v,
|
|
|
174
174
|
|
|
175
175
|
##### Parameters
|
|
176
176
|
|
|
177
|
-
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
178
|
-
* `messageHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
177
|
+
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
178
|
+
* `messageHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
179
179
|
|
|
180
180
|
##### Examples
|
|
181
181
|
|
|
@@ -187,7 +187,7 @@ console.log("Signature : " + signature);
|
|
|
187
187
|
}).catch(function(ex) {console.log(ex);});
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}
|
|
190
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
|
191
191
|
|
|
192
192
|
#### createPaymentTransaction
|
|
193
193
|
|
|
@@ -195,9 +195,9 @@ To sign a transaction involving standard (P2PKH) inputs, call createTransaction
|
|
|
195
195
|
|
|
196
196
|
##### Parameters
|
|
197
197
|
|
|
198
|
-
* `arg` **[CreateTransactionArg](#createtransactionarg)
|
|
199
|
-
* `inputs` is an array of \[ transaction,
|
|
200
|
-
*
|
|
198
|
+
* `arg` **[CreateTransactionArg](#createtransactionarg)** 
|
|
199
|
+
* `inputs` is an array of \[ transaction, output\_index, optional redeem script, optional sequence ] where* transaction is the previously computed transaction object for this UTXO
|
|
200
|
+
* output\_index is the output in the transaction used as input for this UTXO (counting from 0)
|
|
201
201
|
* redeem script is the optional redeem script to use when consuming a Segregated Witness input
|
|
202
202
|
* sequence is the sequence number to use for this input (when using RBF), or non present
|
|
203
203
|
* `associatedKeysets` is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
|
|
@@ -230,13 +230,13 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
230
230
|
|
|
231
231
|
#### signP2SHTransaction
|
|
232
232
|
|
|
233
|
-
To obtain the signature of multisignature (P2SH) inputs, call
|
|
233
|
+
To obtain the signature of multisignature (P2SH) inputs, call signP2SHTransaction\_async with the folowing parameters
|
|
234
234
|
|
|
235
235
|
##### Parameters
|
|
236
236
|
|
|
237
|
-
* `arg` **[SignP2SHTransactionArg](#signp2shtransactionarg)
|
|
238
|
-
* `inputs` is an array of \[ transaction,
|
|
239
|
-
*
|
|
237
|
+
* `arg` **[SignP2SHTransactionArg](#signp2shtransactionarg)** 
|
|
238
|
+
* `inputs` is an array of \[ transaction, output\_index, redeem script, optional sequence ] where* transaction is the previously computed transaction object for this UTXO
|
|
239
|
+
* output\_index is the output in the transaction used as input for this UTXO (counting from 0)
|
|
240
240
|
* redeem script is the mandatory redeem script associated to the current P2SH input
|
|
241
241
|
* sequence is the sequence number to use for this input (when using RBF), or non present
|
|
242
242
|
* `associatedKeysets` is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
|
|
@@ -262,7 +262,7 @@ For each UTXO included in your transaction, create a transaction object from the
|
|
|
262
262
|
|
|
263
263
|
##### Parameters
|
|
264
264
|
|
|
265
|
-
* `transactionHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
265
|
+
* `transactionHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
266
266
|
* `isSegwitSupported` **([boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** (optional, default `false`)
|
|
267
267
|
* `hasTimestamp` (optional, default `false`)
|
|
268
268
|
* `hasExtraData` (optional, default `false`)
|
|
@@ -274,13 +274,13 @@ For each UTXO included in your transaction, create a transaction object from the
|
|
|
274
274
|
const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
|
|
275
275
|
```
|
|
276
276
|
|
|
277
|
-
Returns **[Transaction](#transaction)
|
|
277
|
+
Returns **[Transaction](#transaction)** 
|
|
278
278
|
|
|
279
279
|
#### serializeTransactionOutputs
|
|
280
280
|
|
|
281
281
|
##### Parameters
|
|
282
282
|
|
|
283
|
-
* `t` **[Transaction](#transaction)
|
|
283
|
+
* `t` **[Transaction](#transaction)** 
|
|
284
284
|
|
|
285
285
|
##### Examples
|
|
286
286
|
|
|
@@ -289,7 +289,7 @@ const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc
|
|
|
289
289
|
const outputScript = btc.serializeTransactionOutputs(tx1).toString('hex');
|
|
290
290
|
```
|
|
291
291
|
|
|
292
|
-
Returns **[Buffer](https://nodejs.org/api/buffer.html)
|
|
292
|
+
Returns **[Buffer](https://nodejs.org/api/buffer.html)** 
|
|
293
293
|
|
|
294
294
|
### BtcNew
|
|
295
295
|
|
|
@@ -307,7 +307,7 @@ a much cleaner implementation.
|
|
|
307
307
|
|
|
308
308
|
#### Parameters
|
|
309
309
|
|
|
310
|
-
* ``
|
|
310
|
+
* ``  
|
|
311
311
|
|
|
312
312
|
#### getWalletXpub
|
|
313
313
|
|
|
@@ -342,12 +342,12 @@ We opted for adding a new function, which can greatly simplify client code.
|
|
|
342
342
|
|
|
343
343
|
##### Parameters
|
|
344
344
|
|
|
345
|
-
* `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), xpubVersion: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}
|
|
345
|
+
* `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), xpubVersion: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}** 
|
|
346
346
|
|
|
347
|
-
* `$0.path`
|
|
348
|
-
* `$0.xpubVersion`
|
|
347
|
+
* `$0.path`  
|
|
348
|
+
* `$0.xpubVersion`  
|
|
349
349
|
|
|
350
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
350
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
351
351
|
|
|
352
352
|
#### getWalletPublicKey
|
|
353
353
|
|
|
@@ -359,10 +359,10 @@ will be the empty string "", see this.getWalletAddress() for details.
|
|
|
359
359
|
|
|
360
360
|
##### Parameters
|
|
361
361
|
|
|
362
|
-
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
363
|
-
* `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}
|
|
362
|
+
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
363
|
+
* `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}?** 
|
|
364
364
|
|
|
365
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}
|
|
365
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
|
366
366
|
|
|
367
367
|
#### createPaymentTransaction
|
|
368
368
|
|
|
@@ -375,9 +375,9 @@ transaction is returned.
|
|
|
375
375
|
|
|
376
376
|
##### Parameters
|
|
377
377
|
|
|
378
|
-
* `arg` **[CreateTransactionArg](#createtransactionarg)
|
|
378
|
+
* `arg` **[CreateTransactionArg](#createtransactionarg)** 
|
|
379
379
|
|
|
380
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
380
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
381
381
|
|
|
382
382
|
#### signMessage
|
|
383
383
|
|
|
@@ -387,12 +387,12 @@ and returns v, r, s.
|
|
|
387
387
|
|
|
388
388
|
##### Parameters
|
|
389
389
|
|
|
390
|
-
* `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), messageHex: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}
|
|
390
|
+
* `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), messageHex: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}** 
|
|
391
391
|
|
|
392
|
-
* `$0.path`
|
|
393
|
-
* `$0.messageHex`
|
|
392
|
+
* `$0.path`  
|
|
393
|
+
* `$0.messageHex`  
|
|
394
394
|
|
|
395
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}
|
|
395
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
|
396
396
|
|
|
397
397
|
### BtcOld
|
|
398
398
|
|
|
@@ -400,7 +400,7 @@ Bitcoin API.
|
|
|
400
400
|
|
|
401
401
|
#### Parameters
|
|
402
402
|
|
|
403
|
-
* ``
|
|
403
|
+
* ``  
|
|
404
404
|
|
|
405
405
|
#### Examples
|
|
406
406
|
|
|
@@ -414,7 +414,7 @@ const btc = new Btc({ transport, currency: "zcash" });
|
|
|
414
414
|
##### Parameters
|
|
415
415
|
|
|
416
416
|
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a BIP 32 path
|
|
417
|
-
* `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}
|
|
417
|
+
* `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}?** 
|
|
418
418
|
* `options` an object with optional these fields:* verify (boolean) will ask user to confirm the address on the device
|
|
419
419
|
|
|
420
420
|
* format ("legacy" | "p2sh" | "bech32" | "cashaddr") to use different bitcoin address formatter.NB The normal usage is to use:* legacy format with 44' paths
|
|
@@ -432,7 +432,7 @@ btc.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
|
|
|
432
432
|
btc.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
|
|
433
433
|
```
|
|
434
434
|
|
|
435
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}
|
|
435
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
|
436
436
|
|
|
437
437
|
#### createPaymentTransaction
|
|
438
438
|
|
|
@@ -440,9 +440,9 @@ To sign a transaction involving standard (P2PKH) inputs, call createTransaction
|
|
|
440
440
|
|
|
441
441
|
##### Parameters
|
|
442
442
|
|
|
443
|
-
* `arg` **[CreateTransactionArg](#createtransactionarg)
|
|
444
|
-
* `inputs` is an array of \[ transaction,
|
|
445
|
-
*
|
|
443
|
+
* `arg` **[CreateTransactionArg](#createtransactionarg)** 
|
|
444
|
+
* `inputs` is an array of \[ transaction, output\_index, optional redeem script, optional sequence ] where* transaction is the previously computed transaction object for this UTXO
|
|
445
|
+
* output\_index is the output in the transaction used as input for this UTXO (counting from 0)
|
|
446
446
|
* redeem script is the optional redeem script to use when consuming a Segregated Witness input
|
|
447
447
|
* sequence is the sequence number to use for this input (when using RBF), or non present
|
|
448
448
|
* `associatedKeysets` is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
|
|
@@ -478,20 +478,20 @@ Type: {inputs: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Referen
|
|
|
478
478
|
|
|
479
479
|
#### Properties
|
|
480
480
|
|
|
481
|
-
* `inputs` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<\[[Transaction](#transaction), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)), ([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))]
|
|
482
|
-
* `associatedKeysets` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
483
|
-
* `changePath` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
484
|
-
* `outputScriptHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
485
|
-
* `lockTime` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
486
|
-
* `sigHashType` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
487
|
-
* `segwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
|
|
488
|
-
* `initialTimestamp` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
489
|
-
* `additionals` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
490
|
-
* `expiryHeight` **[Buffer](https://nodejs.org/api/buffer.html)
|
|
491
|
-
* `useTrustedInputForSegwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
|
|
492
|
-
* `onDeviceStreaming` **function (arg0: {progress: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), total: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), index: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}): void
|
|
493
|
-
* `onDeviceSignatureRequested` **function (): void
|
|
494
|
-
* `onDeviceSignatureGranted` **function (): void
|
|
481
|
+
* `inputs` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<\[[Transaction](#transaction), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)), ([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))]>** 
|
|
482
|
+
* `associatedKeysets` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
483
|
+
* `changePath` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
484
|
+
* `outputScriptHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
485
|
+
* `lockTime` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** 
|
|
486
|
+
* `sigHashType` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** 
|
|
487
|
+
* `segwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** 
|
|
488
|
+
* `initialTimestamp` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** 
|
|
489
|
+
* `additionals` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
490
|
+
* `expiryHeight` **[Buffer](https://nodejs.org/api/buffer.html)?** 
|
|
491
|
+
* `useTrustedInputForSegwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** 
|
|
492
|
+
* `onDeviceStreaming` **function (arg0: {progress: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), total: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), index: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}): void?** 
|
|
493
|
+
* `onDeviceSignatureRequested` **function (): void?** 
|
|
494
|
+
* `onDeviceSignatureGranted` **function (): void?** 
|
|
495
495
|
|
|
496
496
|
### AddressFormat
|
|
497
497
|
|
|
@@ -514,9 +514,9 @@ The pubkeys are expected to be 33 byte ecdsa compressed pubkeys.
|
|
|
514
514
|
|
|
515
515
|
##### Parameters
|
|
516
516
|
|
|
517
|
-
* `pubkeys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)
|
|
517
|
+
* `pubkeys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>** 
|
|
518
518
|
|
|
519
|
-
Returns **SpendingCondition
|
|
519
|
+
Returns **SpendingCondition** 
|
|
520
520
|
|
|
521
521
|
#### setInput
|
|
522
522
|
|
|
@@ -531,7 +531,7 @@ Populates the psbt with account type-specific data for an input.
|
|
|
531
531
|
* `pubkeys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>** The 33 byte ecdsa compressed public keys involved in the input
|
|
532
532
|
* `pathElems` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>>** The paths corresponding to the pubkeys, in same order.
|
|
533
533
|
|
|
534
|
-
Returns **void
|
|
534
|
+
Returns **void** 
|
|
535
535
|
|
|
536
536
|
#### setOwnOutput
|
|
537
537
|
|
|
@@ -546,7 +546,7 @@ being spent from.
|
|
|
546
546
|
* `pubkeys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>** The 33 byte ecdsa compressed public keys involved in this output
|
|
547
547
|
* `paths` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>>** The paths corresponding to the pubkeys, in same order.
|
|
548
548
|
|
|
549
|
-
Returns **void
|
|
549
|
+
Returns **void** 
|
|
550
550
|
|
|
551
551
|
#### getDescriptorTemplate
|
|
552
552
|
|
|
@@ -555,7 +555,7 @@ DefaultDescriptorTemplates are allowed, but that might be changed in the
|
|
|
555
555
|
future. See class WalletPolicy for more information on descriptor
|
|
556
556
|
templates.
|
|
557
557
|
|
|
558
|
-
Returns **DefaultDescriptorTemplate
|
|
558
|
+
Returns **DefaultDescriptorTemplate** 
|
|
559
559
|
|
|
560
560
|
### SingleKeyAccount
|
|
561
561
|
|
|
@@ -585,7 +585,7 @@ This class encapsulates the APDU protocol documented at
|
|
|
585
585
|
|
|
586
586
|
#### Parameters
|
|
587
587
|
|
|
588
|
-
* `transport` **Transport
|
|
588
|
+
* `transport` **Transport** 
|
|
589
589
|
|
|
590
590
|
### ClientCommandInterpreter
|
|
591
591
|
|
|
@@ -605,7 +605,7 @@ which will return the yields in the same order as they came in.
|
|
|
605
605
|
|
|
606
606
|
#### Parameters
|
|
607
607
|
|
|
608
|
-
* `progressCallback` **function (): void
|
|
608
|
+
* `progressCallback` **function (): void** 
|
|
609
609
|
|
|
610
610
|
### MerkelizedPsbt
|
|
611
611
|
|
|
@@ -623,7 +623,7 @@ The signing process is documented at
|
|
|
623
623
|
|
|
624
624
|
#### Parameters
|
|
625
625
|
|
|
626
|
-
* `psbt` **[PsbtV2](#psbtv2)
|
|
626
|
+
* `psbt` **[PsbtV2](#psbtv2)** 
|
|
627
627
|
|
|
628
628
|
### Merkle
|
|
629
629
|
|
|
@@ -633,7 +633,7 @@ which is documented at
|
|
|
633
633
|
|
|
634
634
|
#### Parameters
|
|
635
635
|
|
|
636
|
-
* `leaves` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)
|
|
636
|
+
* `leaves` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>** 
|
|
637
637
|
* `hasher` **function (buf: [Buffer](https://nodejs.org/api/buffer.html)): [Buffer](https://nodejs.org/api/buffer.html)** (optional, default `crypto.sha256`)
|
|
638
638
|
|
|
639
639
|
### MerkleMap
|
|
@@ -663,8 +663,8 @@ information. This is documented at
|
|
|
663
663
|
|
|
664
664
|
#### Parameters
|
|
665
665
|
|
|
666
|
-
* `descriptorTemplate` **DefaultDescriptorTemplate
|
|
667
|
-
* `key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
666
|
+
* `descriptorTemplate` **DefaultDescriptorTemplate** 
|
|
667
|
+
* `key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
668
668
|
|
|
669
669
|
### extract
|
|
670
670
|
|
|
@@ -675,9 +675,9 @@ the role is partially documented in BIP174 (PSBTv0
|
|
|
675
675
|
|
|
676
676
|
#### Parameters
|
|
677
677
|
|
|
678
|
-
* `psbt` **[PsbtV2](#psbtv2)
|
|
678
|
+
* `psbt` **[PsbtV2](#psbtv2)** 
|
|
679
679
|
|
|
680
|
-
Returns **[Buffer](https://nodejs.org/api/buffer.html)
|
|
680
|
+
Returns **[Buffer](https://nodejs.org/api/buffer.html)** 
|
|
681
681
|
|
|
682
682
|
### finalize
|
|
683
683
|
|
|
@@ -694,22 +694,22 @@ derivation paths.
|
|
|
694
694
|
#### Parameters
|
|
695
695
|
|
|
696
696
|
* `psbt` **[PsbtV2](#psbtv2)** The psbt with all signatures added as partial sigs, either
|
|
697
|
-
through
|
|
697
|
+
through PSBT\_IN\_PARTIAL\_SIG or PSBT\_IN\_TAP\_KEY\_SIG
|
|
698
698
|
|
|
699
|
-
Returns **void
|
|
699
|
+
Returns **void** 
|
|
700
700
|
|
|
701
701
|
### clearFinalizedInput
|
|
702
702
|
|
|
703
703
|
Deletes fields that are no longer neccesary from the psbt.
|
|
704
704
|
|
|
705
705
|
Note, the spec doesn't say anything about removing ouput fields
|
|
706
|
-
like
|
|
706
|
+
like PSBT\_OUT\_BIP32\_DERIVATION\_PATH and others, so we keep them
|
|
707
707
|
without actually knowing why. I think we should remove them too.
|
|
708
708
|
|
|
709
709
|
#### Parameters
|
|
710
710
|
|
|
711
|
-
* `psbt` **[PsbtV2](#psbtv2)
|
|
712
|
-
* `inputIndex` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
711
|
+
* `psbt` **[PsbtV2](#psbtv2)** 
|
|
712
|
+
* `inputIndex` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
713
713
|
|
|
714
714
|
### writePush
|
|
715
715
|
|
|
@@ -745,9 +745,9 @@ complemantary fields as needed in the future.
|
|
|
745
745
|
|
|
746
746
|
#### Parameters
|
|
747
747
|
|
|
748
|
-
* `$0` **[Transaction](#transaction)
|
|
748
|
+
* `$0` **[Transaction](#transaction)** 
|
|
749
749
|
|
|
750
|
-
* `$0.outputs`
|
|
750
|
+
* `$0.outputs`  
|
|
751
751
|
|
|
752
752
|
#### Examples
|
|
753
753
|
|
|
@@ -756,7 +756,7 @@ const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc
|
|
|
756
756
|
const outputScript = btc.serializeTransactionOutputs(tx1).toString('hex');
|
|
757
757
|
```
|
|
758
758
|
|
|
759
|
-
Returns **[Buffer](https://nodejs.org/api/buffer.html)
|
|
759
|
+
Returns **[Buffer](https://nodejs.org/api/buffer.html)** 
|
|
760
760
|
|
|
761
761
|
### SignP2SHTransactionArg
|
|
762
762
|
|
|
@@ -764,13 +764,13 @@ Type: {inputs: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Referen
|
|
|
764
764
|
|
|
765
765
|
#### Properties
|
|
766
766
|
|
|
767
|
-
* `inputs` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<\[[Transaction](#transaction), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)), ([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))]
|
|
768
|
-
* `associatedKeysets` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
769
|
-
* `outputScriptHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
770
|
-
* `lockTime` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
771
|
-
* `sigHashType` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
772
|
-
* `segwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
|
|
773
|
-
* `transactionVersion` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
767
|
+
* `inputs` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<\[[Transaction](#transaction), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)), ([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))]>** 
|
|
768
|
+
* `associatedKeysets` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
769
|
+
* `outputScriptHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
770
|
+
* `lockTime` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** 
|
|
771
|
+
* `sigHashType` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** 
|
|
772
|
+
* `segwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** 
|
|
773
|
+
* `transactionVersion` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** 
|
|
774
774
|
|
|
775
775
|
### TransactionInput
|
|
776
776
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/hw-app-btc",
|
|
3
|
-
"version": "10.0
|
|
3
|
+
"version": "10.1.0-next.0",
|
|
4
4
|
"description": "Ledger Hardware Wallet Bitcoin Application API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -70,21 +70,21 @@
|
|
|
70
70
|
"sha.js": "2",
|
|
71
71
|
"tiny-secp256k1": "1.1.6",
|
|
72
72
|
"varuint-bitcoin": "1.1.2",
|
|
73
|
-
"@ledgerhq/hw-transport": "^6.
|
|
74
|
-
"@ledgerhq/logs": "^6.
|
|
73
|
+
"@ledgerhq/hw-transport": "^6.30.0-next.0",
|
|
74
|
+
"@ledgerhq/logs": "^6.12.0-next.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/jest": "^29.5.0",
|
|
78
78
|
"@types/node": "^20.8.10",
|
|
79
79
|
"axios": "^0.25.0",
|
|
80
|
-
"documentation": "
|
|
80
|
+
"documentation": "14.0.2",
|
|
81
81
|
"jest": "^28.1.1",
|
|
82
82
|
"rimraf": "^4.4.1",
|
|
83
83
|
"source-map-support": "^0.5.21",
|
|
84
84
|
"ts-jest": "^28.0.5",
|
|
85
85
|
"ts-node": "^10.4.0",
|
|
86
|
-
"@ledgerhq/hw-transport-mocker": "^6.
|
|
87
|
-
"@ledgerhq/hw-transport-node-speculos": "^6.
|
|
86
|
+
"@ledgerhq/hw-transport-mocker": "^6.28.0-next.0",
|
|
87
|
+
"@ledgerhq/hw-transport-node-speculos": "^6.28.0-next.0"
|
|
88
88
|
},
|
|
89
89
|
"gitHead": "dd0dea64b58e5a9125c8a422dcffd29e5ef6abec",
|
|
90
90
|
"scripts": {
|