From 1ea7d563d49c3b21d5a756fe343302fc50f12f5b Mon Sep 17 00:00:00 2001 From: Alice <34962750+hensha256@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:40:18 -0300 Subject: [PATCH] Generalise swap router 02 address (#112) * Generalise swap router 02 address * Update addresses.ts --- src/addresses.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/addresses.ts b/src/addresses.ts index 2c160a23..960264e5 100644 --- a/src/addresses.ts +++ b/src/addresses.ts @@ -310,8 +310,9 @@ export const MIXED_ROUTE_QUOTER_V1_ADDRESSES: AddressMap = SUPPORTED_CHAINS.redu }, {}) export const SWAP_ROUTER_02_ADDRESSES = (chainId: number) => { - if (chainId == ChainId.BNB) { - return CHAIN_TO_ADDRESSES_MAP[chainId].swapRouter02Address + if (chainId in SUPPORTED_CHAINS) { + const id = chainId as SupportedChainsType + return CHAIN_TO_ADDRESSES_MAP[id].swapRouter02Address ?? '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' } - return '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' + return '' }