@lifi/data-types 6.36.0 → 6.38.0-beta.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/foundry.js +93 -0
- package/src/_cjs/chains/foundry.js.map +1 -0
- package/src/_cjs/chains/supportedChains.evm.js +22 -0
- package/src/_cjs/chains/supportedChains.evm.js.map +1 -1
- package/src/_cjs/coins/coins.js +37 -0
- package/src/_cjs/coins/coins.js.map +1 -1
- package/src/_cjs/multicall.js +1 -0
- package/src/_cjs/multicall.js.map +1 -1
- package/src/_esm/chains/foundry.js +94 -0
- package/src/_esm/chains/foundry.js.map +1 -0
- package/src/_esm/chains/supportedChains.evm.js +22 -0
- package/src/_esm/chains/supportedChains.evm.js.map +1 -1
- package/src/_esm/coins/coins.js +38 -0
- package/src/_esm/coins/coins.js.map +1 -1
- package/src/_esm/multicall.js +1 -0
- package/src/_esm/multicall.js.map +1 -1
- package/src/_types/chains/foundry.d.ts +3 -0
- package/src/_types/chains/foundry.d.ts.map +1 -0
- package/src/_types/chains/supportedChains.evm.d.ts.map +1 -1
- package/src/_types/coins/coins.d.ts.map +1 -1
- package/src/_types/multicall.d.ts.map +1 -1
- package/src/chains/foundry.ts +96 -0
- package/src/chains/supportedChains.evm.ts +24 -0
- package/src/coins/coins.ts +40 -0
- package/src/multicall.ts +1 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ChainId } from '@lifi/types'
|
|
2
|
+
|
|
3
|
+
// This name is used to map the chainId to the chain name when running scripts
|
|
4
|
+
// There is no documentation on the chain names, you can refer to
|
|
5
|
+
// the chain names in https://github.com/lifinance/contracts/tree/main/deployments
|
|
6
|
+
const chainNameMap: Record<ChainId, string> = {
|
|
7
|
+
[ChainId.UNI]: 'unichain',
|
|
8
|
+
[ChainId.HYP]: 'hyperevm',
|
|
9
|
+
[ChainId.FLR]: 'flare',
|
|
10
|
+
[ChainId.SON]: 'sonic',
|
|
11
|
+
[ChainId.VAN]: 'vana',
|
|
12
|
+
[ChainId.SOE]: 'soneium',
|
|
13
|
+
[ChainId.SWL]: 'swellchain',
|
|
14
|
+
[ChainId.RON]: 'ronin',
|
|
15
|
+
[ChainId.CRN]: 'corn',
|
|
16
|
+
[ChainId.LNS]: 'lens',
|
|
17
|
+
[ChainId.ABS]: 'abstract',
|
|
18
|
+
[ChainId.FSN]: 'fusion',
|
|
19
|
+
[ChainId.APE]: 'apechain',
|
|
20
|
+
[ChainId.TLO]: 'telos',
|
|
21
|
+
[ChainId.ETL]: 'etherlink',
|
|
22
|
+
[ChainId.XDC]: 'xdc',
|
|
23
|
+
[ChainId.SOP]: 'sophon',
|
|
24
|
+
[ChainId.SUP]: 'superposition',
|
|
25
|
+
[ChainId.INK]: 'ink',
|
|
26
|
+
[ChainId.BOC]: 'bob',
|
|
27
|
+
[ChainId.NIB]: 'niburu',
|
|
28
|
+
[ChainId.KAT]: 'katana',
|
|
29
|
+
[ChainId.BER]: 'berachain',
|
|
30
|
+
[ChainId.VIC]: 'viction',
|
|
31
|
+
[ChainId.PLU]: 'plume',
|
|
32
|
+
[ChainId.ETH]: 'mainnet',
|
|
33
|
+
[ChainId.DAI]: 'gnosis',
|
|
34
|
+
[ChainId.POL]: 'polygon',
|
|
35
|
+
[ChainId.BSC]: 'bsc',
|
|
36
|
+
[ChainId.ARB]: 'arbitrum',
|
|
37
|
+
[ChainId.OPT]: 'optimism',
|
|
38
|
+
[ChainId.FTM]: 'fantom',
|
|
39
|
+
[ChainId.AVA]: 'avalanche',
|
|
40
|
+
[ChainId.MOR]: 'moonriver',
|
|
41
|
+
[ChainId.MOO]: 'moonbeam',
|
|
42
|
+
[ChainId.CEL]: 'celo',
|
|
43
|
+
[ChainId.FUS]: 'fuse',
|
|
44
|
+
[ChainId.CRO]: 'cronos',
|
|
45
|
+
[ChainId.ONE]: 'harmony',
|
|
46
|
+
[ChainId.EVM]: 'evmos',
|
|
47
|
+
[ChainId.BOB]: 'boba',
|
|
48
|
+
[ChainId.ARN]: 'arbitrumnova',
|
|
49
|
+
[ChainId.VEL]: 'velas',
|
|
50
|
+
[ChainId.BAS]: 'base',
|
|
51
|
+
[ChainId.LNA]: 'linea',
|
|
52
|
+
[ChainId.ERA]: 'zksync',
|
|
53
|
+
[ChainId.PZE]: 'polygonzkevm',
|
|
54
|
+
[ChainId.MAM]: 'metis',
|
|
55
|
+
[ChainId.AUR]: 'aurora',
|
|
56
|
+
[ChainId.MOD]: 'mode',
|
|
57
|
+
[ChainId.SCL]: 'scroll',
|
|
58
|
+
[ChainId.BLS]: 'blast',
|
|
59
|
+
[ChainId.RSK]: 'rootstock',
|
|
60
|
+
[ChainId.XLY]: 'xlayer',
|
|
61
|
+
[ChainId.FRA]: 'fraxtal',
|
|
62
|
+
[ChainId.SEI]: 'sei',
|
|
63
|
+
[ChainId.GRA]: 'gravity',
|
|
64
|
+
[ChainId.MNT]: 'mantle',
|
|
65
|
+
[ChainId.KAI]: 'kaia',
|
|
66
|
+
[ChainId.IMX]: 'immutablezkevm',
|
|
67
|
+
[ChainId.TAI]: 'taiko',
|
|
68
|
+
[ChainId.WCC]: 'worldchain',
|
|
69
|
+
[ChainId.OPB]: 'opbnb',
|
|
70
|
+
[ChainId.LSK]: 'lisk',
|
|
71
|
+
[ChainId.PLA]: 'plasma',
|
|
72
|
+
|
|
73
|
+
// Custom chains
|
|
74
|
+
[7777777 as ChainId]: 'zora',
|
|
75
|
+
|
|
76
|
+
// non-evm chains, just kept for more secure typing
|
|
77
|
+
[ChainId.TRN]: 'tron',
|
|
78
|
+
[ChainId.SUI]: 'sui',
|
|
79
|
+
[ChainId.HPL]: 'hyperliquid',
|
|
80
|
+
[ChainId.OAS]: 'oasis',
|
|
81
|
+
[ChainId.SOL]: 'solana',
|
|
82
|
+
[ChainId.TER]: 'terra',
|
|
83
|
+
[ChainId.BTC]: 'bitcoin',
|
|
84
|
+
[ChainId.BCH]: 'bitcoin-cash',
|
|
85
|
+
[ChainId.LTC]: 'litecoin',
|
|
86
|
+
[ChainId.DGE]: 'dogecoin',
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const getFoundryChainNameByChainId = (chainId: ChainId): string => {
|
|
90
|
+
const mapping = chainNameMap[chainId]
|
|
91
|
+
if (mapping === undefined) {
|
|
92
|
+
throw new Error(`[foundry] No chain name found for chainId ${chainId}.`)
|
|
93
|
+
} else {
|
|
94
|
+
return mapping
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1713,4 +1713,28 @@ export const supportedEVMChains: EVMChain[] = [
|
|
|
1713
1713
|
rpcUrls: ['https://rpc.sophon.xyz'],
|
|
1714
1714
|
},
|
|
1715
1715
|
},
|
|
1716
|
+
|
|
1717
|
+
{
|
|
1718
|
+
key: ChainKey.PLA,
|
|
1719
|
+
chainType: ChainType.EVM,
|
|
1720
|
+
name: 'Plasma',
|
|
1721
|
+
coin: CoinKey.XPL,
|
|
1722
|
+
id: ChainId.PLA,
|
|
1723
|
+
mainnet: true,
|
|
1724
|
+
logoURI:
|
|
1725
|
+
'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/plasma.svg',
|
|
1726
|
+
relayerSupported: false,
|
|
1727
|
+
multicallAddress: multicallAddresses[ChainId.PLA],
|
|
1728
|
+
metamask: {
|
|
1729
|
+
chainId: prefixChainId(ChainId.PLA),
|
|
1730
|
+
blockExplorerUrls: ['https://plasmascan.to/'],
|
|
1731
|
+
chainName: 'Plasma',
|
|
1732
|
+
nativeCurrency: {
|
|
1733
|
+
name: CoinKey.XPL,
|
|
1734
|
+
symbol: CoinKey.XPL,
|
|
1735
|
+
decimals: 18,
|
|
1736
|
+
},
|
|
1737
|
+
rpcUrls: ['https://rpc.plasma.to'],
|
|
1738
|
+
},
|
|
1739
|
+
},
|
|
1716
1740
|
]
|
package/src/coins/coins.ts
CHANGED
|
@@ -1848,6 +1848,10 @@ export const basicCoins: BasicCoin[] = [
|
|
|
1848
1848
|
address: '0xca59cA09E5602fAe8B629DeE83FfA819741f14be',
|
|
1849
1849
|
decimals: 18,
|
|
1850
1850
|
},
|
|
1851
|
+
[ChainId.PLA]: {
|
|
1852
|
+
address: '0x9895D81bB462A195b4922ED7De0e3ACD007c32CB',
|
|
1853
|
+
decimals: 18,
|
|
1854
|
+
},
|
|
1851
1855
|
},
|
|
1852
1856
|
},
|
|
1853
1857
|
|
|
@@ -2808,6 +2812,32 @@ export const basicCoins: BasicCoin[] = [
|
|
|
2808
2812
|
},
|
|
2809
2813
|
},
|
|
2810
2814
|
|
|
2815
|
+
{
|
|
2816
|
+
key: CoinKey.XPL,
|
|
2817
|
+
name: 'Plasma',
|
|
2818
|
+
logoURI: 'https://s2.coinmarketcap.com/static/img/coins/64x64/36645.png',
|
|
2819
|
+
verified: true,
|
|
2820
|
+
chains: {
|
|
2821
|
+
[ChainId.PLA]: {
|
|
2822
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
2823
|
+
decimals: 18,
|
|
2824
|
+
},
|
|
2825
|
+
},
|
|
2826
|
+
},
|
|
2827
|
+
|
|
2828
|
+
{
|
|
2829
|
+
key: CoinKey.WXPL,
|
|
2830
|
+
name: 'Wrapped Plasma',
|
|
2831
|
+
logoURI: 'https://s2.coinmarketcap.com/static/img/coins/64x64/36645.png',
|
|
2832
|
+
verified: true,
|
|
2833
|
+
chains: {
|
|
2834
|
+
[ChainId.PLA]: {
|
|
2835
|
+
address: '0x6100E367285b01F48D07953803A2d8dCA5D19873',
|
|
2836
|
+
decimals: 18,
|
|
2837
|
+
},
|
|
2838
|
+
},
|
|
2839
|
+
},
|
|
2840
|
+
|
|
2811
2841
|
// > Bitcoin
|
|
2812
2842
|
{
|
|
2813
2843
|
key: CoinKey.BTC,
|
|
@@ -3558,6 +3588,16 @@ export const wrappedTokens: { [ChainId: string]: StaticToken } = {
|
|
|
3558
3588
|
logoURI:
|
|
3559
3589
|
'https://lifinance.github.io/types/src/assets/icons/chains/tron.svg',
|
|
3560
3590
|
},
|
|
3591
|
+
[ChainId.PLA]: {
|
|
3592
|
+
// https://plasmascan.to/address/0x6100E367285b01F48D07953803A2d8dCA5D19873
|
|
3593
|
+
address: '0x6100E367285b01F48D07953803A2d8dCA5D19873',
|
|
3594
|
+
name: 'Wrapped Plasma',
|
|
3595
|
+
symbol: CoinKey.WXPL,
|
|
3596
|
+
coinKey: CoinKey.WXPL,
|
|
3597
|
+
chainId: ChainId.PLA,
|
|
3598
|
+
decimals: 18,
|
|
3599
|
+
logoURI: 'https://s2.coinmarketcap.com/static/img/coins/64x64/36645.png',
|
|
3600
|
+
},
|
|
3561
3601
|
}
|
|
3562
3602
|
export const findDefaultCoin = (coinKey: CoinKey): Coin => {
|
|
3563
3603
|
const coin = defaultCoins.find((coin) => coin.key === coinKey)
|
package/src/multicall.ts
CHANGED
|
@@ -72,6 +72,7 @@ export const multicallAddresses: { [ChainId: number]: string } = {
|
|
|
72
72
|
[ChainId.RON]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
73
73
|
[ChainId.PLU]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
74
74
|
[ChainId.SOP]: '0x5f4867441d2416cA88B1b3fd38f21811680CD2C8',
|
|
75
|
+
[ChainId.PLA]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
75
76
|
|
|
76
77
|
// TODO
|
|
77
78
|
// [ChainId.EXP]: '', // TODO
|