diff --git a/site/messages/en.json b/site/messages/en.json index 0cab9d7..45b460a 100644 --- a/site/messages/en.json +++ b/site/messages/en.json @@ -39,7 +39,7 @@ "error-no-ethereum-provider": "No Ethereum browser extension detected, install MetaMask on desktop or visit from a dApp browser on mobile.", "error-rejected-wallet-connection": "Please authorize this website to access your Ethereum account.", "error-unknown": "An unknown error occurred.", - "error-unsupported-network": "You're connected to an unsupported network. Switch to Ethereum (net id: 1).", + "error-unsupported-network": "You're connected to an unsupported network.", "error": "Error", "estimated-tx-fee": "Estimated network fee", "floored": "Floored", diff --git a/site/messages/zh.json b/site/messages/zh.json index 7f59096..fd49729 100644 --- a/site/messages/zh.json +++ b/site/messages/zh.json @@ -39,7 +39,7 @@ "error-no-ethereum-provider": "未检测到以太坊浏览器扩展,请在桌面上安装 MetaMask 或从移动设备上的 dApp 浏览器访问。", "error-rejected-wallet-connection": "请授权本网站访问您的以太坊账户。", "error-unknown": "出现未知错误。", - "error-unsupported-network": "您连接到不受支持的网络。切换到以太坊(网络 ID:1)。", + "error-unsupported-network": "您连接到不受支持的网络。", "error": "错误", "estimated-tx-fee": "预估网络费用", "floored": "有地板的", diff --git a/site/utils/connectors.js b/site/utils/connectors.js index e85df69..aa2493c 100644 --- a/site/utils/connectors.js +++ b/site/utils/connectors.js @@ -1,13 +1,18 @@ import { InjectedConnector } from '@web3-react/injected-connector' import { WalletLinkConnector } from '@web3-react/walletlink-connector' +import utilsConfig from './utilsConfig.json' + +const supportedChainIds = Object.keys(utilsConfig).map(k => Number.parseInt(k)) + const environment = process.env.NEXT_PUBLIC_ENVIRONMENT const nodeUrl = process.env.NEXT_PUBLIC_NODE_URL export const injected = new InjectedConnector({ - supportedChainIds: [43111, 743111] + supportedChainIds }) export const walletlink = new WalletLinkConnector({ - url: nodeUrl, - appName: `Pure Finance${environment ? ` ${environment}` : ''}` + appName: `Pure Finance${environment ? ` ${environment}` : ''}`, + supportedChainIds, + url: nodeUrl })