@lifi/data-types 6.2.0 → 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.
- package/package.json +2 -2
- package/src/_cjs/chains/supportedChains.evm.int.spec.js +0 -13
- package/src/_cjs/chains/supportedChains.evm.int.spec.js.map +1 -1
- package/src/_cjs/chains/supportedChains.evm.js +65 -2
- package/src/_cjs/chains/supportedChains.evm.js.map +1 -1
- package/src/_cjs/chains/supportedChains.mvm.int.spec.js +0 -13
- package/src/_cjs/chains/supportedChains.mvm.int.spec.js.map +1 -1
- package/src/_cjs/chains/supportedChains.svm.int.spec.js +11 -14
- package/src/_cjs/chains/supportedChains.svm.int.spec.js.map +1 -1
- package/src/_cjs/chains/supportedChains.unit.spec.js +2 -0
- package/src/_cjs/chains/supportedChains.unit.spec.js.map +1 -1
- package/src/_cjs/chains/supportedChains.utxo.int.spec.js +1 -14
- package/src/_cjs/chains/supportedChains.utxo.int.spec.js.map +1 -1
- package/src/_cjs/coins/coins.js +77 -0
- package/src/_cjs/coins/coins.js.map +1 -1
- package/src/_cjs/multicall.js +3 -0
- package/src/_cjs/multicall.js.map +1 -1
- package/src/_esm/chains/supportedChains.evm.int.spec.js +0 -13
- package/src/_esm/chains/supportedChains.evm.int.spec.js.map +1 -1
- package/src/_esm/chains/supportedChains.evm.js +67 -2
- package/src/_esm/chains/supportedChains.evm.js.map +1 -1
- package/src/_esm/chains/supportedChains.mvm.int.spec.js +0 -13
- package/src/_esm/chains/supportedChains.mvm.int.spec.js.map +1 -1
- package/src/_esm/chains/supportedChains.svm.int.spec.js +14 -15
- package/src/_esm/chains/supportedChains.svm.int.spec.js.map +1 -1
- package/src/_esm/chains/supportedChains.unit.spec.js +2 -0
- package/src/_esm/chains/supportedChains.unit.spec.js.map +1 -1
- package/src/_esm/chains/supportedChains.utxo.int.spec.js +1 -14
- package/src/_esm/chains/supportedChains.utxo.int.spec.js.map +1 -1
- package/src/_esm/coins/coins.js +80 -0
- package/src/_esm/coins/coins.js.map +1 -1
- package/src/_esm/multicall.js +3 -0
- package/src/_esm/multicall.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/_types/multicall.d.ts.map +1 -1
- package/src/chains/supportedChains.evm.int.spec.ts +0 -21
- package/src/chains/supportedChains.evm.ts +76 -2
- package/src/chains/supportedChains.mvm.int.spec.ts +0 -21
- package/src/chains/supportedChains.svm.int.spec.ts +12 -22
- package/src/chains/supportedChains.unit.spec.ts +2 -0
- package/src/chains/supportedChains.utxo.int.spec.ts +1 -22
- package/src/coins/coins.ts +86 -0
- package/src/multicall.ts +3 -0
|
@@ -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
|
-
|
|
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
|
})
|
package/src/coins/coins.ts
CHANGED
|
@@ -147,6 +147,14 @@ export const basicCoins: BasicCoin[] = [
|
|
|
147
147
|
address: '0x0000000000000000000000000000000000000000',
|
|
148
148
|
decimals: 18,
|
|
149
149
|
},
|
|
150
|
+
[ChainId.SOE]: {
|
|
151
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
152
|
+
decimals: 18,
|
|
153
|
+
},
|
|
154
|
+
[ChainId.INK]: {
|
|
155
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
156
|
+
decimals: 18,
|
|
157
|
+
},
|
|
150
158
|
},
|
|
151
159
|
},
|
|
152
160
|
// > MATIC
|
|
@@ -684,6 +692,12 @@ export const basicCoins: BasicCoin[] = [
|
|
|
684
692
|
address: '0x6047828dc181963ba44974801FF68e538dA5eaF9',
|
|
685
693
|
decimals: 6,
|
|
686
694
|
},
|
|
695
|
+
[ChainId.SOE]: {
|
|
696
|
+
address: '0x3A337a6adA9d885b6Ad95ec48F9b75f197b5AE35',
|
|
697
|
+
decimals: 18,
|
|
698
|
+
name: 'Bridged USDT (Soneium)',
|
|
699
|
+
symbol: 'USDT',
|
|
700
|
+
},
|
|
687
701
|
},
|
|
688
702
|
},
|
|
689
703
|
|
|
@@ -941,6 +955,18 @@ export const basicCoins: BasicCoin[] = [
|
|
|
941
955
|
name: 'Bridged USDC (Sonic Labs)',
|
|
942
956
|
symbol: 'USDC.e',
|
|
943
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
|
+
},
|
|
944
970
|
},
|
|
945
971
|
},
|
|
946
972
|
// axlUSDC
|
|
@@ -1264,6 +1290,10 @@ export const basicCoins: BasicCoin[] = [
|
|
|
1264
1290
|
address: '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c',
|
|
1265
1291
|
decimals: 8,
|
|
1266
1292
|
},
|
|
1293
|
+
[ChainId.SOE]: {
|
|
1294
|
+
address: '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c',
|
|
1295
|
+
decimals: 8,
|
|
1296
|
+
},
|
|
1267
1297
|
},
|
|
1268
1298
|
},
|
|
1269
1299
|
|
|
@@ -1432,6 +1462,10 @@ export const basicCoins: BasicCoin[] = [
|
|
|
1432
1462
|
address: '0x4200000000000000000000000000000000000006',
|
|
1433
1463
|
decimals: 18,
|
|
1434
1464
|
},
|
|
1465
|
+
[ChainId.INK]: {
|
|
1466
|
+
address: '0x4200000000000000000000000000000000000006',
|
|
1467
|
+
decimals: 18,
|
|
1468
|
+
},
|
|
1435
1469
|
},
|
|
1436
1470
|
},
|
|
1437
1471
|
|
|
@@ -1754,6 +1788,26 @@ export const basicCoins: BasicCoin[] = [
|
|
|
1754
1788
|
},
|
|
1755
1789
|
},
|
|
1756
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
|
+
|
|
1757
1811
|
// > Solana
|
|
1758
1812
|
{
|
|
1759
1813
|
key: CoinKey.SOL,
|
|
@@ -2604,6 +2658,38 @@ export const wrappedTokens: { [ChainId: string]: StaticToken } = {
|
|
|
2604
2658
|
logoURI:
|
|
2605
2659
|
'https://static.debank.com/image/eth_token/logo_url/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/61844453e63cf81301f845d7864236f6.png',
|
|
2606
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
|
+
},
|
|
2683
|
+
[ChainId.INK]: {
|
|
2684
|
+
address: '0x4200000000000000000000000000000000000006',
|
|
2685
|
+
symbol: 'WETH',
|
|
2686
|
+
decimals: 18,
|
|
2687
|
+
chainId: ChainId.INK,
|
|
2688
|
+
coinKey: CoinKey.WETH,
|
|
2689
|
+
name: 'WETH',
|
|
2690
|
+
logoURI:
|
|
2691
|
+
'https://static.debank.com/image/eth_token/logo_url/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/61844453e63cf81301f845d7864236f6.png',
|
|
2692
|
+
},
|
|
2607
2693
|
}
|
|
2608
2694
|
export const findDefaultCoin = (coinKey: CoinKey): Coin => {
|
|
2609
2695
|
const coin = defaultCoins.find((coin) => coin.key === coinKey)
|
package/src/multicall.ts
CHANGED
|
@@ -53,6 +53,9 @@ 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',
|
|
58
|
+
[ChainId.INK]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
56
59
|
|
|
57
60
|
// TODO
|
|
58
61
|
// [ChainId.EXP]: '', // TODO
|