From 6d0882b676f7d31c8ae169867c847f9d8a32fb9f Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Thu, 25 Apr 2024 21:46:08 -0400 Subject: [PATCH 01/10] Adds Scroll via RFQ --- .../assets/chains/scroll.svg | 32 +++ .../SelectSpecificNetworkButton.tsx | 244 ------------------ .../synapse-interface/constants/bridge.ts | 26 -- .../constants/chains/index.tsx | 10 +- .../constants/chains/master.tsx | 46 ++-- .../constants/chains/supportedChains.ts | 2 + .../constants/existingBridgeRoutes.ts | 29 ++- .../constants/existingRfqRoutes.ts | 45 ++++ .../synapse-interface/constants/rfqMap.ts | 42 +++ packages/synapse-interface/constants/swap.ts | 22 -- .../constants/tokens/bridgeable.ts | 1 + packages/synapse-interface/package.json | 2 +- .../synapse-interface/scripts/generateMaps.js | 13 +- .../scripts/generateRfqMaps.js | 49 ++++ .../scripts/utils/prettyPrintTs.js | 13 + .../utils/getEstimatedBridgeTime.tsx | 1 - .../synapse-interface/utils/types/index.tsx | 1 - 17 files changed, 240 insertions(+), 338 deletions(-) create mode 100644 packages/synapse-interface/assets/chains/scroll.svg delete mode 100644 packages/synapse-interface/components/StateManagedBridge/components/SelectSpecificNetworkButton.tsx create mode 100644 packages/synapse-interface/constants/existingRfqRoutes.ts create mode 100644 packages/synapse-interface/constants/rfqMap.ts create mode 100644 packages/synapse-interface/scripts/generateRfqMaps.js create mode 100644 packages/synapse-interface/scripts/utils/prettyPrintTs.js diff --git a/packages/synapse-interface/assets/chains/scroll.svg b/packages/synapse-interface/assets/chains/scroll.svg new file mode 100644 index 0000000000..0e07355856 --- /dev/null +++ b/packages/synapse-interface/assets/chains/scroll.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + diff --git a/packages/synapse-interface/components/StateManagedBridge/components/SelectSpecificNetworkButton.tsx b/packages/synapse-interface/components/StateManagedBridge/components/SelectSpecificNetworkButton.tsx deleted file mode 100644 index 8d823d1de5..0000000000 --- a/packages/synapse-interface/components/StateManagedBridge/components/SelectSpecificNetworkButton.tsx +++ /dev/null @@ -1,244 +0,0 @@ -import { useEffect, useMemo, useRef, useState } from 'react' -import { CHAINS_BY_ID } from '@constants/chains' -import Image from 'next/image' -import { - getNetworkHover, - getNetworkButtonBorder, - getNetworkButtonBorderHover, - getNetworkButtonBgClassName, - getNetworkButtonBgClassNameActive, - getNetworkButtonBorderActive, - getMenuItemStyleForChain, -} from '@/styles/chains' -import { usePortfolioState } from '@/slices/portfolio/hooks' -import { - TokenAndBalance, - sortTokensByBalanceDescending, -} from '@/utils/actions/fetchPortfolioBalances' - -export const SelectSpecificNetworkButton = ({ - itemChainId, - isCurrentChain, - active, - onClick, - dataId, - isOrigin, - alternateBackground = false, -}: { - itemChainId: number - isCurrentChain: boolean - active: boolean - onClick: () => void - dataId: string - isOrigin: boolean - alternateBackground?: boolean -}) => { - const ref = useRef(null) - const chain = CHAINS_BY_ID[itemChainId] - - useEffect(() => { - if (active) { - ref?.current?.focus() - } - }, [active]) - - let bgClassName - - if (isCurrentChain) { - bgClassName = ` - ${getNetworkButtonBgClassName(chain.color)} - ${getNetworkButtonBorder(chain.color)} - bg-opacity-30 - ` - } - - return ( - - ) -} - -function ButtonContent({ - chainId, - isOrigin, -}: { - chainId: number - isOrigin: boolean -}) { - const chain = CHAINS_BY_ID[chainId] - const { balances } = usePortfolioState() - - const balanceTokens = - balances && - balances[chainId] && - sortTokensByBalanceDescending( - balances[chainId].filter((bt) => bt.balance > 0n) - ) - - return chain ? ( - <> -
- Switch Network -
-
{chain.name}
-
-
- {isOrigin && balanceTokens && balanceTokens.length > 0 ? ( - - ) : null} - - ) : null -} - -const ChainTokens = ({ - balanceTokens = [], -}: { - balanceTokens: TokenAndBalance[] -}) => { - const [isT1Hovered, setIsT1Hovered] = useState(false) - const [isT2Hovered, setIsT2Hovered] = useState(false) - const [isT3Hovered, setIsT3Hovered] = useState(false) - - const hasNoTokens: boolean = - !balanceTokens || (balanceTokens && balanceTokens.length === 0) - const hasOneToken: boolean = balanceTokens && balanceTokens.length > 0 - const hasTwoTokens: boolean = balanceTokens && balanceTokens.length > 1 - const numOverTwoTokens: number = - balanceTokens && balanceTokens.length - 2 > 0 ? balanceTokens.length - 2 : 0 - const hasOnlyOneToken: boolean = balanceTokens && balanceTokens.length === 1 - const hasOnlyTwoTokens: boolean = balanceTokens && balanceTokens.length === 2 - - if (hasNoTokens) { - return ( -
- - -
- ) - } - return ( -
- {hasOneToken && ( -
- {`${balanceTokens[0].token.symbol} setIsT1Hovered(true)} - onMouseLeave={() => setIsT1Hovered(false)} - /> -
- -
- {balanceTokens[0]?.parsedBalance}{' '} - {balanceTokens[0]?.token.symbol} -
-
-
-
- )} - {hasOnlyOneToken && ( -
- {balanceTokens[0].parsedBalance} {balanceTokens[0].token.symbol} -
- )} - {hasTwoTokens && ( -
- {`${balanceTokens[1].token.symbol} setIsT2Hovered(true)} - onMouseLeave={() => setIsT2Hovered(false)} - /> -
- -
- {balanceTokens[1]?.parsedBalance}{' '} - {balanceTokens[1]?.token.symbol} -
-
-
-
- )} - {numOverTwoTokens > 0 && ( -
setIsT3Hovered(true)} - onMouseLeave={() => setIsT3Hovered(false)} - > - + {numOverTwoTokens} -
- )} -
- - {balanceTokens?.map((token: TokenAndBalance, key: number) => { - if (key > 1) { - const tokenSymbol = token.token.symbol - const balance = token.parsedBalance - return ( -
- {balance} {tokenSymbol} -
- ) - } - })} -
-
-
- ) -} - -export const HoverContent = ({ - isHovered, - children, -}: { - isHovered: boolean - children: React.ReactNode -}) => { - if (isHovered) { - return ( -
- {children} -
- ) - } -} diff --git a/packages/synapse-interface/constants/bridge.ts b/packages/synapse-interface/constants/bridge.ts index f263f93a6c..7ab02c2ecc 100644 --- a/packages/synapse-interface/constants/bridge.ts +++ b/packages/synapse-interface/constants/bridge.ts @@ -42,32 +42,6 @@ export const BRIDGE_CONFIG_ADDRESSES = { [CHAINS.POLYGON.id]: '0xd69229f223a8fc84998e1361ae7b4ff724cf4a49', // TESTING ADDRESS } -/** - * number of required confirmations from bridge - */ -export const BRIDGE_REQUIRED_CONFIRMATIONS = { - [CHAINS.ETH.id]: 33, - [CHAINS.BNB.id]: 33, - [CHAINS.POLYGON.id]: 128, - [CHAINS.FANTOM.id]: 80, - [CHAINS.BOBA.id]: 33, - [CHAINS.OPTIMISM.id]: 750, - [CHAINS.MOONBEAM.id]: 33, - [CHAINS.MOONRIVER.id]: 33, - [CHAINS.ARBITRUM.id]: 200, - [CHAINS.AVALANCHE.id]: 80, - [CHAINS.DFK.id]: 33, - [CHAINS.HARMONY.id]: 33, - [CHAINS.AURORA.id]: 33, - [CHAINS.CRONOS.id]: 33, - [CHAINS.METIS.id]: 33, - [CHAINS.DOGE.id]: 33, - [CHAINS.CANTO.id]: 20, - [CHAINS.BASE.id]: 750, - [CHAINS.KLAYTN.id]: 20, - [CHAINS.BLAST.id]: 750, -} - export const DEFAULT_FROM_TOKEN_SYMBOL = 'USDC' export const DEFAULT_TO_TOKEN_SYMBOL = 'USDC' export const DEFAULT_FROM_TOKEN = USDC diff --git a/packages/synapse-interface/constants/chains/index.tsx b/packages/synapse-interface/constants/chains/index.tsx index 3f830c9d7b..4799931e80 100644 --- a/packages/synapse-interface/constants/chains/index.tsx +++ b/packages/synapse-interface/constants/chains/index.tsx @@ -11,14 +11,6 @@ export const CHAINS_ARR = Object.values(all).sort( (a, b) => b.priorityRank - a.priorityRank ) -const getChainEnumById = () => { - const outObj: Record = {} - CHAINS_ARR.map((chain) => { - outObj[chain.id] = chain.codeName - }) - return outObj -} - const getids = () => { const outObj = {} CHAINS_ARR.map((chain) => { @@ -34,7 +26,6 @@ const getChainsByID = (): ChainsByChainID => { return outObj } -export const CHAIN_ENUM_BY_ID = getChainEnumById() export const CHAIN_IDS = getids() // used to be ids export const CHAINS_BY_ID = getChainsByID() export const ORDERED_CHAINS_BY_ID = CHAINS_ARR.map((chain) => String(chain.id)) @@ -61,6 +52,7 @@ export const ChainId = { ARBITRUM: 42161, BASE: 8453, BLAST: 81457, + SCROLL: 534352, AVALANCHE: 43114, DFK: 53935, AURORA: 1313161554, diff --git a/packages/synapse-interface/constants/chains/master.tsx b/packages/synapse-interface/constants/chains/master.tsx index b93fd08ffe..7390cfebdd 100644 --- a/packages/synapse-interface/constants/chains/master.tsx +++ b/packages/synapse-interface/constants/chains/master.tsx @@ -18,6 +18,7 @@ import moonbeamImg from '@assets/chains/moonbeam.svg' import moonriverImg from '@assets/chains/moonriver.svg' import optimismImg from '@assets/chains/optimism.svg' import polygonImg from '@assets/chains/polygon.svg' +import scrollImg from '@assets/chains/scroll.svg' import ethExplorerImg from '@assets/explorer/etherscan.svg' import arbitrumExplorerImg from '@assets/explorer/arbiscan.svg' @@ -35,7 +36,6 @@ export const ETH: Chain = { id: 1, chainSymbol: 'ETH', name: 'Ethereum', - codeName: 'Ethereum', chainImg: ethImg, layer: 1, rpcUrls: { @@ -64,7 +64,6 @@ export const ARBITRUM: Chain = { name: 'Arbitrum', chainImg: arbitrumImg, layer: 2, - codeName: 'arbitrum', blockTime: 300, rpcUrls: { primary: @@ -92,7 +91,6 @@ export const BNB: Chain = { chainImg: bscImg, altName: 'BNB', layer: 1, - codeName: 'bsc', blockTime: 3000, rpcUrls: { primary: 'https://bsc-dataseed1.ninicoin.io/', @@ -118,7 +116,6 @@ export const AVALANCHE: Chain = { name: 'Avalanche', chainImg: avalancheImg, layer: 1, - codeName: 'avalanche', blockTime: 2000, rpcUrls: { primary: 'https://api.avax.network/ext/bc/C/rpc', @@ -144,7 +141,6 @@ export const CANTO: Chain = { name: 'Canto', chainImg: cantoImg, layer: 1, - codeName: 'canto', blockTime: 6000, rpcUrls: { primary: 'https://mainnode.plexnode.org:8545', @@ -170,7 +166,6 @@ export const OPTIMISM: Chain = { name: 'Optimism', chainImg: optimismImg, layer: 2, - codeName: 'optimism', blockTime: 2000, rpcUrls: { primary: @@ -197,7 +192,6 @@ export const POLYGON: Chain = { name: 'Polygon', chainImg: polygonImg, layer: 2, - codeName: 'polygon', blockTime: 2000, rpcUrls: { primary: @@ -224,7 +218,6 @@ export const DFK: Chain = { name: 'DFK Chain', chainImg: dfkImg, layer: 1, - codeName: 'dfk', blockTime: 2000, rpcUrls: { primary: 'https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc', @@ -250,7 +243,6 @@ export const KLAYTN: Chain = { name: 'Klaytn', chainImg: klaytnImg, layer: 1, - codeName: 'klaytn', blockTime: 1000, rpcUrls: { primary: 'https://klaytn.blockpi.network/v1/rpc/public', @@ -276,7 +268,6 @@ export const FANTOM: Chain = { name: 'Fantom', chainImg: fantomImg, layer: 1, - codeName: 'fantom', blockTime: 1000, rpcUrls: { primary: 'https://rpc.ftm.tools', @@ -302,7 +293,6 @@ export const CRONOS: Chain = { name: 'Cronos', chainImg: cronosImg, layer: 1, - codeName: 'cronos', blockTime: 6000, rpcUrls: { primary: 'https://evm-cronos.crypto.org', @@ -328,7 +318,6 @@ export const BOBA: Chain = { name: 'Boba Chain', chainImg: bobaImg, layer: 2, - codeName: 'boba', blockTime: 1000, rpcUrls: { primary: 'https://mainnet.boba.network', @@ -354,7 +343,6 @@ export const METIS: Chain = { name: 'Metis', chainImg: metisImg, layer: 2, - codeName: 'metis', blockTime: 4000, rpcUrls: { primary: 'https://andromeda.metis.io/?owner=1088', @@ -380,7 +368,6 @@ export const AURORA: Chain = { name: 'Aurora', chainImg: auroraImg, layer: 1, - codeName: 'aurora', blockTime: 1000, rpcUrls: { primary: 'https://mainnet.aurora.dev', @@ -406,7 +393,6 @@ export const HARMONY: Chain = { name: 'Harmony', chainImg: harmonyImg, layer: 1, - codeName: 'harmony', blockTime: 2000, rpcUrls: { primary: 'https://api.harmony.one', @@ -432,7 +418,6 @@ export const MOONBEAM: Chain = { name: 'Moonbeam', chainImg: moonbeamImg, layer: 1, - codeName: 'moonbeam', blockTime: 12000, rpcUrls: { primary: 'https://rpc.api.moonbeam.network', @@ -458,7 +443,6 @@ export const MOONRIVER: Chain = { name: 'Moonriver', chainImg: moonriverImg, layer: 1, - codeName: 'moonriver', blockTime: 12000, rpcUrls: { primary: 'https://rpc.api.moonriver.moonbeam.network', @@ -484,7 +468,6 @@ export const DOGE: Chain = { name: 'Dogechain', chainImg: dogechainImg, layer: 1, - codeName: 'dogechain', blockTime: 2000, rpcUrls: { primary: 'https://rpc.dogechain.dog', @@ -508,7 +491,6 @@ export const BASE: Chain = { id: 8453, chainSymbol: 'BASE', name: 'Base', - codeName: 'base', chainImg: baseImg, layer: 2, rpcUrls: { @@ -535,7 +517,6 @@ export const BLAST: Chain = { id: 81457, chainSymbol: 'BLAST', name: 'Blast', - codeName: 'blast', chainImg: blastImg, layer: 2, rpcUrls: { @@ -556,3 +537,28 @@ export const BLAST: Chain = { }, color: 'yellow', } + +export const SCROLL: Chain = { + priorityRank: 90, + id: 534352, + chainSymbol: 'SCROLL', + name: 'Scroll', + chainImg: scrollImg, + layer: 2, + rpcUrls: { + primary: 'https://rpc.scroll.io/', + fallback: 'https://scroll.blockpi.network/v1/rpc/public', + }, + explorerUrl: 'https://scrollscan.com', + explorerName: 'Scrollscan', + explorerImg: scrollImg, + blockTime: 3000, + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + address: zeroAddress, + icon: scrollImg, + }, + color: 'orange', +} diff --git a/packages/synapse-interface/constants/chains/supportedChains.ts b/packages/synapse-interface/constants/chains/supportedChains.ts index f03b2f8df5..ed2038d6b2 100644 --- a/packages/synapse-interface/constants/chains/supportedChains.ts +++ b/packages/synapse-interface/constants/chains/supportedChains.ts @@ -17,6 +17,7 @@ import { moonriver, optimism, polygon, + scroll, } from '@wagmi/core/chains' import { dfk, dogechain } from '@/constants/chains/extraWagmiChains' @@ -43,6 +44,7 @@ export const supportedChains = [ dfk, dogechain, boba, + scroll, ].map((chain) => { return { ...chain, diff --git a/packages/synapse-interface/constants/existingBridgeRoutes.ts b/packages/synapse-interface/constants/existingBridgeRoutes.ts index a1ec85b06f..0eec4b9745 100644 --- a/packages/synapse-interface/constants/existingBridgeRoutes.ts +++ b/packages/synapse-interface/constants/existingBridgeRoutes.ts @@ -1,5 +1,7 @@ -import { BRIDGE_MAP } from '@/constants/bridgeMap' +import { RFQ_MAP } from './rfqMap' +import { transformRFQMap } from './existingRfqRoutes' import { flattenPausedTokens } from '@/utils/flattenPausedTokens' +import { BRIDGE_MAP } from '@/constants/bridgeMap' export type BridgeRoutes = Record @@ -48,7 +50,30 @@ const constructJSON = (swappableMap, exclusionList) => { const PAUSED_TOKENS = flattenPausedTokens() -export const EXISTING_BRIDGE_ROUTES: BridgeRoutes = constructJSON( +const EXISTING_BRIDGE_CCTP_ROUTES: BridgeRoutes = constructJSON( BRIDGE_MAP, PAUSED_TOKENS ) + +const RFQ_ROUTES = transformRFQMap(RFQ_MAP) + +const mergeObjectsUnique = (firstObj, secondObj) => { + Object.keys(secondObj).forEach((key) => { + if (!firstObj[key]) { + firstObj[key] = secondObj[key] + } else { + secondObj[key].forEach((value) => { + if (!firstObj[key].includes(value)) { + firstObj[key].push(value) + } + }) + } + }) + + return firstObj +} + +export const EXISTING_BRIDGE_ROUTES: BridgeRoutes = mergeObjectsUnique( + EXISTING_BRIDGE_CCTP_ROUTES, + RFQ_ROUTES +) diff --git a/packages/synapse-interface/constants/existingRfqRoutes.ts b/packages/synapse-interface/constants/existingRfqRoutes.ts new file mode 100644 index 0000000000..ebd2e67f16 --- /dev/null +++ b/packages/synapse-interface/constants/existingRfqRoutes.ts @@ -0,0 +1,45 @@ +import { zeroAddress } from 'viem' + +import * as ALL_BRIDGEABLE_TOKENS from '@/constants/tokens/bridgeable' +import { ETHEREUM_ADDRESS } from '@/constants' + +const reduceToSymbol = (tokenAddressChainId: string) => { + return tokenAddressToRouteSymbolMap[tokenAddressChainId.toLowerCase()] +} + +const tokenAddressToRouteSymbolMap = Object.values( + ALL_BRIDGEABLE_TOKENS +).reduce((acc, token) => { + Object.entries(token.addresses).forEach(([chainId, address]) => { + const effectiveAddress = + address === zeroAddress ? ETHEREUM_ADDRESS : address + const key = `${effectiveAddress.toLowerCase()}-${chainId}` + acc[key] = `${token.routeSymbol}-${chainId}` + }) + return acc +}, {}) + +export const transformRFQMap = (rfqMap) => { + const transformedMap = {} + + Object.keys(rfqMap).forEach((key) => { + const transformedKey = reduceToSymbol(key) + if (!transformedKey) { + console.error(`No match for key: ${key}`) + } + + const transformedValues = rfqMap[key].map((value) => { + const transformedValue = reduceToSymbol(value) + if (!transformedValue) { + console.error(`No match for value: ${value}`) + } + return transformedValue + }) + + transformedMap[transformedKey] = transformedValues.filter( + (v) => v !== undefined + ) + }) + + return transformedMap +} diff --git a/packages/synapse-interface/constants/rfqMap.ts b/packages/synapse-interface/constants/rfqMap.ts new file mode 100644 index 0000000000..a0eedf0277 --- /dev/null +++ b/packages/synapse-interface/constants/rfqMap.ts @@ -0,0 +1,42 @@ +export const RFQ_MAP = { + '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-1': [ + '0x0b2c639c533813f4aa9d7837caf62653d097ff85-10', + '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913-8453', + '0xaf88d065e77c8cc2239327c5edb3a432268e5831-42161', + ], + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-1': [ + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-10', + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-8453', + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-42161', + ], + '0x0b2c639c533813f4aa9d7837caf62653d097ff85-10': [ + '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-1', + '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913-8453', + '0xaf88d065e77c8cc2239327c5edb3a432268e5831-42161', + ], + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-10': [ + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-1', + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-8453', + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-42161', + ], + '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913-8453': [ + '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-1', + '0x0b2c639c533813f4aa9d7837caf62653d097ff85-10', + '0xaf88d065e77c8cc2239327c5edb3a432268e5831-42161', + ], + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-8453': [ + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-1', + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-10', + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-42161', + ], + '0xaf88d065e77c8cc2239327c5edb3a432268e5831-42161': [ + '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-1', + '0x0b2c639c533813f4aa9d7837caf62653d097ff85-10', + '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913-8453', + ], + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-42161': [ + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-1', + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-10', + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-8453', + ], +} diff --git a/packages/synapse-interface/constants/swap.ts b/packages/synapse-interface/constants/swap.ts index ec1400f37e..6591551e4f 100644 --- a/packages/synapse-interface/constants/swap.ts +++ b/packages/synapse-interface/constants/swap.ts @@ -23,28 +23,6 @@ export const EMPTY_SWAP_QUOTE_ZERO: SwapQuote = { delta: 0n, quote: null, } -/** - * number of required confirmations from bridge - */ -export const BRIDGE_REQUIRED_CONFIRMATIONS = { - [CHAINS.ETH.id]: 33, - [CHAINS.BNB.id]: 14, - [CHAINS.POLYGON.id]: 128, - [CHAINS.FANTOM.id]: 5, - [CHAINS.BOBA.id]: 1, // rewrite - [CHAINS.OPTIMISM.id]: 1, // rewrite - [CHAINS.MOONBEAM.id]: 21, - [CHAINS.MOONRIVER.id]: 21, // 5, - [CHAINS.ARBITRUM.id]: 40, - [CHAINS.AVALANCHE.id]: 5, - [CHAINS.DFK.id]: 6, - [CHAINS.HARMONY.id]: 1, // rewrite - [CHAINS.AURORA.id]: 5, - [CHAINS.CRONOS.id]: 6, - [CHAINS.METIS.id]: 6, - [CHAINS.DOGE.id]: 20, - [CHAINS.CANTO.id]: 20, -} export const DEFAULT_FROM_TOKEN_SYMBOL = 'USDC' export const DEFAULT_TO_TOKEN_SYMBOL = 'DAI' diff --git a/packages/synapse-interface/constants/tokens/bridgeable.ts b/packages/synapse-interface/constants/tokens/bridgeable.ts index ba5346037e..3585f101ee 100644 --- a/packages/synapse-interface/constants/tokens/bridgeable.ts +++ b/packages/synapse-interface/constants/tokens/bridgeable.ts @@ -699,6 +699,7 @@ export const ETH = new Token({ [CHAINS.ARBITRUM.id]: zeroAddress, [CHAINS.DFK.id]: '0xfBDF0E31808d0aa7b9509AA6aBC9754E48C58852', [CHAINS.BLAST.id]: zeroAddress, + [CHAINS.SCROLL.id]: zeroAddress, }, decimals: 18, symbol: 'ETH', diff --git a/packages/synapse-interface/package.json b/packages/synapse-interface/package.json index 9e9c35b900..c52c705de5 100644 --- a/packages/synapse-interface/package.json +++ b/packages/synapse-interface/package.json @@ -19,7 +19,7 @@ "build:go": " ", "build:slither": " ", "graphql:generate": "graphql-codegen --config codegen.ts", - "maps:generate": "node scripts/generateMaps.js", + "maps:generate": "node scripts/generateMaps.js && node scripts/generateRfqMaps", "test": "echo 'No jest tests defined.'" }, "dependencies": { diff --git a/packages/synapse-interface/scripts/generateMaps.js b/packages/synapse-interface/scripts/generateMaps.js index d984d3bbaf..49d7eced3b 100644 --- a/packages/synapse-interface/scripts/generateMaps.js +++ b/packages/synapse-interface/scripts/generateMaps.js @@ -1,8 +1,6 @@ -const fs = require('fs') -const { execSync } = require('child_process') - const { ethers } = require('ethers') +const { prettyPrintTS } = require('./utils/prettyPrintTs') // Provider URLs const providers = require('./data/providers.json') // List of ignored bridge symbols @@ -366,13 +364,4 @@ const getTokenDecimals = async (chainId, token) => { return decimals } -// Writes map export to a TypeScript file, then runs prettier on the file -const prettyPrintTS = (map, mapName, fn) => { - console.log(`Writing ${mapName} to ${fn}`) - const json = JSON.stringify(map) - fs.writeFileSync(fn, `export const ${mapName} = ${json}`) - // Run prettier on the file using terminal command: - execSync(`npx prettier --write ${fn}`) -} - printMaps() diff --git a/packages/synapse-interface/scripts/generateRfqMaps.js b/packages/synapse-interface/scripts/generateRfqMaps.js new file mode 100644 index 0000000000..7f13d28957 --- /dev/null +++ b/packages/synapse-interface/scripts/generateRfqMaps.js @@ -0,0 +1,49 @@ +const { prettyPrintTS } = require('./utils/prettyPrintTs') + +const RFQ_URL = 'https://rfq-api.omnirpc.io/quotes' + +const fetchRFQData = async (url) => { + try { + const response = await fetch(url) + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`) + } + return await response.json() + } catch (error) { + console.error('Failed to fetch RFQ data:', error) + return [] + } +} + +const convertDataToMap = (data) => { + const result = {} + + data.forEach((item) => { + const originKey = `${item.origin_token_addr.toLowerCase()}-${ + item.origin_chain_id + }` + const destinationValue = `${item.dest_token_addr.toLowerCase()}-${ + item.dest_chain_id + }` + + if (!result[originKey]) { + result[originKey] = [] + } + + if (!result[originKey].includes(destinationValue)) { + result[originKey].push(destinationValue) + } + }) + + return result +} + +const printMaps = async () => { + const rfqData = await fetchRFQData(RFQ_URL) + + const data = convertDataToMap(rfqData) + + prettyPrintTS(data, 'RFQ_MAP', './constants/rfqMap.ts') +} + +printMaps() diff --git a/packages/synapse-interface/scripts/utils/prettyPrintTs.js b/packages/synapse-interface/scripts/utils/prettyPrintTs.js new file mode 100644 index 0000000000..61629dafdc --- /dev/null +++ b/packages/synapse-interface/scripts/utils/prettyPrintTs.js @@ -0,0 +1,13 @@ +const fs = require('fs') +const { execSync } = require('child_process') + +// Writes map export to a TypeScript file, then runs prettier on the file +const prettyPrintTS = (map, mapName, fn) => { + console.log(`Writing ${mapName} to ${fn}`) + const json = JSON.stringify(map) + fs.writeFileSync(fn, `export const ${mapName} = ${json}`) + // Run prettier on the file using terminal command: + execSync(`npx prettier --write ${fn}`) +} + +module.exports = { prettyPrintTS } diff --git a/packages/synapse-interface/utils/getEstimatedBridgeTime.tsx b/packages/synapse-interface/utils/getEstimatedBridgeTime.tsx index 69cf4eb41e..eaf3d11d39 100644 --- a/packages/synapse-interface/utils/getEstimatedBridgeTime.tsx +++ b/packages/synapse-interface/utils/getEstimatedBridgeTime.tsx @@ -1,5 +1,4 @@ import { useSynapseContext } from './providers/SynapseProvider' -import { BRIDGE_REQUIRED_CONFIRMATIONS } from '@/constants/bridge' import { Chain } from './types' enum SynapseBridgeModule { diff --git a/packages/synapse-interface/utils/types/index.tsx b/packages/synapse-interface/utils/types/index.tsx index d5733c32b8..bf67744f14 100644 --- a/packages/synapse-interface/utils/types/index.tsx +++ b/packages/synapse-interface/utils/types/index.tsx @@ -7,7 +7,6 @@ export type Chain = { chainSymbol: string name: string altName?: string - codeName: string chainImg: any layer: number rpcUrls: { primary: string; fallback: string } From a8cca84492eb442a3aa7825769a225e20184133c Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Tue, 30 Apr 2024 14:08:51 -0400 Subject: [PATCH 02/10] Adds NewTag --- .../assets/chains/scroll.svg | 39 ++++--------------- .../ui/SelectSpecificNetworkButton.tsx | 15 ++++++- .../constants/chains/master.tsx | 1 + .../synapse-interface/utils/types/index.tsx | 1 + 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/packages/synapse-interface/assets/chains/scroll.svg b/packages/synapse-interface/assets/chains/scroll.svg index 0e07355856..fbfa194347 100644 --- a/packages/synapse-interface/assets/chains/scroll.svg +++ b/packages/synapse-interface/assets/chains/scroll.svg @@ -1,32 +1,9 @@ - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx b/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx index 4fa1ddb903..c613010943 100644 --- a/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx +++ b/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx @@ -80,7 +80,10 @@ function ButtonContent({ /> {chain.name} - {isOrigin && } + {chain.new && } + {isOrigin && balanceTokens?.length > 0 && ( + + )} ) ) @@ -147,3 +150,13 @@ function HoverIcon({ token }) { ) } + +const NewTag = () => { + const className = joinClassNames({ + space: 'px-2 py-[2px] rounded-md', + border: 'border border-fuchsia-500', + background: 'bg-gradient-to-r from-fuchsia-950 to-purple-900', + font: 'text-sm ', + }) + return
New!
+} diff --git a/packages/synapse-interface/constants/chains/master.tsx b/packages/synapse-interface/constants/chains/master.tsx index 7390cfebdd..7d95e72a0c 100644 --- a/packages/synapse-interface/constants/chains/master.tsx +++ b/packages/synapse-interface/constants/chains/master.tsx @@ -561,4 +561,5 @@ export const SCROLL: Chain = { icon: scrollImg, }, color: 'orange', + new: true, } diff --git a/packages/synapse-interface/utils/types/index.tsx b/packages/synapse-interface/utils/types/index.tsx index bf67744f14..8a46bc6727 100644 --- a/packages/synapse-interface/utils/types/index.tsx +++ b/packages/synapse-interface/utils/types/index.tsx @@ -23,6 +23,7 @@ export type Chain = { } priorityRank?: number color?: string + new?: boolean } export type PoolToken = { symbol: string From 9d119d405f25d803bb3696b3799c760ac87d8015 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Wed, 1 May 2024 14:40:50 -0400 Subject: [PATCH 03/10] Adds RFQ logic into the generateMaps script --- .../components/AnnouncementBanner.tsx | 1 - .../synapse-interface/constants/bridgeMap.ts | 166 +++-- .../constants/existingBridgeRoutes.ts | 29 +- .../constants/existingRfqRoutes.ts | 45 -- .../constants/tokens/bridgeable.ts | 2 + packages/synapse-interface/package.json | 2 +- .../scripts/data/providers.json | 1 + .../scripts/data/rfqResponse.json | 678 ++++++++++++++++++ .../synapse-interface/scripts/generateMaps.js | 87 ++- .../scripts/generateRfqMaps.js | 49 -- 10 files changed, 892 insertions(+), 168 deletions(-) delete mode 100644 packages/synapse-interface/constants/existingRfqRoutes.ts create mode 100644 packages/synapse-interface/scripts/data/rfqResponse.json delete mode 100644 packages/synapse-interface/scripts/generateRfqMaps.js diff --git a/packages/synapse-interface/components/Maintenance/components/AnnouncementBanner.tsx b/packages/synapse-interface/components/Maintenance/components/AnnouncementBanner.tsx index 5433d115d1..e8b7ba6da5 100644 --- a/packages/synapse-interface/components/Maintenance/components/AnnouncementBanner.tsx +++ b/packages/synapse-interface/components/Maintenance/components/AnnouncementBanner.tsx @@ -1,6 +1,5 @@ import { useState, useEffect } from 'react' import { getCountdownTimeStatus } from './EventCountdownProgressBar' -import { isNull } from 'lodash' /** * Generic Message Banner that appears between defined start and end time. diff --git a/packages/synapse-interface/constants/bridgeMap.ts b/packages/synapse-interface/constants/bridgeMap.ts index 8257707cf1..f3f5e6da5b 100644 --- a/packages/synapse-interface/constants/bridgeMap.ts +++ b/packages/synapse-interface/constants/bridgeMap.ts @@ -31,7 +31,15 @@ export const BRIDGE_MAP = { '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F': { decimals: 18, symbol: 'nUSD', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + 'RFQ.USDC', + ], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', @@ -60,7 +68,15 @@ export const BRIDGE_MAP = { '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0': { decimals: 18, symbol: 'LUSD', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + 'RFQ.USDC', + ], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -82,7 +98,15 @@ export const BRIDGE_MAP = { '0x6B175474E89094C44Da98b954EedeAC495271d0F': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + 'RFQ.USDC', + ], destination: ['CCTP.USDC', 'DAI', 'nUSD'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -97,7 +121,15 @@ export const BRIDGE_MAP = { '0x6c3ea9036406852006290770BEdFcAbA0e23A0e8': { decimals: 6, symbol: 'PYUSD', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + 'RFQ.USDC', + ], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -126,7 +158,15 @@ export const BRIDGE_MAP = { '0x853d955aCEf822Db058eb8505911ED77F175b99e': { decimals: 18, symbol: 'FRAX', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + 'RFQ.USDC', + ], destination: ['CCTP.USDC', 'synFRAX'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -148,8 +188,16 @@ export const BRIDGE_MAP = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': { decimals: 6, symbol: 'USDC', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], - destination: ['CCTP.USDC', 'USDC', 'nUSD'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + 'RFQ.USDC', + ], + destination: ['CCTP.USDC', 'USDC', 'nUSD', 'RFQ.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', @@ -184,8 +232,8 @@ export const BRIDGE_MAP = { '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { decimals: 18, symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], + destination: ['nETH', 'RFQ.ETH'], swappable: [], }, '0xb753428af26E81097e7fD17f40c88aaA3E04902c': { @@ -198,7 +246,15 @@ export const BRIDGE_MAP = { '0xdAC17F958D2ee523a2206206994597C13D831ec7': { decimals: 6, symbol: 'USDT', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + 'RFQ.USDC', + ], destination: ['CCTP.USDC', 'USDT', 'nUSD'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -220,7 +276,15 @@ export const BRIDGE_MAP = { '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E': { decimals: 18, symbol: 'crvUSD', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + 'RFQ.USDC', + ], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -237,8 +301,8 @@ export const BRIDGE_MAP = { '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85': { decimals: 6, symbol: 'USDC', - origin: ['CCTP.USDC', 'nUSD'], - destination: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + destination: ['CCTP.USDC', 'RFQ.USDC'], swappable: [ '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00', '0x7F5c764cBc14f9669B88837ca1490cCa17c31607', @@ -257,7 +321,7 @@ export const BRIDGE_MAP = { '0x121ab82b49B2BC4c7901CA46B8277962b4350204': { decimals: 18, symbol: 'WETH', - origin: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], destination: ['nETH'], swappable: [ '0x809DC529f07651bD43A172e8dB6f4a7a0d771036', @@ -281,7 +345,7 @@ export const BRIDGE_MAP = { '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00': { decimals: 18, symbol: 'nUSD', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -294,7 +358,7 @@ export const BRIDGE_MAP = { '0x7F5c764cBc14f9669B88837ca1490cCa17c31607': { decimals: 6, symbol: 'USDC.e', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -307,7 +371,7 @@ export const BRIDGE_MAP = { '0x809DC529f07651bD43A172e8dB6f4a7a0d771036': { decimals: 18, symbol: 'nETH', - origin: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], destination: ['nETH'], swappable: [ '0x121ab82b49B2BC4c7901CA46B8277962b4350204', @@ -317,7 +381,7 @@ export const BRIDGE_MAP = { '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9': { decimals: 18, symbol: 'sUSD', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -330,7 +394,7 @@ export const BRIDGE_MAP = { '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58': { decimals: 6, symbol: 'USDT', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -350,7 +414,7 @@ export const BRIDGE_MAP = { '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -370,8 +434,8 @@ export const BRIDGE_MAP = { '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { decimals: 18, symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], + destination: ['nETH', 'RFQ.ETH'], swappable: [ '0x121ab82b49B2BC4c7901CA46B8277962b4350204', '0x809DC529f07651bD43A172e8dB6f4a7a0d771036', @@ -1176,7 +1240,7 @@ export const BRIDGE_MAP = { '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93': { decimals: 18, symbol: 'crvUSD', - origin: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb', @@ -1188,7 +1252,7 @@ export const BRIDGE_MAP = { '0x4200000000000000000000000000000000000006': { decimals: 18, symbol: 'WETH', - origin: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], destination: ['nETH'], swappable: [ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', @@ -1205,7 +1269,7 @@ export const BRIDGE_MAP = { '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1224,8 +1288,8 @@ export const BRIDGE_MAP = { '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913': { decimals: 6, symbol: 'USDC', - origin: ['CCTP.USDC'], - destination: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], + destination: ['CCTP.USDC', 'RFQ.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb', @@ -1236,7 +1300,7 @@ export const BRIDGE_MAP = { '0xEB466342C4d449BC9f53A865D5Cb90586f405215': { decimals: 6, symbol: 'axlUSDC', - origin: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1248,8 +1312,8 @@ export const BRIDGE_MAP = { '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { decimals: 18, symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], + destination: ['nETH', 'RFQ.ETH'], swappable: [ '0x4200000000000000000000000000000000000006', '0xb554A55358fF0382Fb21F0a478C3546d1106Be8c', @@ -1258,7 +1322,7 @@ export const BRIDGE_MAP = { '0xb554A55358fF0382Fb21F0a478C3546d1106Be8c': { decimals: 18, symbol: 'nETH', - origin: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], destination: ['nETH'], swappable: [ '0x4200000000000000000000000000000000000006', @@ -1268,7 +1332,7 @@ export const BRIDGE_MAP = { '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA': { decimals: 6, symbol: 'USDbC', - origin: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1303,7 +1367,7 @@ export const BRIDGE_MAP = { '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F': { decimals: 18, symbol: 'FRAX', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x2913E812Cf0dcCA30FB28E6Cac3d2DCFF4497688', @@ -1316,7 +1380,7 @@ export const BRIDGE_MAP = { '0x2913E812Cf0dcCA30FB28E6Cac3d2DCFF4497688': { decimals: 18, symbol: 'nUSD', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1336,7 +1400,7 @@ export const BRIDGE_MAP = { '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e': { decimals: 18, symbol: 'nETH', - origin: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], destination: ['nETH'], swappable: [ '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', @@ -1360,7 +1424,7 @@ export const BRIDGE_MAP = { '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1': { decimals: 18, symbol: 'WETH', - origin: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], destination: ['nETH'], swappable: [ '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e', @@ -1391,7 +1455,7 @@ export const BRIDGE_MAP = { '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1404,8 +1468,8 @@ export const BRIDGE_MAP = { '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { decimals: 18, symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], + origin: ['nETH', 'RFQ.ETH'], + destination: ['nETH', 'RFQ.ETH'], swappable: [ '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e', '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', @@ -1414,7 +1478,7 @@ export const BRIDGE_MAP = { '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8': { decimals: 6, symbol: 'USDC.e', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1427,7 +1491,7 @@ export const BRIDGE_MAP = { '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': { decimals: 6, symbol: 'USDT', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1447,8 +1511,8 @@ export const BRIDGE_MAP = { '0xaf88d065e77c8cC2239327C5EDb3A432268e5831': { decimals: 6, symbol: 'USDC', - origin: ['CCTP.USDC', 'nUSD'], - destination: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + destination: ['CCTP.USDC', 'RFQ.USDC'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', '0x2913E812Cf0dcCA30FB28E6Cac3d2DCFF4497688', @@ -1768,6 +1832,22 @@ export const BRIDGE_MAP = { ], }, }, + '534352': { + '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4': { + origin: ['RFQ.USDC'], + destination: ['RFQ.USDC'], + swappable: [], + symbol: 'USDC', + decimals: 6, + }, + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { + origin: ['RFQ.ETH'], + destination: ['RFQ.ETH'], + swappable: [], + symbol: 'ETH', + decimals: 18, + }, + }, '1313161554': { '0x07379565cD8B0CaE7c60Dc78e7f601b34AF2A21c': { decimals: 18, diff --git a/packages/synapse-interface/constants/existingBridgeRoutes.ts b/packages/synapse-interface/constants/existingBridgeRoutes.ts index 0eec4b9745..a1ec85b06f 100644 --- a/packages/synapse-interface/constants/existingBridgeRoutes.ts +++ b/packages/synapse-interface/constants/existingBridgeRoutes.ts @@ -1,7 +1,5 @@ -import { RFQ_MAP } from './rfqMap' -import { transformRFQMap } from './existingRfqRoutes' -import { flattenPausedTokens } from '@/utils/flattenPausedTokens' import { BRIDGE_MAP } from '@/constants/bridgeMap' +import { flattenPausedTokens } from '@/utils/flattenPausedTokens' export type BridgeRoutes = Record @@ -50,30 +48,7 @@ const constructJSON = (swappableMap, exclusionList) => { const PAUSED_TOKENS = flattenPausedTokens() -const EXISTING_BRIDGE_CCTP_ROUTES: BridgeRoutes = constructJSON( +export const EXISTING_BRIDGE_ROUTES: BridgeRoutes = constructJSON( BRIDGE_MAP, PAUSED_TOKENS ) - -const RFQ_ROUTES = transformRFQMap(RFQ_MAP) - -const mergeObjectsUnique = (firstObj, secondObj) => { - Object.keys(secondObj).forEach((key) => { - if (!firstObj[key]) { - firstObj[key] = secondObj[key] - } else { - secondObj[key].forEach((value) => { - if (!firstObj[key].includes(value)) { - firstObj[key].push(value) - } - }) - } - }) - - return firstObj -} - -export const EXISTING_BRIDGE_ROUTES: BridgeRoutes = mergeObjectsUnique( - EXISTING_BRIDGE_CCTP_ROUTES, - RFQ_ROUTES -) diff --git a/packages/synapse-interface/constants/existingRfqRoutes.ts b/packages/synapse-interface/constants/existingRfqRoutes.ts deleted file mode 100644 index ebd2e67f16..0000000000 --- a/packages/synapse-interface/constants/existingRfqRoutes.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { zeroAddress } from 'viem' - -import * as ALL_BRIDGEABLE_TOKENS from '@/constants/tokens/bridgeable' -import { ETHEREUM_ADDRESS } from '@/constants' - -const reduceToSymbol = (tokenAddressChainId: string) => { - return tokenAddressToRouteSymbolMap[tokenAddressChainId.toLowerCase()] -} - -const tokenAddressToRouteSymbolMap = Object.values( - ALL_BRIDGEABLE_TOKENS -).reduce((acc, token) => { - Object.entries(token.addresses).forEach(([chainId, address]) => { - const effectiveAddress = - address === zeroAddress ? ETHEREUM_ADDRESS : address - const key = `${effectiveAddress.toLowerCase()}-${chainId}` - acc[key] = `${token.routeSymbol}-${chainId}` - }) - return acc -}, {}) - -export const transformRFQMap = (rfqMap) => { - const transformedMap = {} - - Object.keys(rfqMap).forEach((key) => { - const transformedKey = reduceToSymbol(key) - if (!transformedKey) { - console.error(`No match for key: ${key}`) - } - - const transformedValues = rfqMap[key].map((value) => { - const transformedValue = reduceToSymbol(value) - if (!transformedValue) { - console.error(`No match for value: ${value}`) - } - return transformedValue - }) - - transformedMap[transformedKey] = transformedValues.filter( - (v) => v !== undefined - ) - }) - - return transformedMap -} diff --git a/packages/synapse-interface/constants/tokens/bridgeable.ts b/packages/synapse-interface/constants/tokens/bridgeable.ts index 3585f101ee..9b64ec5707 100644 --- a/packages/synapse-interface/constants/tokens/bridgeable.ts +++ b/packages/synapse-interface/constants/tokens/bridgeable.ts @@ -409,6 +409,7 @@ export const USDC = new Token({ [CHAINS.AVALANCHE.id]: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e', [CHAINS.DFK.id]: '0x3AD9DFE640E1A9Cc1D9B0948620820D975c3803a', [CHAINS.BASE.id]: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', + [CHAINS.SCROLL.id]: '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4', }, decimals: { [CHAINS.ETH.id]: 6, @@ -424,6 +425,7 @@ export const USDC = new Token({ [CHAINS.AVALANCHE.id]: 6, [CHAINS.DFK.id]: 18, [CHAINS.BASE.id]: 6, + [CHAINS.SCROLL.id]: 6, }, symbol: 'USDC', name: 'USD Coin', diff --git a/packages/synapse-interface/package.json b/packages/synapse-interface/package.json index c52c705de5..9e9c35b900 100644 --- a/packages/synapse-interface/package.json +++ b/packages/synapse-interface/package.json @@ -19,7 +19,7 @@ "build:go": " ", "build:slither": " ", "graphql:generate": "graphql-codegen --config codegen.ts", - "maps:generate": "node scripts/generateMaps.js && node scripts/generateRfqMaps", + "maps:generate": "node scripts/generateMaps.js", "test": "echo 'No jest tests defined.'" }, "dependencies": { diff --git a/packages/synapse-interface/scripts/data/providers.json b/packages/synapse-interface/scripts/data/providers.json index 2105ded426..d5d4b120ec 100644 --- a/packages/synapse-interface/scripts/data/providers.json +++ b/packages/synapse-interface/scripts/data/providers.json @@ -17,6 +17,7 @@ "42161": "https://arbitrum-one.publicnode.com", "43114": "https://api.avax.network/ext/bc/C/rpc", "53935": "https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc", + "534352": "https://rpc.scroll.io", "1313161554": "https://mainnet.aurora.dev", "1666600000": "https://api.s0.t.hmny.io" } diff --git a/packages/synapse-interface/scripts/data/rfqResponse.json b/packages/synapse-interface/scripts/data/rfqResponse.json new file mode 100644 index 0000000000..103e406108 --- /dev/null +++ b/packages/synapse-interface/scripts/data/rfqResponse.json @@ -0,0 +1,678 @@ +[ + { + "origin_chain_id": 1, + "origin_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_chain_id": 10, + "dest_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_amount": "774262502365", + "max_origin_amount": "774417385843", + "fixed_fee": "8054808", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:30Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "dest_chain_id": 10, + "dest_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "8554665", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_chain_id": 8453, + "dest_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_amount": "487144501894", + "max_origin_amount": "487241950285", + "fixed_fee": "8070710", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_chain_id": 8453, + "dest_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "8385119", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_chain_id": 42161, + "dest_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_amount": "347116182337", + "max_origin_amount": "347185619461", + "fixed_fee": "8047222", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "dest_chain_id": 42161, + "dest_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "8547762", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 10, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "59945200251111734576", + "max_origin_amount": "59957191689449624500", + "fixed_fee": "2761920526687600", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:30Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "dest_chain_id": 10, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "2933316889676025", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:30Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 8453, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "183755522999099641851", + "max_origin_amount": "183792281455390719992", + "fixed_fee": "2767373042987600", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 8453, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "2875180960595575", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 42161, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "70001868021959841948", + "max_origin_amount": "70015871196199081763", + "fixed_fee": "2759319545425500", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "dest_chain_id": 42161, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "2867463149077875", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_chain_id": 1, + "dest_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_amount": "822633257106", + "max_origin_amount": "822797816670", + "fixed_fee": "6826600", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + "dest_chain_id": 1, + "dest_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "7249811", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_chain_id": 8453, + "dest_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_amount": "487144501894", + "max_origin_amount": "487241950285", + "fixed_fee": "84574", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_chain_id": 8453, + "dest_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_amount": "65387254625", + "max_origin_amount": "65400334692", + "fixed_fee": "85666", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_chain_id": 42161, + "dest_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_amount": "347116182337", + "max_origin_amount": "347185619461", + "fixed_fee": "61086", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + "dest_chain_id": 42161, + "dest_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_amount": "31460047113", + "max_origin_amount": "31466340382", + "fixed_fee": "63158", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 1, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "69071705428131773329", + "max_origin_amount": "69085522532638300988", + "fixed_fee": "2340778902187700", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "dest_chain_id": 1, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "2485894263539550", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 8453, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "183755522999099641851", + "max_origin_amount": "183792281455390719992", + "fixed_fee": "29000142775300", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 8453, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "9628405038969472756", + "max_origin_amount": "9630331105190510858", + "fixed_fee": "29374869449225", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 42161, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "70001868021959841948", + "max_origin_amount": "70015871196199081763", + "fixed_fee": "20946645213200", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 10, + "origin_token_addr": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "dest_chain_id": 42161, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "2115551460015393249", + "max_origin_amount": "2115974654946382526", + "fixed_fee": "21657057931525", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_chain_id": 1, + "dest_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_amount": "822633257106", + "max_origin_amount": "822797816670", + "fixed_fee": "6845393", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_chain_id": 1, + "dest_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "7268186", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_chain_id": 10, + "dest_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_amount": "774262502365", + "max_origin_amount": "774417385843", + "fixed_fee": "87465", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:30Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_chain_id": 10, + "dest_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_amount": "47529681404", + "max_origin_amount": "47539189242", + "fixed_fee": "88536", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_chain_id": 42161, + "dest_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_amount": "347116182337", + "max_origin_amount": "347185619461", + "fixed_fee": "79879", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_chain_id": 42161, + "dest_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_amount": "31460047113", + "max_origin_amount": "31466340382", + "fixed_fee": "81633", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 1, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "69071705428131773329", + "max_origin_amount": "69085522532638300988", + "fixed_fee": "2347222785087700", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 1, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "2492194874252050", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 10, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "59945200251111734576", + "max_origin_amount": "59957191689449624500", + "fixed_fee": "29991509375300", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 10, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "15925536277659377442", + "max_origin_amount": "15928722022063790200", + "fixed_fee": "30358839328075", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 42161, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "70001868021959841948", + "max_origin_amount": "70015871196199081763", + "fixed_fee": "27390528113200", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 8453, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 42161, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "2115551460015393249", + "max_origin_amount": "2115974654946382526", + "fixed_fee": "27957668644025", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:27Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_chain_id": 1, + "dest_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_amount": "822633257106", + "max_origin_amount": "822797816670", + "fixed_fee": "6822741", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + "dest_chain_id": 1, + "dest_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "7247076", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:28Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_chain_id": 10, + "dest_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_amount": "774262502365", + "max_origin_amount": "774417385843", + "fixed_fee": "64813", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:30Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + "dest_chain_id": 10, + "dest_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_amount": "47529681404", + "max_origin_amount": "47539189242", + "fixed_fee": "67426", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_chain_id": 8453, + "dest_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_amount": "487144501894", + "max_origin_amount": "487241950285", + "fixed_fee": "80715", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "dest_chain_id": 8453, + "dest_token_addr": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "dest_amount": "65387254625", + "max_origin_amount": "65400334692", + "fixed_fee": "82747", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:25Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 1, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "69071705428131773329", + "max_origin_amount": "69085522532638300988", + "fixed_fee": "2339455783476500", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "dest_chain_id": 1, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "2484956594352875", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 10, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "59945200251111734576", + "max_origin_amount": "59957191689449624500", + "fixed_fee": "22224507764100", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:30Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "dest_chain_id": 10, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "15925536277659377442", + "max_origin_amount": "15928722022063790200", + "fixed_fee": "23120559428900", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:30Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 8453, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "183755522999099641851", + "max_origin_amount": "183792281455390719992", + "fixed_fee": "27677024064100", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 42161, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 8453, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "9628405038969472756", + "max_origin_amount": "9630331105190510858", + "fixed_fee": "28373737929200", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 534352, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "9628405038969472756", + "max_origin_amount": "9630331105190510858", + "fixed_fee": "28373737929200", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 534352, + "origin_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_chain_id": 1, + "dest_token_addr": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "dest_amount": "9628405038969472756", + "max_origin_amount": "9630331105190510858", + "fixed_fee": "28373737929200", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:26Z" + }, + { + "origin_chain_id": 1, + "origin_token_addr": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "dest_chain_id": 534352, + "dest_token_addr": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4", + "dest_amount": "774262502365", + "max_origin_amount": "774417385843", + "fixed_fee": "8054808", + "relayer_addr": "0xDc927Bd56CF9DfC2e3779C7E3D6d28dA1C219969", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:30Z" + }, + { + "origin_chain_id": 534352, + "origin_token_addr": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4", + "dest_chain_id": 10, + "dest_token_addr": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "dest_amount": "0", + "max_origin_amount": "0", + "fixed_fee": "8554665", + "relayer_addr": "0xDD50676F81f607fD8bA7Ed3187DdF172DB174CD3", + "origin_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "dest_fast_bridge_address": "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E", + "updated_at": "2024-04-30T20:09:29Z" + } +] diff --git a/packages/synapse-interface/scripts/generateMaps.js b/packages/synapse-interface/scripts/generateMaps.js index 49d7eced3b..7cce8539b1 100644 --- a/packages/synapse-interface/scripts/generateMaps.js +++ b/packages/synapse-interface/scripts/generateMaps.js @@ -23,18 +23,29 @@ Object.keys(providers).forEach((chainId) => { providers[chainId] = new ethers.providers.JsonRpcProvider(providers[chainId]) }) +const rfqResponse = require('./data/rfqResponse.json') + // Contract addresses const SynapseRouterAddress = '0x7e7a0e201fd38d3adaa9523da6c109a07118c96a' const SynapseCCTPRouterAddress = '0xd5a597d6e7ddf373a92C8f477DAAA673b0902F48' const SynapseCCTPAddress = '0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E' +// Chain IDs where SynapseBridge is allowed +const allowedChainIdsForSynapseBridge = [ + 1, 10, 25, 56, 137, 250, 288, 1088, 1284, 1285, 2000, 7700, 8217, 8453, 81457, + 42161, 43114, 53935, 1313161554, 1666600000, +] + // Chain IDs where SynapseCCTPRouter is allowed const allowedChainIdsForSynapseCCTPRouter = [1, 10, 137, 8453, 42161, 43114] +// Chain IDs where RFQ is allowed +const allowedChainIdsForRfq = [1, 10, 8453, 42161, 534352] + // Get SynapseRouter contract instances for each chain const SynapseRouters = {} const SwapQuoters = {} -Object.keys(providers).forEach((chainId) => { +allowedChainIdsForSynapseBridge.forEach((chainId) => { SynapseRouters[chainId] = new ethers.Contract( SynapseRouterAddress, SynapseRouterABI, @@ -67,6 +78,13 @@ allowedChainIdsForSynapseCCTPRouter.forEach((chainId) => { // Function to get list of tokens that could be swapped // into SynapseBridge tokens for a given chain. const getBridgeOriginMap = async (chainId) => { + if (!SwapQuoters[chainId]) { + return { + originMap: {}, + poolSets: [], + } + } + // Get WETH address const weth = await SwapQuoters[chainId].weth() // Get list of supported tokens @@ -252,7 +270,6 @@ const sortMapByKeys = (map) => { }) return sortedMap } - const printMaps = async () => { const bridgeMap = {} const bridgeSymbolsMap = {} @@ -278,11 +295,69 @@ const printMaps = async () => { } }) ) + + if (allowedChainIdsForRfq.includes(parseInt(chainId))) { + await Promise.all( + rfqResponse.map(async (quote) => { + const { + origin_chain_id, + origin_token_addr, + dest_chain_id, + dest_token_addr, + } = quote + + const normalizedOriginAddress = + ethers.utils.getAddress(origin_token_addr) + + const normalizedDestAddress = + ethers.utils.getAddress(dest_token_addr) + + if (origin_chain_id === parseInt(chainId)) { + const originTokenSymbol = await getTokenSymbol( + origin_chain_id, + normalizedOriginAddress + ) + + const rfqOriginSymbol = getRFQSymbol(originTokenSymbol) + + if (!tokens[normalizedOriginAddress]) { + tokens[normalizedOriginAddress] = { + origin: [], + destination: [], + swappable: [], // poolSets are handled during SynapseBridge portion + symbol: null, + decimals: null, + } + } + + if ( + normalizedOriginAddress in tokens && + !tokens[normalizedOriginAddress].origin.includes( + rfqOriginSymbol + ) + ) { + tokens[normalizedOriginAddress].origin.push(rfqOriginSymbol) + tokens[normalizedOriginAddress].symbol = originTokenSymbol + tokens[normalizedOriginAddress].decimals = + await getTokenDecimals( + origin_chain_id, + normalizedOriginAddress + ) + tokens[normalizedOriginAddress].destination.push( + rfqOriginSymbol + ) + } + } + }) + ) + } + bridgeMap[chainId] = sortMapByKeys(tokens) bridgeSymbolsMap[chainId] = sortMapByKeys(extractBridgeSymbolsMap(tokens)) console.log('Finished chain: ', chainId) }) ) + prettyPrintTS(bridgeMap, 'BRIDGE_MAP', './constants/bridgeMap.ts') } @@ -320,6 +395,7 @@ const extractBridgeSymbolsMap = (tokens) => { ...Object.keys(bridgeSymbolsDestinationSets), ]) const bridgeSymbolsMap = {} + bridgeSymbols.forEach((symbol) => { bridgeSymbolsMap[symbol] = { origin: Array.from(bridgeSymbolsOriginSets[symbol]).sort(), @@ -332,6 +408,9 @@ const extractBridgeSymbolsMap = (tokens) => { const getTokenSymbol = async (chainId, token) => { // Check if token is ETH if (token === ETH) { + if (!SwapQuoters[chainId]) { + return 'ETH' + } // Get WETH address from SwapQuoter const weth = await SwapQuoters[chainId].weth() // Return "WETH" symbol without first character @@ -364,4 +443,8 @@ const getTokenDecimals = async (chainId, token) => { return decimals } +const getRFQSymbol = (symbol) => { + return `RFQ.${symbol}` +} + printMaps() diff --git a/packages/synapse-interface/scripts/generateRfqMaps.js b/packages/synapse-interface/scripts/generateRfqMaps.js deleted file mode 100644 index 7f13d28957..0000000000 --- a/packages/synapse-interface/scripts/generateRfqMaps.js +++ /dev/null @@ -1,49 +0,0 @@ -const { prettyPrintTS } = require('./utils/prettyPrintTs') - -const RFQ_URL = 'https://rfq-api.omnirpc.io/quotes' - -const fetchRFQData = async (url) => { - try { - const response = await fetch(url) - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`) - } - return await response.json() - } catch (error) { - console.error('Failed to fetch RFQ data:', error) - return [] - } -} - -const convertDataToMap = (data) => { - const result = {} - - data.forEach((item) => { - const originKey = `${item.origin_token_addr.toLowerCase()}-${ - item.origin_chain_id - }` - const destinationValue = `${item.dest_token_addr.toLowerCase()}-${ - item.dest_chain_id - }` - - if (!result[originKey]) { - result[originKey] = [] - } - - if (!result[originKey].includes(destinationValue)) { - result[originKey].push(destinationValue) - } - }) - - return result -} - -const printMaps = async () => { - const rfqData = await fetchRFQData(RFQ_URL) - - const data = convertDataToMap(rfqData) - - prettyPrintTS(data, 'RFQ_MAP', './constants/rfqMap.ts') -} - -printMaps() From de0c355660d8ee6f800abc73b2c18982ff176be9 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Wed, 1 May 2024 15:13:38 -0400 Subject: [PATCH 04/10] Adds announcement banner --- .../components/layouts/LandingPageWrapper/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx b/packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx index d3c4ccb17b..5c406a770d 100644 --- a/packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx +++ b/packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx @@ -26,6 +26,7 @@ import { MoreButton } from './MoreButton' import { PageFooter } from './PageFooter' import { joinClassNames } from '@/utils/joinClassNames' import { MaintenanceBanners } from '@/components/Maintenance/Maintenance' +import { AnnouncementBanner } from '@/components/Maintenance/components/AnnouncementBanner' const wrapperClassName = joinClassNames({ textColor: 'text-zinc-800 dark:text-zinc-200', @@ -49,6 +50,12 @@ export function LandingPageWrapper({ children }: { children: any }) { return (
+ {children} From 4fce20c4c45edcb4e833669703af5874cffc2b09 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Wed, 1 May 2024 15:29:48 -0400 Subject: [PATCH 05/10] Linting --- packages/synapse-interface/scripts/generateMaps.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/synapse-interface/scripts/generateMaps.js b/packages/synapse-interface/scripts/generateMaps.js index 7cce8539b1..263ab0ccf9 100644 --- a/packages/synapse-interface/scripts/generateMaps.js +++ b/packages/synapse-interface/scripts/generateMaps.js @@ -14,6 +14,7 @@ const SynapseCCTPRouterABI = require('./abi/SynapseCCTPRouter.json') const SwapQuoterABI = require('./abi/SwapQuoter.json') const ERC20ABI = require('./abi/IERC20Metadata.json') const DefaultPoolABI = require('./abi/IDefaultPool.json') +const rfqResponse = require('./data/rfqResponse.json') // ETH address const ETH = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' @@ -23,8 +24,6 @@ Object.keys(providers).forEach((chainId) => { providers[chainId] = new ethers.providers.JsonRpcProvider(providers[chainId]) }) -const rfqResponse = require('./data/rfqResponse.json') - // Contract addresses const SynapseRouterAddress = '0x7e7a0e201fd38d3adaa9523da6c109a07118c96a' const SynapseCCTPRouterAddress = '0xd5a597d6e7ddf373a92C8f477DAAA673b0902F48' @@ -296,7 +295,7 @@ const printMaps = async () => { }) ) - if (allowedChainIdsForRfq.includes(parseInt(chainId))) { + if (allowedChainIdsForRfq.includes(Number(chainId))) { await Promise.all( rfqResponse.map(async (quote) => { const { @@ -312,7 +311,7 @@ const printMaps = async () => { const normalizedDestAddress = ethers.utils.getAddress(dest_token_addr) - if (origin_chain_id === parseInt(chainId)) { + if (origin_chain_id === Number(chainId)) { const originTokenSymbol = await getTokenSymbol( origin_chain_id, normalizedOriginAddress From 6ca16ff90ad72beb59a09a43f2456adda24552a7 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Wed, 1 May 2024 15:39:30 -0400 Subject: [PATCH 06/10] Adjusts order --- .../constants/chains/supportedChains.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/synapse-interface/constants/chains/supportedChains.ts b/packages/synapse-interface/constants/chains/supportedChains.ts index ed2038d6b2..d71da31902 100644 --- a/packages/synapse-interface/constants/chains/supportedChains.ts +++ b/packages/synapse-interface/constants/chains/supportedChains.ts @@ -26,25 +26,25 @@ import { CHAINS_BY_ID } from '@/constants/chains' export const supportedChains = [ mainnet, arbitrum, - aurora, avalanche, base, + optimism, + scroll, blast, + metis, + dfk, bsc, + polygon, + aurora, canto, + klaytn, fantom, - harmonyOne, - metis, moonbeam, moonriver, - optimism, - polygon, - klaytn, cronos, - dfk, dogechain, boba, - scroll, + harmonyOne, ].map((chain) => { return { ...chain, From f35adb3480204f53ede0b5d892dac73eb6acaad4 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Wed, 1 May 2024 19:03:17 -0400 Subject: [PATCH 07/10] API call for quotes --- .../ui/SelectSpecificNetworkButton.tsx | 2 +- .../synapse-interface/constants/bridgeMap.ts | 127 ++++-------------- .../constants/chains/master.tsx | 2 +- .../synapse-interface/constants/rfqMap.ts | 42 ------ .../synapse-interface/scripts/generateMaps.js | 5 +- .../scripts/utils/fetchRfqData.js | 17 +++ .../synapse-interface/utils/types/index.tsx | 2 +- 7 files changed, 52 insertions(+), 145 deletions(-) delete mode 100644 packages/synapse-interface/constants/rfqMap.ts create mode 100644 packages/synapse-interface/scripts/utils/fetchRfqData.js diff --git a/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx b/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx index c613010943..1839d5162e 100644 --- a/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx +++ b/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx @@ -80,7 +80,7 @@ function ButtonContent({ /> {chain.name} - {chain.new && } + {chain.isNew && } {isOrigin && balanceTokens?.length > 0 && ( )} diff --git a/packages/synapse-interface/constants/bridgeMap.ts b/packages/synapse-interface/constants/bridgeMap.ts index f3f5e6da5b..8fdbc56453 100644 --- a/packages/synapse-interface/constants/bridgeMap.ts +++ b/packages/synapse-interface/constants/bridgeMap.ts @@ -31,15 +31,7 @@ export const BRIDGE_MAP = { '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F': { decimals: 18, symbol: 'nUSD', - origin: [ - 'CCTP.USDC', - 'DAI', - 'USDC', - 'USDT', - 'nUSD', - 'synFRAX', - 'RFQ.USDC', - ], + origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', @@ -68,15 +60,7 @@ export const BRIDGE_MAP = { '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0': { decimals: 18, symbol: 'LUSD', - origin: [ - 'CCTP.USDC', - 'DAI', - 'USDC', - 'USDT', - 'nUSD', - 'synFRAX', - 'RFQ.USDC', - ], + origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -98,15 +82,7 @@ export const BRIDGE_MAP = { '0x6B175474E89094C44Da98b954EedeAC495271d0F': { decimals: 18, symbol: 'DAI', - origin: [ - 'CCTP.USDC', - 'DAI', - 'USDC', - 'USDT', - 'nUSD', - 'synFRAX', - 'RFQ.USDC', - ], + origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], destination: ['CCTP.USDC', 'DAI', 'nUSD'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -121,15 +97,7 @@ export const BRIDGE_MAP = { '0x6c3ea9036406852006290770BEdFcAbA0e23A0e8': { decimals: 6, symbol: 'PYUSD', - origin: [ - 'CCTP.USDC', - 'DAI', - 'USDC', - 'USDT', - 'nUSD', - 'synFRAX', - 'RFQ.USDC', - ], + origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -158,15 +126,7 @@ export const BRIDGE_MAP = { '0x853d955aCEf822Db058eb8505911ED77F175b99e': { decimals: 18, symbol: 'FRAX', - origin: [ - 'CCTP.USDC', - 'DAI', - 'USDC', - 'USDT', - 'nUSD', - 'synFRAX', - 'RFQ.USDC', - ], + origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], destination: ['CCTP.USDC', 'synFRAX'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -246,15 +206,7 @@ export const BRIDGE_MAP = { '0xdAC17F958D2ee523a2206206994597C13D831ec7': { decimals: 6, symbol: 'USDT', - origin: [ - 'CCTP.USDC', - 'DAI', - 'USDC', - 'USDT', - 'nUSD', - 'synFRAX', - 'RFQ.USDC', - ], + origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], destination: ['CCTP.USDC', 'USDT', 'nUSD'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -276,15 +228,7 @@ export const BRIDGE_MAP = { '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E': { decimals: 18, symbol: 'crvUSD', - origin: [ - 'CCTP.USDC', - 'DAI', - 'USDC', - 'USDT', - 'nUSD', - 'synFRAX', - 'RFQ.USDC', - ], + origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -321,7 +265,7 @@ export const BRIDGE_MAP = { '0x121ab82b49B2BC4c7901CA46B8277962b4350204': { decimals: 18, symbol: 'WETH', - origin: ['nETH', 'RFQ.ETH'], + origin: ['nETH'], destination: ['nETH'], swappable: [ '0x809DC529f07651bD43A172e8dB6f4a7a0d771036', @@ -345,7 +289,7 @@ export const BRIDGE_MAP = { '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00': { decimals: 18, symbol: 'nUSD', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -358,7 +302,7 @@ export const BRIDGE_MAP = { '0x7F5c764cBc14f9669B88837ca1490cCa17c31607': { decimals: 6, symbol: 'USDC.e', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -371,7 +315,7 @@ export const BRIDGE_MAP = { '0x809DC529f07651bD43A172e8dB6f4a7a0d771036': { decimals: 18, symbol: 'nETH', - origin: ['nETH', 'RFQ.ETH'], + origin: ['nETH'], destination: ['nETH'], swappable: [ '0x121ab82b49B2BC4c7901CA46B8277962b4350204', @@ -381,7 +325,7 @@ export const BRIDGE_MAP = { '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9': { decimals: 18, symbol: 'sUSD', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -394,7 +338,7 @@ export const BRIDGE_MAP = { '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58': { decimals: 6, symbol: 'USDT', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -414,7 +358,7 @@ export const BRIDGE_MAP = { '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -1240,7 +1184,7 @@ export const BRIDGE_MAP = { '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93': { decimals: 18, symbol: 'crvUSD', - origin: ['CCTP.USDC', 'RFQ.USDC'], + origin: ['CCTP.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb', @@ -1252,7 +1196,7 @@ export const BRIDGE_MAP = { '0x4200000000000000000000000000000000000006': { decimals: 18, symbol: 'WETH', - origin: ['nETH', 'RFQ.ETH'], + origin: ['nETH'], destination: ['nETH'], swappable: [ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', @@ -1269,7 +1213,7 @@ export const BRIDGE_MAP = { '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'RFQ.USDC'], + origin: ['CCTP.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1300,7 +1244,7 @@ export const BRIDGE_MAP = { '0xEB466342C4d449BC9f53A865D5Cb90586f405215': { decimals: 6, symbol: 'axlUSDC', - origin: ['CCTP.USDC', 'RFQ.USDC'], + origin: ['CCTP.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1322,7 +1266,7 @@ export const BRIDGE_MAP = { '0xb554A55358fF0382Fb21F0a478C3546d1106Be8c': { decimals: 18, symbol: 'nETH', - origin: ['nETH', 'RFQ.ETH'], + origin: ['nETH'], destination: ['nETH'], swappable: [ '0x4200000000000000000000000000000000000006', @@ -1332,7 +1276,7 @@ export const BRIDGE_MAP = { '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA': { decimals: 6, symbol: 'USDbC', - origin: ['CCTP.USDC', 'RFQ.USDC'], + origin: ['CCTP.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1367,7 +1311,7 @@ export const BRIDGE_MAP = { '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F': { decimals: 18, symbol: 'FRAX', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x2913E812Cf0dcCA30FB28E6Cac3d2DCFF4497688', @@ -1380,7 +1324,7 @@ export const BRIDGE_MAP = { '0x2913E812Cf0dcCA30FB28E6Cac3d2DCFF4497688': { decimals: 18, symbol: 'nUSD', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1400,7 +1344,7 @@ export const BRIDGE_MAP = { '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e': { decimals: 18, symbol: 'nETH', - origin: ['nETH', 'RFQ.ETH'], + origin: ['nETH'], destination: ['nETH'], swappable: [ '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', @@ -1424,7 +1368,7 @@ export const BRIDGE_MAP = { '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1': { decimals: 18, symbol: 'WETH', - origin: ['nETH', 'RFQ.ETH'], + origin: ['nETH'], destination: ['nETH'], swappable: [ '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e', @@ -1455,7 +1399,7 @@ export const BRIDGE_MAP = { '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1478,7 +1422,7 @@ export const BRIDGE_MAP = { '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8': { decimals: 6, symbol: 'USDC.e', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1491,7 +1435,7 @@ export const BRIDGE_MAP = { '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': { decimals: 6, symbol: 'USDT', - origin: ['CCTP.USDC', 'nUSD', 'RFQ.USDC'], + origin: ['CCTP.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1832,22 +1776,7 @@ export const BRIDGE_MAP = { ], }, }, - '534352': { - '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4': { - origin: ['RFQ.USDC'], - destination: ['RFQ.USDC'], - swappable: [], - symbol: 'USDC', - decimals: 6, - }, - '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { - origin: ['RFQ.ETH'], - destination: ['RFQ.ETH'], - swappable: [], - symbol: 'ETH', - decimals: 18, - }, - }, + '534352': {}, '1313161554': { '0x07379565cD8B0CaE7c60Dc78e7f601b34AF2A21c': { decimals: 18, diff --git a/packages/synapse-interface/constants/chains/master.tsx b/packages/synapse-interface/constants/chains/master.tsx index 7d95e72a0c..4a6daea35e 100644 --- a/packages/synapse-interface/constants/chains/master.tsx +++ b/packages/synapse-interface/constants/chains/master.tsx @@ -561,5 +561,5 @@ export const SCROLL: Chain = { icon: scrollImg, }, color: 'orange', - new: true, + isNew: true, } diff --git a/packages/synapse-interface/constants/rfqMap.ts b/packages/synapse-interface/constants/rfqMap.ts deleted file mode 100644 index a0eedf0277..0000000000 --- a/packages/synapse-interface/constants/rfqMap.ts +++ /dev/null @@ -1,42 +0,0 @@ -export const RFQ_MAP = { - '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-1': [ - '0x0b2c639c533813f4aa9d7837caf62653d097ff85-10', - '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913-8453', - '0xaf88d065e77c8cc2239327c5edb3a432268e5831-42161', - ], - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-1': [ - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-10', - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-8453', - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-42161', - ], - '0x0b2c639c533813f4aa9d7837caf62653d097ff85-10': [ - '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-1', - '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913-8453', - '0xaf88d065e77c8cc2239327c5edb3a432268e5831-42161', - ], - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-10': [ - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-1', - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-8453', - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-42161', - ], - '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913-8453': [ - '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-1', - '0x0b2c639c533813f4aa9d7837caf62653d097ff85-10', - '0xaf88d065e77c8cc2239327c5edb3a432268e5831-42161', - ], - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-8453': [ - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-1', - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-10', - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-42161', - ], - '0xaf88d065e77c8cc2239327c5edb3a432268e5831-42161': [ - '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-1', - '0x0b2c639c533813f4aa9d7837caf62653d097ff85-10', - '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913-8453', - ], - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-42161': [ - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-1', - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-10', - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-8453', - ], -} diff --git a/packages/synapse-interface/scripts/generateMaps.js b/packages/synapse-interface/scripts/generateMaps.js index 263ab0ccf9..e98cb0cea4 100644 --- a/packages/synapse-interface/scripts/generateMaps.js +++ b/packages/synapse-interface/scripts/generateMaps.js @@ -1,6 +1,7 @@ const { ethers } = require('ethers') const { prettyPrintTS } = require('./utils/prettyPrintTs') +const { fetchRfqData } = require('./utils/fetchRfqData') // Provider URLs const providers = require('./data/providers.json') // List of ignored bridge symbols @@ -14,7 +15,7 @@ const SynapseCCTPRouterABI = require('./abi/SynapseCCTPRouter.json') const SwapQuoterABI = require('./abi/SwapQuoter.json') const ERC20ABI = require('./abi/IERC20Metadata.json') const DefaultPoolABI = require('./abi/IDefaultPool.json') -const rfqResponse = require('./data/rfqResponse.json') +// const rfqResponse = require('./data/rfqResponse.json') // ETH address const ETH = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' @@ -273,6 +274,8 @@ const printMaps = async () => { const bridgeMap = {} const bridgeSymbolsMap = {} console.log('Starting on chains: ', Object.keys(providers)) + + const rfqResponse = await fetchRfqData() await Promise.all( Object.keys(providers).map(async (chainId) => { // Get map from token to set of bridge token symbols diff --git a/packages/synapse-interface/scripts/utils/fetchRfqData.js b/packages/synapse-interface/scripts/utils/fetchRfqData.js new file mode 100644 index 0000000000..8289c36d58 --- /dev/null +++ b/packages/synapse-interface/scripts/utils/fetchRfqData.js @@ -0,0 +1,17 @@ +// URL for RFQ quotes +const RFQ_URL = 'https://rfq-api.omnirpc.io/quotes' + +const fetchRfqData = async () => { + try { + const response = await fetch(RFQ_URL) + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`) + } + return await response.json() + } catch (error) { + console.error('Failed to fetch RFQ data:', error) + return [] + } +} + +module.exports = { fetchRfqData } diff --git a/packages/synapse-interface/utils/types/index.tsx b/packages/synapse-interface/utils/types/index.tsx index 8a46bc6727..64f4bee837 100644 --- a/packages/synapse-interface/utils/types/index.tsx +++ b/packages/synapse-interface/utils/types/index.tsx @@ -23,7 +23,7 @@ export type Chain = { } priorityRank?: number color?: string - new?: boolean + isNew?: boolean } export type PoolToken = { symbol: string From e45031f0d5189a41cbc7d5691d5820d917dea3b9 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Fri, 3 May 2024 19:59:54 -0400 Subject: [PATCH 08/10] Updates bridgeMap for live Scroll quotes --- .../synapse-interface/constants/bridgeMap.ts | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/packages/synapse-interface/constants/bridgeMap.ts b/packages/synapse-interface/constants/bridgeMap.ts index 8fdbc56453..52bafe0416 100644 --- a/packages/synapse-interface/constants/bridgeMap.ts +++ b/packages/synapse-interface/constants/bridgeMap.ts @@ -175,6 +175,13 @@ export const BRIDGE_MAP = { destination: ['VSTA'], swappable: [], }, + '0xAdF7C35560035944e805D98fF17d58CDe2449389': { + decimals: 18, + symbol: 'SPEC', + origin: ['SPEC'], + destination: ['SPEC'], + swappable: [], + }, '0xBAac2B4491727D78D2b78815144570b9f2Fe8899': { decimals: 18, symbol: 'DOG', @@ -1241,6 +1248,13 @@ export const BRIDGE_MAP = { '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', ], }, + '0x96419929d7949D6A801A6909c145C8EEf6A40431': { + decimals: 18, + symbol: 'SPEC', + origin: ['SPEC'], + destination: ['SPEC'], + swappable: [], + }, '0xEB466342C4d449BC9f53A865D5Cb90586f405215': { decimals: 6, symbol: 'axlUSDC', @@ -1776,7 +1790,22 @@ export const BRIDGE_MAP = { ], }, }, - '534352': {}, + '534352': { + '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4': { + origin: ['RFQ.USDC'], + destination: ['RFQ.USDC'], + swappable: [], + symbol: 'USDC', + decimals: 6, + }, + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { + origin: ['RFQ.ETH'], + destination: ['RFQ.ETH'], + swappable: [], + symbol: 'ETH', + decimals: 18, + }, + }, '1313161554': { '0x07379565cD8B0CaE7c60Dc78e7f601b34AF2A21c': { decimals: 18, From 5f7b8ff38edf21883fd0188c4944899063799a41 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Fri, 3 May 2024 21:14:12 -0400 Subject: [PATCH 09/10] For reusing NewTag --- packages/synapse-interface/components/ui/NewTag.tsx | 11 +++++++++++ .../components/ui/SelectSpecificNetworkButton.tsx | 11 +---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 packages/synapse-interface/components/ui/NewTag.tsx diff --git a/packages/synapse-interface/components/ui/NewTag.tsx b/packages/synapse-interface/components/ui/NewTag.tsx new file mode 100644 index 0000000000..3509c46a8d --- /dev/null +++ b/packages/synapse-interface/components/ui/NewTag.tsx @@ -0,0 +1,11 @@ +import { joinClassNames } from '@/utils/joinClassNames' + +export const NewTag = () => { + const className = joinClassNames({ + space: 'px-2 py-[2px] rounded-md', + border: 'border border-fuchsia-500', + background: 'bg-gradient-to-r from-fuchsia-950 to-purple-900', + font: 'text-sm ', + }) + return
New!
+} diff --git a/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx b/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx index 1839d5162e..79d5526cbe 100644 --- a/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx +++ b/packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx @@ -8,6 +8,7 @@ import { sortTokensByBalanceDescending, } from '@/utils/actions/fetchPortfolioBalances' import { joinClassNames } from '@/utils/joinClassNames' +import { NewTag } from '@/components/ui/NewTag' export const SelectSpecificNetworkButton = ({ itemChainId, @@ -150,13 +151,3 @@ function HoverIcon({ token }) { ) } - -const NewTag = () => { - const className = joinClassNames({ - space: 'px-2 py-[2px] rounded-md', - border: 'border border-fuchsia-500', - background: 'bg-gradient-to-r from-fuchsia-950 to-purple-900', - font: 'text-sm ', - }) - return
New!
-} From 3c106730ba558d7a801dfed39e75707277af4e58 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Thu, 9 May 2024 10:08:49 -0400 Subject: [PATCH 10/10] Adjust dates --- .../components/layouts/LandingPageWrapper/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx b/packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx index 5c406a770d..ff2365398f 100644 --- a/packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx +++ b/packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx @@ -53,8 +53,8 @@ export function LandingPageWrapper({ children }: { children: any }) {