Provider

A simple wrapper over ethers.js JsonRpcProvider with the ability to re-route bundler methods.

By default userop.js assumes both bundler and node methods share the same RPC url. However, this may not always be the case. This module is a simple wrapper over ethers.js JsonRpcProvider with the added ability to override the bundler RPC. This allows all bundler RPC methods to be re-routed to a different endpoint.

View the source code on GitHub.


BundlerJsonRpcProvider

import { BundlerJsonRpcProvider } from "userop";

// provider will have the same interface as a regular JsonRpcProvider.
const provider = new BundlerJsonRpcProvider(rpcUrl).setBundlerRpc(config.overrideBundlerRpc);