@ledgerhq/hw-app-btc 10.2.1 → 10.2.2-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 +9 -0
- package/README.md +104 -58
- package/lib/Btc.d.ts +31 -7
- package/lib/Btc.d.ts.map +1 -1
- package/lib/Btc.js +31 -7
- package/lib/Btc.js.map +1 -1
- package/lib/BtcNew.d.ts +4 -2
- package/lib/BtcNew.d.ts.map +1 -1
- package/lib/BtcNew.js +9 -2
- package/lib/BtcNew.js.map +1 -1
- package/lib/BtcOld.d.ts +8 -6
- package/lib/BtcOld.d.ts.map +1 -1
- package/lib/BtcOld.js +8 -6
- package/lib/BtcOld.js.map +1 -1
- package/lib/bip32.d.ts +9 -0
- package/lib/bip32.d.ts.map +1 -1
- package/lib/bip32.js +9 -0
- package/lib/bip32.js.map +1 -1
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +6 -1
- package/lib/constants.js.map +1 -1
- package/lib/createTransaction.d.ts.map +1 -1
- package/lib/createTransaction.js +2 -1
- package/lib/createTransaction.js.map +1 -1
- package/lib/getWalletPublicKey.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib-es/Btc.d.ts +31 -7
- package/lib-es/Btc.d.ts.map +1 -1
- package/lib-es/Btc.js +31 -7
- package/lib-es/Btc.js.map +1 -1
- package/lib-es/BtcNew.d.ts +4 -2
- package/lib-es/BtcNew.d.ts.map +1 -1
- package/lib-es/BtcNew.js +9 -2
- package/lib-es/BtcNew.js.map +1 -1
- package/lib-es/BtcOld.d.ts +8 -6
- package/lib-es/BtcOld.d.ts.map +1 -1
- package/lib-es/BtcOld.js +8 -6
- package/lib-es/BtcOld.js.map +1 -1
- package/lib-es/bip32.d.ts +9 -0
- package/lib-es/bip32.d.ts.map +1 -1
- package/lib-es/bip32.js +9 -0
- package/lib-es/bip32.js.map +1 -1
- package/lib-es/constants.d.ts.map +1 -1
- package/lib-es/constants.js +6 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/createTransaction.d.ts.map +1 -1
- package/lib-es/createTransaction.js +2 -1
- package/lib-es/createTransaction.js.map +1 -1
- package/lib-es/getWalletPublicKey.d.ts +1 -1
- package/lib-es/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/Btc.ts +34 -8
- package/src/BtcNew.ts +9 -2
- package/src/BtcOld.ts +8 -6
- package/src/bip32.ts +10 -0
- package/src/constants.ts +6 -1
- package/src/createTransaction.ts +2 -1
- package/src/getWalletPublicKey.ts +1 -1
- package/src/types.ts +12 -0
package/src/createTransaction.ts
CHANGED
|
@@ -173,7 +173,8 @@ export async function createTransaction(
|
|
|
173
173
|
|
|
174
174
|
if (expiryHeight && !isDecred) {
|
|
175
175
|
targetTransaction.nVersionGroupId = Buffer.from(
|
|
176
|
-
// nVersionGroupId is 0x26A7270A for zcash
|
|
176
|
+
// nVersionGroupId is 0x26A7270A for zcash NU5 upgrade
|
|
177
|
+
// refer to https://github.com/zcash/zcash/blob/master/src/primitives/transaction.h
|
|
177
178
|
isZcash
|
|
178
179
|
? [0x0a, 0x27, 0xa7, 0x26]
|
|
179
180
|
: sapling
|
|
@@ -2,7 +2,7 @@ import type Transport from "@ledgerhq/hw-transport";
|
|
|
2
2
|
import { bip32asBuffer } from "./bip32";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* address format is one of legacy | p2sh | bech32 | cashaddr
|
|
5
|
+
* address format is one of legacy | p2sh | bech32 | bech32m | cashaddr
|
|
6
6
|
*/
|
|
7
7
|
export type AddressFormat = "legacy" | "p2sh" | "bech32" | "bech32m" | "cashaddr";
|
|
8
8
|
const addressFormatMap = {
|
package/src/types.ts
CHANGED
|
@@ -17,14 +17,26 @@ export interface TransactionOutput {
|
|
|
17
17
|
/**
|
|
18
18
|
*/
|
|
19
19
|
export interface Transaction {
|
|
20
|
+
// Each transaction is prefixed by a four-byte transaction version number
|
|
21
|
+
// which tells Bitcoin peers and miners which set of rules to use to validate it.
|
|
20
22
|
version: Buffer;
|
|
21
23
|
inputs: TransactionInput[];
|
|
22
24
|
outputs?: TransactionOutput[];
|
|
25
|
+
// locktime indicates the earliest time or earliest block when that transaction may
|
|
26
|
+
// be added to the block chain.
|
|
23
27
|
locktime?: Buffer;
|
|
24
28
|
witness?: Buffer;
|
|
29
|
+
// timestamp is used only for peercoin but it is no longer necessary anymore
|
|
25
30
|
timestamp?: Buffer;
|
|
31
|
+
// nVersionGroupId is used only for Zcash, different version of Zcash has different nVersionGroupId
|
|
32
|
+
// refer to https://github.com/zcash/zcash/blob/master/src/primitives/transaction.h for more details
|
|
26
33
|
nVersionGroupId?: Buffer;
|
|
34
|
+
// nExpiryHeight is used only for Decred and Zcash and ZenCash.
|
|
35
|
+
// It sets the block height after which transactions will be removed
|
|
36
|
+
// from the mempool if they have not been mined
|
|
37
|
+
// refer to https://zips.z.cash/zip-0203 for more details
|
|
27
38
|
nExpiryHeight?: Buffer;
|
|
39
|
+
// extraData is used only for Zcash and ZenCash and komodo
|
|
28
40
|
extraData?: Buffer;
|
|
29
41
|
}
|
|
30
42
|
|