Description

Represents a browser-based wallet.

To connect to a wallet, create an object to represent the wallet to access with the createProvider() method. These wallet objects implement the Provider interface so you can access different types of wallets in a consistent way.

Example

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

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

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

Hierarchy

  • Provider

Implements

Constructors

Properties

proxyConstructor: ProviderProxyConstructor
selectedProvider?: PROVIDERS
chainsDetails?: Record<ChainId, Chain>

Accessors

Methods

  • Parameters

    • message: string

    Returns Promise<string>

Generated using TypeDoc