yarn add @web3-react/walletconnect-connector
rpc: { [chainId: number]: string }
bridge?: string
qrcode?: boolean
pollingInterval?: number
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
const walletconnect = new WalletConnectConnector({ rpc: { 1: '...' } })
import { URI_AVAILABLE } from '@web3-react/walletconnect-connector'
function Component () {
useEffect(() => {
walletconnect.on(URI_AVAILABLE, uri => {
// ...
})
})
// ...
}
import { UserRejectedRequestError } from '@web3-react/walletconnect-connector'
function Component () {
const { error } = useWeb3React()
const isUserRejectedRequestError = error instanceof UserRejectedRequestError
// ...
}
Note: Once the connector has been activated, the WalletConnect provider can be accessed under the .walletConnectProvider
property.