UNPKG

viem-tracer

Version:

[![npm package][npm-img]][npm-url] [![Build Status][build-img]][build-url] [![Downloads][downloads-img]][downloads-url] [![Issues][issues-img]][issues-url] [![Commitizen Friendly][commitizen-img]][commitizen-url] [![Semantic Release][semantic-release-img]

35 lines (34 loc) 1.99 kB
import { type Address, type Hex } from "viem"; import type { RpcCallTrace, RpcLogTrace } from "./actions/traceCall"; export interface TraceFormatConfig { /** * Whether to trace gas with each call. Defaults to `false`. */ gas?: boolean; /** * Whether to trace raw step with each call. Defaults to `false`. */ raw?: boolean; /** * Whether to show full arguments for each call. Defaults to `false`. */ fullArgs?: boolean; } export interface SignaturesCache { events: Record<Hex, string>; functions: Record<Hex, string>; } export declare const getSignaturesCachePath: () => string; export declare const loadSignaturesCache: () => SignaturesCache; export declare const getSelector: (input: Hex) => `0x${string}`; export declare const getCallTraceUnknownFunctionSelectors: (trace: RpcCallTrace, signatures: SignaturesCache) => string; export declare const getCallTraceUnknownEventSelectors: (trace: RpcCallTrace, signatures: SignaturesCache) => string; export declare const getIndentLevel: (level: number, index?: boolean) => string; export declare const formatAddress: (address: Address) => string; export declare const formatHex: (hex: Hex) => string; export declare const formatInt: (value: bigint | number) => string; export declare const formatArg: (arg: unknown, level: number, config: Partial<TraceFormatConfig>) => string; export declare const formatCallSignature: (trace: RpcCallTrace, config: Partial<TraceFormatConfig>, level: number, signatures: SignaturesCache) => string; export declare const formatCallLog: (log: RpcLogTrace, level: number, signatures: SignaturesCache, config: Partial<TraceFormatConfig>) => string; export declare const formatCallTrace: (trace: RpcCallTrace, config?: Partial<TraceFormatConfig>, signatures?: SignaturesCache, level?: number) => string; export declare function formatFullTrace(trace: RpcCallTrace, config?: Partial<TraceFormatConfig>, signatures?: SignaturesCache): Promise<string>;