Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Generalise swap router 02 address (#112)
Browse files Browse the repository at this point in the history
* Generalise swap router 02 address

* Update addresses.ts
  • Loading branch information
hensha256 authored Feb 13, 2024
1 parent 7dc06d5 commit 1ea7d56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
}

0 comments on commit 1ea7d56

Please sign in to comment.