@ledgerhq/coin-bitcoin 0.28.0-nightly.20260106024351 → 0.28.0-nightly.20260107024347
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/.unimportedrc.json +4 -1
- package/CHANGELOG.md +13 -8
- package/jest.config.js +10 -2
- package/jest.integ.config.js +15 -4
- package/package.json +17 -16
- package/src/__tests__/unit/buildTransaction.fees.unit.test.ts +19 -18
- package/src/getTransactionStatus.test.ts +24 -5
package/.unimportedrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
# @ledgerhq/coin-bitcoin
|
|
2
2
|
|
|
3
|
-
## 0.28.0-nightly.
|
|
3
|
+
## 0.28.0-nightly.20260107024347
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- [#13431](https://github.com/LedgerHQ/ledger-live/pull/13431) [`d1a83d9`](https://github.com/LedgerHQ/ledger-live/commit/d1a83d942d98e52eeac3d459f5f8ac763d4b6c13) Thanks [@gre-ledger](https://github.com/gre-ledger)! - Update to latest bs58 libs.
|
|
8
8
|
|
|
9
|
+
- [#13396](https://github.com/LedgerHQ/ledger-live/pull/13396) [`b9a3e43`](https://github.com/LedgerHQ/ledger-live/commit/b9a3e431be33943ab4feb4294d6a7f27b966e61b) Thanks [@gre-ledger](https://github.com/gre-ledger)! - Update Jest to v30
|
|
10
|
+
|
|
9
11
|
### Patch Changes
|
|
10
12
|
|
|
11
|
-
- Updated dependencies [[`6e6a12c`](https://github.com/LedgerHQ/ledger-live/commit/6e6a12cdfd79b752839bf664bab5156cea9c9e23), [`7e12cd3`](https://github.com/LedgerHQ/ledger-live/commit/7e12cd30f47d42cd8dac35cfa475abdd9ad44e19), [`a8c59da`](https://github.com/LedgerHQ/ledger-live/commit/a8c59da888c8cb3c200a9f62869ca54aba706cae), [`4455451`](https://github.com/LedgerHQ/ledger-live/commit/445545117cf0196d7c5a303df21041c23b91844c), [`8cb7d40`](https://github.com/LedgerHQ/ledger-live/commit/8cb7d40e0a55e47f42adc5cd522740cab1fd4de4), [`fba1e31`](https://github.com/LedgerHQ/ledger-live/commit/fba1e31386e589a93adb19bc4f6eae55129e19ea), [`e57fa40`](https://github.com/LedgerHQ/ledger-live/commit/e57fa40a1bb480ebcc03120a1aab3b02e249bf8d), [`e844b3b`](https://github.com/LedgerHQ/ledger-live/commit/e844b3bd5f8a4b21cf94e0a598c22a2a42791490), [`c2d4259`](https://github.com/LedgerHQ/ledger-live/commit/c2d425989b600732f4fb0a88993e2673e93698a7), [`9e80ecc`](https://github.com/LedgerHQ/ledger-live/commit/9e80ecc5ef6da4f39a184d3c555c8d7c439754a8), [`ffa9e7e`](https://github.com/LedgerHQ/ledger-live/commit/ffa9e7e58dd60d0f568362a95e14ba5d130c2d07), [`4caf2ef`](https://github.com/LedgerHQ/ledger-live/commit/4caf2eff2aff2a6f1048ccf8e94295c954554ae1), [`c4045c7`](https://github.com/LedgerHQ/ledger-live/commit/c4045c714ee0fb1f02f6e75cae04e99cdea01ae4)]:
|
|
12
|
-
- @ledgerhq/cryptoassets@13.
|
|
13
|
-
- @ledgerhq/
|
|
14
|
-
- @ledgerhq/
|
|
15
|
-
- @ledgerhq/
|
|
16
|
-
- @ledgerhq/
|
|
17
|
-
- @ledgerhq/
|
|
13
|
+
- Updated dependencies [[`6e6a12c`](https://github.com/LedgerHQ/ledger-live/commit/6e6a12cdfd79b752839bf664bab5156cea9c9e23), [`537a975`](https://github.com/LedgerHQ/ledger-live/commit/537a975536ca3669d3b88371e1e1f651c4cb9a1b), [`cbcae7c`](https://github.com/LedgerHQ/ledger-live/commit/cbcae7c0ba9b54b1167d26e4227bd2b847207cb9), [`7e12cd3`](https://github.com/LedgerHQ/ledger-live/commit/7e12cd30f47d42cd8dac35cfa475abdd9ad44e19), [`a8c59da`](https://github.com/LedgerHQ/ledger-live/commit/a8c59da888c8cb3c200a9f62869ca54aba706cae), [`4455451`](https://github.com/LedgerHQ/ledger-live/commit/445545117cf0196d7c5a303df21041c23b91844c), [`8cb7d40`](https://github.com/LedgerHQ/ledger-live/commit/8cb7d40e0a55e47f42adc5cd522740cab1fd4de4), [`fba1e31`](https://github.com/LedgerHQ/ledger-live/commit/fba1e31386e589a93adb19bc4f6eae55129e19ea), [`e57fa40`](https://github.com/LedgerHQ/ledger-live/commit/e57fa40a1bb480ebcc03120a1aab3b02e249bf8d), [`e844b3b`](https://github.com/LedgerHQ/ledger-live/commit/e844b3bd5f8a4b21cf94e0a598c22a2a42791490), [`b9a3e43`](https://github.com/LedgerHQ/ledger-live/commit/b9a3e431be33943ab4feb4294d6a7f27b966e61b), [`c2d4259`](https://github.com/LedgerHQ/ledger-live/commit/c2d425989b600732f4fb0a88993e2673e93698a7), [`9e80ecc`](https://github.com/LedgerHQ/ledger-live/commit/9e80ecc5ef6da4f39a184d3c555c8d7c439754a8), [`ffa9e7e`](https://github.com/LedgerHQ/ledger-live/commit/ffa9e7e58dd60d0f568362a95e14ba5d130c2d07), [`4caf2ef`](https://github.com/LedgerHQ/ledger-live/commit/4caf2eff2aff2a6f1048ccf8e94295c954554ae1), [`c4045c7`](https://github.com/LedgerHQ/ledger-live/commit/c4045c714ee0fb1f02f6e75cae04e99cdea01ae4)]:
|
|
14
|
+
- @ledgerhq/cryptoassets@13.36.0-nightly.20260107024347
|
|
15
|
+
- @ledgerhq/coin-framework@6.12.0-nightly.20260107024347
|
|
16
|
+
- @ledgerhq/types-live@6.92.0-nightly.20260107024347
|
|
17
|
+
- @ledgerhq/devices@8.9.0-nightly.20260107024347
|
|
18
|
+
- @ledgerhq/live-env@2.24.0-nightly.20260107024347
|
|
19
|
+
- @ledgerhq/types-cryptoassets@7.32.0-nightly.20260107024347
|
|
20
|
+
- @ledgerhq/errors@6.29.0-nightly.20260107024347
|
|
21
|
+
- @ledgerhq/logs@6.14.0-nightly.20260107024347
|
|
22
|
+
- @ledgerhq/live-network@2.2.0-nightly.20260107024347
|
|
18
23
|
|
|
19
24
|
## 0.27.1
|
|
20
25
|
|
package/jest.config.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
|
|
2
1
|
module.exports = {
|
|
3
2
|
passWithNoTests: true,
|
|
4
3
|
collectCoverageFrom: [
|
|
@@ -11,8 +10,17 @@ module.exports = {
|
|
|
11
10
|
"!src/wallet-btc/__tests__/**/*.ts",
|
|
12
11
|
],
|
|
13
12
|
coverageReporters: ["json", ["lcov", { file: "lcov.info", projectRoot: "../../../" }], "text"],
|
|
14
|
-
preset: "ts-jest",
|
|
15
13
|
testEnvironment: "node",
|
|
14
|
+
transform: {
|
|
15
|
+
"^.+\\.(ts|tsx)$": [
|
|
16
|
+
"@swc/jest",
|
|
17
|
+
{
|
|
18
|
+
jsc: {
|
|
19
|
+
target: "esnext",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
16
24
|
testPathIgnorePatterns: ["lib/", "lib-es/", ".integration.test.ts"],
|
|
17
25
|
modulePathIgnorePatterns: ["__tests__/fixtures"],
|
|
18
26
|
reporters: [
|
package/jest.integ.config.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
/** @type {import('
|
|
1
|
+
/** @type {import('jest').Config} */
|
|
2
2
|
module.exports = {
|
|
3
|
-
preset: "ts-jest",
|
|
4
3
|
testEnvironment: "node",
|
|
5
|
-
testRegex: ".
|
|
6
|
-
testPathIgnorePatterns: ["lib/", "lib-es/"
|
|
4
|
+
testRegex: ".integ.test.ts$",
|
|
5
|
+
testPathIgnorePatterns: ["lib/", "lib-es/"],
|
|
7
6
|
testTimeout: 60_000,
|
|
7
|
+
forceExit: true,
|
|
8
|
+
passWithNoTests: true,
|
|
9
|
+
transform: {
|
|
10
|
+
"^.+\\.(t|j)sx?$": [
|
|
11
|
+
"@swc/jest",
|
|
12
|
+
{
|
|
13
|
+
jsc: {
|
|
14
|
+
target: "esnext",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
8
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-bitcoin",
|
|
3
|
-
"version": "0.28.0-nightly.
|
|
3
|
+
"version": "0.28.0-nightly.20260107024347",
|
|
4
4
|
"description": "Ledger Bitcoin Coin integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -54,22 +54,22 @@
|
|
|
54
54
|
"cashaddrjs": "^0.4.4",
|
|
55
55
|
"coininfo": "^5.1.0",
|
|
56
56
|
"create-hmac": "^1.1.7",
|
|
57
|
-
"expect": "
|
|
57
|
+
"expect": "30.2.0",
|
|
58
58
|
"invariant": "^2.2.2",
|
|
59
59
|
"lodash": "^4.17.21",
|
|
60
60
|
"rxjs": "7.8.2",
|
|
61
61
|
"@noble/curves": "^1.9.7",
|
|
62
62
|
"utility-types": "^3.10.0",
|
|
63
63
|
"varuint-bitcoin": "1.1.2",
|
|
64
|
-
"@ledgerhq/coin-framework": "^6.
|
|
65
|
-
"@ledgerhq/cryptoassets": "^13.
|
|
66
|
-
"@ledgerhq/devices": "8.9.0-nightly.
|
|
67
|
-
"@ledgerhq/errors": "^6.
|
|
68
|
-
"@ledgerhq/live-env": "^2.24.0-nightly.
|
|
69
|
-
"@ledgerhq/live-network": "^2.
|
|
70
|
-
"@ledgerhq/logs": "^6.
|
|
71
|
-
"@ledgerhq/types-cryptoassets": "^7.
|
|
72
|
-
"@ledgerhq/types-live": "^6.92.0-nightly.
|
|
64
|
+
"@ledgerhq/coin-framework": "^6.12.0-nightly.20260107024347",
|
|
65
|
+
"@ledgerhq/cryptoassets": "^13.36.0-nightly.20260107024347",
|
|
66
|
+
"@ledgerhq/devices": "8.9.0-nightly.20260107024347",
|
|
67
|
+
"@ledgerhq/errors": "^6.29.0-nightly.20260107024347",
|
|
68
|
+
"@ledgerhq/live-env": "^2.24.0-nightly.20260107024347",
|
|
69
|
+
"@ledgerhq/live-network": "^2.2.0-nightly.20260107024347",
|
|
70
|
+
"@ledgerhq/logs": "^6.14.0-nightly.20260107024347",
|
|
71
|
+
"@ledgerhq/types-cryptoassets": "^7.32.0-nightly.20260107024347",
|
|
72
|
+
"@ledgerhq/types-live": "^6.92.0-nightly.20260107024347"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/bchaddrjs": "^0.4.3",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@types/cashaddrjs": "^0.3.3",
|
|
79
79
|
"@types/create-hmac": "^1.1.3",
|
|
80
80
|
"@types/invariant": "^2.2.2",
|
|
81
|
-
"@types/jest": "
|
|
81
|
+
"@types/jest": "30.0.0",
|
|
82
82
|
"@types/lodash": "^4.14.191",
|
|
83
83
|
"@types/object-hash": "^2.1.0",
|
|
84
84
|
"@types/ripemd160": "^2.0.3",
|
|
@@ -87,11 +87,12 @@
|
|
|
87
87
|
"axios": "1.13.2",
|
|
88
88
|
"bip32": "^2.0.6",
|
|
89
89
|
"bip39": "^3.0.4",
|
|
90
|
-
"jest": "
|
|
91
|
-
"jest-file-snapshot": "
|
|
90
|
+
"jest": "30.2.0",
|
|
91
|
+
"jest-file-snapshot": "0.7.0",
|
|
92
92
|
"object-hash": "^2.2.0",
|
|
93
|
-
"
|
|
94
|
-
"@
|
|
93
|
+
"@swc/jest": "0.2.39",
|
|
94
|
+
"@swc/core": "1.15.8",
|
|
95
|
+
"@ledgerhq/disable-network-setup": "^0.2.0-nightly.20260107024347"
|
|
95
96
|
},
|
|
96
97
|
"scripts": {
|
|
97
98
|
"clean": "rimraf lib lib-es",
|
|
@@ -10,24 +10,25 @@ let currentExplorer: any = {
|
|
|
10
10
|
getNetwork: jest.fn().mockResolvedValue({ relay_fee: "0.00001000" }), // 1 sat/vB
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
13
|
+
jest.mock("../../wallet-btc", () => {
|
|
14
|
+
class DummyStrategy {
|
|
15
|
+
constructor(..._args: any[]) {}
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
__esModule: true,
|
|
19
|
+
default: {
|
|
20
|
+
estimateAccountMaxSpendable: (...args: any[]) => estimateAccountMaxSpendable(...args),
|
|
21
|
+
buildAccountTx: (...args: any[]) => buildAccountTx(...args),
|
|
22
|
+
},
|
|
23
|
+
getWalletAccount: jest.fn((_account: any) => ({
|
|
24
|
+
xpub: { explorer: currentExplorer, crypto: {} },
|
|
25
|
+
derivationMode: "native_segwit",
|
|
26
|
+
})),
|
|
27
|
+
CoinSelect: DummyStrategy,
|
|
28
|
+
DeepFirst: DummyStrategy,
|
|
29
|
+
Merge: DummyStrategy,
|
|
30
|
+
};
|
|
31
|
+
});
|
|
31
32
|
|
|
32
33
|
import { buildTransaction } from "../../buildTransaction";
|
|
33
34
|
|
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
/* eslint @typescript-eslint/consistent-type-assertions: 0 */
|
|
2
2
|
|
|
3
3
|
import { Account } from "@ledgerhq/types-live";
|
|
4
|
-
import * as cache from "./cache";
|
|
5
4
|
import { BitcoinInput, Transaction } from "./types";
|
|
6
|
-
import getTransactionStatus, { MAX_BLOCK_HEIGHT_FOR_TAPROOT } from "./getTransactionStatus";
|
|
7
5
|
import { AddressesSanctionedError } from "@ledgerhq/coin-framework/sanction/errors";
|
|
8
6
|
import BigNumber from "bignumber.js";
|
|
7
|
+
|
|
8
|
+
// Mock modules before importing the module under test
|
|
9
|
+
jest.mock("./cache", () => {
|
|
10
|
+
const actual = jest.requireActual("./cache");
|
|
11
|
+
return {
|
|
12
|
+
...actual,
|
|
13
|
+
calculateFees: jest.fn(),
|
|
14
|
+
validateRecipient: jest.fn(),
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
jest.mock("@ledgerhq/coin-framework/sanction/index", () => {
|
|
19
|
+
const actual = jest.requireActual("@ledgerhq/coin-framework/sanction/index");
|
|
20
|
+
return {
|
|
21
|
+
...actual,
|
|
22
|
+
isAddressSanctioned: jest.fn(),
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
import * as cache from "./cache";
|
|
9
27
|
import * as sanction from "@ledgerhq/coin-framework/sanction/index";
|
|
28
|
+
import getTransactionStatus, { MAX_BLOCK_HEIGHT_FOR_TAPROOT } from "./getTransactionStatus";
|
|
10
29
|
|
|
11
|
-
const calculateFeesSpy = jest.
|
|
12
|
-
const validateRecipientSpy = jest.
|
|
13
|
-
const isAddressSanctionedSpy = jest.
|
|
30
|
+
const calculateFeesSpy = cache.calculateFees as jest.Mock;
|
|
31
|
+
const validateRecipientSpy = cache.validateRecipient as jest.Mock;
|
|
32
|
+
const isAddressSanctionedSpy = sanction.isAddressSanctioned as jest.Mock;
|
|
14
33
|
|
|
15
34
|
describe("getTransactionStatus on Bitcoin", () => {
|
|
16
35
|
it("should return as sender error only sanctioned utxo addresses", async () => {
|