@ledgerhq/coin-tester-evm 1.10.0-nightly.20251105073255 → 1.10.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/CHANGELOG.md +48 -11
- package/lib/src/scenarii/core.d.ts.map +1 -1
- package/lib/src/scenarii/core.js +12 -2
- package/lib/src/scenarii/core.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-es/src/scenarii/core.d.ts.map +1 -1
- package/lib-es/src/scenarii/core.js +10 -3
- package/lib-es/src/scenarii/core.js.map +1 -1
- package/lib-es/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/scenarii/core.ts +12 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-tester-evm",
|
|
3
|
-
"version": "1.10.0
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Ledger EVM Coin Tester",
|
|
5
5
|
"main": "src/scenarii.test.ts",
|
|
6
6
|
"keywords": [
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
"dotenv": "^16.4.5",
|
|
52
52
|
"ethers": "6.15.0",
|
|
53
53
|
"msw": "^2.2.1",
|
|
54
|
-
"@ledgerhq/coin-evm": "^2.34.0
|
|
55
|
-
"@ledgerhq/coin-framework": "^6.8.0
|
|
56
|
-
"@ledgerhq/coin-tester": "^0.11.0
|
|
57
|
-
"@ledgerhq/cryptoassets": "^13.32.0
|
|
58
|
-
"@ledgerhq/live-common": "^34.52.0
|
|
54
|
+
"@ledgerhq/coin-evm": "^2.34.0",
|
|
55
|
+
"@ledgerhq/coin-framework": "^6.8.0",
|
|
56
|
+
"@ledgerhq/coin-tester": "^0.11.0",
|
|
57
|
+
"@ledgerhq/cryptoassets": "^13.32.0",
|
|
58
|
+
"@ledgerhq/live-common": "^34.52.0",
|
|
59
59
|
"@ledgerhq/live-config": "^3.2.0",
|
|
60
|
-
"@ledgerhq/live-signer-evm": "^0.10.0
|
|
61
|
-
"@ledgerhq/types-cryptoassets": "^7.30.0
|
|
62
|
-
"@ledgerhq/types-live": "^6.88.0
|
|
60
|
+
"@ledgerhq/live-signer-evm": "^0.10.0",
|
|
61
|
+
"@ledgerhq/types-cryptoassets": "^7.30.0",
|
|
62
|
+
"@ledgerhq/types-live": "^6.88.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@swc/core": "1.4.11",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"ts-jest": "^29.1.2",
|
|
73
73
|
"ts-node": "^10.9.2",
|
|
74
74
|
"typescript": "^5.3.3",
|
|
75
|
-
"@ledgerhq/hw-transport": "6.31.13
|
|
75
|
+
"@ledgerhq/hw-transport": "6.31.13"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"clean": "rimraf lib lib-es",
|
package/src/scenarii/core.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { makeAccount } from "../fixtures";
|
|
2
|
+
import { buildAccountBridge, buildCurrencyBridge } from "@ledgerhq/coin-evm/bridge/js";
|
|
2
3
|
import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
|
|
4
|
+
import resolver from "@ledgerhq/coin-evm/hw-getAddress";
|
|
5
|
+
import { EvmSigner } from "@ledgerhq/coin-evm/types/signer";
|
|
3
6
|
import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
|
|
4
7
|
import { encodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
|
|
8
|
+
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
5
9
|
import { Scenario, ScenarioTransaction } from "@ledgerhq/coin-tester/main";
|
|
6
10
|
import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/speculos";
|
|
7
11
|
import { findTokenById } from "@ledgerhq/cryptoassets/tokens";
|
|
8
12
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
13
|
+
import { LegacySignerEth } from "@ledgerhq/live-signer-evm";
|
|
9
14
|
import { Account } from "@ledgerhq/types-live";
|
|
10
15
|
import { BigNumber } from "bignumber.js";
|
|
11
16
|
import { ethers } from "ethers";
|
|
12
17
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
13
|
-
import { VITALIK, core
|
|
18
|
+
import { VITALIK, core } from "../helpers";
|
|
14
19
|
import { indexBlocks, initMswHandlers, resetIndexer, setBlock } from "../indexer";
|
|
15
20
|
import { defaultNanoApp } from "../constants";
|
|
16
21
|
|
|
@@ -64,12 +69,13 @@ const makeScenarioTransactions = ({ address }: { address: string }): CoreScenari
|
|
|
64
69
|
|
|
65
70
|
export const scenarioCore: Scenario<EvmTransaction, Account> = {
|
|
66
71
|
name: "Ledger Live Basic CORE Transactions",
|
|
67
|
-
setup: async
|
|
72
|
+
setup: async () => {
|
|
68
73
|
const [{ transport, getOnSpeculosConfirmation }] = await Promise.all([
|
|
69
74
|
spawnSpeculos(`/${defaultNanoApp.firmware}/Ethereum/app_${defaultNanoApp.version}.elf`),
|
|
70
75
|
spawnAnvil("https://rpc.ankr.com/core"),
|
|
71
76
|
]);
|
|
72
77
|
const provider = new ethers.JsonRpcProvider("http://127.0.0.1:8545");
|
|
78
|
+
const signerContext: SignerContext<EvmSigner> = (_, fn) => fn(new LegacySignerEth(transport));
|
|
73
79
|
|
|
74
80
|
setCoinConfig(() => ({
|
|
75
81
|
info: {
|
|
@@ -108,7 +114,10 @@ export const scenarioCore: Scenario<EvmTransaction, Account> = {
|
|
|
108
114
|
initMswHandlers(getCoinConfig(core).info);
|
|
109
115
|
|
|
110
116
|
const onSignerConfirmation = getOnSpeculosConfirmation();
|
|
111
|
-
const
|
|
117
|
+
const currencyBridge = buildCurrencyBridge(signerContext);
|
|
118
|
+
await currencyBridge.preload(core);
|
|
119
|
+
const accountBridge = buildAccountBridge(signerContext);
|
|
120
|
+
const getAddress = resolver(signerContext);
|
|
112
121
|
const { address } = await getAddress("", {
|
|
113
122
|
path: "44'/60'/0'/0/0",
|
|
114
123
|
currency: core,
|