Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ NEXT_PUBLIC_PROGRAMMABLE_SEARCH_ENGINE_ID=004538121411474993797:xkl3sdy-9su
NEXT_PUBLIC_TRAVELOGGERS_URL=https://nft-develop.matters.news
NEXT_PUBLIC_LOGBOOKS_URL=https://logbooks-vercel.matters.news
NEXT_PUBLIC_ALCHEMY_KEY=1dMo8xjAFo8M6Y4sQ45WTD3Zie2-MA4C
NEXT_PUBLIC_USDT_CONTRACT_ADDRESS=0xfe4F5145f6e09952a5ba9e956ED0C25e3Fa4c7F1
NEXT_PUBLIC_USDT_CONTRACT_ADDRESS=0xc2132D05D31c914a87C6611C10748AEb04B58e8F
NEXT_PUBLIC_CURATION_CONTRACT_ADDRESS=0xa219c6722008aa22828b31a13ab9ba93bb91222c
DEBUG=false
13 changes: 8 additions & 5 deletions src/common/utils/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Chain, configureChains, createClient, createStorage } from 'wagmi'
import { goerli, mainnet, polygon, polygonMumbai } from 'wagmi/chains'
import { goerli, mainnet, polygon } from 'wagmi/chains'
import { MetaMaskConnector } from 'wagmi/connectors/metaMask'
import { WalletConnectConnector } from 'wagmi/connectors/walletConnect'
import { alchemyProvider } from 'wagmi/providers/alchemy'
Expand All @@ -10,13 +10,16 @@ const isProd = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'production'
const alchemyId = process.env.NEXT_PUBLIC_ALCHEMY_KEY!

export const featureSupportedChains = {
curation: isProd ? [polygon] : [polygonMumbai],
curation: isProd ? [polygon] : [polygon],
ens: isProd ? [mainnet] : [goerli],
}

const defaultChains: Chain[] = isProd
? [mainnet, polygon]
: [goerli, polygonMumbai]
const defaultChains: Chain[] = isProd ? [mainnet, polygon] : [goerli, polygon]

// FIXME: make contract wallet (e.g. UniPass) default chain as
// Polygon Mainnet for signing since most of the wallet providers help user
// to deplopy contract on Polygon Mainnet free of charge.
export const walletConnectConnectChain = polygon

export const { provider: wagmiProvider, chains } = configureChains(
defaultChains,
Expand Down
7 changes: 5 additions & 2 deletions src/components/Forms/WalletAuthForm/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl'
import { useAccount, useConnect, useDisconnect } from 'wagmi'

import { EXTERNAL_LINKS, GUIDE_LINKS } from '~/common/enums'
import { analytics } from '~/common/utils'
import { analytics, walletConnectConnectChain } from '~/common/utils'
import {
Dialog,
Form,
Expand Down Expand Up @@ -236,7 +236,10 @@ const Select: React.FC<FormProps> = ({
analytics.trackEvent('click_button', {
type: 'connectorWalletConnect',
})
connect({ connector: walletConnectConnector })
connect({
connector: walletConnectConnector,
chainId: walletConnectConnectChain.id,
})
}}
role="button"
right={isWalletConnectLoading ? <IconSpinner16 color="grey" /> : null}
Expand Down