Manifold Ethereum Provider

This section is for advanced users only. If you are just working on frontend integration, you can skip right to the Connect Widget documentation.

Overview

The Manifold Ethereum Provider is a wrapper around ethers.js that provides a number of convenience APIs for chain detection, wallet detection and automated provider switching (it will use the injected browser provider whenever possible).

The Manifold Ethereum Provider is instantiated by the Connect Widget

Making Use of the Manifold Ethereum Provider

Step 1: Creation

Add the Connect Widget to your page. This will instantiate the Manifold Ethereum Provider.

Step 2: Initialization

Wait for Manifold Ethereum Provider to finish initialization. You can do this by using the detectManifoldEthereumProvider function found in the @manifoldxyz/frontend-provider-utils npm package

Once initialized, you will have access to the Manifold Ethereum Provider via window.ManifoldEthereumProvider

Step 3: Usage

You can find all the functionality that Manifold Ethereum Provider gives you by looking at the @manifoldxyz/frontend-provider-types package.

import { EthereumProvider } from @manifoldxyz/frontend-provider-types

declare global {
  interface Window {
    ManifoldEthereumProvider: typeof EthereumProvider;
  }
}

// Access the ManifoldEthereumProvider via window.ManifoldEthereumProvider

Last updated