@lifi/data-types 6.24.0 → 6.25.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/package.json +2 -2
- package/src/_cjs/chains/supportedChains.evm.int.spec.js +5 -1
- package/src/_cjs/chains/supportedChains.evm.int.spec.js.map +1 -1
- package/src/_cjs/chains/supportedChains.evm.js +21 -0
- package/src/_cjs/chains/supportedChains.evm.js.map +1 -1
- package/src/_cjs/chains/supportedChains.unit.spec.js +5 -0
- package/src/_cjs/chains/supportedChains.unit.spec.js.map +1 -1
- package/src/_cjs/coins/coins.js +13 -0
- package/src/_cjs/coins/coins.js.map +1 -1
- package/src/_esm/chains/supportedChains.evm.int.spec.js +6 -1
- package/src/_esm/chains/supportedChains.evm.int.spec.js.map +1 -1
- package/src/_esm/chains/supportedChains.evm.js +21 -0
- package/src/_esm/chains/supportedChains.evm.js.map +1 -1
- package/src/_esm/chains/supportedChains.unit.spec.js +5 -0
- package/src/_esm/chains/supportedChains.unit.spec.js.map +1 -1
- package/src/_esm/coins/coins.js +13 -0
- package/src/_esm/coins/coins.js.map +1 -1
- package/src/_types/chains/supportedChains.evm.d.ts.map +1 -1
- package/src/_types/coins/coins.d.ts.map +1 -1
- package/src/chains/supportedChains.evm.int.spec.ts +13 -7
- package/src/chains/supportedChains.evm.ts +22 -0
- package/src/chains/supportedChains.unit.spec.ts +6 -0
- package/src/coins/coins.ts +14 -0
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { createPublicClient, http } from 'viem'
|
|
2
2
|
import { describe, expect, test } from 'vitest'
|
|
3
3
|
import { supportedEVMChains } from './supportedChains.evm.js'
|
|
4
|
+
import { ChainKey } from '@lifi/types'
|
|
5
|
+
|
|
6
|
+
// It's an artificial EVM chain, so we skip it
|
|
7
|
+
const chainsToSkip = [ChainKey.HPL]
|
|
4
8
|
|
|
5
9
|
describe.concurrent('EVM chains RPC check', () => {
|
|
6
|
-
const rpcUrls = supportedEVMChains
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const rpcUrls = supportedEVMChains
|
|
11
|
+
.filter((chain) => !chainsToSkip.includes(chain.key))
|
|
12
|
+
.flatMap((chain) =>
|
|
13
|
+
chain.metamask.rpcUrls.map((rpcUrl) => ({
|
|
14
|
+
rpcUrl: rpcUrl,
|
|
15
|
+
chainId: chain.id,
|
|
16
|
+
chainName: chain.name,
|
|
17
|
+
}))
|
|
18
|
+
)
|
|
13
19
|
|
|
14
20
|
test.for(rpcUrls)(
|
|
15
21
|
`should successfully get chain ID from $chainName - $chainId RPC: $rpcUrl`,
|
|
@@ -1676,4 +1676,26 @@ export const supportedEVMChains: EVMChain[] = [
|
|
|
1676
1676
|
rpcUrls: ['https://rpc.plume.org'],
|
|
1677
1677
|
},
|
|
1678
1678
|
},
|
|
1679
|
+
{
|
|
1680
|
+
key: ChainKey.HPL,
|
|
1681
|
+
chainType: ChainType.EVM,
|
|
1682
|
+
name: 'Hyperliquid',
|
|
1683
|
+
coin: CoinKey.USDC,
|
|
1684
|
+
id: ChainId.HPL,
|
|
1685
|
+
mainnet: true,
|
|
1686
|
+
logoURI:
|
|
1687
|
+
'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/hyperliquid.svg',
|
|
1688
|
+
relayerSupported: false,
|
|
1689
|
+
metamask: {
|
|
1690
|
+
chainId: prefixChainId(ChainId.ARB),
|
|
1691
|
+
blockExplorerUrls: ['https://app.hyperliquid.xyz/explorer/'],
|
|
1692
|
+
chainName: 'Hyperliquid',
|
|
1693
|
+
nativeCurrency: {
|
|
1694
|
+
name: CoinKey.USDC,
|
|
1695
|
+
symbol: CoinKey.USDC,
|
|
1696
|
+
decimals: 6,
|
|
1697
|
+
},
|
|
1698
|
+
rpcUrls: [],
|
|
1699
|
+
},
|
|
1700
|
+
},
|
|
1679
1701
|
]
|
|
@@ -31,6 +31,7 @@ test('native token defined for all chains', () => {
|
|
|
31
31
|
ChainId.LTC,
|
|
32
32
|
ChainId.DGE,
|
|
33
33
|
ChainId.SUI,
|
|
34
|
+
ChainId.HPL,
|
|
34
35
|
]
|
|
35
36
|
for (const chain of supportedChains) {
|
|
36
37
|
if (ignoredChainsForNativeToken.includes(chain.id)) {
|
|
@@ -86,8 +87,13 @@ describe('findTokenByChainIdAndAddress', () => {
|
|
|
86
87
|
})
|
|
87
88
|
|
|
88
89
|
describe('validate chains', () => {
|
|
90
|
+
const ignoredChains = [ChainId.HPL]
|
|
89
91
|
supportedEVMChains.forEach((chain) => {
|
|
90
92
|
it(`validate chain ${chain.name}`, () => {
|
|
93
|
+
if (ignoredChains.includes(chain.id)) {
|
|
94
|
+
return
|
|
95
|
+
}
|
|
96
|
+
|
|
91
97
|
// blockExplorerUrls
|
|
92
98
|
expect(chain.metamask.blockExplorerUrls.length).toBeGreaterThan(0)
|
|
93
99
|
chain.metamask.blockExplorerUrls.forEach((blockExplorerUrl) => {
|
package/src/coins/coins.ts
CHANGED
|
@@ -973,6 +973,10 @@ export const basicCoins: BasicCoin[] = [
|
|
|
973
973
|
address: '0x0b7007c13325c48911f73a2dad5fa5dcbf808adc',
|
|
974
974
|
decimals: 6,
|
|
975
975
|
},
|
|
976
|
+
[ChainId.HPL]: {
|
|
977
|
+
address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
|
|
978
|
+
decimals: 6,
|
|
979
|
+
},
|
|
976
980
|
},
|
|
977
981
|
},
|
|
978
982
|
// USDC.e
|
|
@@ -3379,6 +3383,16 @@ export const wrappedTokens: { [ChainId: string]: StaticToken } = {
|
|
|
3379
3383
|
logoURI:
|
|
3380
3384
|
'https://static.debank.com/image/plume_token/logo_url/plume/20ecb01558edaac59ad4cd20b9ccc51d.png',
|
|
3381
3385
|
},
|
|
3386
|
+
[ChainId.HPL]: {
|
|
3387
|
+
name: 'USD Coin',
|
|
3388
|
+
address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
|
|
3389
|
+
symbol: CoinKey.USDC,
|
|
3390
|
+
coinKey: CoinKey.USDC,
|
|
3391
|
+
chainId: ChainId.HPL,
|
|
3392
|
+
decimals: 6,
|
|
3393
|
+
logoURI:
|
|
3394
|
+
'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png',
|
|
3395
|
+
},
|
|
3382
3396
|
}
|
|
3383
3397
|
export const findDefaultCoin = (coinKey: CoinKey): Coin => {
|
|
3384
3398
|
const coin = defaultCoins.find((coin) => coin.key === coinKey)
|