@ledgerhq/coin-evm 2.28.0-nightly.3 → 2.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/.eslintrc.js +0 -1
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +20 -32
- package/{lib-es/__fixtures__/ethereum-erc20-weth.json → lib/__fixtures__/ethereum-erc20-usd_tether__erc20_.json} +8 -8
- package/lib/__fixtures__/{optimism-erc20-usd_coin.json → scroll_sepolia-erc20-new_token_mock.json} +20 -21
- package/lib/__tests__/fixtures/accounts.fixtures.d.ts +1 -1
- package/lib/__tests__/fixtures/accounts.fixtures.d.ts.map +1 -1
- package/lib/__tests__/fixtures/accounts.fixtures.js +19 -2
- package/lib/__tests__/fixtures/accounts.fixtures.js.map +1 -1
- package/lib/__tests__/fixtures/common.fixtures.d.ts +0 -1
- package/lib/__tests__/fixtures/common.fixtures.d.ts.map +1 -1
- package/lib/__tests__/fixtures/common.fixtures.js +0 -1
- package/lib/__tests__/fixtures/common.fixtures.js.map +1 -1
- package/lib/__tests__/fixtures/prepareTransaction.fixtures.d.ts.map +1 -1
- package/lib/__tests__/fixtures/prepareTransaction.fixtures.js +2 -3
- package/lib/__tests__/fixtures/prepareTransaction.fixtures.js.map +1 -1
- package/lib/__tests__/fixtures/synchronization.fixtures.d.ts +1 -1
- package/lib/__tests__/fixtures/synchronization.fixtures.d.ts.map +1 -1
- package/lib/__tests__/fixtures/synchronization.fixtures.js +18 -3
- package/lib/__tests__/fixtures/synchronization.fixtures.js.map +1 -1
- package/lib/__tests__/fixtures/transaction.fixtures.d.ts +2 -2
- package/lib/__tests__/fixtures/transaction.fixtures.d.ts.map +1 -1
- package/lib/__tests__/fixtures/transaction.fixtures.js +2 -3
- package/lib/__tests__/fixtures/transaction.fixtures.js.map +1 -1
- package/lib/__tests__/unit/accounts.unit.test.js +27 -0
- package/lib/__tests__/unit/accounts.unit.test.js.map +1 -1
- package/lib/__tests__/unit/adapters/etherscan.unit.test.js +7 -72
- package/lib/__tests__/unit/adapters/etherscan.unit.test.js.map +1 -1
- package/lib/__tests__/unit/adapters/ledger.unit.test.js +2 -15
- package/lib/__tests__/unit/adapters/ledger.unit.test.js.map +1 -1
- package/lib/__tests__/unit/api/explorer/etherscan.unit.test.js +0 -8
- package/lib/__tests__/unit/api/explorer/etherscan.unit.test.js.map +1 -1
- package/lib/__tests__/unit/api/explorer/ledger.unit.test.js +0 -12
- package/lib/__tests__/unit/api/explorer/ledger.unit.test.js.map +1 -1
- package/lib/__tests__/unit/broadcast.unit.test.js +1 -3
- package/lib/__tests__/unit/broadcast.unit.test.js.map +1 -1
- package/lib/__tests__/unit/buildOptimisticOperation.unit.test.js +1 -3
- package/lib/__tests__/unit/buildOptimisticOperation.unit.test.js.map +1 -1
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +1 -1
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -1
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js +0 -1
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -1
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js +1 -3
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -1
- package/lib/__tests__/unit/getTransactionStatus.unit.test.js +1 -3
- package/lib/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -1
- package/lib/__tests__/unit/logic.unit.test.js +18 -22
- package/lib/__tests__/unit/logic.unit.test.js.map +1 -1
- package/lib/__tests__/unit/operation.test.js +2 -6
- package/lib/__tests__/unit/operation.test.js.map +1 -1
- package/lib/__tests__/unit/prepareTransaction.unit.test.js +17 -4
- package/lib/__tests__/unit/prepareTransaction.unit.test.js.map +1 -1
- package/lib/adapters/etherscan.d.ts.map +1 -1
- package/lib/adapters/etherscan.js +2 -2
- package/lib/adapters/etherscan.js.map +1 -1
- package/lib/adapters/ledger.d.ts.map +1 -1
- package/lib/adapters/ledger.js +2 -2
- package/lib/adapters/ledger.js.map +1 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +4 -2
- package/lib/api/index.js.map +1 -1
- package/lib/bridge/js.d.ts +1 -2
- package/lib/bridge/js.d.ts.map +1 -1
- package/lib/bridge/js.js +1 -3
- package/lib/bridge/js.js.map +1 -1
- package/lib/bridge/preload.d.ts +0 -1
- package/lib/bridge/preload.d.ts.map +1 -1
- package/lib/bridge/preload.js +1 -10
- package/lib/bridge/preload.js.map +1 -1
- package/lib/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/deviceTransactionConfig.js +2 -2
- package/lib/deviceTransactionConfig.js.map +1 -1
- package/lib/logic/common.d.ts +0 -18
- package/lib/logic/common.d.ts.map +1 -1
- package/lib/logic/common.js +1 -35
- package/lib/logic/common.js.map +1 -1
- package/lib/logic/estimateFees.d.ts +1 -1
- package/lib/logic/estimateFees.d.ts.map +1 -1
- package/lib/logic/estimateFees.js +12 -25
- package/lib/logic/estimateFees.js.map +1 -1
- package/lib/logic/estimateFees.test.js +41 -93
- package/lib/logic/estimateFees.test.js.map +1 -1
- package/lib/logic/index.d.ts +0 -1
- package/lib/logic/index.d.ts.map +1 -1
- package/lib/logic/index.js +0 -1
- package/lib/logic/index.js.map +1 -1
- package/lib/types/transaction.d.ts +0 -9
- package/lib/types/transaction.d.ts.map +1 -1
- package/{lib/__fixtures__/ethereum-erc20-weth.json → lib-es/__fixtures__/ethereum-erc20-usd_tether__erc20_.json} +8 -8
- package/lib-es/__fixtures__/{optimism-erc20-usd_coin.json → scroll_sepolia-erc20-new_token_mock.json} +20 -21
- package/lib-es/__tests__/fixtures/accounts.fixtures.d.ts +1 -1
- package/lib-es/__tests__/fixtures/accounts.fixtures.d.ts.map +1 -1
- package/lib-es/__tests__/fixtures/accounts.fixtures.js +18 -1
- package/lib-es/__tests__/fixtures/accounts.fixtures.js.map +1 -1
- package/lib-es/__tests__/fixtures/common.fixtures.d.ts +0 -1
- package/lib-es/__tests__/fixtures/common.fixtures.d.ts.map +1 -1
- package/lib-es/__tests__/fixtures/common.fixtures.js +0 -1
- package/lib-es/__tests__/fixtures/common.fixtures.js.map +1 -1
- package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.d.ts.map +1 -1
- package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.js +2 -3
- package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.js.map +1 -1
- package/lib-es/__tests__/fixtures/synchronization.fixtures.d.ts +1 -1
- package/lib-es/__tests__/fixtures/synchronization.fixtures.d.ts.map +1 -1
- package/lib-es/__tests__/fixtures/synchronization.fixtures.js +18 -3
- package/lib-es/__tests__/fixtures/synchronization.fixtures.js.map +1 -1
- package/lib-es/__tests__/fixtures/transaction.fixtures.d.ts +2 -2
- package/lib-es/__tests__/fixtures/transaction.fixtures.d.ts.map +1 -1
- package/lib-es/__tests__/fixtures/transaction.fixtures.js +2 -3
- package/lib-es/__tests__/fixtures/transaction.fixtures.js.map +1 -1
- package/lib-es/__tests__/unit/accounts.unit.test.js +27 -0
- package/lib-es/__tests__/unit/accounts.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/adapters/etherscan.unit.test.js +7 -72
- package/lib-es/__tests__/unit/adapters/etherscan.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/adapters/ledger.unit.test.js +2 -15
- package/lib-es/__tests__/unit/adapters/ledger.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/api/explorer/etherscan.unit.test.js +0 -8
- package/lib-es/__tests__/unit/api/explorer/etherscan.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/api/explorer/ledger.unit.test.js +0 -12
- package/lib-es/__tests__/unit/api/explorer/ledger.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/broadcast.unit.test.js +2 -4
- package/lib-es/__tests__/unit/broadcast.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/buildOptimisticOperation.unit.test.js +2 -4
- package/lib-es/__tests__/unit/buildOptimisticOperation.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +1 -1
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -1
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js +0 -1
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js +2 -4
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js +2 -4
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/logic.unit.test.js +19 -23
- package/lib-es/__tests__/unit/logic.unit.test.js.map +1 -1
- package/lib-es/__tests__/unit/operation.test.js +3 -7
- package/lib-es/__tests__/unit/operation.test.js.map +1 -1
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.js +17 -4
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.js.map +1 -1
- package/lib-es/adapters/etherscan.d.ts.map +1 -1
- package/lib-es/adapters/etherscan.js +2 -2
- package/lib-es/adapters/etherscan.js.map +1 -1
- package/lib-es/adapters/ledger.d.ts.map +1 -1
- package/lib-es/adapters/ledger.js +2 -2
- package/lib-es/adapters/ledger.js.map +1 -1
- package/lib-es/api/index.d.ts.map +1 -1
- package/lib-es/api/index.js +5 -3
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/bridge/js.d.ts +1 -2
- package/lib-es/bridge/js.d.ts.map +1 -1
- package/lib-es/bridge/js.js +1 -3
- package/lib-es/bridge/js.js.map +1 -1
- package/lib-es/bridge/preload.d.ts +0 -1
- package/lib-es/bridge/preload.d.ts.map +1 -1
- package/lib-es/bridge/preload.js +0 -8
- package/lib-es/bridge/preload.js.map +1 -1
- package/lib-es/deviceTransactionConfig.d.ts.map +1 -1
- package/lib-es/deviceTransactionConfig.js +2 -2
- package/lib-es/deviceTransactionConfig.js.map +1 -1
- package/lib-es/logic/common.d.ts +0 -18
- package/lib-es/logic/common.d.ts.map +1 -1
- package/lib-es/logic/common.js +0 -30
- package/lib-es/logic/common.js.map +1 -1
- package/lib-es/logic/estimateFees.d.ts +1 -1
- package/lib-es/logic/estimateFees.d.ts.map +1 -1
- package/lib-es/logic/estimateFees.js +12 -25
- package/lib-es/logic/estimateFees.js.map +1 -1
- package/lib-es/logic/estimateFees.test.js +41 -93
- package/lib-es/logic/estimateFees.test.js.map +1 -1
- package/lib-es/logic/index.d.ts +0 -1
- package/lib-es/logic/index.d.ts.map +1 -1
- package/lib-es/logic/index.js +0 -1
- package/lib-es/logic/index.js.map +1 -1
- package/lib-es/types/transaction.d.ts +0 -9
- package/lib-es/types/transaction.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/__tests__/fixtures/accounts.fixtures.ts +23 -1
- package/src/__tests__/fixtures/common.fixtures.ts +0 -1
- package/src/__tests__/fixtures/prepareTransaction.fixtures.ts +4 -4
- package/src/__tests__/fixtures/synchronization.fixtures.ts +20 -3
- package/src/__tests__/fixtures/transaction.fixtures.ts +3 -4
- package/src/__tests__/unit/accounts.unit.test.ts +36 -0
- package/src/__tests__/unit/adapters/etherscan.unit.test.ts +7 -87
- package/src/__tests__/unit/adapters/ledger.unit.test.ts +2 -20
- package/src/__tests__/unit/api/explorer/etherscan.unit.test.ts +0 -12
- package/src/__tests__/unit/api/explorer/ledger.unit.test.ts +0 -16
- package/src/__tests__/unit/broadcast.unit.test.ts +3 -5
- package/src/__tests__/unit/buildOptimisticOperation.unit.test.ts +2 -5
- package/src/__tests__/unit/deviceTransactionConfig.unit.test.ts +0 -1
- package/src/__tests__/unit/estimateMaxSpendable.unit.test.ts +3 -5
- package/src/__tests__/unit/getTransactionStatus.unit.test.ts +2 -5
- package/src/__tests__/unit/logic.unit.test.ts +29 -41
- package/src/__tests__/unit/operation.test.ts +5 -9
- package/src/__tests__/unit/prepareTransaction.unit.test.ts +18 -4
- package/src/adapters/etherscan.ts +2 -5
- package/src/adapters/ledger.ts +2 -5
- package/src/api/index.ts +5 -4
- package/src/bridge/js.ts +0 -4
- package/src/bridge/preload.ts +0 -8
- package/src/deviceTransactionConfig.ts +2 -3
- package/src/logic/common.ts +0 -52
- package/src/logic/estimateFees.test.ts +57 -98
- package/src/logic/estimateFees.ts +18 -28
- package/src/logic/index.ts +0 -1
- package/src/types/transaction.ts +0 -12
- package/lib/__fixtures__/cardano-native-8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc34c4f4253544552.json +0 -52
- package/lib/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-IN-i0.json +0 -20
- package/lib/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-OUT-i0.json +0 -19
- package/lib/__tests__/fixtures/cryptoAssetsStore.fixtures.d.ts +0 -2
- package/lib/__tests__/fixtures/cryptoAssetsStore.fixtures.d.ts.map +0 -1
- package/lib/__tests__/fixtures/cryptoAssetsStore.fixtures.js +0 -44
- package/lib/__tests__/fixtures/cryptoAssetsStore.fixtures.js.map +0 -1
- package/lib/cryptoAssetsStore.d.ts +0 -5
- package/lib/cryptoAssetsStore.d.ts.map +0 -1
- package/lib/cryptoAssetsStore.js +0 -17
- package/lib/cryptoAssetsStore.js.map +0 -1
- package/lib/cryptoAssetsStore.test.d.ts +0 -2
- package/lib/cryptoAssetsStore.test.d.ts.map +0 -1
- package/lib/cryptoAssetsStore.test.js +0 -15
- package/lib/cryptoAssetsStore.test.js.map +0 -1
- package/lib/logic/validateIntent.d.ts +0 -4
- package/lib/logic/validateIntent.d.ts.map +0 -1
- package/lib/logic/validateIntent.js +0 -192
- package/lib/logic/validateIntent.js.map +0 -1
- package/lib/logic/validateIntent.test.d.ts +0 -2
- package/lib/logic/validateIntent.test.d.ts.map +0 -1
- package/lib/logic/validateIntent.test.js +0 -485
- package/lib/logic/validateIntent.test.js.map +0 -1
- package/lib-es/__fixtures__/cardano-native-8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc34c4f4253544552.json +0 -52
- package/lib-es/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-IN-i0.json +0 -20
- package/lib-es/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-OUT-i0.json +0 -19
- package/lib-es/__tests__/fixtures/cryptoAssetsStore.fixtures.d.ts +0 -2
- package/lib-es/__tests__/fixtures/cryptoAssetsStore.fixtures.d.ts.map +0 -1
- package/lib-es/__tests__/fixtures/cryptoAssetsStore.fixtures.js +0 -19
- package/lib-es/__tests__/fixtures/cryptoAssetsStore.fixtures.js.map +0 -1
- package/lib-es/cryptoAssetsStore.d.ts +0 -5
- package/lib-es/cryptoAssetsStore.d.ts.map +0 -1
- package/lib-es/cryptoAssetsStore.js +0 -12
- package/lib-es/cryptoAssetsStore.js.map +0 -1
- package/lib-es/cryptoAssetsStore.test.d.ts +0 -2
- package/lib-es/cryptoAssetsStore.test.d.ts.map +0 -1
- package/lib-es/cryptoAssetsStore.test.js +0 -13
- package/lib-es/cryptoAssetsStore.test.js.map +0 -1
- package/lib-es/logic/validateIntent.d.ts +0 -4
- package/lib-es/logic/validateIntent.d.ts.map +0 -1
- package/lib-es/logic/validateIntent.js +0 -185
- package/lib-es/logic/validateIntent.js.map +0 -1
- package/lib-es/logic/validateIntent.test.d.ts +0 -2
- package/lib-es/logic/validateIntent.test.d.ts.map +0 -1
- package/lib-es/logic/validateIntent.test.js +0 -480
- package/lib-es/logic/validateIntent.test.js.map +0 -1
- package/src/__fixtures__/cardano-native-8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc34c4f4253544552.json +0 -52
- package/src/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-IN-i0.json +0 -20
- package/src/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-OUT-i0.json +0 -19
- package/src/__fixtures__/ethereum-erc20-usd__coin-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48.json +0 -73
- package/src/__fixtures__/ethereum-erc20-weth.json +0 -73
- package/src/__fixtures__/optimism-erc20-usd_coin.json +0 -69
- package/src/__tests__/fixtures/cryptoAssetsStore.fixtures.ts +0 -24
- package/src/cryptoAssetsStore.test.ts +0 -19
- package/src/cryptoAssetsStore.ts +0 -16
- package/src/logic/validateIntent.test.ts +0 -659
- package/src/logic/validateIntent.ts +0 -274
package/src/__fixtures__/ethereum-erc20-usd__coin-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48.json
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
type: "TokenCurrency",
|
|
3
|
-
id: "ethereum/erc20/usd__coin",
|
|
4
|
-
ledgerSignature: "3045022100b2e358726e4e6a6752cf344017c0e9d45b9a904120758d45f61b2804f9ad5299022015161ef28d8c4481bd9432c13562def9cce688bcfec896ef244c9a213f106cdd",
|
|
5
|
-
contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
6
|
-
parentCurrency: {
|
|
7
|
-
type: "CryptoCurrency",
|
|
8
|
-
id: "ethereum",
|
|
9
|
-
coinType: 60,
|
|
10
|
-
name: "Ethereum",
|
|
11
|
-
managerAppName: "Ethereum",
|
|
12
|
-
ticker: "ETH",
|
|
13
|
-
scheme: "ethereum",
|
|
14
|
-
color: "#0ebdcd",
|
|
15
|
-
symbol: "Ξ",
|
|
16
|
-
family: "evm",
|
|
17
|
-
blockAvgTime: 15,
|
|
18
|
-
units: [
|
|
19
|
-
{
|
|
20
|
-
name: "ether",
|
|
21
|
-
code: "ETH",
|
|
22
|
-
magnitude: 18,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "Gwei",
|
|
26
|
-
code: "Gwei",
|
|
27
|
-
magnitude: 9,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "Mwei",
|
|
31
|
-
code: "Mwei",
|
|
32
|
-
magnitude: 6,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "Kwei",
|
|
36
|
-
code: "Kwei",
|
|
37
|
-
magnitude: 3,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: "wei",
|
|
41
|
-
code: "wei",
|
|
42
|
-
magnitude: 0,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
ethereumLikeInfo: {
|
|
46
|
-
chainId: 1,
|
|
47
|
-
},
|
|
48
|
-
explorerViews: [
|
|
49
|
-
{
|
|
50
|
-
tx: "https://etherscan.io/tx/$hash",
|
|
51
|
-
address: "https://etherscan.io/address/$address",
|
|
52
|
-
token: "https://etherscan.io/token/$contractAddress?a=$address",
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
keywords: [
|
|
56
|
-
"eth",
|
|
57
|
-
"ethereum",
|
|
58
|
-
],
|
|
59
|
-
explorerId: "eth",
|
|
60
|
-
},
|
|
61
|
-
tokenType: "erc20",
|
|
62
|
-
name: "USD Coin",
|
|
63
|
-
ticker: "USDC",
|
|
64
|
-
delisted: false,
|
|
65
|
-
disableCountervalue: false,
|
|
66
|
-
units: [
|
|
67
|
-
{
|
|
68
|
-
name: "USD Coin",
|
|
69
|
-
code: "USDC",
|
|
70
|
-
magnitude: 6,
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "TokenCurrency",
|
|
3
|
-
"id": "ethereum/erc20/weth",
|
|
4
|
-
"ledgerSignature": "3045022100b47ee8551c15a2cf681c649651e987d7e527c481d27c38da1f971a8242792bd3022069c3f688ac5493a23dab5798e3c9b07484765069e1d4be14321aae4d92cb8cbe",
|
|
5
|
-
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
6
|
-
"parentCurrency": {
|
|
7
|
-
"type": "CryptoCurrency",
|
|
8
|
-
"id": "ethereum",
|
|
9
|
-
"coinType": 60,
|
|
10
|
-
"name": "Ethereum",
|
|
11
|
-
"managerAppName": "Ethereum",
|
|
12
|
-
"ticker": "ETH",
|
|
13
|
-
"scheme": "ethereum",
|
|
14
|
-
"color": "#0ebdcd",
|
|
15
|
-
"symbol": "Ξ",
|
|
16
|
-
"family": "evm",
|
|
17
|
-
"blockAvgTime": 15,
|
|
18
|
-
"units": [
|
|
19
|
-
{
|
|
20
|
-
"name": "ether",
|
|
21
|
-
"code": "ETH",
|
|
22
|
-
"magnitude": 18
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"name": "Gwei",
|
|
26
|
-
"code": "Gwei",
|
|
27
|
-
"magnitude": 9
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "Mwei",
|
|
31
|
-
"code": "Mwei",
|
|
32
|
-
"magnitude": 6
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "Kwei",
|
|
36
|
-
"code": "Kwei",
|
|
37
|
-
"magnitude": 3
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "wei",
|
|
41
|
-
"code": "wei",
|
|
42
|
-
"magnitude": 0
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"ethereumLikeInfo": {
|
|
46
|
-
"chainId": 1
|
|
47
|
-
},
|
|
48
|
-
"explorerViews": [
|
|
49
|
-
{
|
|
50
|
-
"tx": "https://etherscan.io/tx/$hash",
|
|
51
|
-
"address": "https://etherscan.io/address/$address",
|
|
52
|
-
"token": "https://etherscan.io/token/$contractAddress?a=$address"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"keywords": [
|
|
56
|
-
"eth",
|
|
57
|
-
"ethereum"
|
|
58
|
-
],
|
|
59
|
-
"explorerId": "eth"
|
|
60
|
-
},
|
|
61
|
-
"tokenType": "erc20",
|
|
62
|
-
"name": "WETH",
|
|
63
|
-
"ticker": "WETH",
|
|
64
|
-
"delisted": false,
|
|
65
|
-
"disableCountervalue": false,
|
|
66
|
-
"units": [
|
|
67
|
-
{
|
|
68
|
-
"name": "WETH",
|
|
69
|
-
"code": "WETH",
|
|
70
|
-
"magnitude": 18
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "TokenCurrency",
|
|
3
|
-
"id": "optimism/erc20/usd_coin",
|
|
4
|
-
"ledgerSignature": "30440220597e4a9911df217d680aa240ca96f7e8fca24c24e7c673c43820c94b08ef69e402206e975e27e82b3370eca40041fca772bd6c4ca7dd087d2bfcc8aa146cb8e1de53",
|
|
5
|
-
"contractAddress": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
6
|
-
"parentCurrency": {
|
|
7
|
-
"type": "CryptoCurrency",
|
|
8
|
-
"id": "optimism",
|
|
9
|
-
"coinType": 60,
|
|
10
|
-
"name": "OP Mainnet",
|
|
11
|
-
"managerAppName": "Ethereum",
|
|
12
|
-
"ticker": "ETH",
|
|
13
|
-
"scheme": "optimism",
|
|
14
|
-
"color": "#FF0421",
|
|
15
|
-
"family": "evm",
|
|
16
|
-
"units": [
|
|
17
|
-
{
|
|
18
|
-
"name": "ether",
|
|
19
|
-
"code": "ETH",
|
|
20
|
-
"magnitude": 18
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"name": "Gwei",
|
|
24
|
-
"code": "Gwei",
|
|
25
|
-
"magnitude": 9
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "Mwei",
|
|
29
|
-
"code": "Mwei",
|
|
30
|
-
"magnitude": 6
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"name": "Kwei",
|
|
34
|
-
"code": "Kwei",
|
|
35
|
-
"magnitude": 3
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"name": "wei",
|
|
39
|
-
"code": "wei",
|
|
40
|
-
"magnitude": 0
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"ethereumLikeInfo": {
|
|
44
|
-
"chainId": 10
|
|
45
|
-
},
|
|
46
|
-
"explorerViews": [
|
|
47
|
-
{
|
|
48
|
-
"tx": "https://optimism.blockscout.com/tx/$hash",
|
|
49
|
-
"address": "https://optimism.blockscout.com/address/$address",
|
|
50
|
-
"token": "https://optimism.blockscout.com/address/$address?tab=token_transfer&token=$contractAddress"
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
"keywords": [
|
|
54
|
-
"optimism"
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
"tokenType": "erc20",
|
|
58
|
-
"name": "USD Coin",
|
|
59
|
-
"ticker": "USDC",
|
|
60
|
-
"delisted": false,
|
|
61
|
-
"disableCountervalue": false,
|
|
62
|
-
"units": [
|
|
63
|
-
{
|
|
64
|
-
"name": "USD Coin",
|
|
65
|
-
"code": "USDC",
|
|
66
|
-
"magnitude": 6
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as legacyTokens from "@ledgerhq/cryptoassets/tokens";
|
|
2
|
-
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
|
3
|
-
import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
|
|
4
|
-
import { setCryptoAssetsStoreGetter } from "../../cryptoAssetsStore";
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* TODO change implementation when new CryptoAssesStore implemented with DADA
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
11
|
-
setCryptoAssetsStoreForCoinFramework({
|
|
12
|
-
findTokenById: legacyTokens.findTokenById,
|
|
13
|
-
findTokenByAddressInCurrency: legacyTokens.findTokenByAddressInCurrency,
|
|
14
|
-
} as CryptoAssetsStore);
|
|
15
|
-
|
|
16
|
-
setCryptoAssetsStoreGetter(
|
|
17
|
-
() =>
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
19
|
-
({
|
|
20
|
-
findTokenById: legacyTokens.findTokenById,
|
|
21
|
-
findTokenByAddressInCurrency: legacyTokens.findTokenByAddressInCurrency,
|
|
22
|
-
findTokenByAddress: legacyTokens.findTokenByAddress,
|
|
23
|
-
}) as CryptoAssetsStore,
|
|
24
|
-
);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
|
2
|
-
import {
|
|
3
|
-
CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE,
|
|
4
|
-
getCryptoAssetsStore,
|
|
5
|
-
setCryptoAssetsStoreGetter,
|
|
6
|
-
} from "./cryptoAssetsStore";
|
|
7
|
-
|
|
8
|
-
describe("cryptoAssetsStore", () => {
|
|
9
|
-
it("should throw an error when CryptoAssetsStoreGetter is not set", () => {
|
|
10
|
-
expect(() => getCryptoAssetsStore()).toThrow(CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it("should return the CryptoAssetsStoreGetter set", () => {
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
15
|
-
const store = {} as CryptoAssetsStore;
|
|
16
|
-
setCryptoAssetsStoreGetter(() => store);
|
|
17
|
-
expect(getCryptoAssetsStore()).toEqual(store);
|
|
18
|
-
});
|
|
19
|
-
});
|
package/src/cryptoAssetsStore.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { CryptoAssetsStore, CryptoAssetsStoreGetter } from "@ledgerhq/types-live";
|
|
2
|
-
|
|
3
|
-
export const CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE =
|
|
4
|
-
"CryptoAssetsStore is not set. Please call setCryptoAssetsStore first on coin EVM";
|
|
5
|
-
|
|
6
|
-
let getStore: CryptoAssetsStoreGetter;
|
|
7
|
-
export function setCryptoAssetsStoreGetter(cryptoAssetsStoreGetter: CryptoAssetsStoreGetter): void {
|
|
8
|
-
getStore = cryptoAssetsStoreGetter;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function getCryptoAssetsStore(): CryptoAssetsStore {
|
|
12
|
-
if (!getStore) {
|
|
13
|
-
throw new Error(CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE);
|
|
14
|
-
}
|
|
15
|
-
return getStore();
|
|
16
|
-
}
|