@ledgerhq/coin-tester-evm 1.11.0 → 1.11.1-nightly.20251126160702
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 +13 -0
- package/lib/src/scenarii/blast.d.ts.map +1 -1
- package/lib/src/scenarii/blast.js +9 -23
- package/lib/src/scenarii/blast.js.map +1 -1
- package/lib/src/scenarii/core.d.ts.map +1 -1
- package/lib/src/scenarii/core.js +5 -9
- package/lib/src/scenarii/core.js.map +1 -1
- package/lib/src/scenarii/ethereum.d.ts.map +1 -1
- package/lib/src/scenarii/ethereum.js +9 -16
- package/lib/src/scenarii/ethereum.js.map +1 -1
- package/lib/src/scenarii/polygon.d.ts.map +1 -1
- package/lib/src/scenarii/polygon.js +8 -12
- package/lib/src/scenarii/polygon.js.map +1 -1
- package/lib/src/scenarii/scroll.d.ts.map +1 -1
- package/lib/src/scenarii/scroll.js +9 -23
- package/lib/src/scenarii/scroll.js.map +1 -1
- package/lib/src/scenarii/sonic.d.ts.map +1 -1
- package/lib/src/scenarii/sonic.js +2 -5
- package/lib/src/scenarii/sonic.js.map +1 -1
- package/lib/src/tokenFixtures.d.ts +8 -0
- package/lib/src/tokenFixtures.d.ts.map +1 -0
- package/lib/src/tokenFixtures.js +87 -0
- package/lib/src/tokenFixtures.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-es/src/scenarii/blast.d.ts.map +1 -1
- package/lib-es/src/scenarii/blast.js +1 -15
- package/lib-es/src/scenarii/blast.js.map +1 -1
- package/lib-es/src/scenarii/core.d.ts.map +1 -1
- package/lib-es/src/scenarii/core.js +1 -5
- package/lib-es/src/scenarii/core.js.map +1 -1
- package/lib-es/src/scenarii/ethereum.d.ts.map +1 -1
- package/lib-es/src/scenarii/ethereum.js +1 -8
- package/lib-es/src/scenarii/ethereum.js.map +1 -1
- package/lib-es/src/scenarii/polygon.d.ts.map +1 -1
- package/lib-es/src/scenarii/polygon.js +1 -5
- package/lib-es/src/scenarii/polygon.js.map +1 -1
- package/lib-es/src/scenarii/scroll.d.ts.map +1 -1
- package/lib-es/src/scenarii/scroll.js +1 -15
- package/lib-es/src/scenarii/scroll.js.map +1 -1
- package/lib-es/src/scenarii/sonic.d.ts.map +1 -1
- package/lib-es/src/scenarii/sonic.js +2 -5
- package/lib-es/src/scenarii/sonic.js.map +1 -1
- package/lib-es/src/tokenFixtures.d.ts +8 -0
- package/lib-es/src/tokenFixtures.d.ts.map +1 -0
- package/lib-es/src/tokenFixtures.js +84 -0
- package/lib-es/src/tokenFixtures.js.map +1 -0
- package/lib-es/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/scenarii/blast.ts +1 -12
- package/src/scenarii/core.ts +1 -6
- package/src/scenarii/ethereum.ts +1 -9
- package/src/scenarii/polygon.ts +1 -5
- package/src/scenarii/scroll.ts +1 -12
- package/src/scenarii/sonic.ts +2 -5
- package/src/scenarii.test.ts +2 -7
- package/src/tokenFixtures.ts +92 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-tester-evm",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.1-nightly.20251126160702",
|
|
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.
|
|
55
|
-
"@ledgerhq/coin-framework": "^6.
|
|
56
|
-
"@ledgerhq/coin-tester": "^0.
|
|
57
|
-
"@ledgerhq/
|
|
58
|
-
"@ledgerhq/
|
|
54
|
+
"@ledgerhq/coin-evm": "^2.36.0-nightly.20251126160702",
|
|
55
|
+
"@ledgerhq/coin-framework": "^6.10.0-nightly.20251126160702",
|
|
56
|
+
"@ledgerhq/coin-tester": "^0.13.0-nightly.20251126160702",
|
|
57
|
+
"@ledgerhq/cryptoassets": "^13.34.0-nightly.20251126160702",
|
|
58
|
+
"@ledgerhq/live-common": "^34.54.0-nightly.20251126160702",
|
|
59
59
|
"@ledgerhq/live-config": "^3.2.0",
|
|
60
|
-
"@ledgerhq/live-signer-evm": "^0.10.
|
|
60
|
+
"@ledgerhq/live-signer-evm": "^0.10.2-nightly.20251126160702",
|
|
61
61
|
"@ledgerhq/types-cryptoassets": "^7.30.0",
|
|
62
|
-
"@ledgerhq/types-live": "^6.
|
|
62
|
+
"@ledgerhq/types-live": "^6.90.0-nightly.20251126160702"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@swc/core": "1.4.11",
|
package/src/scenarii/blast.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { LegacySignerEth } from "@ledgerhq/live-signer-evm";
|
|
|
2
2
|
import { BigNumber } from "bignumber.js";
|
|
3
3
|
import { ethers } from "ethers";
|
|
4
4
|
import { Account } from "@ledgerhq/types-live";
|
|
5
|
-
import { tokensById } from "@ledgerhq/cryptoassets/legacy/legacy-state";
|
|
6
5
|
import { Scenario, ScenarioTransaction } from "@ledgerhq/coin-tester/main";
|
|
7
6
|
import { encodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
|
|
8
7
|
import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/speculos";
|
|
@@ -17,12 +16,10 @@ import { killAnvil, spawnAnvil } from "../anvil";
|
|
|
17
16
|
import resolver from "@ledgerhq/coin-evm/hw-getAddress";
|
|
18
17
|
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
19
18
|
import { EvmSigner } from "@ledgerhq/coin-evm/types/signer";
|
|
19
|
+
import { MIM_ON_BLAST } from "../tokenFixtures";
|
|
20
20
|
|
|
21
21
|
type BlastScenarioTransaction = ScenarioTransaction<EvmTransaction, Account>;
|
|
22
22
|
|
|
23
|
-
// getTokenById will only work after the currency has been preloaded
|
|
24
|
-
const TOKEN_ID = "blast/erc20/magic_internet_money";
|
|
25
|
-
|
|
26
23
|
const makeScenarioTransactions = ({ address }: { address: string }): BlastScenarioTransaction[] => {
|
|
27
24
|
const scenarioSendEthTransaction: BlastScenarioTransaction = {
|
|
28
25
|
name: "Send 1 ETH",
|
|
@@ -39,8 +36,6 @@ const makeScenarioTransactions = ({ address }: { address: string }): BlastScenar
|
|
|
39
36
|
},
|
|
40
37
|
};
|
|
41
38
|
|
|
42
|
-
const MIM_ON_BLAST = tokensById[TOKEN_ID];
|
|
43
|
-
if (!MIM_ON_BLAST) throw new Error("MIM on Blast token not found");
|
|
44
39
|
const scenarioSendMIMTransaction: BlastScenarioTransaction = {
|
|
45
40
|
name: "Send 80 MIM",
|
|
46
41
|
amount: new BigNumber(ethers.parseUnits("80", MIM_ON_BLAST.units[0].magnitude).toString()),
|
|
@@ -110,8 +105,6 @@ export const scenarioBlast: Scenario<EvmTransaction, Account> = {
|
|
|
110
105
|
|
|
111
106
|
const scenarioAccount = makeAccount(address, blast);
|
|
112
107
|
|
|
113
|
-
const MIM_ON_BLAST = tokensById[TOKEN_ID];
|
|
114
|
-
if (!MIM_ON_BLAST) throw new Error("MIM on Blast token not found");
|
|
115
108
|
await callMyDealer({
|
|
116
109
|
provider,
|
|
117
110
|
drug: MIM_ON_BLAST,
|
|
@@ -132,8 +125,6 @@ export const scenarioBlast: Scenario<EvmTransaction, Account> = {
|
|
|
132
125
|
await indexBlocks();
|
|
133
126
|
},
|
|
134
127
|
beforeAll: account => {
|
|
135
|
-
const MIM_ON_BLAST = tokensById[TOKEN_ID];
|
|
136
|
-
if (!MIM_ON_BLAST) throw new Error("MIM on Blast token not found");
|
|
137
128
|
expect(account.balance.toFixed()).toBe(ethers.parseEther("10000").toString());
|
|
138
129
|
expect(account.subAccounts?.[0]?.type).toBe("TokenAccount");
|
|
139
130
|
expect(account.subAccounts?.[0]?.balance?.toFixed()).toBe(
|
|
@@ -141,8 +132,6 @@ export const scenarioBlast: Scenario<EvmTransaction, Account> = {
|
|
|
141
132
|
);
|
|
142
133
|
},
|
|
143
134
|
afterAll: account => {
|
|
144
|
-
const MIM_ON_BLAST = tokensById[TOKEN_ID];
|
|
145
|
-
if (!MIM_ON_BLAST) throw new Error("MIM on Blast token not found");
|
|
146
135
|
expect(account.subAccounts?.length).toBe(1);
|
|
147
136
|
expect(account.subAccounts?.[0].balance.toFixed()).toBe(
|
|
148
137
|
ethers.parseUnits("20", MIM_ON_BLAST.units[0].magnitude).toString(),
|
package/src/scenarii/core.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transact
|
|
|
4
4
|
import { encodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
|
|
5
5
|
import { Scenario, ScenarioTransaction } from "@ledgerhq/coin-tester/main";
|
|
6
6
|
import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/speculos";
|
|
7
|
-
import { tokensById } from "@ledgerhq/cryptoassets/legacy/legacy-state";
|
|
8
7
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
9
8
|
import { Account } from "@ledgerhq/types-live";
|
|
10
9
|
import { BigNumber } from "bignumber.js";
|
|
@@ -13,14 +12,10 @@ import { killAnvil, spawnAnvil } from "../anvil";
|
|
|
13
12
|
import { VITALIK, core, getBridges } from "../helpers";
|
|
14
13
|
import { indexBlocks, initMswHandlers, resetIndexer, setBlock } from "../indexer";
|
|
15
14
|
import { defaultNanoApp } from "../constants";
|
|
15
|
+
import { STCORE_ON_CORE } from "../tokenFixtures";
|
|
16
16
|
|
|
17
17
|
type CoreScenarioTransaction = ScenarioTransaction<EvmTransaction, Account>;
|
|
18
18
|
|
|
19
|
-
const stcoreOnCore =
|
|
20
|
-
tokensById["core/erc20/liquid_staked_core_0xb3a8f0f0da9ffc65318aa39e55079796093029ad"];
|
|
21
|
-
if (!stcoreOnCore) throw new Error("stCORE on Core token not found");
|
|
22
|
-
const STCORE_ON_CORE = stcoreOnCore;
|
|
23
|
-
|
|
24
19
|
const makeScenarioTransactions = ({ address }: { address: string }): CoreScenarioTransaction[] => {
|
|
25
20
|
const scenarioSendSTransaction: CoreScenarioTransaction = {
|
|
26
21
|
name: "Send 1 CORE",
|
package/src/scenarii/ethereum.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { encodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
|
|
2
2
|
import { Scenario, ScenarioTransaction } from "@ledgerhq/coin-tester/main";
|
|
3
3
|
import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/speculos";
|
|
4
|
-
import { tokensById } from "@ledgerhq/cryptoassets/legacy/legacy-state";
|
|
5
|
-
import { initializeLegacyTokens } from "@ledgerhq/cryptoassets/legacy/legacy-data";
|
|
6
|
-
import { addTokens } from "@ledgerhq/cryptoassets/legacy/legacy-utils";
|
|
7
4
|
import { Account } from "@ledgerhq/types-live";
|
|
8
5
|
import { BigNumber } from "bignumber.js";
|
|
9
6
|
import { ethers } from "ethers";
|
|
@@ -19,14 +16,9 @@ import { indexBlocks, initMswHandlers, resetIndexer, setBlock } from "../indexer
|
|
|
19
16
|
import { defaultNanoApp } from "../constants";
|
|
20
17
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
21
18
|
import { BridgeStrategy } from "@ledgerhq/coin-tester/types";
|
|
22
|
-
|
|
23
|
-
initializeLegacyTokens(addTokens);
|
|
19
|
+
import { USDC_ON_ETHEREUM } from "../tokenFixtures";
|
|
24
20
|
|
|
25
21
|
type EthereumScenarioTransaction = ScenarioTransaction<EvmTransaction, Account>;
|
|
26
|
-
|
|
27
|
-
const usdcOnEthereum = tokensById["ethereum/erc20/usd__coin"];
|
|
28
|
-
if (!usdcOnEthereum) throw new Error("USDC on Ethereum token not found");
|
|
29
|
-
const USDC_ON_ETHEREUM = usdcOnEthereum;
|
|
30
22
|
const boredApeContract = "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D";
|
|
31
23
|
const boredApeTokenId = "3368";
|
|
32
24
|
const cloneXContract = "0x348FC118bcC65a92dC033A951aF153d14D945312";
|
package/src/scenarii/polygon.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BigNumber } from "bignumber.js";
|
|
2
2
|
import { ethers } from "ethers";
|
|
3
3
|
import { Account } from "@ledgerhq/types-live";
|
|
4
|
-
import { tokensById } from "@ledgerhq/cryptoassets/legacy/legacy-state";
|
|
5
4
|
import { Scenario, ScenarioTransaction } from "@ledgerhq/coin-tester/main";
|
|
6
5
|
import { encodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
|
|
7
6
|
import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/speculos";
|
|
@@ -14,12 +13,9 @@ import { defaultNanoApp } from "../constants";
|
|
|
14
13
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
15
14
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
16
15
|
import { BridgeStrategy } from "@ledgerhq/coin-tester/types";
|
|
16
|
+
import { USDC_ON_POLYGON } from "../tokenFixtures";
|
|
17
17
|
|
|
18
18
|
type PolygonScenarioTransaction = ScenarioTransaction<EvmTransaction, Account>;
|
|
19
|
-
|
|
20
|
-
const usdcOnPolygon = tokensById["polygon/erc20/usd_coin_(pos)"];
|
|
21
|
-
if (!usdcOnPolygon) throw new Error("USDC on Polygon token not found");
|
|
22
|
-
const USDC_ON_POLYGON = usdcOnPolygon;
|
|
23
19
|
const yootContract = "0x670fd103b1a08628e9557cD66B87DeD841115190";
|
|
24
20
|
const yootTokenId = "1953";
|
|
25
21
|
const emberContract = "0xa5511E9941E303101b50675926Fd4d9c1A8a8805";
|
package/src/scenarii/scroll.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { LegacySignerEth } from "@ledgerhq/live-signer-evm";
|
|
|
2
2
|
import { BigNumber } from "bignumber.js";
|
|
3
3
|
import { ethers } from "ethers";
|
|
4
4
|
import { Account } from "@ledgerhq/types-live";
|
|
5
|
-
import { tokensById } from "@ledgerhq/cryptoassets/legacy/legacy-state";
|
|
6
5
|
import { Scenario, ScenarioTransaction } from "@ledgerhq/coin-tester/main";
|
|
7
6
|
import { encodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
|
|
8
7
|
import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/speculos";
|
|
@@ -17,12 +16,10 @@ import { killAnvil, spawnAnvil } from "../anvil";
|
|
|
17
16
|
import resolver from "@ledgerhq/coin-evm/hw-getAddress";
|
|
18
17
|
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
19
18
|
import { EvmSigner } from "@ledgerhq/coin-evm/types/signer";
|
|
19
|
+
import { USDC_ON_SCROLL } from "../tokenFixtures";
|
|
20
20
|
|
|
21
21
|
type ScrollScenarioTransaction = ScenarioTransaction<EvmTransaction, Account>;
|
|
22
22
|
|
|
23
|
-
// getTokenById will only work after the currency has been preloaded
|
|
24
|
-
const TOKEN_ID = "scroll/erc20/usd_coin";
|
|
25
|
-
|
|
26
23
|
const makeScenarioTransactions = ({
|
|
27
24
|
address,
|
|
28
25
|
}: {
|
|
@@ -43,8 +40,6 @@ const makeScenarioTransactions = ({
|
|
|
43
40
|
},
|
|
44
41
|
};
|
|
45
42
|
|
|
46
|
-
const USDC_ON_SCROLL = tokensById["scroll/erc20/usd_coin"];
|
|
47
|
-
if (!USDC_ON_SCROLL) throw new Error("USDC on Scroll token not found");
|
|
48
43
|
const scenarioSendUSDCTransaction: ScrollScenarioTransaction = {
|
|
49
44
|
name: "Send USDC",
|
|
50
45
|
amount: new BigNumber(ethers.parseUnits("80", USDC_ON_SCROLL.units[0].magnitude).toString()),
|
|
@@ -114,8 +109,6 @@ export const scenarioScroll: Scenario<EvmTransaction, Account> = {
|
|
|
114
109
|
|
|
115
110
|
const scenarioAccount = makeAccount(address, scroll);
|
|
116
111
|
|
|
117
|
-
const USDC_ON_SCROLL = tokensById[TOKEN_ID];
|
|
118
|
-
if (!USDC_ON_SCROLL) throw new Error("USDC on Scroll token not found");
|
|
119
112
|
await callMyDealer({
|
|
120
113
|
provider,
|
|
121
114
|
drug: USDC_ON_SCROLL,
|
|
@@ -136,8 +129,6 @@ export const scenarioScroll: Scenario<EvmTransaction, Account> = {
|
|
|
136
129
|
await indexBlocks();
|
|
137
130
|
},
|
|
138
131
|
beforeAll: account => {
|
|
139
|
-
const USDC_ON_SCROLL = tokensById[TOKEN_ID];
|
|
140
|
-
if (!USDC_ON_SCROLL) throw new Error("USDC on Scroll token not found");
|
|
141
132
|
expect(account.balance.toFixed()).toBe(ethers.parseEther("10000").toString());
|
|
142
133
|
expect(account.subAccounts?.[0]?.type).toBe("TokenAccount");
|
|
143
134
|
expect(account.subAccounts?.[0]?.balance?.toFixed()).toBe(
|
|
@@ -145,8 +136,6 @@ export const scenarioScroll: Scenario<EvmTransaction, Account> = {
|
|
|
145
136
|
);
|
|
146
137
|
},
|
|
147
138
|
afterAll: account => {
|
|
148
|
-
const USDC_ON_SCROLL = tokensById[TOKEN_ID];
|
|
149
|
-
if (!USDC_ON_SCROLL) throw new Error("USDC on Scroll token not found");
|
|
150
139
|
expect(account.subAccounts?.length).toBe(1);
|
|
151
140
|
expect(account.subAccounts?.[0].balance.toFixed()).toBe(
|
|
152
141
|
ethers.parseUnits("20", USDC_ON_SCROLL.units[0].magnitude).toString(),
|
package/src/scenarii/sonic.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BigNumber } from "bignumber.js";
|
|
2
2
|
import { ethers } from "ethers";
|
|
3
3
|
import { Account } from "@ledgerhq/types-live";
|
|
4
|
-
import { tokensById } from "@ledgerhq/cryptoassets/legacy/legacy-state";
|
|
5
4
|
import { encodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
|
|
6
5
|
import { Scenario, ScenarioTransaction } from "@ledgerhq/coin-tester/main";
|
|
7
6
|
import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/speculos";
|
|
@@ -13,13 +12,11 @@ import { VITALIK, callMyDealer, getBridges, sonic } from "../helpers";
|
|
|
13
12
|
import { defaultNanoApp } from "../constants";
|
|
14
13
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
15
14
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
15
|
+
import { BRIDGED_USDC_ON_SONIC } from "../tokenFixtures";
|
|
16
16
|
|
|
17
17
|
type SonicScenarioTransaction = ScenarioTransaction<EvmTransaction, Account>;
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
tokensById["sonic/erc20/bridged_usdc_sonic_labs_0x29219dd400f2bf60e5a23d13be72b486d4038894"];
|
|
21
|
-
if (!usdcOnSonic) throw new Error("USDC on Sonic token not found");
|
|
22
|
-
const USDC_ON_SONIC = usdcOnSonic;
|
|
19
|
+
const USDC_ON_SONIC = BRIDGED_USDC_ON_SONIC;
|
|
23
20
|
|
|
24
21
|
const makeScenarioTransactions = ({ address }: { address: string }): SonicScenarioTransaction[] => {
|
|
25
22
|
const scenarioSendSTransaction: SonicScenarioTransaction = {
|
package/src/scenarii.test.ts
CHANGED
|
@@ -7,17 +7,12 @@ import { scenarioScroll } from "./scenarii/scroll";
|
|
|
7
7
|
import { scenarioBlast } from "./scenarii/blast";
|
|
8
8
|
import { scenarioSonic } from "./scenarii/sonic";
|
|
9
9
|
import { scenarioCore } from "./scenarii/core";
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import { initializeLegacyTokens } from "@ledgerhq/cryptoassets/legacy/legacy-data";
|
|
13
|
-
import { addTokens } from "@ledgerhq/cryptoassets/legacy/legacy-utils";
|
|
10
|
+
// Import tokenFixtures to setup mock store
|
|
11
|
+
import "./tokenFixtures";
|
|
14
12
|
|
|
15
13
|
global.console = require("console");
|
|
16
14
|
jest.setTimeout(100_000);
|
|
17
15
|
|
|
18
|
-
initializeLegacyTokens(addTokens);
|
|
19
|
-
setCryptoAssetsStoreForCoinFramework(legacyCryptoAssetsStore);
|
|
20
|
-
|
|
21
16
|
// Note this config runs with NanoX
|
|
22
17
|
// https://github.com/LedgerHQ/ledger-live/blob/develop/libs/coin-tester/docker-compose.yml
|
|
23
18
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { setupCalClientStore } from "@ledgerhq/cryptoassets/cal-client/test-helpers";
|
|
2
|
+
import { setCryptoAssetsStore } from "@ledgerhq/cryptoassets/state";
|
|
3
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
|
|
4
|
+
import type { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
5
|
+
|
|
6
|
+
const ethereum = getCryptoCurrencyById("ethereum");
|
|
7
|
+
const polygon = getCryptoCurrencyById("polygon");
|
|
8
|
+
const scroll = getCryptoCurrencyById("scroll_sepolia");
|
|
9
|
+
const blast = getCryptoCurrencyById("blast");
|
|
10
|
+
const sonic = getCryptoCurrencyById("sonic");
|
|
11
|
+
const core = getCryptoCurrencyById("core");
|
|
12
|
+
|
|
13
|
+
export const USDC_ON_ETHEREUM: TokenCurrency = {
|
|
14
|
+
type: "TokenCurrency",
|
|
15
|
+
id: "ethereum/erc20/usd__coin",
|
|
16
|
+
contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
17
|
+
parentCurrency: ethereum,
|
|
18
|
+
tokenType: "erc20",
|
|
19
|
+
name: "USD Coin",
|
|
20
|
+
ticker: "USDC",
|
|
21
|
+
delisted: false,
|
|
22
|
+
disableCountervalue: false,
|
|
23
|
+
units: [{ name: "USDC", code: "USDC", magnitude: 6 }],
|
|
24
|
+
} as TokenCurrency;
|
|
25
|
+
|
|
26
|
+
export const USDC_ON_POLYGON: TokenCurrency = {
|
|
27
|
+
type: "TokenCurrency",
|
|
28
|
+
id: "polygon/erc20/usd_coin_(pos)",
|
|
29
|
+
contractAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
|
30
|
+
parentCurrency: polygon,
|
|
31
|
+
tokenType: "erc20",
|
|
32
|
+
name: "USD Coin (PoS)",
|
|
33
|
+
ticker: "USDC",
|
|
34
|
+
delisted: false,
|
|
35
|
+
disableCountervalue: false,
|
|
36
|
+
units: [{ name: "USDC", code: "USDC", magnitude: 6 }],
|
|
37
|
+
} as TokenCurrency;
|
|
38
|
+
|
|
39
|
+
export const USDC_ON_SCROLL: TokenCurrency = {
|
|
40
|
+
type: "TokenCurrency",
|
|
41
|
+
id: "scroll/erc20/usd_coin",
|
|
42
|
+
contractAddress: "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4",
|
|
43
|
+
parentCurrency: scroll,
|
|
44
|
+
tokenType: "erc20",
|
|
45
|
+
name: "USD Coin",
|
|
46
|
+
ticker: "USDC",
|
|
47
|
+
delisted: false,
|
|
48
|
+
disableCountervalue: false,
|
|
49
|
+
units: [{ name: "USDC", code: "USDC", magnitude: 6 }],
|
|
50
|
+
} as TokenCurrency;
|
|
51
|
+
|
|
52
|
+
export const MIM_ON_BLAST: TokenCurrency = {
|
|
53
|
+
type: "TokenCurrency",
|
|
54
|
+
id: "blast/erc20/magic_internet_money",
|
|
55
|
+
contractAddress: "0x76DA31D7C9CbEAE102aff34D3398bC450c8374c1",
|
|
56
|
+
parentCurrency: blast,
|
|
57
|
+
tokenType: "erc20",
|
|
58
|
+
name: "Magic Internet Money",
|
|
59
|
+
ticker: "MIM",
|
|
60
|
+
delisted: false,
|
|
61
|
+
disableCountervalue: false,
|
|
62
|
+
units: [{ name: "MIM", code: "MIM", magnitude: 18 }],
|
|
63
|
+
} as TokenCurrency;
|
|
64
|
+
|
|
65
|
+
export const BRIDGED_USDC_ON_SONIC: TokenCurrency = {
|
|
66
|
+
type: "TokenCurrency",
|
|
67
|
+
id: "sonic/erc20/bridged_usdc_sonic_labs_0x29219dd400f2bf60e5a23d13be72b486d4038894",
|
|
68
|
+
contractAddress: "0x29219dd400f2Bf60E5a23d13Be72B486D4038894",
|
|
69
|
+
parentCurrency: sonic,
|
|
70
|
+
tokenType: "erc20",
|
|
71
|
+
name: "Bridged USDC (Sonic Labs)",
|
|
72
|
+
ticker: "USDC",
|
|
73
|
+
delisted: false,
|
|
74
|
+
disableCountervalue: false,
|
|
75
|
+
units: [{ name: "Bridged USDC (Sonic Labs)", code: "USDC", magnitude: 6 }],
|
|
76
|
+
} as TokenCurrency;
|
|
77
|
+
|
|
78
|
+
export const STCORE_ON_CORE: TokenCurrency = {
|
|
79
|
+
type: "TokenCurrency",
|
|
80
|
+
id: "core/erc20/liquid_staked_core_0xb3a8f0f0da9ffc65318aa39e55079796093029ad",
|
|
81
|
+
contractAddress: "0xb3a8f0f0da9ffc65318aa39e55079796093029ad",
|
|
82
|
+
parentCurrency: core,
|
|
83
|
+
tokenType: "erc20",
|
|
84
|
+
name: "Liquid Staked CORE",
|
|
85
|
+
ticker: "stCORE",
|
|
86
|
+
delisted: false,
|
|
87
|
+
disableCountervalue: false,
|
|
88
|
+
units: [{ name: "stCORE", code: "stCORE", magnitude: 18 }],
|
|
89
|
+
} as TokenCurrency;
|
|
90
|
+
|
|
91
|
+
const cryptoAssetsStore = setupCalClientStore();
|
|
92
|
+
setCryptoAssetsStore(cryptoAssetsStore);
|