@ledgerhq/coin-bitcoin 0.28.0-nightly.20260113024349 → 0.28.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/.turbo/turbo-build.log +1 -1
- package/.unimportedrc.json +1 -4
- package/CHANGELOG.md +30 -12
- package/jest.config.js +2 -10
- package/jest.integ.config.js +4 -15
- package/package.json +16 -17
- package/src/__tests__/unit/buildTransaction.fees.unit.test.ts +18 -19
- package/src/getTransactionStatus.test.ts +5 -24
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @ledgerhq/coin-bitcoin@0.
|
|
2
|
+
> @ledgerhq/coin-bitcoin@0.28.0 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-bitcoin
|
|
3
3
|
> tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
|
|
4
4
|
|
package/.unimportedrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,43 @@
|
|
|
1
1
|
# @ledgerhq/coin-bitcoin
|
|
2
2
|
|
|
3
|
-
## 0.28.0
|
|
3
|
+
## 0.28.0
|
|
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
|
-
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`6e6a12c`](https://github.com/LedgerHQ/ledger-live/commit/6e6a12cdfd79b752839bf664bab5156cea9c9e23), [`398b3d8`](https://github.com/LedgerHQ/ledger-live/commit/398b3d85d2de4a520d5ae78a18135f8d163aad5b), [`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.36.0
|
|
13
|
+
- @ledgerhq/coin-framework@6.12.0
|
|
14
|
+
- @ledgerhq/types-live@6.92.0
|
|
15
|
+
- @ledgerhq/devices@8.9.0
|
|
16
|
+
- @ledgerhq/live-env@2.24.0
|
|
17
|
+
- @ledgerhq/live-network@2.1.5
|
|
18
|
+
|
|
19
|
+
## 0.28.0-next.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`398b3d8`](https://github.com/LedgerHQ/ledger-live/commit/398b3d85d2de4a520d5ae78a18135f8d163aad5b)]:
|
|
24
|
+
- @ledgerhq/coin-framework@6.12.0-next.1
|
|
25
|
+
|
|
26
|
+
## 0.28.0-next.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- [#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.
|
|
10
31
|
|
|
11
32
|
### Patch Changes
|
|
12
33
|
|
|
13
|
-
- Updated dependencies [[`6e6a12c`](https://github.com/LedgerHQ/ledger-live/commit/6e6a12cdfd79b752839bf664bab5156cea9c9e23), [`
|
|
14
|
-
- @ledgerhq/cryptoassets@13.36.0-
|
|
15
|
-
- @ledgerhq/
|
|
16
|
-
- @ledgerhq/
|
|
17
|
-
- @ledgerhq/
|
|
18
|
-
- @ledgerhq/
|
|
19
|
-
- @ledgerhq/
|
|
20
|
-
- @ledgerhq/errors@6.29.0-nightly.20260113024349
|
|
21
|
-
- @ledgerhq/logs@6.14.0-nightly.20260113024349
|
|
22
|
-
- @ledgerhq/live-network@2.2.0-nightly.20260113024349
|
|
34
|
+
- 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)]:
|
|
35
|
+
- @ledgerhq/cryptoassets@13.36.0-next.0
|
|
36
|
+
- @ledgerhq/types-live@6.92.0-next.0
|
|
37
|
+
- @ledgerhq/devices@8.9.0-next.0
|
|
38
|
+
- @ledgerhq/live-env@2.24.0-next.0
|
|
39
|
+
- @ledgerhq/coin-framework@6.11.2-next.0
|
|
40
|
+
- @ledgerhq/live-network@2.1.5-next.0
|
|
23
41
|
|
|
24
42
|
## 0.27.1
|
|
25
43
|
|
package/jest.config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
|
|
1
2
|
module.exports = {
|
|
2
3
|
passWithNoTests: true,
|
|
3
4
|
collectCoverageFrom: [
|
|
@@ -10,17 +11,8 @@ module.exports = {
|
|
|
10
11
|
"!src/wallet-btc/__tests__/**/*.ts",
|
|
11
12
|
],
|
|
12
13
|
coverageReporters: ["json", ["lcov", { file: "lcov.info", projectRoot: "../../../" }], "text"],
|
|
14
|
+
preset: "ts-jest",
|
|
13
15
|
testEnvironment: "node",
|
|
14
|
-
transform: {
|
|
15
|
-
"^.+\\.(ts|tsx)$": [
|
|
16
|
-
"@swc/jest",
|
|
17
|
-
{
|
|
18
|
-
jsc: {
|
|
19
|
-
target: "esnext",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
16
|
testPathIgnorePatterns: ["lib/", "lib-es/", ".integration.test.ts"],
|
|
25
17
|
modulePathIgnorePatterns: ["__tests__/fixtures"],
|
|
26
18
|
reporters: [
|
package/jest.integ.config.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
/** @type {import('jest').
|
|
1
|
+
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
|
|
2
2
|
module.exports = {
|
|
3
|
+
preset: "ts-jest",
|
|
3
4
|
testEnvironment: "node",
|
|
4
|
-
testRegex: ".
|
|
5
|
-
testPathIgnorePatterns: ["lib/", "lib-es/"],
|
|
5
|
+
testRegex: ".integration.test.ts$",
|
|
6
|
+
testPathIgnorePatterns: ["lib/", "lib-es/", "bridge.integration.test.ts"],
|
|
6
7
|
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
|
-
},
|
|
19
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-bitcoin",
|
|
3
|
-
"version": "0.28.0
|
|
3
|
+
"version": "0.28.0",
|
|
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": "^27.4.6",
|
|
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.12.0
|
|
65
|
-
"@ledgerhq/cryptoassets": "^13.36.0
|
|
66
|
-
"@ledgerhq/devices": "8.9.0
|
|
67
|
-
"@ledgerhq/errors": "^6.
|
|
68
|
-
"@ledgerhq/live-env": "^2.24.0
|
|
69
|
-
"@ledgerhq/live-network": "^2.
|
|
70
|
-
"@ledgerhq/logs": "^6.
|
|
71
|
-
"@ledgerhq/types-cryptoassets": "^7.
|
|
72
|
-
"@ledgerhq/types-live": "^6.92.0
|
|
64
|
+
"@ledgerhq/coin-framework": "^6.12.0",
|
|
65
|
+
"@ledgerhq/cryptoassets": "^13.36.0",
|
|
66
|
+
"@ledgerhq/devices": "8.9.0",
|
|
67
|
+
"@ledgerhq/errors": "^6.28.0",
|
|
68
|
+
"@ledgerhq/live-env": "^2.24.0",
|
|
69
|
+
"@ledgerhq/live-network": "^2.1.5",
|
|
70
|
+
"@ledgerhq/logs": "^6.13.0",
|
|
71
|
+
"@ledgerhq/types-cryptoassets": "^7.31.0",
|
|
72
|
+
"@ledgerhq/types-live": "^6.92.0"
|
|
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": "^29.5.10",
|
|
82
82
|
"@types/lodash": "^4.14.191",
|
|
83
83
|
"@types/object-hash": "^2.1.0",
|
|
84
84
|
"@types/ripemd160": "^2.0.3",
|
|
@@ -87,12 +87,11 @@
|
|
|
87
87
|
"axios": "1.13.2",
|
|
88
88
|
"bip32": "^2.0.6",
|
|
89
89
|
"bip39": "^3.0.4",
|
|
90
|
-
"jest": "
|
|
91
|
-
"jest-file-snapshot": "0.
|
|
90
|
+
"jest": "^29.7.0",
|
|
91
|
+
"jest-file-snapshot": "^0.5.0",
|
|
92
92
|
"object-hash": "^2.2.0",
|
|
93
|
-
"
|
|
94
|
-
"@
|
|
95
|
-
"@ledgerhq/disable-network-setup": "^0.2.0-nightly.20260113024349"
|
|
93
|
+
"ts-jest": "^29.1.1",
|
|
94
|
+
"@ledgerhq/disable-network-setup": "^0.1.0"
|
|
96
95
|
},
|
|
97
96
|
"scripts": {
|
|
98
97
|
"clean": "rimraf lib lib-es",
|
|
@@ -10,25 +10,24 @@ 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
|
-
|
|
31
|
-
});
|
|
13
|
+
class DummyStrategy {
|
|
14
|
+
constructor(..._args: any[]) {}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
jest.mock("../../wallet-btc", () => ({
|
|
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
|
+
}));
|
|
32
31
|
|
|
33
32
|
import { buildTransaction } from "../../buildTransaction";
|
|
34
33
|
|
|
@@ -1,35 +1,16 @@
|
|
|
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";
|
|
4
5
|
import { BitcoinInput, Transaction } from "./types";
|
|
6
|
+
import getTransactionStatus, { MAX_BLOCK_HEIGHT_FOR_TAPROOT } from "./getTransactionStatus";
|
|
5
7
|
import { AddressesSanctionedError } from "@ledgerhq/coin-framework/sanction/errors";
|
|
6
8
|
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";
|
|
27
9
|
import * as sanction from "@ledgerhq/coin-framework/sanction/index";
|
|
28
|
-
import getTransactionStatus, { MAX_BLOCK_HEIGHT_FOR_TAPROOT } from "./getTransactionStatus";
|
|
29
10
|
|
|
30
|
-
const calculateFeesSpy = cache
|
|
31
|
-
const validateRecipientSpy = cache
|
|
32
|
-
const isAddressSanctionedSpy = sanction
|
|
11
|
+
const calculateFeesSpy = jest.spyOn(cache, "calculateFees");
|
|
12
|
+
const validateRecipientSpy = jest.spyOn(cache, "validateRecipient");
|
|
13
|
+
const isAddressSanctionedSpy = jest.spyOn(sanction, "isAddressSanctioned");
|
|
33
14
|
|
|
34
15
|
describe("getTransactionStatus on Bitcoin", () => {
|
|
35
16
|
it("should return as sender error only sanctioned utxo addresses", async () => {
|