Description

Represents a Metamask wallet.

Example

import { createProvider, MetamaskProvider } from '@rarimo/provider'

const getMetamaskWalletAddress = async () => {
// Connect to the Metamask wallet in the browser using Web3.js, 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

Implements

Constructors

Properties

address?: string
chainId?: ChainId
emitter: EventEmitter<ProviderEventMap> = ...
provider: Web3Provider
rawProvider: RawProvider

Accessors

  • get defaultEventPayload(): {
        address: undefined | string;
        chainId: undefined | ChainId;
        isConnected: boolean;
    }
  • Returns {
        address: undefined | string;
        chainId: undefined | ChainId;
        isConnected: boolean;
    }

    • address: undefined | string
    • chainId: undefined | ChainId
    • isConnected: boolean

Methods

Generated using TypeDoc