@lidofinance/eth-api-providers
v0.46.0
Published
Wraps JsonRpcProvider to track requests to RPC
Downloads
1,313
Readme
@lidofinance/eth-api-providers
Wraps JsonRpcProvider to track requests to RPC.
Installation
yarn add @lidofinance/eth-api-providers
Getting started
You just need to pass a few extra parameters to the used JsonRpcProvider, and you will get a patched class.
import {
providerFactory,
StaticJsonRpcBatchProvider,
} from '@lidofinance/eth-providers';
import { trackedJsonRpcProvider } from '@lidofinance/eth-api-providers';
import { registry } from './metrics';
import { METRICS_PREFIX } from '../config';
export const getStaticRpcBatchProvider = providerFactory(
trackedJsonRpcProvider({
prefix: METRICS_PREFIX,
registry,
Provider: StaticJsonRpcBatchProvider,
}),
);