import type { providers } from 'ethers'; import { EvmWarpRouteReader } from '../token/EvmWarpRouteReader.js'; export declare const REPLAY_FIXTURE_DIR: URL; export declare const REPLAY_CHAIN_NAME = "replaychain"; export interface JsonRpcErrorBody { code: number; message: string; data?: unknown; } export interface RecordedRequest { method: string; address?: string; slot?: string; to?: string; data?: string; result?: string; resultGzBase64?: string; error?: JsonRpcErrorBody; } export interface ReplayFixture { scenario: string; chain: string; chainId: number; blockNumber: number; capturedAt: string; requests: RecordedRequest[]; } export declare function serializeReplayFixture(fixture: ReplayFixture): string; export declare function parseReplayFixture(text: string): ReplayFixture; export declare function loadReplayFixture(scenario: string): ReplayFixture; export declare function recordedResult(request: RecordedRequest): string | undefined; export declare function recordedCode(fixture: ReplayFixture, address: string): string | undefined; /** * Derives a variant of a recording by replacing the recorded response of the * eth_call to `to` with calldata starting with `dataPrefix`. Variants are * synthetic: only the replaced response is not a recording. */ export declare function withCallResult(fixture: ReplayFixture, to: string, dataPrefix: string, result: string): ReplayFixture; /** * Derives a variant of a recording by replacing the recorded response of the * eth_call to `to` with calldata starting with `dataPrefix` by a JSON-RPC * error. */ export declare function withCallError(fixture: ReplayFixture, to: string, dataPrefix: string, error: JsonRpcErrorBody): ReplayFixture; /** * Derives a variant of a recording whose storage `slot` at `address` reads as * `value`, adding the read when it was not recorded. */ export declare function withStorage(fixture: ReplayFixture, address: string, slot: string, value: string): ReplayFixture; /** * Derives a variant of a recording whose contract code at `address` has * `hexSuffix` appended. */ export declare function withCodeSuffix(fixture: ReplayFixture, address: string, hexSuffix: string): ReplayFixture; export interface ReplayServer { url: string; ethCalls: string[]; unexpected: string[]; close(): Promise; } /** * Serves the recorded JSON-RPC responses (results and error bodies exactly as * recorded). Requests without a recording are answered with an error and listed * in `unexpected`. */ export declare function startReplayServer(fixture: ReplayFixture): Promise; export interface RecordingServer { url: string; fixture: ReplayFixture; failures: string[]; close(): Promise; } /** * Forwards requests to a real node and records the eth_getCode, * eth_getStorageAt, eth_call and eth_estimateGas responses. */ export declare function startRecordingServer(upstreamUrl: string, meta: Pick): Promise; export declare function createReplayReader(rpcUrl: string, chainId: number): { reader: EvmWarpRouteReader; provider: providers.Provider; }; //# sourceMappingURL=replayRpc.d.ts.map