import { type Account, type Address, type BlockTag, type Chain, type Client, type ExactPartial, type FormattedTransactionRequest, type Hex, type RpcTransactionRequest, type Transport, type UnionOmit } from "viem"; export type TraceCallRpcSchema = { Method: "debug_traceCall"; Parameters: [ExactPartial, Hex | BlockTag] | [ ExactPartial, BlockTag | Hex, { tracer: "callTracer" | "prestateTracer"; tracerConfig?: { onlyTopCall?: boolean; withLog?: boolean; }; } ]; ReturnType: RpcCallTrace; }; export type RpcCallType = "CALL" | "STATICCALL" | "DELEGATECALL" | "CREATE" | "CREATE2" | "SELFDESTRUCT" | "CALLCODE"; export type RpcLogTrace = { address: Address; data: Hex; position: Hex; topics: [Hex, ...Hex[]]; }; export type RpcCallTrace = { from: Address; gas: Hex; gasUsed: Hex; to: Address; input: Hex; output: Hex; error?: string; revertReason?: string; calls?: RpcCallTrace[]; logs?: RpcLogTrace[]; value?: Hex; type: RpcCallType; }; export type TraceCallParameters = UnionOmit, "from"> & { account?: Account | Address | undefined; tracer?: "callTracer" | "prestateTracer"; tracerConfig?: { onlyTopCall?: boolean; }; } & ({ blockNumber?: bigint | undefined; blockTag?: undefined; } | { blockNumber?: undefined; blockTag?: BlockTag | undefined; }); /** * Traces a call. * * - JSON-RPC Methods: [`debug_traceCall`](https://www.quicknode.com/docs/ethereum/debug_traceCall) * * @param client - Client to use * @param parameters - {@link TraceCallParameters} * @returns The call trace. {@link RpcCallTrace} * * @example * import { createPublicClient, http, parseEther } from 'viem' * import { mainnet } from 'viem/chains' * import { traceCall } from 'viem-tracer' * * const client = createPublicClient({ * chain: mainnet, * transport: http(), * }) * const gasEstimate = await traceCall(client, { * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', * value: parseEther('1'), * }) */ export declare function traceCall(client: Client, { tracer, tracerConfig, ...args }: TraceCallParameters): Promise;