Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Account

Account: string

ConnectWallet

ConnectWallet: (opts?: Partial<ICoreOptions>) => Promise<State>

Type declaration

    • (opts?: Partial<ICoreOptions>): Promise<State>
    • Parameters

      • Optional opts: Partial<ICoreOptions>

      Returns Promise<State>

DisconnectWallet

DisconnectWallet: () => void

Type declaration

    • (): void
    • Returns void

FrameProvider

FrameProvider: (a: "frame", b?: FrameConnectorArguments) => Provider

Type declaration

State

State: { account: Account; network: Network; provider: Web3Provider; web3Modal: Web3Modal }

Type declaration

  • account: Account
  • network: Network
  • provider: Web3Provider
  • web3Modal: Web3Modal

UseWallet

UseWallet: () => Partial<State> & { connect: ConnectWallet; disconnect: DisconnectWallet }

Type declaration

Web3ReactHooks

Web3ReactHooks: ReturnType<typeof getStateHooks> & ReturnType<typeof getDerivedHooks> & ReturnType<typeof getAugmentedHooks>

Web3ReactPriorityHooks

Web3ReactPriorityHooks: ReturnType<typeof getPriorityConnector>

Web3ReactSelectedHooks

Web3ReactSelectedHooks: ReturnType<typeof getSelectedConnector>

Web3ReactStateUpdate

Web3ReactStateUpdate: { accounts: string[]; chainId: number } | { accounts?: undefined; chainId: number } | { accounts: string[]; chainId?: undefined }

Web3ReactStore

Web3ReactStore: StoreApi<Web3ReactState>

url

url: string | ConnectionInfo

Variables

Const useStore

useStore: UseBoundStore<Partial<State>, StoreApi<Partial<State>>> = create<Partial<State>>((_set) => ({web3Modal: typeof window !== 'undefined' ? new Web3Modal() : undefined,}))

Functions

Const ACCOUNTS

  • ACCOUNTS(state: Web3ReactState): undefined | string[]

Const ACCOUNTS_EQUALITY_CHECKER

  • ACCOUNTS_EQUALITY_CHECKER(oldAccounts: undefined | string[], newAccounts: undefined | string[]): boolean

Const ACTIVATING

  • ACTIVATING(state: Web3ReactState): boolean

Const CHAIN_ID

  • CHAIN_ID(state: Web3ReactState): undefined | number

Const ERROR

  • ERROR(state: Web3ReactState): undefined | Error

computeIsActive

  • computeIsActive(__namedParameters: { accounts: undefined | string[]; activating: boolean; chainId: undefined | number; error: undefined | Error }): boolean
  • Parameters

    • __namedParameters: { accounts: undefined | string[]; activating: boolean; chainId: undefined | number; error: undefined | Error }
      • accounts: undefined | string[]
      • activating: boolean
      • chainId: undefined | number
      • error: undefined | Error

    Returns boolean

createWeb3ReactStoreAndActions

  • createWeb3ReactStoreAndActions(allowedChainIds?: number[]): [Web3ReactStore, Actions]

ensureChainIdIsAllowed

getAugmentedHooks

  • getAugmentedHooks<T>(connector: T, __namedParameters: { useAccounts: useAccounts; useChainId: useChainId; useError: useError }, __namedParameters: { useAccount: useAccount; useIsActive: useIsActive }): { useENSName: useENSName; useENSNames: useENSNames; useProvider: useProvider; useWeb3React: useWeb3React }

getDerivedHooks

getPriorityConnector

  • getPriorityConnector(...initializedConnectors: [Connector, Web3ReactHooks][]): { usePriorityAccount: usePriorityAccount; usePriorityAccounts: usePriorityAccounts; usePriorityChainId: usePriorityChainId; usePriorityConnector: usePriorityConnector; usePriorityENSName: usePriorityENSName; usePriorityENSNames: usePriorityENSNames; usePriorityError: usePriorityError; usePriorityIsActivating: usePriorityIsActivating; usePriorityIsActive: usePriorityIsActive; usePriorityProvider: usePriorityProvider; usePriorityWeb3React: usePriorityWeb3React; useSelectedAccount: useSelectedAccount; useSelectedAccounts: useSelectedAccounts; useSelectedChainId: useSelectedChainId; useSelectedENSName: useSelectedENSName; useSelectedENSNames: useSelectedENSNames; useSelectedError: useSelectedError; useSelectedIsActivating: useSelectedIsActivating; useSelectedIsActive: useSelectedIsActive; useSelectedProvider: useSelectedProvider; useSelectedWeb3React: useSelectedWeb3React }
  • Creates a variety of convenience hooks that return data associated with the first of the initializedConnectors that is active.

    Parameters

    • Rest ...initializedConnectors: [Connector, Web3ReactHooks][]

      Two or more [connector, hooks] arrays, as returned from initializeConnector.

    Returns { usePriorityAccount: usePriorityAccount; usePriorityAccounts: usePriorityAccounts; usePriorityChainId: usePriorityChainId; usePriorityConnector: usePriorityConnector; usePriorityENSName: usePriorityENSName; usePriorityENSNames: usePriorityENSNames; usePriorityError: usePriorityError; usePriorityIsActivating: usePriorityIsActivating; usePriorityIsActive: usePriorityIsActive; usePriorityProvider: usePriorityProvider; usePriorityWeb3React: usePriorityWeb3React; useSelectedAccount: useSelectedAccount; useSelectedAccounts: useSelectedAccounts; useSelectedChainId: useSelectedChainId; useSelectedENSName: useSelectedENSName; useSelectedENSNames: useSelectedENSNames; useSelectedError: useSelectedError; useSelectedIsActivating: useSelectedIsActivating; useSelectedIsActive: useSelectedIsActive; useSelectedProvider: useSelectedProvider; useSelectedWeb3React: useSelectedWeb3React }

    hooks - A variety of convenience hooks that wrap the hooks returned from initializeConnector.

    • usePriorityAccount: usePriorityAccount
    • usePriorityAccounts: usePriorityAccounts
    • usePriorityChainId: usePriorityChainId
    • usePriorityConnector: usePriorityConnector
    • usePriorityENSName: usePriorityENSName
    • usePriorityENSNames: usePriorityENSNames
    • usePriorityError: usePriorityError
    • usePriorityIsActivating: usePriorityIsActivating
    • usePriorityIsActive: usePriorityIsActive
    • usePriorityProvider: usePriorityProvider
    • usePriorityWeb3React: usePriorityWeb3React
    • useSelectedAccount: useSelectedAccount
    • useSelectedAccounts: useSelectedAccounts
    • useSelectedChainId: useSelectedChainId
    • useSelectedENSName: useSelectedENSName
    • useSelectedENSNames: useSelectedENSNames
    • useSelectedError: useSelectedError
    • useSelectedIsActivating: useSelectedIsActivating
    • useSelectedIsActive: useSelectedIsActive
    • useSelectedProvider: useSelectedProvider
    • useSelectedWeb3React: useSelectedWeb3React

getSelectedConnector

  • getSelectedConnector(...initializedConnectors: [Connector, Web3ReactHooks][]): { useSelectedAccount: useSelectedAccount; useSelectedAccounts: useSelectedAccounts; useSelectedChainId: useSelectedChainId; useSelectedENSName: useSelectedENSName; useSelectedENSNames: useSelectedENSNames; useSelectedError: useSelectedError; useSelectedIsActivating: useSelectedIsActivating; useSelectedIsActive: useSelectedIsActive; useSelectedProvider: useSelectedProvider; useSelectedWeb3React: useSelectedWeb3React }
  • Creates a variety of convenience hooks that return data associated with a particular passed connector.

    Parameters

    • Rest ...initializedConnectors: [Connector, Web3ReactHooks][]

      Two or more [connector, hooks] arrays, as returned from initializeConnector.

    Returns { useSelectedAccount: useSelectedAccount; useSelectedAccounts: useSelectedAccounts; useSelectedChainId: useSelectedChainId; useSelectedENSName: useSelectedENSName; useSelectedENSNames: useSelectedENSNames; useSelectedError: useSelectedError; useSelectedIsActivating: useSelectedIsActivating; useSelectedIsActive: useSelectedIsActive; useSelectedProvider: useSelectedProvider; useSelectedWeb3React: useSelectedWeb3React }

    hooks - A variety of convenience hooks that wrap the hooks returned from initializeConnector.

    • useSelectedAccount: useSelectedAccount
    • useSelectedAccounts: useSelectedAccounts
    • useSelectedChainId: useSelectedChainId
    • useSelectedENSName: useSelectedENSName
    • useSelectedENSNames: useSelectedENSNames
    • useSelectedError: useSelectedError
    • useSelectedIsActivating: useSelectedIsActivating
    • useSelectedIsActive: useSelectedIsActive
    • useSelectedProvider: useSelectedProvider
    • useSelectedWeb3React: useSelectedWeb3React

getStateHooks

initializeConnector

  • Wraps the initialization of a connector. Creates a zustand store with actions bound to it, and then passes these to the connector as specified in f. Also creates a variety of hooks bound to this store.

    Type parameters

    • T: Connector

      The type of the connector returned from f.

    Parameters

    • f: (actions: Actions) => T

      A function which is called with actions bound to the returned store.

        • (actions: Actions): T
        • Parameters

          • actions: Actions

          Returns T

    • Optional allowedChainIds: number[]

      An optional array of chainIds which the connector may connect to. If the connector is connected to a chainId which is not allowed, a ChainIdNotAllowedError error will be reported. If this argument is unspecified, the connector may connect to any chainId.

    Returns [T, Web3ReactHooks, Web3ReactStore]

    • The initialized connector, a variety of hooks, and a zustand store.

parseChainId

  • parseChainId(chainId: string): number

useENS

  • useENS(provider?: Web3Provider, accounts?: string[]): (string | null)[] | undefined
  • Parameters

    • Optional provider: Web3Provider
    • Optional accounts: string[]

    Returns (string | null)[] | undefined

Const useWallet

  • useWallet(): { account: undefined | string; connect: ConnectWallet; disconnect: DisconnectWallet; network: undefined | Network; provider: undefined | Web3Provider; web3Modal: undefined | Core }

validateAccount

  • validateAccount(account: string): string

validateChainId

  • validateChainId(chainId: number): void

Object literals

Const DEFAULT_STATE

DEFAULT_STATE: object

accounts

accounts: undefined = undefined

activating

activating: boolean = false

chainId

chainId: undefined = undefined

error

error: undefined = undefined

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Protected property
  • Static property

Generated using TypeDoc