Skip to content

Commit

Permalink
feat: in case of unsupported network - connect to Harmony Mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
msvstj committed Aug 16, 2023
1 parent efacfc3 commit b4e66f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/constants/chains.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainId, SUPPORTED_CHAINS, SupportedChainsType } from '@uniswap/sdk-core'
import { ChainId, SupportedChainsType } from '@uniswap/sdk-core'

export const UniWalletSupportedChains = [ChainId.MAINNET, ChainId.ARBITRUM_ONE, ChainId.OPTIMISM, ChainId.POLYGON]

Expand Down Expand Up @@ -31,7 +31,10 @@ export function isSupportedChain(
if (featureFlags && chainId && chainId in featureFlags) {
return featureFlags[chainId]
}
return !!chainId && SUPPORTED_CHAINS.indexOf(chainId) !== -1 && NOT_YET_UX_SUPPORTED_CHAIN_IDS.indexOf(chainId) === -1
// return !!chainId && SUPPORTED_CHAINS.indexOf(chainId) !== -1 && NOT_YET_UX_SUPPORTED_CHAIN_IDS.indexOf(chainId) === -1
// UPDATE: due to external fetch selecting currently supported network
// TODO: patch the supported netwok SDK library.
return chainId == ChainId.HARMONY
}

export function asSupportedChain(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default function SwapPage({ className }: { className?: string }) {
<PageWrapper>
<Swap
className={className}
chainId={supportedChainId ?? ChainId.MAINNET}
chainId={supportedChainId ?? ChainId.HARMONY}
prefilledState={{
[Field.INPUT]: { currencyId: loadedUrlParams?.[Field.INPUT]?.currencyId },
[Field.OUTPUT]: { currencyId: loadedUrlParams?.[Field.OUTPUT]?.currencyId },
Expand Down

0 comments on commit b4e66f4

Please sign in to comment.