diff --git a/apps/canonical-bridge-ui/public/images/chains/1116.png b/apps/canonical-bridge-ui/public/images/chains/1116.png new file mode 100644 index 00000000..1c3361e8 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/1116.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/11501.png b/apps/canonical-bridge-ui/public/images/chains/11501.png new file mode 100644 index 00000000..673a9ecf Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/11501.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/1482601649.png b/apps/canonical-bridge-ui/public/images/chains/1482601649.png new file mode 100644 index 00000000..e25a0422 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/1482601649.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/1564830818.png b/apps/canonical-bridge-ui/public/images/chains/1564830818.png new file mode 100644 index 00000000..a0147b70 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/1564830818.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/17777.png b/apps/canonical-bridge-ui/public/images/chains/17777.png new file mode 100644 index 00000000..97d2a36c Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/17777.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/200901.png b/apps/canonical-bridge-ui/public/images/chains/200901.png new file mode 100644 index 00000000..89157ee4 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/200901.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/2046399126.png b/apps/canonical-bridge-ui/public/images/chains/2046399126.png new file mode 100644 index 00000000..0f521c7e Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/2046399126.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/223.png b/apps/canonical-bridge-ui/public/images/chains/223.png new file mode 100644 index 00000000..6295a495 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/223.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/22776.png b/apps/canonical-bridge-ui/public/images/chains/22776.png new file mode 100644 index 00000000..16070edb Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/22776.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/25.png b/apps/canonical-bridge-ui/public/images/chains/25.png new file mode 100644 index 00000000..229b5d06 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/25.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/2525.png b/apps/canonical-bridge-ui/public/images/chains/2525.png new file mode 100644 index 00000000..611c9206 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/2525.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/255.png b/apps/canonical-bridge-ui/public/images/chains/255.png new file mode 100644 index 00000000..2f94524e Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/255.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/2649.png b/apps/canonical-bridge-ui/public/images/chains/2649.png new file mode 100644 index 00000000..b88f7a04 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/2649.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/34443.png b/apps/canonical-bridge-ui/public/images/chains/34443.png new file mode 100644 index 00000000..b645b26d Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/34443.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/4200.png b/apps/canonical-bridge-ui/public/images/chains/4200.png new file mode 100644 index 00000000..a5523725 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/4200.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/42766.png b/apps/canonical-bridge-ui/public/images/chains/42766.png new file mode 100644 index 00000000..8a020b42 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/42766.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/48900.png b/apps/canonical-bridge-ui/public/images/chains/48900.png new file mode 100644 index 00000000..ff55abce Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/48900.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/6001.png b/apps/canonical-bridge-ui/public/images/chains/6001.png new file mode 100644 index 00000000..f9f64ba5 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/6001.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/60808.png b/apps/canonical-bridge-ui/public/images/chains/60808.png new file mode 100644 index 00000000..281b1f04 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/60808.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/7000.png b/apps/canonical-bridge-ui/public/images/chains/7000.png new file mode 100644 index 00000000..d14ca038 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/7000.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/810180.png b/apps/canonical-bridge-ui/public/images/chains/810180.png new file mode 100644 index 00000000..09091807 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/810180.png differ diff --git a/apps/canonical-bridge-ui/public/images/chains/888888888.png b/apps/canonical-bridge-ui/public/images/chains/888888888.png new file mode 100644 index 00000000..fc6d9a36 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/chains/888888888.png differ diff --git a/apps/canonical-bridge-ui/public/images/tokens/BTC.png b/apps/canonical-bridge-ui/public/images/tokens/BTC.png new file mode 100644 index 00000000..0a9441e9 Binary files /dev/null and b/apps/canonical-bridge-ui/public/images/tokens/BTC.png differ diff --git a/apps/canonical-bridge-ui/token-config/mainnet/chains.ts b/apps/canonical-bridge-ui/token-config/mainnet/chains.ts index 03efe82a..3292ce68 100644 --- a/apps/canonical-bridge-ui/token-config/mainnet/chains.ts +++ b/apps/canonical-bridge-ui/token-config/mainnet/chains.ts @@ -43,6 +43,20 @@ export const chains: IChainConfig[] = [ url: 'https://flarescan.com/', }, }, + { + id: 25, + name: 'Cronos', + nativeCurrency: { + name: 'CRO', + symbol: 'CRO', + decimals: 18, + }, + rpcUrl: 'https://evm.cronos.org', + explorer: { + name: 'Crono Scan', + url: 'https://cronoscan.com/', + }, + }, { id: 44, name: 'Crab Network', @@ -212,6 +226,20 @@ export const chains: IChainConfig[] = [ url: 'https://mainnet.opbnbscan.com', }, }, + { + id: 223, + name: 'b2', + nativeCurrency: { + name: 'BTC', + symbol: 'BTC', + decimals: 18, + }, + rpcUrl: 'https://rpc.bsquared.network', + explorer: { + name: 'B2 Network Explorer', + url: 'https://explorer.bsquared.network', + }, + }, { id: 248, name: 'Oasys', @@ -240,6 +268,20 @@ export const chains: IChainConfig[] = [ url: 'https://ftmscan.com', }, }, + { + id: 255, + name: 'Kroma', + nativeCurrency: { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + }, + rpcUrl: 'https://api.kroma.network', + explorer: { + name: 'Kroma Scan', + url: 'https://kromascan.com', + }, + }, { id: 288, name: 'Boba Network', @@ -381,6 +423,20 @@ export const chains: IChainConfig[] = [ url: 'https://zkevm.polygonscan.com', }, }, + { + id: 1116, + name: 'Core', + nativeCurrency: { + name: 'CORE', + symbol: 'CORE', + decimals: 18, + }, + rpcUrl: 'https://rpc.coredao.org', + explorer: { + name: 'Core Explorer', + url: 'https://scan.coredao.org', + }, + }, { id: 1284, name: 'Moonbeam', @@ -479,6 +535,48 @@ export const chains: IChainConfig[] = [ url: 'https://kavascan.com', }, }, + { + id: 2525, + name: 'inEVM', + nativeCurrency: { + name: 'INJ', + symbol: 'INJ', + decimals: 18, + }, + rpcUrl: 'https://mainnet.rpc.inevm.com/http', + explorer: { + name: 'inEVM Explorer', + url: 'https://explorer.inevm.com', + }, + }, + { + id: 2649, + name: 'AILayer', + nativeCurrency: { + name: 'BTC', + symbol: 'BTC', + decimals: 18, + }, + rpcUrl: 'https://mainnet-rpc.ailayer.xyz', + explorer: { + name: 'AI Layer Explorer', + url: 'https://mainnet-explorer.ailayer.xyz', + }, + }, + { + id: 4200, + name: 'Merlin', + nativeCurrency: { + name: 'BTC', + symbol: 'BTC', + decimals: 18, + }, + rpcUrl: 'https://rpc.merlinchain.io', + explorer: { + name: 'Merlin Scan', + url: 'https://scan.merlinchain.io', + }, + }, { id: 5000, name: 'Mantle', @@ -493,6 +591,34 @@ export const chains: IChainConfig[] = [ url: 'https://explorer.mantle.xyz/', }, }, + { + id: 6001, + name: 'BB', + nativeCurrency: { + name: 'BB', + symbol: 'BB', + decimals: 18, + }, + rpcUrl: 'https://fullnode-mainnet.bouncebitapi.com', + explorer: { + name: 'BB Scan', + url: 'https://bbscan.io', + }, + }, + { + id: 7000, + name: 'ZetaChain', + nativeCurrency: { + name: 'ZETA', + symbol: 'ZETA', + decimals: 18, + }, + rpcUrl: 'https://zetachain-evm.blockpi.network:443/v1/rpc/public', + explorer: { + name: 'Zeta Chain Explorer', + url: 'https://explorer.zetachain.com/', + }, + }, { id: 7700, name: 'Canto', @@ -564,6 +690,20 @@ export const chains: IChainConfig[] = [ tokenUrlPattern: 'https://www.mintscan.io/evmos/address/{0}', }, }, + { + id: 11501, + name: 'BEVM', + nativeCurrency: { + name: 'BTC', + symbol: 'BTC', + decimals: 18, + }, + rpcUrl: 'https://rpc-mainnet-1.bevm.io', + explorer: { + name: 'BEVM Explorer', + url: 'https://scan-mainnet.bevm.io', + }, + }, { id: 13000, name: 'SPS', @@ -578,6 +718,34 @@ export const chains: IChainConfig[] = [ url: 'http://spsscan.ssquad.games', }, }, + { + id: 17777, + name: 'EOS EVM', + nativeCurrency: { + name: 'EOS', + symbol: 'EOS', + decimals: 18, + }, + rpcUrl: 'https://api.evm.eosnetwork.com', + explorer: { + name: 'EOS EVM Explorer', + url: 'https://explorer.evm.eosnetwork.com', + }, + }, + { + id: 22776, + name: 'MAP Protocol', + nativeCurrency: { + name: 'MAPO', + symbol: 'MAPO', + decimals: 18, + }, + rpcUrl: 'https://rpc.maplabs.io', + explorer: { + name: 'MAPO Scan', + url: 'https://maposcan.io', + }, + }, { id: 23294, name: 'Oasis Sapphire', @@ -592,6 +760,20 @@ export const chains: IChainConfig[] = [ url: 'https://explorer.oasis.io/mainnet/sapphire', }, }, + { + id: 34443, + name: 'Mode', + nativeCurrency: { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + }, + rpcUrl: 'https://mainnet.mode.network', + explorer: { + name: 'Mode Explorer', + url: 'https://explorer.mode.network', + }, + }, { id: 42161, name: 'Arbitrum One', @@ -648,6 +830,20 @@ export const chains: IChainConfig[] = [ url: 'https://explorer.oasis.io/mainnet/emerald', }, }, + { + id: 42766, + name: 'ZKFair', + nativeCurrency: { + name: 'USDC', + symbol: 'USDC', + decimals: 18, + }, + rpcUrl: 'https://rpc.zkfair.io', + explorer: { + name: 'Zkfair Scan', + url: 'https://scan.zkfair.io', + }, + }, { id: 43114, name: 'Avalanche', @@ -676,6 +872,20 @@ export const chains: IChainConfig[] = [ url: 'https://scan.rei.network', }, }, + { + id: 48900, + name: 'Zircuit', + nativeCurrency: { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + }, + rpcUrl: 'https://zircuit-mainnet.drpc.org', + explorer: { + name: 'Zircuit Explorer', + url: 'https://explorer.zircuit.com', + }, + }, { id: 59144, name: 'Linea', @@ -747,6 +957,20 @@ export const chains: IChainConfig[] = [ url: 'https://taikoscan.io', }, }, + { + id: 200901, + name: 'Bitlayer Mainnet', + nativeCurrency: { + name: 'BTC', + symbol: 'BTC', + decimals: 18, + }, + rpcUrl: 'https://rpc.bitlayer.org', + explorer: { + name: 'Bitlayer Scan', + url: 'https://www.btrscan.com', + }, + }, { id: 210425, name: 'PlatON', @@ -776,6 +1000,48 @@ export const chains: IChainConfig[] = [ url: 'https://scrollscan.com', }, }, + { + id: 60808, + name: 'BOB', + nativeCurrency: { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + }, + rpcUrl: 'https://rpc.gobob.xyz', + explorer: { + name: 'BOB Explorer', + url: 'https://explorer.gobob.xyz', + }, + }, + { + id: 810180, + name: 'zkLink', + nativeCurrency: { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + }, + rpcUrl: 'https://rpc.zklink.io', + explorer: { + name: 'ZKLink Explorer', + url: 'https://explorer.zklink.io', + }, + }, + { + id: 888888888, + name: 'Ancient8', + nativeCurrency: { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + }, + rpcUrl: 'https://rpc.ancient8.gg', + explorer: { + name: 'Ancient8 Scan', + url: 'https://scan.ancient8.gg', + }, + }, { id: 1313161554, name: 'Aurora', @@ -804,6 +1070,34 @@ export const chains: IChainConfig[] = [ url: 'https://mainnet.explorer.rarichain.org/', }, }, + { + id: 1482601649, + name: 'SKALE Nebula Hub', + nativeCurrency: { + name: 'sFUEL', + symbol: 'sFUEL', + decimals: 18, + }, + rpcUrl: 'https://mainnet.skalenodes.com/v1/green-giddy-denebola', + explorer: { + name: 'SKALE Nebula Explorer', + url: 'https://green-giddy-denebola.explorer.mainnet.skalenodes.com', + }, + }, + { + id: 1564830818, + name: 'SKALE Calypso', + nativeCurrency: { + name: 'sFUEL', + symbol: 'sFUEL', + decimals: 18, + }, + rpcUrl: 'https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague', + explorer: { + name: 'SKALE Calypso Hub Explorer', + url: 'https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com/', + }, + }, { id: 1666600000, name: 'Harmony One', @@ -818,6 +1112,20 @@ export const chains: IChainConfig[] = [ url: 'https://explorer.harmony.one', }, }, + { + id: 2046399126, + name: 'SKALE Europa Hub', + nativeCurrency: { + name: 'sFUEL', + symbol: 'sFUEL', + decimals: 18, + }, + rpcUrl: 'https://mainnet.skalenodes.com/v1/elated-tan-skat', + explorer: { + name: 'SKALE Europa Hub Explorer', + url: 'https://elated-tan-skat.explorer.mainnet.skalenodes.com', + }, + }, { id: 728126428, name: 'Tron', diff --git a/apps/canonical-bridge-ui/token-config/mainnet/meson/config.json b/apps/canonical-bridge-ui/token-config/mainnet/meson/config.json index 746efda6..93cf2aa8 100644 --- a/apps/canonical-bridge-ui/token-config/mainnet/meson/config.json +++ b/apps/canonical-bridge-ui/token-config/mainnet/meson/config.json @@ -1,5 +1,303 @@ { "result": [ + { + "id": "ancient8", + "name": "Ancient8", + "chainId": "0x34fb5e38", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "min": "0.001", + "decimals": 18, + "max": "2" + } + ] + }, + { + "id": "arb", + "name": "Arbitrum", + "chainId": "0xa4b1", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "min": "0.001", + "decimals": 18, + "max": "2" + }, + { + "id": "btc", + "addr": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", + "decimals": 8, + "min": "0.00055", + "max": "0.05" + } + ] + }, + { + "id": "aurora", + "name": "Aurora", + "chainId": "0x4e454152", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x4988a896b1227218e4A686fdE5EabdcAbd91571f", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "min": "0.002", + "decimals": 18, + "max": "2" + } + ] + }, + { + "id": "avax", + "name": "Avalanche", + "chainId": "0xa86a", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", + "decimals": 6, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "b2", + "name": "B² Network", + "chainId": "0xdf", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "btc", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.00055", + "max": "0.05" + }, + { + "id": "usdc", + "addr": "0xE544e8a38aDD9B1ABF21922090445Ba93f74B9E5", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x681202351a488040Fa4FdCc24188AfB582c9DD62", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "fdusd", + "addr": "0xc2fe4f673455ef92299770a09cdb5e8756a525d5", + "decimals": 18, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0xD48d3A551757ac47655fCe25BDE1B0B6b1Cb2a5A", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "base", + "name": "Base", + "chainId": "0x2105", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "eth", + "min": "0.001", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "max": "2" + } + ] + }, + { + "id": "bb", + "name": "BounceBit", + "chainId": "0x1771", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "btc", + "addr": "0xF5e11df1ebCf78b6b6D26E04FF19cD786a1e81dC", + "decimals": 18, + "min": "0.0005", + "max": "0.05" + }, + { + "id": "busd", + "addr": "0x77776b40C3d75cb07ce54dEA4b2Fd1D07F865222", + "decimals": 18, + "min": "0.5", + "max": "20000" + } + ] + }, + { + "id": "beam", + "name": "Moonbeam", + "chainId": "0x504", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdt", + "addr": "0xFFFFFFfFea09FB06d082fd1275CD48b191cbCD1d", + "decimals": 6, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "bevm2", + "name": "BEVM", + "chainId": "0x2ced", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "btc", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.00055", + "max": "0.05" + }, + { + "id": "usdc", + "addr": "0x2f5ee356fAeBE9C51f5996f09ce807AaeCF14dDF", + "decimals": 6, + "min": "0.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x48CfbeC43a29dD3bfb8933e4A183678826494ac7", + "decimals": 6, + "min": "0.5", + "max": "20000" + }, + { + "id": "eth", + "addr": "0xc68Ddbe40A24Ab7FE7987F3c97d4094f4dC68f21", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "bitlayer", + "name": "Bitlayer", + "chainId": "0x310c5", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "btc", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.00055", + "max": "0.05" + }, + { + "id": "usdc", + "addr": "0xf8C374CE88A3BE3d374e8888349C7768B607c755", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xfe9f969faf8ad72a83b761138bf25de87eff9dd2", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "eth", + "addr": "0xef63d4e178b3180beec9b0e143e0f37f4c93f4c2", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "blast", + "name": "Blast", + "chainId": "0x13e31", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdb", + "addr": "0x4300000000000000000000000000000000000003", + "decimals": 18, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, { "id": "bnb", "name": "BNB Smart Chain", @@ -8,14 +306,641 @@ "tokens": [ { "id": "usdt", - "addr": "0x55d398326f99059ff775485246999027b3197955", + "addr": "0x55d398326f99059ff775485246999027b3197955", + "decimals": 18, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdc", + "addr": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "decimals": 18, + "min": "1.0", + "max": "20000" + }, + { + "id": "fdusd", + "addr": "0xc5f0f7b66764F6ec8C8Dff7BA683102295E16409", + "decimals": 18, + "min": "1.0", + "max": "20000" + }, + { + "id": "btc", + "addr": "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c", + "decimals": 18, + "min": "0.00055", + "max": "0.05" + } + ] + }, + { + "id": "bob", + "name": "Bob", + "chainId": "0xed88", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "btc", + "addr": "0x03c7054bcb39f7b2e5b2c7acb37583e32d70cfa3", + "decimals": 8, + "min": "0.00055", + "max": "0.05" + }, + { + "id": "usdt", + "addr": "0x05d032ac25d322df992303dca074ee7392c117b9", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "celo", + "name": "Celo", + "chainId": "0xa4ec", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "cusd", + "addr": "0x765DE816845861e75A25fCA122bb6898B8B1282a", + "decimals": 18, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "cfx", + "name": "Conflux eSpace", + "chainId": "0x406", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x6963efed0ab40f6c3d7bda44a05dcf1437c44372", + "decimals": 18, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xfe97e85d13abd9c1c33384e796f10b73905637ce", + "decimals": 18, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "core", + "name": "Core", + "chainId": "0x45c", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0xa4151B2B3e269645181dCcF2D426cE75fcbDeca9", + "decimals": 6, + "min": "0.5", + "max": "20000" + }, + { + "id": "btc", + "decimals": 8, + "addr": "0x8034ab88c3512246bf7894f57c834dddbd1de01f", + "min": "0.00055", + "max": "0.05" + }, + { + "id": "usdt", + "addr": "0x900101d06A7426441Ae63e9AB3B9b0F63Be145F1", + "decimals": 6, + "min": "0.5", + "max": "20000" + }, + { + "id": "eth", + "addr": "0xeAB3aC417c4d6dF6b143346a46fEe1B847B50296", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "cronos", + "name": "Cronos", + "chainId": "0x19", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0xc21223249ca28397b4b6541dffaecc539bff0c59", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x66e428c3f67a68878562e79a0234c1f83c208770", + "decimals": 6, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "eos", + "name": "EOS EVM", + "chainId": "0x4571", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdt", + "addr": "0x33B57dC70014FD7AA6e1ed3080eeD2B619632B8e", + "decimals": 6, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "eth", + "name": "Ethereum", + "chainId": "0x1", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "decimals": 6, + "min": "2.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "decimals": 6, + "min": "2.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + }, + { + "id": "btc", + "addr": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", + "decimals": 8, + "min": "0.0006", + "max": "0.05" + } + ] + }, + { + "id": "ftm", + "name": "Fantom", + "chainId": "0xfa", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf", + "decimals": 6, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "gnosis", + "name": "Gnosis", + "chainId": "0x64", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "dai", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "inevm", + "name": "inEVM", + "chainId": "0x9dd", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x97423A68BAe94b5De52d767a17aBCc54c157c0E5", + "decimals": 6, + "min": "1.5", + "max": "20000" + } + ] + }, + { + "id": "kava", + "name": "Kava", + "chainId": "0x8ae", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdt", + "addr": "0x919C1c267BC06a7039e03fcc2eF738525769109c", + "decimals": 6, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "linea", + "name": "Linea", + "chainId": "0xe708", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x176211869cA2b568f2A7D4EE941E073a821EE1ff", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xA219439258ca9da29E9Cc4cE5596924745e12B93", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "manta", + "name": "Manta", + "chainId": "0xa9", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + }, + { + "id": "usdc", + "addr": "0xb73603C5d87fA094B7314C74ACE2e64D165016fb", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xf417F5A458eC102B90352F697D6e2Ac3A3d2851f", + "decimals": 6, + "min": "1.5", + "max": "20000" + } + ] + }, + { + "id": "map", + "name": "MAP Protocol", + "chainId": "0x58f8", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "eth", + "addr": "0x05aB928d446d8ce6761e368c8e7bE03C3168A9ec", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "merlin", + "name": "Merlin", + "chainId": "0x1068", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "btc", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.00055", + "max": "0.05" + }, + { + "id": "usdc", + "addr": "0x6b4eCAdA640F1B30dBdB68f77821A03A5f282EbE", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x967aEC3276b63c5E2262da9641DB9dbeBB07dC0d", + "decimals": 6, + "min": "1.5", + "max": "20000" + } + ] + }, + { + "id": "metis", + "name": "Metis", + "chainId": "0x440", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0xEA32A96608495e54156Ae48931A7c20f0dcc1a21", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xbB06DCA3AE6887fAbF931640f67cab3e3a16F4dC", + "decimals": 6, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "mnt", + "name": "Mantle", + "chainId": "0x1388", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9", + "decimals": 6, + "min": "0.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE", + "decimals": 6, + "min": "0.5", + "max": "20000" + } + ] + }, + { + "id": "mode", + "name": "Mode", + "chainId": "0x868b", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0xd988097fb8612cc24eeC14542bC03424c656005f", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xf0F161fDA2712DB8b566946122a5af183995e2eD", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.002", + "max": "2" + }, + { + "id": "btc", + "addr": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF", + "decimals": 8, + "min": "0.00055", + "max": "0.05" + } + ] + }, + { + "id": "opbnb", + "name": "opBNB", + "chainId": "0xcc", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdt", + "addr": "0x9e5aac1ba1a2e6aed6b32689dfcf62a509ca96f3", + "decimals": 18, + "min": "1.0", + "max": "20000" + } + ] + }, + { + "id": "opt", + "name": "Optimism", + "chainId": "0xa", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "polygon", + "name": "Polygon PoS", + "chainId": "0x89", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", + "decimals": 6, "min": "1.0", "max": "20000" + }, + { + "id": "btc", + "addr": "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6", + "decimals": 8, + "min": "0.00055", + "max": "0.05" + } + ] + }, + { + "id": "scroll", + "name": "Scroll", + "chainId": "0x82750", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df", + "decimals": 6, + "min": "1.5", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "skale-calypso", + "name": "SKALE Calypso", + "chainId": "0x5d456c62", + "address": "0x4c2F26ba59cD10C605b669add14966547CA93d02", + "tokens": [ + { + "id": "usdc", + "addr": "0x7Cf76E740Cb23b99337b21F392F22c47Ad910c67", + "decimals": 6, + "min": "0.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0xf9B5736E74b37Ec2EDd37B1B3c8e1aF9fa426F2A", + "decimals": 6, + "min": "0.5", + "max": "20000" + } + ] + }, + { + "id": "skale-europa", + "name": "SKALE Europa", + "chainId": "0x79f99296", + "address": "0x529c2945c257CC737A15733d43a1fD1cBBe79C67", + "tokens": [ + { + "id": "usdc", + "addr": "0x5F795bb52dAC3085f578f4877D450e2929D2F13d", + "decimals": 6, + "min": "0.5", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x1c0491E3396AD6a35f061c62387a95d7218FC515", + "decimals": 6, + "min": "0.5", + "max": "20000" + } + ] + }, + { + "id": "skale-nebula", + "name": "SKALE Nebula", + "chainId": "0x585eb4b1", + "address": "0x4c2F26ba59cD10C605b669add14966547CA93d02", + "tokens": [ + { + "id": "usdc", + "addr": "0xCC205196288B7A26f6D43bBD68AaA98dde97276d", + "decimals": 6, + "min": "0.5", + "max": "20000" + } + ] + }, + { + "id": "taiko", + "name": "Taiko", + "chainId": "0x28c58", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x07d83526730c7438048D55A4fc0b850e2aaB6f0b", + "decimals": 6, + "min": "0.5", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" } ] }, - { "id": "tron", "name": "Tron", @@ -30,6 +955,180 @@ "max": "20000" } ] + }, + { + "id": "xlayer", + "name": "XLayer", + "chainId": "0xc4", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x74b7F16337b8972027F6196A17a631aC6dE26d22", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x1E4a5963aBFD975d8c9021ce480b42188849D41d", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x5A77f1443D16ee5761d310e38b62f77f726bC71c", + "decimals": 18, + "min": "0.001", + "max": "2" + }, + { + "id": "btc", + "addr": "0xEA034fb02eB1808C2cc3adbC15f447B93CbE08e1", + "decimals": 8, + "min": "0.00055", + "max": "0.05" + } + ] + }, + { + "id": "zeta", + "name": "ZetaChain", + "chainId": "0x1b58", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "eth", + "addr": "0xd97b1de3619ed2c6beb3860147e30ca8a7dc9891", + "decimals": 18, + "min": "0.002", + "max": "2" + }, + { + "id": "btc", + "addr": "0x13A0c5930C028511Dc02665E7285134B6d11A5f4", + "decimals": 8, + "min": "0.00055", + "max": "0.05" + } + ] + }, + { + "id": "zkevm", + "name": "Polygon zkEVM", + "chainId": "0x44d", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x37eAA0eF3549a5Bb7D431be78a3D99BD360d19e5", + "decimals": 6, + "min": "2.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x1E4a5963aBFD975d8c9021ce480b42188849D41d", + "decimals": 6, + "min": "2.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "zkfair", + "name": "ZKFair", + "chainId": "0xa70e", + "address": "0x25aB3Efd52e6470681CE037cD546Dc60726948D3", + "tokens": [ + { + "id": "usdc", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "2.5", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x4b21b980d0Dc7D3C0C6175b0A412694F3A1c7c6b", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] + }, + { + "id": "zklink", + "name": "zkLink Nova", + "chainId": "0xc5cc4", + "address": "0x2DcC88Fa6b6950EE28245C3238B8993BE5feeA42", + "tokens": [ + { + "id": "usdc", + "addr": "0x1a1A3b2ff016332e866787B311fcB63928464509", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "usdt", + "addr": "0x2F8A25ac62179B31D62D7F80884AE57464699059", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + }, + { + "id": "busd", + "addr": "0x7F934E97101e2239b9cB438A4B07d9474AD51406", + "decimals": 18, + "min": "1.0", + "max": "20000" + }, + { + "id": "btc", + "decimals": 18, + "addr": "0x7118D8700B1b635CA37992294349Dc616fDC94Fe", + "min": "0.0005", + "max": "0.05" + } + ] + }, + { + "id": "zksync", + "name": "zkSync Era", + "chainId": "0x144", + "address": "0x2DcC88Fa6b6950EE28245C3238B8993BE5feeA42", + "tokens": [ + { + "id": "usdc", + "addr": "0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4", + "decimals": 6, + "min": "1.0", + "max": "20000" + }, + { + "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", + "decimals": 18, + "min": "0.001", + "max": "2" + } + ] } ] } diff --git a/apps/canonical-bridge-ui/token-config/mainnet/useTransferConfig.ts b/apps/canonical-bridge-ui/token-config/mainnet/useTransferConfig.ts index db620060..ad81eac0 100644 --- a/apps/canonical-bridge-ui/token-config/mainnet/useTransferConfig.ts +++ b/apps/canonical-bridge-ui/token-config/mainnet/useTransferConfig.ts @@ -47,6 +47,7 @@ export function useTransferConfig() { 'AAVE', 'LDO', 'LINK', + 'BTC', 'BTCB', 'WBTC', 'sUSDe', @@ -169,7 +170,7 @@ export function useTransferConfig() { config: mesonConfig.result as any, exclude: { chains: [], - tokens: {}, + tokens: { 42161: ['SOL'] }, }, bridgedTokenGroups: [], }, diff --git a/apps/canonical-bridge-ui/token-config/testnet/meson/config.json b/apps/canonical-bridge-ui/token-config/testnet/meson/config.json index ab7afe13..f4ac920e 100644 --- a/apps/canonical-bridge-ui/token-config/testnet/meson/config.json +++ b/apps/canonical-bridge-ui/token-config/testnet/meson/config.json @@ -15,6 +15,7 @@ }, { "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", "decimals": 18, "min": "0.001", "max": "2" @@ -43,6 +44,7 @@ }, { "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", "decimals": 18, "min": "0.001", "max": "2" @@ -86,6 +88,7 @@ }, { "id": "eth", + "addr": "0x0000000000000000000000000000000000000000", "decimals": 18, "min": "0.001", "max": "2" diff --git a/packages/canonical-bridge-widget/src/core/locales/en.ts b/packages/canonical-bridge-widget/src/core/locales/en.ts index 3fc37b62..3496064d 100644 --- a/packages/canonical-bridge-widget/src/core/locales/en.ts +++ b/packages/canonical-bridge-widget/src/core/locales/en.ts @@ -76,6 +76,9 @@ export const en = { 'modal.submit.button.view-tx': 'View Transaction', 'modal.submit.button.close': 'Make Another Transaction', + 'modal.confirm.title': 'Waiting for Confirmation', + 'modal.confirm.desc': 'Confirm this transaction in your wallet', + 'select-modal.tag.incompatible': 'Incompatible', 'select-modal.search.no-result.title': 'No result found', 'select-modal.search.no-result.warning': diff --git a/packages/canonical-bridge-widget/src/modules/aggregator/adapters/deBridge/hooks/useGetDeBridgeFees.ts b/packages/canonical-bridge-widget/src/modules/aggregator/adapters/deBridge/hooks/useGetDeBridgeFees.ts index a5ed7420..9b744aa0 100644 --- a/packages/canonical-bridge-widget/src/modules/aggregator/adapters/deBridge/hooks/useGetDeBridgeFees.ts +++ b/packages/canonical-bridge-widget/src/modules/aggregator/adapters/deBridge/hooks/useGetDeBridgeFees.ts @@ -70,7 +70,7 @@ export const useGetDeBridgeFees = () => { if (nativeTokenBalance && nativeTokenBalance?.value < totalNativeAmount) { dispatch( setRouteError({ - deBridge: 'Could not cover deBridge Protocol Fee', + deBridge: `Insufficient ${nativeToken} to cover protocol fee`, }), ); isDisplayError = true; diff --git a/packages/canonical-bridge-widget/src/modules/aggregator/adapters/meson/MesonAdapter.ts b/packages/canonical-bridge-widget/src/modules/aggregator/adapters/meson/MesonAdapter.ts index 06520b41..7d710baa 100644 --- a/packages/canonical-bridge-widget/src/modules/aggregator/adapters/meson/MesonAdapter.ts +++ b/packages/canonical-bridge-widget/src/modules/aggregator/adapters/meson/MesonAdapter.ts @@ -2,9 +2,10 @@ import { BridgeType } from '@bnb-chain/canonical-bridge-sdk'; import { BaseAdapter, ITransferTokenPair } from '@/modules/aggregator/shared/BaseAdapter'; import { IMesonChain, IMesonToken } from '@/modules/aggregator/adapters/meson/types'; +import { isNativeToken } from '@/core/utils/address'; -const SUPPORTED_CHAIN_IDS = [56, 97, 3448148188, 728126428]; -const SUPPORTED_TOKENS = ['USDT', 'USDC']; +// const SUPPORTED_CHAIN_IDS = [56, 97, 3448148188, 728126428]; +// const SUPPORTED_TOKENS = ['USDT', 'USDC']; export class MesonAdapter extends BaseAdapter { public bridgeType: BridgeType = 'meson'; @@ -17,8 +18,8 @@ export class MesonAdapter extends BaseAdapter 0; - const isSupported = SUPPORTED_CHAIN_IDS.includes(Number(chain.chainId)); // TODO - return hasChainConfig && !isExcludedChain && hasToken && isSupported; + // const isSupported = SUPPORTED_CHAIN_IDS.includes(Number(chain.chainId)); // TODO + return hasChainConfig && !isExcludedChain && hasToken; }); const chainMap = new Map(); @@ -45,8 +46,8 @@ export class MesonAdapter extends BaseAdapter 0 && this.chainMap.has(chainId)) { diff --git a/packages/canonical-bridge-widget/src/modules/aggregator/components/TokenBalancesProvider.tsx b/packages/canonical-bridge-widget/src/modules/aggregator/components/TokenBalancesProvider.tsx index 3bd01301..96e4e835 100644 --- a/packages/canonical-bridge-widget/src/modules/aggregator/components/TokenBalancesProvider.tsx +++ b/packages/canonical-bridge-widget/src/modules/aggregator/components/TokenBalancesProvider.tsx @@ -11,7 +11,7 @@ import { useTronWeb } from '@/core/hooks/useTronWeb'; import { useCurrentWallet } from '@/modules/wallet/CurrentWalletProvider'; export function TokenBalancesProvider() { - const { address } = useCurrentWallet(); + const { address, walletType } = useCurrentWallet(); const chains = useChains(); const tronWeb = useTronWeb(); @@ -30,6 +30,7 @@ export function TokenBalancesProvider() { queryKey: ['tokenBalances', address, fromChain?.id, toChain?.id], queryFn: async () => { const balances = await getTokenBalances({ + walletType, chainType: fromChain?.chainType, account: address, tokens, diff --git a/packages/canonical-bridge-widget/src/modules/aggregator/hooks/useSelection.ts b/packages/canonical-bridge-widget/src/modules/aggregator/hooks/useSelection.ts index 73e2e88c..b7511f6d 100644 --- a/packages/canonical-bridge-widget/src/modules/aggregator/hooks/useSelection.ts +++ b/packages/canonical-bridge-widget/src/modules/aggregator/hooks/useSelection.ts @@ -204,7 +204,7 @@ function useSortedTokens() { const { transferConfig } = useAggregator(); const chains = useChains(); - const { address } = useCurrentWallet(); + const { address, walletType } = useCurrentWallet(); const { getTokenPrice } = useTokenPrice(); const tronWeb = useTronWeb(); @@ -219,6 +219,7 @@ function useSortedTokens() { tokens: IBridgeToken[]; }) => { const balances = await getTokenBalances({ + walletType, chainType, account: address, tokens, @@ -247,7 +248,7 @@ function useSortedTokens() { orders: transferConfig.order?.tokens, }); }, - [address, chains, tronWeb, transferConfig.order?.tokens, getTokenPrice], + [walletType, address, chains, tronWeb, transferConfig.order?.tokens, getTokenPrice], ); return { diff --git a/packages/canonical-bridge-widget/src/modules/aggregator/shared/getTokenBalances.ts b/packages/canonical-bridge-widget/src/modules/aggregator/shared/getTokenBalances.ts index aa3c7496..dec7c41b 100644 --- a/packages/canonical-bridge-widget/src/modules/aggregator/shared/getTokenBalances.ts +++ b/packages/canonical-bridge-widget/src/modules/aggregator/shared/getTokenBalances.ts @@ -1,34 +1,42 @@ import { Address, Chain, createPublicClient, formatUnits, http } from 'viem'; import { TronWeb } from 'tronweb'; +import axios from 'axios'; import { ChainType, IBridgeToken } from '@/modules/aggregator/types'; import { ERC20_TOKEN } from '@/core/contract/abi'; import { isChainOrTokenCompatible } from '@/modules/aggregator/shared/isChainOrTokenCompatible'; +import { isSameAddress } from '@/core/utils/address'; export async function getTokenBalances({ + walletType, chainType, account, tokens, chain, tronWeb, }: { + walletType?: ChainType; chainType?: ChainType; account?: string; tokens?: IBridgeToken[]; chain?: Chain; tronWeb?: TronWeb; }) { + if (walletType !== chainType) return {}; + + const compatibleTokens = tokens?.filter((item) => isChainOrTokenCompatible(item)); + if (chainType === 'tron') { return await getTronTokenBalances({ account, - tokens, + tokens: compatibleTokens, tronWeb, }); } return await getEvmTokenBalances({ account, chain, - tokens, + tokens: compatibleTokens, }); } @@ -51,8 +59,7 @@ async function getEvmTokenBalances({ transport: http(), }); - const compatibleTokens = tokens.filter((item) => isChainOrTokenCompatible(item)); - const contracts = compatibleTokens.map((item) => ({ + const contracts = tokens.map((item) => ({ abi: ERC20_TOKEN, address: item.address as Address, functionName: 'balanceOf', @@ -74,7 +81,7 @@ async function getEvmTokenBalances({ const values = erc20TokensRes.value?.map((item) => item.result) ?? []; values.map((value, index) => { - const token = compatibleTokens[index]; + const token = tokens[index]; const symbol = token.displaySymbol?.toUpperCase(); balances[symbol] = @@ -95,17 +102,11 @@ async function getEvmTokenBalances({ } } -const tronBalanceABI = [ - { - constant: true, - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'balanceOf', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, -]; +interface ITronAccountToken { + balance: string; + tokenId: string; + tokenAbbr: string; +} async function getTronTokenBalances({ account, @@ -120,20 +121,42 @@ async function getTronTokenBalances({ if (!account || !tokens?.length || !tronWeb) { return {}; } - const balances: Record = {}; - for (let i = 0; i < Math.min(tokens.length, 2); i++) { - const token = tokens?.[i]; - const tokenAddress = token.address; + const isTestnet = tronWeb.fullNode.host.includes('nile'); + const endpoint = isTestnet + ? 'https://nileapi.tronscan.org/api' + : 'https://apilist.tronscan.org/api'; + + const res = await axios<{ data: ITronAccountToken[] }>({ + url: `${endpoint}/account/tokens`, + params: { + address: account, + start: 0, + limit: 50, + }, + }); - tronWeb.setAddress(token.address); - const contractInstance = await tronWeb.contract(tronBalanceABI, tokenAddress); - const balanceOf = await contractInstance.balanceOf(account).call(); - const balance = balanceOf?.toString() as string; + const tokenInfos = res.data?.data ?? []; + tokenInfos.forEach((tokenInfo) => { + const token = tokens.find( + (t) => + isSameAddress(t.address, tokenInfo.tokenId) || + (t.displaySymbol.toUpperCase() === 'TRX' && tokenInfo.tokenId === '_'), + ); + + if (token) { + balances[token.displaySymbol.toUpperCase()] = formatUnits( + BigInt(tokenInfo.balance), + token.decimals, + ); + } + }); - balances[token.displaySymbol?.toUpperCase()] = formatUnits(BigInt(balance), token.decimals); - } + tokens.forEach((t) => { + const key = t.displaySymbol.toUpperCase(); + balances[key] = balances[key] ?? '0'; + }); return balances; } catch (err) { diff --git a/packages/canonical-bridge-widget/src/modules/aggregator/shared/sortTokens.ts b/packages/canonical-bridge-widget/src/modules/aggregator/shared/sortTokens.ts index ad55e1a4..460514b9 100644 --- a/packages/canonical-bridge-widget/src/modules/aggregator/shared/sortTokens.ts +++ b/packages/canonical-bridge-widget/src/modules/aggregator/shared/sortTokens.ts @@ -17,6 +17,23 @@ export function sortTokens({ const isA = isChainOrTokenCompatible(a); const isB = isChainOrTokenCompatible(b); + const indexA = tokenOrders.indexOf(aSymbol); + const indexB = tokenOrders.indexOf(bSymbol); + + const sortWithPredefinedOrders = () => { + if (indexA > -1 && indexB === -1) { + return -1; + } + if (indexA === -1 && indexB > -1) { + return 1; + } + if (indexA > -1 && indexB > -1) { + return indexA - indexB; + } + + return aSymbol < bSymbol ? -1 : 1; + }; + if (isA && !isB) { return -1; } @@ -34,22 +51,19 @@ export function sortTokens({ if (!a.value && b.value) { return 1; } - } - const indexA = tokenOrders.indexOf(aSymbol); - const indexB = tokenOrders.indexOf(bSymbol); - - if (indexA > -1 && indexB === -1) { - return -1; - } - if (indexA === -1 && indexB > -1) { - return 1; - } - if (indexA > -1 && indexB > -1) { - return indexA - indexB; + if (a.balance && b.balance) { + return sortWithPredefinedOrders(); + } + if (a.balance && !b.balance) { + return -1; + } + if (!a.balance && b.balance) { + return 1; + } } - return a.displaySymbol < b.displaySymbol ? -1 : 1; + return sortWithPredefinedOrders(); }); return sortedTokens; diff --git a/packages/canonical-bridge-widget/src/modules/transfer/components/Modal/TransactionConfirmingModal/index.tsx b/packages/canonical-bridge-widget/src/modules/transfer/components/Modal/TransactionConfirmingModal/index.tsx index 80dc9d30..d003e442 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/components/Modal/TransactionConfirmingModal/index.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/components/Modal/TransactionConfirmingModal/index.tsx @@ -1,13 +1,17 @@ +import { useIntl } from '@bnb-chain/space'; + import { StateModal, StateModalProps } from '@/core/components/StateModal'; export function TransactionConfirmingModal(props: Omit) { const { ...restProps } = props; + const { formatMessage } = useIntl(); + return ( } bodyProps={{ pb: 0, diff --git a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/modal/RoutesModal.tsx b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/modal/RoutesModal.tsx index c30b730c..3d715d09 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/modal/RoutesModal.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/modal/RoutesModal.tsx @@ -20,9 +20,9 @@ export function RoutesModal(props: RoutesModalProps) { { if (mesonEst.status === 'fulfilled' && mesonEst?.value) { if (mesonEst?.value?.error) { const error = mesonEst?.value?.error; + dispatch(setRouteFees({ meson: undefined })); if (error.code === 21 && error.message === 'amount-over-limit') { dispatch(setEstimatedAmount({ meson: 'error' })); dispatch(