For the complete documentation index, see llms.txt. This page is also available as Markdown.

EthersProvider

Provider adapter that wraps an ethers Provider or EIP-1193 source for read-only chain access.

Provider adapter that wraps an ethers Provider or EIP-1193 source for read-only chain access. Implements GenericProvider.

Import

import { EthersProvider } from "@zama-fhe/sdk/ethers";

Usage

import { JsonRpcProvider } from "ethers";
import { EthersProvider } from "@zama-fhe/sdk/ethers";

const ethersProvider = new JsonRpcProvider("https://sepolia.infura.io/v3/YOUR_KEY");
const provider = new EthersProvider({ provider: ethersProvider });
import { EthersProvider } from "@zama-fhe/sdk/ethers";

const provider = new EthersProvider({ ethereum: window.ethereum! });

You rarely need to instantiate EthersProvider directly. The ethers createConfig builds one from the configuration you pass. Use this class when constructing ZamaSDK manually or when using the generic createConfig.

Constructor

Pass exactly one of the two parameters below.

provider

ethers.Provider

Pre-built ethers provider (e.g. JsonRpcProvider, WebSocketProvider).


ethereum

EIP1193Provider

Raw EIP-1193 provider from the browser wallet. The adapter wraps it in a BrowserProvider internally.

Methods

All methods are inherited from GenericProvider.

Last updated