Description

Represents a Metamask wallet.

Example

import { createProvider } from '@rarimo/provider'
import { MetamaskProvider } from '@rarimo/providers-evm'

const getMetamaskWalletAddress = async () => {
// Connect to the Metamask wallet in the browser, using the MetamaskProvider interface to limit bundle size.
const provider = await createProvider(MetamaskProvider)
await provider.connect()

// Get the address of the wallet
console.log(provider.address)
}

Hierarchy

  • BaseEVMProvider
    • MetamaskProvider

Implements

  • ProviderProxy

Constructors

Properties

#address?: string
#chainId?: ChainId
#private: any
#provider: Web3Provider

Accessors

  • get emitter(): EventEmitter<ProviderEventMap>
  • Returns EventEmitter<ProviderEventMap>

Methods

  • Parameters

    • chain: Chain

    Returns Promise<void>

  • Returns void

  • Parameters

    • event: ProviderEventBusEvents
    • payload: ProviderEventPayload

    Returns void

  • Parameters

    • chain: Chain
    • address: string

    Returns string

  • Parameters

    • chain: Chain
    • txHash: string

    Returns string

  • Parameters

    • cb: ProviderEventCallback

    Returns void

  • Parameters

    • cb: ProviderEventCallback

    Returns void

  • Parameters

    • cb: ProviderEventCallback

    Returns void

  • Parameters

    • cb: ProviderEventCallback

    Returns void

  • Parameters

    • cb: ProviderEventCallback

    Returns void

  • Parameters

    • tx: TransactionRequestBody

    Returns Promise<TransactionResponse>

  • Parameters

    • chainId: ChainId

    Returns Promise<void>

Generated using TypeDoc