@exromany/lido-csm-sdk
Version:
[](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [](h
16 lines • 1.61 kB
TypeScript
import { Block } from 'viem';
import { FrameConfig } from './types.js';
/**
* Safety buffer in blocks for slot-to-block estimation (~33 hours at 12s/block).
* Accounts for missed slots and clock drift when querying events by estimated block range.
*/
export declare const ESTIMATED_BLOCK_GAP = 10000n;
export declare const slotToTimestamp: (slot: number | bigint, { secondsPerSlot, genesisTime, }: Pick<FrameConfig, "secondsPerSlot" | "genesisTime">) => number;
export declare const timestampToSlot: (timestamp: number | bigint, { genesisTime, secondsPerSlot, }: Pick<FrameConfig, "genesisTime" | "secondsPerSlot">) => bigint;
export declare const slotToEpoch: (slot: number | bigint, { slotsPerEpoch }: Pick<FrameConfig, "slotsPerEpoch">) => bigint;
export declare const epochToSlot: (epoch: number | bigint, { slotsPerEpoch }: Pick<FrameConfig, "slotsPerEpoch">) => bigint;
export declare const epochToTimestamp: (epoch: number | bigint, config: Pick<FrameConfig, "slotsPerEpoch" | "secondsPerSlot" | "genesisTime">) => number;
export declare const getSlotsPerFrame: ({ epochsPerFrame, slotsPerEpoch, }: Pick<FrameConfig, "epochsPerFrame" | "slotsPerEpoch">) => bigint;
export declare const getFrameDuration: ({ epochsPerFrame, slotsPerEpoch, secondsPerSlot, }: Pick<FrameConfig, "epochsPerFrame" | "secondsPerSlot" | "slotsPerEpoch">) => number;
export declare const slotToApproximateBlockNumber: (slot: number | bigint, config: Pick<FrameConfig, "secondsPerSlot" | "genesisTime">, currentBlock: Pick<Block<bigint, false, "latest">, "number" | "timestamp">) => bigint;
//# sourceMappingURL=utils.d.ts.map