From fbf623bc97fa8b274c4a5dc00f06b1e270b6fa1e Mon Sep 17 00:00:00 2001 From: Sam Bugs Date: Mon, 20 Jan 2025 16:51:39 -0300 Subject: [PATCH] feat: add sonic and zksync to many quote sources --- src/chains.ts | 18 ++++++++++++++++++ .../quotes/quote-sources/1inch-quote-source.ts | 1 + .../quote-sources/kyberswap-quote-source.ts | 2 ++ .../quotes/quote-sources/li-fi-quote-source.ts | 1 + .../quote-sources/magpie-quote-source.ts | 1 + .../quotes/quote-sources/odos-quote-source.ts | 2 ++ 6 files changed, 25 insertions(+) diff --git a/src/chains.ts b/src/chains.ts index 05ec75f5..9a2ef769 100644 --- a/src/chains.ts +++ b/src/chains.ts @@ -498,6 +498,24 @@ export const Chains = { publicRPCs: ['https://rpc.mantle.xyz', 'https://rpc.ankr.com/mantle', 'https://mantle.drpc.org'], explorer: 'https://explorer.mantle.xyz/', }, + SONIC: { + chainId: 146, + name: 'Sonic', + ids: ['sonic'], + nativeCurrency: { symbol: 'S', name: 'Sonic' }, + wToken: '0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38', + publicRPCs: ['https://sonic-rpc.publicnode.com', 'https://rpc.soniclabs.com', 'https://sonic.drpc.org'], + explorer: ' https://sonicscan.org/', + }, + ZK_SYNC_ERA: { + chainId: 324, + name: 'ZK Sync Era', + ids: ['zksync'], + nativeCurrency: { symbol: 'ETH', name: 'Ethereum' }, + wToken: '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', + publicRPCs: ['https://zksync.meowrpc.com', 'https://mainnet.era.zksync.io'], + explorer: 'https://explorer.zksync.io/', + }, ETHEREUM_GOERLI: { chainId: 5, name: 'Ethereum Goerli', diff --git a/src/services/quotes/quote-sources/1inch-quote-source.ts b/src/services/quotes/quote-sources/1inch-quote-source.ts index 7813bde8..9e9b2bce 100644 --- a/src/services/quotes/quote-sources/1inch-quote-source.ts +++ b/src/services/quotes/quote-sources/1inch-quote-source.ts @@ -21,6 +21,7 @@ export const ONE_INCH_METADATA: QuoteSourceMetadata = { Chains.KAIA.chainId, Chains.AURORA.chainId, Chains.BASE.chainId, + Chains.ZK_SYNC_ERA.chainId, ], swapAndTransfer: true, buyOrders: false, diff --git a/src/services/quotes/quote-sources/kyberswap-quote-source.ts b/src/services/quotes/quote-sources/kyberswap-quote-source.ts index 94256cc5..6782e0f7 100644 --- a/src/services/quotes/quote-sources/kyberswap-quote-source.ts +++ b/src/services/quotes/quote-sources/kyberswap-quote-source.ts @@ -25,6 +25,8 @@ const SUPPORTED_CHAINS: Record = { [Chains.SCROLL.chainId]: 'scroll', [Chains.BLAST.chainId]: 'blast', [Chains.MANTLE.chainId]: 'mantle', + [Chains.SONIC.chainId]: 'sonic', + [Chains.ZK_SYNC_ERA.chainId]: 'zksync', }; const KYBERSWAP_METADATA: QuoteSourceMetadata = { diff --git a/src/services/quotes/quote-sources/li-fi-quote-source.ts b/src/services/quotes/quote-sources/li-fi-quote-source.ts index 7b34f027..33a84c4d 100644 --- a/src/services/quotes/quote-sources/li-fi-quote-source.ts +++ b/src/services/quotes/quote-sources/li-fi-quote-source.ts @@ -38,6 +38,7 @@ const LI_FI_METADATA: QuoteSourceMetadata = { Chains.SCROLL.chainId, Chains.BLAST.chainId, Chains.MANTLE.chainId, + Chains.ZK_SYNC_ERA.chainId, ], swapAndTransfer: true, buyOrders: false, diff --git a/src/services/quotes/quote-sources/magpie-quote-source.ts b/src/services/quotes/quote-sources/magpie-quote-source.ts index 0c6f213b..5b777916 100644 --- a/src/services/quotes/quote-sources/magpie-quote-source.ts +++ b/src/services/quotes/quote-sources/magpie-quote-source.ts @@ -21,6 +21,7 @@ const SUPPORTED_CHAINS: Record = { [Chains.SCROLL.chainId]: 'scroll', [Chains.METIS_ANDROMEDA.chainId]: 'metis', [Chains.FANTOM.chainId]: 'fantom', + [Chains.SONIC.chainId]: 'sonic', }; const MAGPIE_METADATA: QuoteSourceMetadata = { diff --git a/src/services/quotes/quote-sources/odos-quote-source.ts b/src/services/quotes/quote-sources/odos-quote-source.ts index 33cb14b5..b6ad23c7 100644 --- a/src/services/quotes/quote-sources/odos-quote-source.ts +++ b/src/services/quotes/quote-sources/odos-quote-source.ts @@ -25,6 +25,8 @@ const ODOS_METADATA: QuoteSourceMetadata = { Chains.LINEA.chainId, Chains.MANTLE.chainId, Chains.SCROLL.chainId, + Chains.SONIC.chainId, + Chains.ZK_SYNC_ERA.chainId, ], swapAndTransfer: true, buyOrders: false,