UNPKG

@exromany/lido-csm-sdk

Version:

[![GitHub license](https://img.shields.io/github/license/lidofinance/lido-csm-sdk?color=limegreen)](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [![Version npm](https://img.shields.io/npm/v/@lidofinance/lido-csm-sdk?label=version)](h

26 lines 1.19 kB
import { OperatorCurveIdChange } from '../events-sdk/types.js'; /** * Gets the operator's curve ID that was active at a specific block number. * * This function looks through the historical curve ID changes and finds the most recent * curve ID change that occurred at or before the specified block number. * * @param blockNumber - The block number to find the curve ID for * @param curveIdChanges - Array of historical curve ID changes, should be sorted by block number * @param defaultCurveId - The default curve ID to use if no changes found * @returns The curve ID that was active at the specified block * * @example * ```ts * const curveIdChanges = [ * { curveId: 1n, blockNumber: 100n }, * { curveId: 2n, blockNumber: 200n }, * ]; * * getOperatorCurveIdByBlock(150n, curveIdChanges, 0n); // Returns 1n * getOperatorCurveIdByBlock(250n, curveIdChanges, 0n); // Returns 2n * getOperatorCurveIdByBlock(50n, curveIdChanges, 0n); // Returns 0n (default) * ``` */ export declare const getOperatorCurveIdByBlock: (blockNumber: bigint, curveIdChanges: OperatorCurveIdChange[], defaultCurveId: bigint) => bigint; //# sourceMappingURL=get-operator-curve-id.d.ts.map