@lifi/data-types 6.2.0-beta.1 → 6.3.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.
Files changed (46) hide show
  1. package/package.json +2 -2
  2. package/src/_cjs/chains/supportedChains.evm.int.spec.js +0 -13
  3. package/src/_cjs/chains/supportedChains.evm.int.spec.js.map +1 -1
  4. package/src/_cjs/chains/supportedChains.evm.js +55 -2
  5. package/src/_cjs/chains/supportedChains.evm.js.map +1 -1
  6. package/src/_cjs/chains/supportedChains.mvm.int.spec.js +0 -13
  7. package/src/_cjs/chains/supportedChains.mvm.int.spec.js.map +1 -1
  8. package/src/_cjs/chains/supportedChains.svm.int.spec.js +11 -14
  9. package/src/_cjs/chains/supportedChains.svm.int.spec.js.map +1 -1
  10. package/src/_cjs/chains/supportedChains.unit.spec.js +2 -0
  11. package/src/_cjs/chains/supportedChains.unit.spec.js.map +1 -1
  12. package/src/_cjs/chains/supportedChains.utxo.int.spec.js +1 -14
  13. package/src/_cjs/chains/supportedChains.utxo.int.spec.js.map +1 -1
  14. package/src/_cjs/coins/coins.js +60 -0
  15. package/src/_cjs/coins/coins.js.map +1 -1
  16. package/src/_cjs/multicall.js +2 -0
  17. package/src/_cjs/multicall.js.map +1 -1
  18. package/src/_esm/chains/supportedChains.evm.int.spec.js +0 -13
  19. package/src/_esm/chains/supportedChains.evm.int.spec.js.map +1 -1
  20. package/src/_esm/chains/supportedChains.evm.js +57 -2
  21. package/src/_esm/chains/supportedChains.evm.js.map +1 -1
  22. package/src/_esm/chains/supportedChains.mvm.int.spec.js +0 -13
  23. package/src/_esm/chains/supportedChains.mvm.int.spec.js.map +1 -1
  24. package/src/_esm/chains/supportedChains.svm.int.spec.js +14 -15
  25. package/src/_esm/chains/supportedChains.svm.int.spec.js.map +1 -1
  26. package/src/_esm/chains/supportedChains.unit.spec.js +2 -0
  27. package/src/_esm/chains/supportedChains.unit.spec.js.map +1 -1
  28. package/src/_esm/chains/supportedChains.utxo.int.spec.js +1 -14
  29. package/src/_esm/chains/supportedChains.utxo.int.spec.js.map +1 -1
  30. package/src/_esm/coins/coins.js +63 -0
  31. package/src/_esm/coins/coins.js.map +1 -1
  32. package/src/_esm/multicall.js +2 -0
  33. package/src/_esm/multicall.js.map +1 -1
  34. package/src/_types/chains/supportedChains.d.ts.map +1 -1
  35. package/src/_types/chains/supportedChains.evm.d.ts.map +1 -1
  36. package/src/_types/chains/utils.d.ts.map +1 -1
  37. package/src/_types/coins/coins.d.ts.map +1 -1
  38. package/src/_types/multicall.d.ts.map +1 -1
  39. package/src/chains/supportedChains.evm.int.spec.ts +0 -21
  40. package/src/chains/supportedChains.evm.ts +63 -4
  41. package/src/chains/supportedChains.mvm.int.spec.ts +0 -21
  42. package/src/chains/supportedChains.svm.int.spec.ts +12 -22
  43. package/src/chains/supportedChains.unit.spec.ts +2 -0
  44. package/src/chains/supportedChains.utxo.int.spec.ts +1 -22
  45. package/src/coins/coins.ts +68 -0
  46. package/src/multicall.ts +2 -0
@@ -22,6 +22,7 @@ export const supportedEVMChains: EVMChain[] = [
22
22
  'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/ethereum.svg',
23
23
  tokenlistUrl: 'https://gateway.ipfs.io/ipns/tokens.uniswap.org',
24
24
  multicallAddress: multicallAddresses[ChainId.ETH],
25
+ relayerSupported: true,
25
26
  metamask: {
26
27
  chainId: prefixChainId(1),
27
28
  blockExplorerUrls: ['https://etherscan.io/'],
@@ -53,6 +54,7 @@ export const supportedEVMChains: EVMChain[] = [
53
54
  'https://unpkg.com/quickswap-default-token-list@1.0.71/build/quickswap-default.tokenlist.json',
54
55
  faucetUrls: ['https://stakely.io/faucet/polygon-matic'],
55
56
  multicallAddress: multicallAddresses[ChainId.POL],
57
+ relayerSupported: true,
56
58
  metamask: {
57
59
  chainId: prefixChainId(137),
58
60
  blockExplorerUrls: ['https://polygonscan.com/'],
@@ -84,6 +86,7 @@ export const supportedEVMChains: EVMChain[] = [
84
86
  'https://tokens.pancakeswap.finance/pancakeswap-extended.json',
85
87
  faucetUrls: ['https://stakely.io/faucet/bsc-chain-bnb'],
86
88
  multicallAddress: multicallAddresses[ChainId.BSC],
89
+ relayerSupported: true,
87
90
  // https://docs.binance.org/smart-chain/wallet/metamask.html
88
91
  metamask: {
89
92
  chainId: prefixChainId(56),
@@ -183,6 +186,7 @@ export const supportedEVMChains: EVMChain[] = [
183
186
  tokenlistUrl:
184
187
  'https://raw.githubusercontent.com/sushiswap/default-token-list/master/tokens/avalanche.json',
185
188
  multicallAddress: multicallAddresses[ChainId.AVA],
189
+ relayerSupported: true,
186
190
  // https://support.avax.network/en/articles/4626956-how-do-i-set-up-metamask-on-avalanche
187
191
  metamask: {
188
192
  chainId: prefixChainId(43114),
@@ -216,6 +220,7 @@ export const supportedEVMChains: EVMChain[] = [
216
220
  'https://raw.githubusercontent.com/sushiswap/default-token-list/master/tokens/arbitrum.json',
217
221
  faucetUrls: ['https://bridge.arbitrum.io/'],
218
222
  multicallAddress: multicallAddresses[ChainId.ARB],
223
+ relayerSupported: true,
219
224
  metamask: {
220
225
  chainId: prefixChainId(42161),
221
226
  blockExplorerUrls: ['https://arbiscan.io/'],
@@ -246,6 +251,7 @@ export const supportedEVMChains: EVMChain[] = [
246
251
  tokenlistUrl: 'https://static.optimism.io/optimism.tokenlist.json',
247
252
  faucetUrls: ['https://gateway.optimism.io/'],
248
253
  multicallAddress: multicallAddresses[ChainId.OPT],
254
+ relayerSupported: true,
249
255
  metamask: {
250
256
  chainId: prefixChainId(10),
251
257
  blockExplorerUrls: ['https://optimistic.etherscan.io/'],
@@ -624,6 +630,7 @@ export const supportedEVMChains: EVMChain[] = [
624
630
  logoURI:
625
631
  'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/zksync.svg',
626
632
  multicallAddress: multicallAddresses[ChainId.ERA],
633
+ relayerSupported: true,
627
634
  metamask: {
628
635
  chainId: prefixChainId(324),
629
636
  blockExplorerUrls: ['https://explorer.zksync.io/'],
@@ -671,6 +678,7 @@ export const supportedEVMChains: EVMChain[] = [
671
678
  logoURI:
672
679
  'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/base.svg',
673
680
  multicallAddress: multicallAddresses[ChainId.BAS],
681
+ relayerSupported: true,
674
682
  metamask: {
675
683
  chainId: prefixChainId(ChainId.BAS),
676
684
  blockExplorerUrls: ['https://basescan.org/'],
@@ -793,7 +801,6 @@ export const supportedEVMChains: EVMChain[] = [
793
801
  'https://mantle-rpc.publicnode.com',
794
802
  'https://mantle.drpc.org',
795
803
  'https://mantle.public-rpc.com',
796
- 'https://rpc.ankr.com/mantle',
797
804
  ],
798
805
  },
799
806
  },
@@ -809,6 +816,7 @@ export const supportedEVMChains: EVMChain[] = [
809
816
  logoURI:
810
817
  'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/blast.png',
811
818
  multicallAddress: multicallAddresses[ChainId.BLS],
819
+ relayerSupported: true,
812
820
  metamask: {
813
821
  chainId: prefixChainId(81457),
814
822
  blockExplorerUrls: ['https://blastscan.io/', 'https://blastexplorer.io/'],
@@ -1157,7 +1165,7 @@ export const supportedEVMChains: EVMChain[] = [
1157
1165
  logoURI:
1158
1166
  'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/bera.svg',
1159
1167
  multicallAddress: multicallAddresses[ChainId.BER],
1160
-
1168
+ relayerSupported: true,
1161
1169
  metamask: {
1162
1170
  chainId: prefixChainId(80094),
1163
1171
  blockExplorerUrls: ['https://berascan.com/', 'https://beratrail.io/'],
@@ -1203,14 +1211,14 @@ export const supportedEVMChains: EVMChain[] = [
1203
1211
  {
1204
1212
  key: ChainKey.UNI,
1205
1213
  chainType: ChainType.EVM,
1206
- name: 'Unichain',
1214
+ name: 'ETH',
1207
1215
  coin: CoinKey.ETH,
1208
1216
  id: 130,
1209
1217
  mainnet: true,
1210
1218
  logoURI:
1211
1219
  'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/unichain.svg',
1212
1220
  multicallAddress: multicallAddresses[ChainId.UNI],
1213
-
1221
+ relayerSupported: true,
1214
1222
  metamask: {
1215
1223
  chainId: prefixChainId(130),
1216
1224
  blockExplorerUrls: [
@@ -1227,6 +1235,56 @@ export const supportedEVMChains: EVMChain[] = [
1227
1235
  },
1228
1236
  },
1229
1237
 
1238
+ // 33139 - Apechain
1239
+ {
1240
+ key: ChainKey.APE,
1241
+ chainType: ChainType.EVM,
1242
+ name: 'Apechain',
1243
+ coin: CoinKey.APE,
1244
+ id: 33139,
1245
+ mainnet: true,
1246
+ logoURI:
1247
+ 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/apechain.svg',
1248
+ multicallAddress: multicallAddresses[ChainId.APE],
1249
+
1250
+ metamask: {
1251
+ chainId: prefixChainId(33139),
1252
+ blockExplorerUrls: ['https://apescan.io/'],
1253
+ chainName: 'ApeChain',
1254
+ nativeCurrency: {
1255
+ name: 'ApeCoin',
1256
+ symbol: 'APE',
1257
+ decimals: 18,
1258
+ },
1259
+ rpcUrls: ['https://rpc.apechain.com'],
1260
+ },
1261
+ },
1262
+
1263
+ // 1868 - Soneium
1264
+ {
1265
+ key: ChainKey.SOE,
1266
+ chainType: ChainType.EVM,
1267
+ name: 'Soneium',
1268
+ coin: CoinKey.ETH,
1269
+ id: 1868,
1270
+ mainnet: true,
1271
+ logoURI:
1272
+ 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/soneium.svg',
1273
+ multicallAddress: multicallAddresses[ChainId.SOE],
1274
+
1275
+ metamask: {
1276
+ chainId: prefixChainId(1868),
1277
+ blockExplorerUrls: ['https://soneium.blockscout.com/'],
1278
+ chainName: 'Soneium',
1279
+ nativeCurrency: {
1280
+ name: 'Ether',
1281
+ symbol: 'ETH',
1282
+ decimals: 18,
1283
+ },
1284
+ rpcUrls: ['https://rpc.soneium.org/'],
1285
+ },
1286
+ },
1287
+
1230
1288
  {
1231
1289
  key: ChainKey.INK,
1232
1290
  chainType: ChainType.EVM,
@@ -1237,6 +1295,7 @@ export const supportedEVMChains: EVMChain[] = [
1237
1295
  logoURI:
1238
1296
  'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/ink.svg',
1239
1297
  multicallAddress: multicallAddresses[ChainId.INK],
1298
+ relayerSupported: true,
1240
1299
 
1241
1300
  metamask: {
1242
1301
  chainId: prefixChainId(57079),
@@ -48,24 +48,3 @@ describe.concurrent('MVM chains RPC check', () => {
48
48
  }
49
49
  )
50
50
  })
51
-
52
- describe.concurrent('MVM chains block explorer check', () => {
53
- const blockExplorerUrls = supportedMVMChains.flatMap((chain) =>
54
- chain.metamask.blockExplorerUrls.map((blockExplorerUrl) => ({
55
- blockExplorerUrl: blockExplorerUrl,
56
- chainId: chain.id,
57
- chainName: chain.name,
58
- }))
59
- )
60
-
61
- test.for(blockExplorerUrls)(
62
- `block explorer should be alive $chainName - $chainId - $blockExplorerUrl`,
63
- { timeout: 10_000, retry: 3 },
64
- async ({ blockExplorerUrl }) => {
65
- const response = await fetch(blockExplorerUrl)
66
- expect(response.url).toBe(blockExplorerUrl)
67
- expect(response.ok).toBe(true)
68
- expect(response.status).toBe(200)
69
- }
70
- )
71
- })
@@ -22,8 +22,19 @@ describe.concurrent('SVM chains RPC check', () => {
22
22
  const accountPublicKey = new PublicKey(WalletAddress)
23
23
  const tokenProgramPublicKey = new PublicKey(TokenProgramAddress)
24
24
  const [blockHeight, slot, balance, tokenAccountsByOwner] =
25
+ // connection.getBlockHeight() with https://solana-rpc.publicnode.com will result in 500 error
25
26
  await Promise.allSettled([
26
- connection.getBlockHeight(),
27
+ fetch(rpcUrl, {
28
+ method: 'POST',
29
+ headers: {
30
+ 'Content-Type': 'application/json',
31
+ },
32
+ body: JSON.stringify({
33
+ jsonrpc: '2.0',
34
+ id: 1,
35
+ method: 'getBlockHeight',
36
+ }),
37
+ }),
27
38
  connection.getSlot(),
28
39
  connection.getBalance(accountPublicKey),
29
40
  connection.getParsedTokenAccountsByOwner(accountPublicKey, {
@@ -37,24 +48,3 @@ describe.concurrent('SVM chains RPC check', () => {
37
48
  }
38
49
  )
39
50
  })
40
-
41
- describe.concurrent('SVM chains block explorer check', () => {
42
- const blockExplorerUrls = supportedSolanaChains.flatMap((chain) =>
43
- chain.metamask.blockExplorerUrls.map((blockExplorerUrl) => ({
44
- blockExplorerUrl: blockExplorerUrl,
45
- chainId: chain.id,
46
- chainName: chain.name,
47
- }))
48
- )
49
-
50
- test.for(blockExplorerUrls)(
51
- `block explorer should be alive $chainName - $chainId - $blockExplorerUrl`,
52
- { timeout: 10_000, retry: 3 },
53
- async ({ blockExplorerUrl }) => {
54
- const response = await fetch(blockExplorerUrl)
55
- expect(response.url).toBe(blockExplorerUrl)
56
- expect(response.ok).toBe(true)
57
- expect(response.status).toBe(200)
58
- }
59
- )
60
- })
@@ -30,6 +30,7 @@ test('native token defined for all chains', () => {
30
30
  ChainId.BCH,
31
31
  ChainId.LTC,
32
32
  ChainId.DGE,
33
+ ChainId.SUI,
33
34
  ]
34
35
  for (const chain of supportedChains) {
35
36
  if (ignoredChainsForNativeToken.includes(chain.id)) {
@@ -92,6 +93,7 @@ describe('validate chains', () => {
92
93
  chain.metamask.blockExplorerUrls.forEach((blockExplorerUrl) => {
93
94
  expect(blockExplorerUrl.startsWith('https://')).toBeTruthy()
94
95
  expect(blockExplorerUrl.endsWith('/')).toBeTruthy()
96
+ expect(new URL(blockExplorerUrl)).toBeDefined()
95
97
  })
96
98
 
97
99
  const chainId = prefixChainId(chain.id)
@@ -27,30 +27,9 @@ describe.concurrent('UTXO chains RPC check', () => {
27
27
  }),
28
28
  })
29
29
  const data = await response.json()
30
- expect(response.ok).toBeTruthy()
31
- expect(response.status).toBe(200)
32
- expect(data.result.blocks).toBeGreaterThan(0)
33
- }
34
- )
35
- })
36
-
37
- describe.concurrent('UTXO chains block explorer check', () => {
38
- const blockExplorerUrls = supportedUXTOChains.flatMap((chain) =>
39
- chain.metamask.blockExplorerUrls.map((blockExplorerUrl) => ({
40
- blockExplorerUrl: blockExplorerUrl,
41
- chainId: chain.id,
42
- chainName: chain.name,
43
- }))
44
- )
45
-
46
- test.for(blockExplorerUrls)(
47
- `block explorer should be alive $chainName - $chainId - $blockExplorerUrl`,
48
- { timeout: 10_000, retry: 3 },
49
- async ({ blockExplorerUrl }) => {
50
- const response = await fetch(blockExplorerUrl)
51
- expect(response.url).toBe(blockExplorerUrl)
52
30
  expect(response.ok).toBe(true)
53
31
  expect(response.status).toBe(200)
32
+ expect(data.result.blocks).toBeGreaterThan(0)
54
33
  }
55
34
  )
56
35
  })
@@ -147,6 +147,10 @@ export const basicCoins: BasicCoin[] = [
147
147
  address: '0x0000000000000000000000000000000000000000',
148
148
  decimals: 18,
149
149
  },
150
+ [ChainId.SOE]: {
151
+ address: '0x0000000000000000000000000000000000000000',
152
+ decimals: 18,
153
+ },
150
154
  [ChainId.INK]: {
151
155
  address: '0x0000000000000000000000000000000000000000',
152
156
  decimals: 18,
@@ -688,6 +692,12 @@ export const basicCoins: BasicCoin[] = [
688
692
  address: '0x6047828dc181963ba44974801FF68e538dA5eaF9',
689
693
  decimals: 6,
690
694
  },
695
+ [ChainId.SOE]: {
696
+ address: '0x3A337a6adA9d885b6Ad95ec48F9b75f197b5AE35',
697
+ decimals: 18,
698
+ name: 'Bridged USDT (Soneium)',
699
+ symbol: 'USDT',
700
+ },
691
701
  },
692
702
  },
693
703
 
@@ -945,6 +955,18 @@ export const basicCoins: BasicCoin[] = [
945
955
  name: 'Bridged USDC (Sonic Labs)',
946
956
  symbol: 'USDC.e',
947
957
  },
958
+ [ChainId.SOE]: {
959
+ address: '0xba9986d2381edf1da03b0b9c1f8b00dc4aacc369',
960
+ decimals: 6,
961
+ name: 'Bridged USDC (Soneium)',
962
+ symbol: 'USDC.e',
963
+ },
964
+ [ChainId.INK]: {
965
+ address: '0xF1815bd50389c46847f0Bda824eC8da914045D14',
966
+ decimals: 6,
967
+ name: 'Bridged USDC (Stargate)',
968
+ symbol: 'USDC.e',
969
+ },
948
970
  },
949
971
  },
950
972
  // axlUSDC
@@ -1268,6 +1290,10 @@ export const basicCoins: BasicCoin[] = [
1268
1290
  address: '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c',
1269
1291
  decimals: 8,
1270
1292
  },
1293
+ [ChainId.SOE]: {
1294
+ address: '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c',
1295
+ decimals: 8,
1296
+ },
1271
1297
  },
1272
1298
  },
1273
1299
 
@@ -1762,6 +1788,26 @@ export const basicCoins: BasicCoin[] = [
1762
1788
  },
1763
1789
  },
1764
1790
  },
1791
+
1792
+ // APE
1793
+ {
1794
+ key: CoinKey.APE,
1795
+ name: CoinKey.APE,
1796
+ logoURI:
1797
+ 'https://static.debank.com/image/ape_token/logo_url/ape/2357165eac1453c46f526704b51a801b.png',
1798
+ verified: true,
1799
+ chains: {
1800
+ [ChainId.APE]: {
1801
+ address: '0x0000000000000000000000000000000000000000',
1802
+ decimals: 18,
1803
+ },
1804
+ [ChainId.ETH]: {
1805
+ address: '0x4d224452801aced8b2f0aebe155379bb5d594381',
1806
+ decimals: 18,
1807
+ },
1808
+ },
1809
+ },
1810
+
1765
1811
  // > Solana
1766
1812
  {
1767
1813
  key: CoinKey.SOL,
@@ -2612,6 +2658,28 @@ export const wrappedTokens: { [ChainId: string]: StaticToken } = {
2612
2658
  logoURI:
2613
2659
  'https://static.debank.com/image/eth_token/logo_url/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/61844453e63cf81301f845d7864236f6.png',
2614
2660
  },
2661
+ [ChainId.APE]: {
2662
+ // https://apescan.io/token/0x48b62137edfa95a428d35c09e44256a739f6b557
2663
+ address: '0x48b62137EdfA95a428D35C09E44256a739F6B557',
2664
+ symbol: 'WAPE',
2665
+ decimals: 18,
2666
+ chainId: ChainId.APE,
2667
+ coinKey: CoinKey.WAPE,
2668
+ name: 'WAPE',
2669
+ logoURI:
2670
+ 'https://static.debank.com/image/ape_token/logo_url/ape/2357165eac1453c46f526704b51a801b.png',
2671
+ },
2672
+ [ChainId.SOE]: {
2673
+ // https://soneium.blockscout.com/address/0x4200000000000000000000000000000000000006
2674
+ address: '0x4200000000000000000000000000000000000006',
2675
+ symbol: 'WETH',
2676
+ decimals: 18,
2677
+ chainId: ChainId.SOE,
2678
+ coinKey: CoinKey.WETH,
2679
+ name: 'WETH',
2680
+ logoURI:
2681
+ 'https://static.debank.com/image/eth_token/logo_url/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/61844453e63cf81301f845d7864236f6.png',
2682
+ },
2615
2683
  [ChainId.INK]: {
2616
2684
  address: '0x4200000000000000000000000000000000000006',
2617
2685
  symbol: 'WETH',
package/src/multicall.ts CHANGED
@@ -53,6 +53,8 @@ export const multicallAddresses: { [ChainId: number]: string } = {
53
53
  [ChainId.BER]: '0xcA11bde05977b3631167028862bE2a173976CA11',
54
54
  [ChainId.SON]: '0xcA11bde05977b3631167028862bE2a173976CA11',
55
55
  [ChainId.UNI]: '0xcA11bde05977b3631167028862bE2a173976CA11',
56
+ [ChainId.APE]: '0xcA11bde05977b3631167028862bE2a173976CA11',
57
+ [ChainId.SOE]: '0xcA11bde05977b3631167028862bE2a173976CA11',
56
58
  [ChainId.INK]: '0xcA11bde05977b3631167028862bE2a173976CA11',
57
59
 
58
60
  // TODO