Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Connector
    • MetaMask

Index

Constructors

Properties

Methods

Constructors

constructor

  • new MetaMask(actions: Actions, connectEagerly?: boolean, options?: Parameters<typeof detectEthereumProvider>[0]): MetaMask
  • Parameters

    • actions: Actions
    • Default value connectEagerly: boolean = true

      A flag indicating whether connection should be initiated when the class is constructed.

    • Optional options: Parameters<typeof detectEthereumProvider>[0]

      Options to pass to @metamask/detect-provider

    Returns MetaMask

Properties

Protected Readonly actions

actions: Actions

provider

provider: Provider | undefined

An EIP-1193 (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md) and EIP-1102 (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md) compliant provider. May also comply with EIP-3085 (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3085.md). This property must be defined while the connector is active.

Methods

activate

  • Initiates a connection.

    Parameters

    • Optional desiredChainIdOrChainParameters: number | AddEthereumChainParameter

      If defined, indicates the desired chain to connect to. If the user is already connected to this chain, no additional steps will be taken. Otherwise, the user will be prompted to switch to the chain, if one of two conditions is met: either they already have it added in their extension, or the argument is of type AddEthereumChainParameter, in which case the user will be prompted to add the chain with the specified parameters first, before being prompted to switch.

    Returns Promise<void>

deactivate

  • deactivate(...args: unknown[]): Promise<void> | void
  • Initiate a disconnect.

    Parameters

    • Rest ...args: unknown[]

    Returns Promise<void> | void

Legend

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

Generated using TypeDoc