Skip to content

Commit

Permalink
chore: renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Z4karia committed Sep 25, 2024
1 parent bb0bb3b commit dcc4ed3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ input data into the PSBT process.

This is a new method that allow users to get an xpub at a standard path.
Standard paths are described at
<https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md#description>
<https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md#description>

This boils down to paths (N=0 for Bitcoin, N=1 for Testnet):
M/44'/N'/x'/\*\*
Expand Down Expand Up @@ -453,7 +453,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
### descrTemplFrom

This function returns a descriptor template based on the address format.
See <https://github.com/LedgerHQ/app-bitcoin-new/blob/develop/doc/wallet.md> for details of
See <https://github.com/blooo-io/app-acre/blob/develop/doc/wallet.md> for details of
the bitcoin descriptor template.

#### Parameters
Expand All @@ -464,7 +464,9 @@ Returns **DefaultDescriptorTemplate**&#x20;

### AcreBtcOld

This Bitcoin old API is compatible with versions of the Bitcoin nano app that are earlier than 2.1.0
This old API is compatible with versions of the Bitcoin nano app that are earlier than 2.1.0 .
It is never used by Acre, that is based on the latest Bitcoin nano app (2.1.0+).
This class is kept for compatibility purposes.

#### getWalletPublicKey

Expand Down Expand Up @@ -656,7 +658,7 @@ Returns **[Buffer](https://nodejs.org/api/buffer.html)** The output key
### AppClient

This class encapsulates the APDU protocol documented at
<https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md>
<https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md>

#### Parameters

Expand Down Expand Up @@ -694,17 +696,17 @@ The reason for this is the limited amount of memory available to the app,
so it can't always store the full psbt in memory.

The signing process is documented at
<https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md#sign_psbt>
<https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md#sign_psbt>

#### Parameters

* `psbt` **[PsbtV2](#psbtv2)**&#x20;

### Merkle

This class implements the merkle tree used by Ledger Bitcoin app v2+,
This class implements the merkle tree used by Ledger Acre app,
which is documented at
<https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/merkle.md>
<https://github.com/blooo-io/app-acre/blob/develop/doc/merkle.md>

#### Parameters

Expand All @@ -714,7 +716,7 @@ which is documented at
### MerkleMap

This implements "Merkelized Maps", documented at
<https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/merkle.md#merkleized-maps>
<https://github.com/blooo-io/app-acre/blob/develop/doc/merkle.md#merkleized-maps>

A merkelized map consist of two merkle trees, one for the keys of
a map and one for the values of the same map, thus the two merkle
Expand All @@ -734,7 +736,7 @@ how to construct output scripts from keys. A "Wallet Policy" consists
of a "Descriptor Template" and a list of "keys". A key is basically
a serialized BIP32 extended public key with some added derivation path
information. This is documented at
<https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/wallet.md>
<https://github.com/blooo-io/app-acre/blob/develop/doc/wallet.md>

#### Parameters

Expand Down
6 changes: 3 additions & 3 deletions src/Acre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { checkIsBtcLegacy, getAppAndVersion } from "./getAppAndVersion";

/**
* @class Acre
* @description Bitcoin API.
* @description Acre API.
* @param transport The transport layer used for communication.
* @param scrambleKey This parameter is deprecated and no longer needed.
* @param currency The currency to use, defaults to "bitcoin".
Expand Down Expand Up @@ -61,10 +61,10 @@ export default class Acre {
case "bitcoin":
case "bitcoin_testnet":
case "qtum":
// new APDU (nano app API) for currencies using app-bitcoin-new implementation
// new APDU (nano app API) for currencies using app-acre implementation
return new AcreBtcNew(new AppClient(this._transport));
default:
// old APDU (legacy API) for currencies using legacy bitcoin app implementation
// old APDU (legacy API) for currencies using legacy bitcoin app implementation (not used by acre)
return new AcreBtcOld(this._transport);
}
})();
Expand Down
6 changes: 3 additions & 3 deletions src/AcreBtcNew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { log } from "@ledgerhq/logs";
* named Btc), but interacts with Bitcoin hardware app version 2.1.0+
* which uses a totally new APDU protocol. This new
* protocol is documented at
* https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md
* https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md
*
* Since the interface must remain compatible with AcreBtcOld, the methods
* of this class are quite clunky, because it needs to adapt legacy
Expand All @@ -48,7 +48,7 @@ export default class AcreBtcNew {
/**
* This is a new method that allow users to get an xpub at a standard path.
* Standard paths are described at
* https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md#description
* https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md#description
*
* This boils down to paths (N=0 for Bitcoin, N=1 for Testnet):
* M/44'/N'/x'/**
Expand Down Expand Up @@ -515,7 +515,7 @@ export default class AcreBtcNew {

/**
* This function returns a descriptor template based on the address format.
* See https://github.com/LedgerHQ/app-bitcoin-new/blob/develop/doc/wallet.md for details of
* See https://github.com/blooo-io/app-acre/blob/develop/doc/wallet.md for details of
* the bitcoin descriptor template.
*/
function descrTemplFrom(addressFormat: AddressFormat): DefaultDescriptorTemplate {
Expand Down
5 changes: 3 additions & 2 deletions src/AcreBtcOld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export type { AddressFormat };

/**
* @class AcreBtcOld
* @description This Bitcoin old API is compatible with versions of the Bitcoin nano app that are earlier than 2.1.0
*
* @description This old API is compatible with versions of the Bitcoin nano app that are earlier than 2.1.0 .
* It is never used by Acre, that is based on the latest Bitcoin nano app (2.1.0+).
* This class is kept for compatibility purposes.
*/

export default class AcreBtcOld {
Expand Down

0 comments on commit dcc4ed3

Please sign in to comment.