Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 1.33 KB

walletconnect.md

File metadata and controls

64 lines (50 loc) · 1.33 KB

web3-react Documentation - WalletConnect

Install

yarn add @web3-react/walletconnect-connector

Arguments

rpc: { [chainId: number]: string }
bridge?: string
qrcode?: boolean
pollingInterval?: number

Example

import { WalletConnectConnector } from '@web3-react/walletconnect-connector'

const walletconnect = new WalletConnectConnector({ rpc: { 1: '...' } })

Events

URI_AVAILABLE

Example

import { URI_AVAILABLE } from '@web3-react/walletconnect-connector'

function Component () {
  useEffect(() => {
    walletconnect.on(URI_AVAILABLE, uri => {
      // ...
    })
  })
  // ...
}

Errors

UserRejectedRequestError

Example

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.