Skip to content

Commit bb0bb3b

Browse files
committed
renaming + delete unused tests
1 parent e1c0890 commit bb0bb3b

17 files changed

+244
-681
lines changed

README.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ For a smooth and quick integration:
2828
#### Table of Contents
2929

3030
* [bippath](#bippath)
31-
* [Acre](#btc)
31+
* [Acre](#acre)
3232
* [Parameters](#parameters)
3333
* [Examples](#examples)
3434
* [getWalletXpub](#getwalletxpub)
@@ -55,7 +55,7 @@ For a smooth and quick integration:
5555
* [Parameters](#parameters-8)
5656
* [getTrustedInputBIP143](#gettrustedinputbip143)
5757
* [Parameters](#parameters-9)
58-
* [BtcNew](#btcnew)
58+
* [AcreBtcNew](#acrebtcnew)
5959
* [getWalletXpub](#getwalletxpub-1)
6060
* [Parameters](#parameters-10)
6161
* [getWalletPublicKey](#getwalletpublickey-1)
@@ -68,7 +68,7 @@ For a smooth and quick integration:
6868
* [Parameters](#parameters-14)
6969
* [descrTemplFrom](#descrtemplfrom)
7070
* [Parameters](#parameters-15)
71-
* [BtcOld](#btcold)
71+
* [AcreBtcOld](#acrebtcold)
7272
* [getWalletPublicKey](#getwalletpublickey-2)
7373
* [Parameters](#parameters-16)
7474
* [Examples](#examples-7)
@@ -144,7 +144,7 @@ Acre app API.
144144

145145
```javascript
146146
import Acre from "@blooo/hw-app-acre:";
147-
const btc = new Acre({ transport, currency: "bitcoin" });
147+
const acre = new Acre({ transport, currency: "bitcoin" });
148148
```
149149

150150
#### getWalletXpub
@@ -181,8 +181,8 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
181181
##### Examples
182182

183183
```javascript
184-
btc.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
185-
btc.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
184+
acre.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
185+
acre.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
186186
```
187187

188188
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)}>**&#x20;
@@ -199,7 +199,7 @@ You can sign a message according to the Bitcoin Signature format and retrieve v,
199199
##### Examples
200200

201201
```javascript
202-
btc.signMessage("44'/60'/0'/0'/0", Buffer.from("test").toString("hex")).then(function(result) {
202+
acre.signMessage("44'/60'/0'/0'/0", Buffer.from("test").toString("hex")).then(function(result) {
203203
var v = result['v'] + 27 + 4;
204204
var signature = Buffer.from(v.toString(16) + result['r'] + result['s'], 'hex').toString('base64');
205205
console.log("Signature : " + signature);
@@ -239,7 +239,7 @@ To sign a transaction involving standard (P2PKH) inputs, call createTransaction
239239
##### Examples
240240

241241
```javascript
242-
btc.createTransaction({
242+
acre.createTransaction({
243243
inputs: [ [tx1, 1] ],
244244
associatedKeysets: ["0'/0/0"],
245245
outputScriptHex: "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
@@ -267,7 +267,7 @@ To obtain the signature of multisignature (P2SH) inputs, call signP2SHTransactio
267267
##### Examples
268268

269269
```javascript
270-
btc.signP2SHTransaction({
270+
acre.signP2SHTransaction({
271271
inputs: [ [tx, 1, "52210289b4a3ad52a919abd2bdd6920d8a6879b1e788c38aa76f0440a6f32a9f1996d02103a3393b1439d1693b063482c04bd40142db97bdf139eedd1b51ffb7070a37eac321030b9a409a1e476b0d5d17b804fcdb81cf30f9b99c6f3ae1178206e08bc500639853ae"] ],
272272
associatedKeysets: ["0'/0/0"],
273273
outputScriptHex: "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
@@ -290,7 +290,7 @@ For each UTXO included in your transaction, create a transaction object from the
290290
##### Examples
291291

292292
```javascript
293-
const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
293+
const tx1 = acre.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
294294
```
295295

296296
Returns **[Transaction](#transaction)** the transaction object deserialized from the raw hexadecimal transaction
@@ -306,8 +306,8 @@ Serialize a transaction's outputs to hexadecimal
306306
##### Examples
307307

308308
```javascript
309-
const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
310-
const outputScript = btc.serializeTransactionOutputs(tx1).toString('hex');
309+
const tx1 = acre.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
310+
const outputScript = acre.serializeTransactionOutputs(tx1).toString('hex');
311311
```
312312

313313
Returns **[Buffer](https://nodejs.org/api/buffer.html)**&#x20;
@@ -338,15 +338,15 @@ Trusted input is the hash of a UTXO that needs to be signed. BIP143 is used for
338338

339339
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
340340

341-
### BtcNew
341+
### AcreBtcNew
342342

343-
This class implements the same interface as BtcOld (formerly
343+
This class implements the same interface as AcreBtcOld (formerly
344344
named Btc), but interacts with Acre hardware app from version 1.0.0
345345
which uses the same APDU protocol as the Bitcoin app version 2.1.0+.
346346
This protocol is documented at
347347
<https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md>
348348

349-
Since the interface must remain compatible with BtcOld, the methods
349+
Since the interface must remain compatible with AcreBtcOld, the methods
350350
of this class are quite clunky, because it needs to adapt legacy
351351
input data into the PSBT process.
352352

@@ -462,7 +462,7 @@ the bitcoin descriptor template.
462462

463463
Returns **DefaultDescriptorTemplate**&#x20;
464464

465-
### BtcOld
465+
### AcreBtcOld
466466

467467
This Bitcoin old API is compatible with versions of the Bitcoin nano app that are earlier than 2.1.0
468468

@@ -487,8 +487,8 @@ This Bitcoin old API is compatible with versions of the Bitcoin nano app that ar
487487
##### Examples
488488

489489
```javascript
490-
btc.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
491-
btc.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
490+
acre.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
491+
acre.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
492492
```
493493

494494
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)}>**&#x20;
@@ -523,7 +523,7 @@ To sign a transaction involving standard (P2PKH) inputs, call createTransaction
523523
##### Examples
524524

525525
```javascript
526-
btc.createTransaction({
526+
acre.createTransaction({
527527
inputs: [ [tx1, 1] ],
528528
associatedKeysets: ["0'/0/0"],
529529
outputScriptHex: "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
@@ -827,8 +827,8 @@ complemantary fields as needed in the future.
827827
#### Examples
828828

829829
```javascript
830-
const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
831-
const outputScript = btc.serializeTransactionOutputs(tx1).toString('hex');
830+
const tx1 = acre.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
831+
const outputScript = acre.serializeTransactionOutputs(tx1).toString('hex');
832832
```
833833

834834
Returns **[Buffer](https://nodejs.org/api/buffer.html)**&#x20;

jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
collectCoverage: true,
66
testPathIgnorePatterns: ["packages/*/lib-es", "packages/*/lib"],
77
coveragePathIgnorePatterns: ["packages/create-dapp"],
8-
testMatch: ["**/tests/newops/BtcNew.test.ts"],
8+
testMatch: ["**/tests/newops/AcreBtcNew.test.ts"],
99
passWithNoTests: true,
1010
// collectCoverageFrom: ["packages/**/src/*.ts"],
1111
rootDir: __dirname,

src/Acre.ts

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import semver from "semver";
22
import type Transport from "@ledgerhq/hw-transport";
3-
import BtcNew from "./BtcNew";
4-
import BtcOld from "./BtcOld";
3+
import AcreBtcNew from "./AcreBtcNew";
4+
import AcreBtcOld from "./AcreBtcOld";
55
import type { CreateTransactionArg } from "./createTransaction";
66
import { getTrustedInput } from "./getTrustedInput";
77
import { getTrustedInputBIP143 } from "./getTrustedInputBIP143";
@@ -23,15 +23,15 @@ import { checkIsBtcLegacy, getAppAndVersion } from "./getAppAndVersion";
2323
* @param currency The currency to use, defaults to "bitcoin".
2424
* @example
2525
* import Acre from "@blooo/hw-app-acre:";
26-
* const btc = new Acre({ transport, currency: "bitcoin" });
26+
* const acre = new Acre({ transport, currency: "bitcoin" });
2727
*/
2828

2929
export default class Acre {
3030
// Transport instance
3131
private _transport: Transport;
3232
// The specific implementation used, determined by the nano app and its version.
33-
// It chooses between BtcNew (new interface) and BtcOld (old interface).
34-
private _impl: BtcOld | BtcNew;
33+
// It chooses between AcreBtcNew (current acre interface) and AcreBtcOld (old bitcoin interface).
34+
private _impl: AcreBtcOld | AcreBtcNew;
3535
constructor({
3636
transport,
3737
scrambleKey = "BTC",
@@ -62,10 +62,10 @@ export default class Acre {
6262
case "bitcoin_testnet":
6363
case "qtum":
6464
// new APDU (nano app API) for currencies using app-bitcoin-new implementation
65-
return new BtcNew(new AppClient(this._transport));
65+
return new AcreBtcNew(new AppClient(this._transport));
6666
default:
6767
// old APDU (legacy API) for currencies using legacy bitcoin app implementation
68-
return new BtcOld(this._transport);
68+
return new AcreBtcOld(this._transport);
6969
}
7070
})();
7171
}
@@ -106,8 +106,8 @@ export default class Acre {
106106
* - cashaddr in case of Bitcoin Cash
107107
*
108108
* @example
109-
* btc.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
110-
* btc.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
109+
* acre.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
110+
* acre.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)
111111
*/
112112
getWalletPublicKey(
113113
path: string,
@@ -123,7 +123,7 @@ export default class Acre {
123123
let options;
124124
if (arguments.length > 2 || typeof opts === "boolean") {
125125
console.warn(
126-
"btc.getWalletPublicKey deprecated signature used. Please switch to getWalletPublicKey(path, { format, verify })",
126+
"acre.getWalletPublicKey deprecated signature used. Please switch to getWalletPublicKey(path, { format, verify })",
127127
);
128128
options = {
129129
verify: !!opts,
@@ -141,7 +141,7 @@ export default class Acre {
141141
/**
142142
* You can sign a message according to the Bitcoin Signature format and retrieve v, r, s given the message and the BIP 32 path of the account to sign.
143143
* @example
144-
btc.signMessage("44'/60'/0'/0'/0", Buffer.from("test").toString("hex")).then(function(result) {
144+
acre.signMessage("44'/60'/0'/0'/0", Buffer.from("test").toString("hex")).then(function(result) {
145145
var v = result['v'] + 27 + 4;
146146
var signature = Buffer.from(v.toString(16) + result['r'] + result['s'], 'hex').toString('base64');
147147
console.log("Signature : " + signature);
@@ -179,7 +179,7 @@ export default class Acre {
179179
nonce: "0xC",
180180
};
181181
const path = "m/44'/0'/0'/0/0";
182-
const result = await btc.signWithdrawal({path: path, withdrawalData: withdrawalData});
182+
const result = await acre.signWithdrawal({path: path, withdrawalData: withdrawalData});
183183
*/
184184
signWithdrawal(
185185
path: string,
@@ -225,7 +225,7 @@ export default class Acre {
225225
* @param useTrustedInputForSegwit trust inputs for segwit transactions. If app version >= 1.4.0 this should be true.
226226
* @return the signed transaction ready to be broadcast
227227
* @example
228-
btc.createTransaction({
228+
acre.createTransaction({
229229
inputs: [ [tx1, 1] ],
230230
associatedKeysets: ["0'/0/0"],
231231
outputScriptHex: "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
@@ -255,7 +255,7 @@ export default class Acre {
255255
* @param sigHashType is the hash type of the transaction to sign, or default (all)
256256
* @return the signed transaction ready to be broadcast
257257
* @example
258-
btc.signP2SHTransaction({
258+
acre.signP2SHTransaction({
259259
inputs: [ [tx, 1, "52210289b4a3ad52a919abd2bdd6920d8a6879b1e788c38aa76f0440a6f32a9f1996d02103a3393b1439d1693b063482c04bd40142db97bdf139eedd1b51ffb7070a37eac321030b9a409a1e476b0d5d17b804fcdb81cf30f9b99c6f3ae1178206e08bc500639853ae"] ],
260260
associatedKeysets: ["0'/0/0"],
261261
outputScriptHex: "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
@@ -273,7 +273,7 @@ export default class Acre {
273273
* @param additionals list of additionnal options
274274
* @return the transaction object deserialized from the raw hexadecimal transaction
275275
* @example
276-
const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
276+
const tx1 = acre.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
277277
*/
278278
splitTransaction(
279279
transactionHex: string,
@@ -287,8 +287,8 @@ export default class Acre {
287287
/**
288288
* Serialize a transaction's outputs to hexadecimal
289289
* @example
290-
const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
291-
const outputScript = btc.serializeTransactionOutputs(tx1).toString('hex');
290+
const tx1 = acre.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");
291+
const outputScript = acre.serializeTransactionOutputs(tx1).toString('hex');
292292
*/
293293
serializeTransactionOutputs(t: Transaction): Buffer {
294294
return serializeTransactionOutputs(t);
@@ -318,9 +318,8 @@ export default class Acre {
318318
return getTrustedInputBIP143(this._transport, indexLookup, transaction, additionals);
319319
}
320320

321-
async changeImplIfNecessary(): Promise<BtcOld | BtcNew> {
322-
// if BtcOld was instantiated, stick with it
323-
if (this._impl instanceof BtcOld) return this._impl;
321+
async changeImplIfNecessary(): Promise<AcreBtcOld | AcreBtcNew> {
322+
if (this._impl instanceof AcreBtcOld) return this._impl;
324323

325324
const { name, version } = await getAppAndVersion(this._transport);
326325

@@ -353,7 +352,7 @@ export default class Acre {
353352
})();
354353

355354
if (isBtcLegacy) {
356-
this._impl = new BtcOld(this._transport);
355+
this._impl = new AcreBtcOld(this._transport);
357356
}
358357
return this._impl;
359358
}

src/BtcNew.ts src/AcreBtcNew.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ import type { Transaction, AcreWithdrawalData, AcreWithdrawalDataBuffer } from "
2828
import { log } from "@ledgerhq/logs";
2929

3030
/**
31-
* @class BtcNew
32-
* @description This class implements the same interface as BtcOld (formerly
31+
* @class AcreBtcNew
32+
* @description This class implements the same interface as AcreBtcOld (formerly
3333
* named Btc), but interacts with Bitcoin hardware app version 2.1.0+
3434
* which uses a totally new APDU protocol. This new
3535
* protocol is documented at
3636
* https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md
3737
*
38-
* Since the interface must remain compatible with BtcOld, the methods
38+
* Since the interface must remain compatible with AcreBtcOld, the methods
3939
* of this class are quite clunky, because it needs to adapt legacy
4040
* input data into the PSBT process. In the future, a new interface should
4141
* be developed that exposes PSBT to the outer world, which would render
4242
* a much cleaner implementation.
4343
*
4444
*/
45-
export default class BtcNew {
45+
export default class AcreBtcNew {
4646
constructor(private client: Client) {}
4747

4848
/**
@@ -559,7 +559,7 @@ function accountTypeFromArg(
559559
Useful resource on derivation paths: https://learnmeabitcoin.com/technical/derivation-paths
560560
*/
561561

562-
//path is not deepest hardened node of a standard path or deeper, use BtcOld
562+
//path is not deepest hardened node of a standard path or deeper, use AcreBtcOld
563563
const H = 0x80000000; //HARDENED from bip32
564564

565565
const VALID_COIN_TYPES = [

0 commit comments

Comments
 (0)