Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 1.15 KB

injected.md

File metadata and controls

53 lines (41 loc) · 1.15 KB

web3-react Documentation - Injected

Install

yarn add @web3-react/injected-connector

Arguments

supportedChainIds?: number[]

Example

import { InjectedConnector } from '@web3-react/injected-connector'

const injected = new InjectedConnector({ supportedChainIds: [1, 3, 4, 5, 42] })

Errors

NoEthereumProviderError

Example

import { NoEthereumProviderError } from '@web3-react/injected-connector'

function Component () {
  const { error } = useWeb3React()
  const isNoEthereumProviderError = error instanceof NoEthereumProviderError
  // ...
}

UserRejectedRequestError

Example

import { UserRejectedRequestError } from '@web3-react/injected-connector'

function Component () {
  const { error } = useWeb3React()
  const isUserRejectedRequestError = error instanceof UserRejectedRequestError
  // ...
}