import { EvmBlockHeader, EvmLog, EvmStateDiff, EvmStateDiffBase, EvmTraceBase, EvmTraceCallAction, EvmTraceCallResult, EvmTraceCreateAction, EvmTraceCreateResult, EvmTraceRewardAction, EvmTraceSuicideAction, EvmTransaction } from './evm'; type Simplify = { [K in keyof T]: T[K]; } & {}; type Selector = { [P in Exclude]?: boolean; }; type AddPrefix = `${Prefix}${Capitalize}`; export type BlockRequiredFields = 'height' | 'hash' | 'parentHash'; export type TransactionRequiredFields = 'transactionIndex'; export type LogRequiredFields = 'logIndex' | 'transactionIndex'; export type TraceRequiredFields = 'transactionIndex' | 'traceAddress' | 'type'; export type StateDiffRequiredFields = 'transactionIndex' | 'address' | 'key'; export interface FieldSelection { block?: Selector; transaction?: Selector; log?: Selector; trace?: Selector | AddPrefix<'createResult', keyof EvmTraceCreateResult> | AddPrefix<'call', keyof EvmTraceCallAction> | AddPrefix<'callResult', keyof EvmTraceCallResult> | AddPrefix<'suicide', keyof EvmTraceSuicideAction> | AddPrefix<'reward', keyof EvmTraceRewardAction>, TraceRequiredFields>; stateDiff?: Selector; } export declare const DEFAULT_FIELDS: { readonly block: { readonly timestamp: true; }; readonly log: { readonly address: true; readonly topics: true; readonly data: true; }; readonly transaction: { readonly from: true; readonly to: true; readonly hash: true; }; readonly trace: { readonly error: true; }; readonly stateDiff: { readonly kind: true; readonly next: true; readonly prev: true; }; }; type DefaultFields = typeof DEFAULT_FIELDS; type ExcludeUndefined = { [K in keyof T as undefined extends T[K] ? never : K]: T[K]; } & {}; type MergeDefault = Simplify> & ExcludeUndefined>; type TrueFields = keyof { [K in keyof F as true extends F[K] ? K : never]: true; }; type GetFields = TrueFields>; type Select = T extends any ? Simplify>> : never; export type BlockHeader = Simplify<{ id: string; } & Pick & Select>>; export type Transaction = Simplify<{ id: string; } & Pick & Select> & { block: BlockHeader; logs: Log[]; traces: Trace[]; stateDiffs: StateDiff[]; }>; export type Log = Simplify<{ id: string; } & Pick & Select> & { block: BlockHeader; transaction?: Transaction; getTransaction(): Transaction; }>; type RemovePrefix = T extends `${Prefix}${infer S}` ? Uncapitalize : never; export type TraceCreateAction = Select>>; export type TraceCreateResult = Select>>; export type TraceCallAction = Select>>; export type TraceCallResult = Select>>; export type TraceSuicideAction = Select>>; export type TraceRewardAction = Select>>; type TraceBase = Pick> & Select> & { block: BlockHeader; transaction?: Transaction; getTransaction(): Transaction; parent?: Trace; getParent(): Trace; children: Trace[]; }; type RemoveEmptyObjects = { [K in keyof T as {} extends T[K] ? never : K]: T[K]; }; export type TraceCreate = Simplify & { type: 'create'; } & RemoveEmptyObjects<{ action: TraceCreateAction; result?: TraceCreateResult; }>>; export type TraceCall = Simplify & { type: 'call'; } & RemoveEmptyObjects<{ action: TraceCallAction; result?: TraceCallResult; }>>; export type TraceSuicide = Simplify & { type: 'suicide'; } & RemoveEmptyObjects<{ action: TraceSuicideAction; }>>; export type TraceReward = Simplify & { type: 'reward'; } & RemoveEmptyObjects<{ action: TraceRewardAction; }>>; export type Trace = TraceCreate | TraceCall | TraceSuicide | TraceReward; export type StateDiff = Simplify> & { block: BlockHeader; transaction?: Transaction; getTransaction(): Transaction; }>; export type BlockData = { header: BlockHeader; transactions: Transaction[]; logs: Log[]; traces: Trace[]; stateDiffs: StateDiff[]; }; export type AllFields = { block: Trues; transaction: Trues; log: Trues; trace: Trues; stateDiff: Trues; }; type Trues = { [K in keyof Exclude]-?: true; }; export {}; //# sourceMappingURL=data.d.ts.map