@ledgerhq/hw-app-eth 7.2.0-nightly.20260110024039 → 7.2.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 +21 -10
- package/package.json +11 -12
- package/tests/ledgerService.unit.test.ts +16 -51
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @ledgerhq/hw-app-eth@7.
|
|
2
|
+
> @ledgerhq/hw-app-eth@7.2.0 build /home/runner/work/ledger-live/ledger-live/libs/ledgerjs/packages/hw-app-eth
|
|
3
3
|
> tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
|
|
4
4
|
|
package/.unimportedrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
# @ledgerhq/hw-app-eth
|
|
2
2
|
|
|
3
|
-
## 7.2.0
|
|
3
|
+
## 7.2.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- [#13426](https://github.com/LedgerHQ/ledger-live/pull/13426) [`a8c59da`](https://github.com/LedgerHQ/ledger-live/commit/a8c59da888c8cb3c200a9f62869ca54aba706cae) Thanks [@gre-ledger](https://github.com/gre-ledger)! - update semver library (minor)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`7e12cd3`](https://github.com/LedgerHQ/ledger-live/commit/7e12cd30f47d42cd8dac35cfa475abdd9ad44e19), [`4455451`](https://github.com/LedgerHQ/ledger-live/commit/445545117cf0196d7c5a303df21041c23b91844c), [`8cb7d40`](https://github.com/LedgerHQ/ledger-live/commit/8cb7d40e0a55e47f42adc5cd522740cab1fd4de4), [`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/types-live@6.92.0
|
|
13
|
+
- @ledgerhq/domain-service@1.5.2
|
|
14
|
+
- @ledgerhq/evm-tools@1.9.1
|
|
15
|
+
- @ledgerhq/hw-transport@6.31.16
|
|
16
|
+
- @ledgerhq/hw-transport-mocker@6.30.1
|
|
17
|
+
|
|
18
|
+
## 7.2.0-next.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- [#13426](https://github.com/LedgerHQ/ledger-live/pull/13426) [`a8c59da`](https://github.com/LedgerHQ/ledger-live/commit/a8c59da888c8cb3c200a9f62869ca54aba706cae) Thanks [@gre-ledger](https://github.com/gre-ledger)! - update semver library (minor)
|
|
10
23
|
|
|
11
24
|
### Patch Changes
|
|
12
25
|
|
|
13
|
-
- Updated dependencies [[`7e12cd3`](https://github.com/LedgerHQ/ledger-live/commit/7e12cd30f47d42cd8dac35cfa475abdd9ad44e19), [`4455451`](https://github.com/LedgerHQ/ledger-live/commit/445545117cf0196d7c5a303df21041c23b91844c), [`8cb7d40`](https://github.com/LedgerHQ/ledger-live/commit/8cb7d40e0a55e47f42adc5cd522740cab1fd4de4), [`e57fa40`](https://github.com/LedgerHQ/ledger-live/commit/e57fa40a1bb480ebcc03120a1aab3b02e249bf8d), [`e844b3b`](https://github.com/LedgerHQ/ledger-live/commit/e844b3bd5f8a4b21cf94e0a598c22a2a42791490), [`
|
|
14
|
-
- @ledgerhq/types-live@6.92.0-
|
|
15
|
-
- @ledgerhq/
|
|
16
|
-
- @ledgerhq/
|
|
17
|
-
- @ledgerhq/
|
|
18
|
-
- @ledgerhq/
|
|
19
|
-
- @ledgerhq/domain-service@1.6.0-nightly.20260110024039
|
|
20
|
-
- @ledgerhq/evm-tools@1.10.0-nightly.20260110024039
|
|
26
|
+
- Updated dependencies [[`7e12cd3`](https://github.com/LedgerHQ/ledger-live/commit/7e12cd30f47d42cd8dac35cfa475abdd9ad44e19), [`4455451`](https://github.com/LedgerHQ/ledger-live/commit/445545117cf0196d7c5a303df21041c23b91844c), [`8cb7d40`](https://github.com/LedgerHQ/ledger-live/commit/8cb7d40e0a55e47f42adc5cd522740cab1fd4de4), [`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)]:
|
|
27
|
+
- @ledgerhq/types-live@6.92.0-next.0
|
|
28
|
+
- @ledgerhq/domain-service@1.5.2-next.0
|
|
29
|
+
- @ledgerhq/evm-tools@1.9.1-next.0
|
|
30
|
+
- @ledgerhq/hw-transport@6.31.16-next.0
|
|
31
|
+
- @ledgerhq/hw-transport-mocker@6.30.1-next.0
|
|
21
32
|
|
|
22
33
|
## 7.1.1
|
|
23
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/hw-app-eth",
|
|
3
|
-
"version": "7.2.0
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Ledger Hardware Wallet Ethereum Application API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -32,28 +32,27 @@
|
|
|
32
32
|
"axios": "1.13.2",
|
|
33
33
|
"bignumber.js": "^9.1.2",
|
|
34
34
|
"semver": "7.7.3",
|
|
35
|
-
"@ledgerhq/domain-service": "^1.
|
|
36
|
-
"@ledgerhq/errors": "^6.
|
|
37
|
-
"@ledgerhq/evm-tools": "^1.
|
|
38
|
-
"@ledgerhq/hw-transport": "6.
|
|
39
|
-
"@ledgerhq/hw-transport-mocker": "^6.
|
|
40
|
-
"@ledgerhq/logs": "^6.
|
|
41
|
-
"@ledgerhq/types-live": "^6.92.0
|
|
35
|
+
"@ledgerhq/domain-service": "^1.5.2",
|
|
36
|
+
"@ledgerhq/errors": "^6.28.0",
|
|
37
|
+
"@ledgerhq/evm-tools": "^1.9.1",
|
|
38
|
+
"@ledgerhq/hw-transport": "6.31.16",
|
|
39
|
+
"@ledgerhq/hw-transport-mocker": "^6.30.1",
|
|
40
|
+
"@ledgerhq/logs": "^6.13.0",
|
|
41
|
+
"@ledgerhq/types-live": "^6.92.0"
|
|
42
42
|
},
|
|
43
43
|
"gitHead": "dd0dea64b58e5a9125c8a422dcffd29e5ef6abec",
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@ethersproject/bignumber": "^5.7.0",
|
|
46
46
|
"@ethersproject/constants": "^5.7.0",
|
|
47
47
|
"@ethersproject/units": "^5.7.0",
|
|
48
|
-
"@types/jest": "
|
|
48
|
+
"@types/jest": "^29.5.10",
|
|
49
49
|
"@types/node": "^22.10.10",
|
|
50
50
|
"documentation": "14.0.2",
|
|
51
|
-
"jest": "
|
|
51
|
+
"jest": "^29.7.0",
|
|
52
52
|
"nock": "^13.0.5",
|
|
53
53
|
"rimraf": "^4.4.1",
|
|
54
54
|
"source-map-support": "^0.5.21",
|
|
55
|
-
"
|
|
56
|
-
"@swc/core": "1.15.8",
|
|
55
|
+
"ts-jest": "^29.1.1",
|
|
57
56
|
"ts-node": "^10.4.0"
|
|
58
57
|
},
|
|
59
58
|
"overrides": {
|
|
@@ -2,57 +2,14 @@ import axios from "axios";
|
|
|
2
2
|
import { getSerializedTransaction, transactionData, transactionContracts } from "./fixtures/utils";
|
|
3
3
|
import { ERC1155_CLEAR_SIGNED_SELECTORS, ERC721_CLEAR_SIGNED_SELECTORS } from "../src/utils";
|
|
4
4
|
import partialPluginResponse from "./fixtures/REST/Paraswap-Plugin.json";
|
|
5
|
-
import { getLoadConfig } from "../src/services/ledger/loadConfig";
|
|
6
|
-
import signatureCALEth from "./fixtures/SignatureCALEth";
|
|
7
|
-
import { ResolutionConfig } from "../src/services/types";
|
|
8
|
-
import { ledgerService } from "../src/Eth";
|
|
9
|
-
|
|
10
|
-
// Mock axios
|
|
11
|
-
jest.mock("axios");
|
|
12
|
-
|
|
13
|
-
// Mock the service modules with wrapped real implementations
|
|
14
|
-
jest.mock("../src/services/ledger/contracts", () => {
|
|
15
|
-
const actual = jest.requireActual("../src/services/ledger/contracts");
|
|
16
|
-
return {
|
|
17
|
-
...actual,
|
|
18
|
-
loadInfosForContractMethod: jest.fn(actual.loadInfosForContractMethod),
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
jest.mock("../src/services/ledger/erc20", () => {
|
|
23
|
-
const actual = jest.requireActual("../src/services/ledger/erc20");
|
|
24
|
-
return {
|
|
25
|
-
...actual,
|
|
26
|
-
findERC20SignaturesInfo: jest.fn(actual.findERC20SignaturesInfo),
|
|
27
|
-
byContractAddressAndChainId: jest.fn(actual.byContractAddressAndChainId),
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
jest.mock("../src/services/ledger/nfts", () => {
|
|
32
|
-
const actual = jest.requireActual("../src/services/ledger/nfts");
|
|
33
|
-
return {
|
|
34
|
-
...actual,
|
|
35
|
-
getNFTInfo: jest.fn(actual.getNFTInfo),
|
|
36
|
-
loadNftPlugin: jest.fn(actual.loadNftPlugin),
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
jest.mock("../src/modules/Uniswap", () => {
|
|
41
|
-
const actual = jest.requireActual("../src/modules/Uniswap");
|
|
42
|
-
return {
|
|
43
|
-
...actual,
|
|
44
|
-
loadInfosForUniswap: jest.fn(actual.loadInfosForUniswap),
|
|
45
|
-
getCommandsAndTokensFromUniswapCalldata: jest.fn(
|
|
46
|
-
actual.getCommandsAndTokensFromUniswapCalldata,
|
|
47
|
-
),
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// Import mocked modules after jest.mock calls
|
|
52
5
|
import * as contractServices from "../src/services/ledger/contracts";
|
|
6
|
+
import { getLoadConfig } from "../src/services/ledger/loadConfig";
|
|
53
7
|
import * as erc20Services from "../src/services/ledger/erc20";
|
|
54
8
|
import * as nftServices from "../src/services/ledger/nfts";
|
|
9
|
+
import signatureCALEth from "./fixtures/SignatureCALEth";
|
|
55
10
|
import * as uniswapModule from "../src/modules/Uniswap";
|
|
11
|
+
import { ResolutionConfig } from "../src/services/types";
|
|
12
|
+
import { ledgerService } from "../src/Eth";
|
|
56
13
|
|
|
57
14
|
const loadConfig = getLoadConfig({ staticERC20Signatures: { 1: signatureCALEth } });
|
|
58
15
|
const resolutionConfig: ResolutionConfig = {
|
|
@@ -62,6 +19,16 @@ const resolutionConfig: ResolutionConfig = {
|
|
|
62
19
|
uniswapV3: true,
|
|
63
20
|
};
|
|
64
21
|
|
|
22
|
+
jest.mock("axios");
|
|
23
|
+
|
|
24
|
+
jest.spyOn(contractServices, "loadInfosForContractMethod");
|
|
25
|
+
jest.spyOn(nftServices, "loadNftPlugin");
|
|
26
|
+
jest.spyOn(nftServices, "getNFTInfo");
|
|
27
|
+
jest.spyOn(erc20Services, "findERC20SignaturesInfo");
|
|
28
|
+
jest.spyOn(erc20Services, "byContractAddressAndChainId");
|
|
29
|
+
jest.spyOn(uniswapModule, "loadInfosForUniswap");
|
|
30
|
+
jest.spyOn(uniswapModule, "getCommandsAndTokensFromUniswapCalldata");
|
|
31
|
+
|
|
65
32
|
describe("Ledger Service", () => {
|
|
66
33
|
describe("Transaction resolution", () => {
|
|
67
34
|
beforeEach(() => {
|
|
@@ -724,8 +691,7 @@ describe("Ledger Service", () => {
|
|
|
724
691
|
expect(erc20Services.findERC20SignaturesInfo).toHaveBeenCalledTimes(2);
|
|
725
692
|
expect(erc20Services.byContractAddressAndChainId).toHaveBeenCalledTimes(2);
|
|
726
693
|
expect(uniswapModule.loadInfosForUniswap).toHaveBeenCalledTimes(1);
|
|
727
|
-
|
|
728
|
-
// so it doesn't go through the mock when using jest.mock with wrapped real implementations
|
|
694
|
+
expect(uniswapModule.getCommandsAndTokensFromUniswapCalldata).toHaveBeenCalledTimes(1);
|
|
729
695
|
expect(nftServices.getNFTInfo).not.toHaveBeenCalled();
|
|
730
696
|
expect(nftServices.loadNftPlugin).not.toHaveBeenCalled();
|
|
731
697
|
});
|
|
@@ -767,8 +733,7 @@ describe("Ledger Service", () => {
|
|
|
767
733
|
expect(erc20Services.findERC20SignaturesInfo).toHaveBeenCalledTimes(2);
|
|
768
734
|
expect(erc20Services.byContractAddressAndChainId).toHaveBeenCalledTimes(2);
|
|
769
735
|
expect(uniswapModule.loadInfosForUniswap).toHaveBeenCalledTimes(1);
|
|
770
|
-
|
|
771
|
-
// so it doesn't go through the mock when using jest.mock with wrapped real implementations
|
|
736
|
+
expect(uniswapModule.getCommandsAndTokensFromUniswapCalldata).toHaveBeenCalledTimes(1);
|
|
772
737
|
expect(nftServices.getNFTInfo).not.toHaveBeenCalled();
|
|
773
738
|
expect(nftServices.loadNftPlugin).not.toHaveBeenCalled();
|
|
774
739
|
});
|