import { LogParams, TransactionReceiptParams, TransactionResponseParams } from 'ethers/providers'; import { Addressable, BlockParams, Contract, ContractRunner, DeferredTopicFilter, Interface, InterfaceAbi, LogDescription, Result } from 'ethers'; import { ContractContext } from './context.js'; import { type EthCallContext, type EthCallParam } from '@sentio/protos'; export interface IResult { /** * Returns the Result as a normal Array. */ toArray(): Array; /** * Returns the Result as an Object with each name-value pair. */ toObject(): Record; } export type RawEvent = Record; export type TypedEventFilter<_TEvent extends TypedEvent> = DeferredTopicFilter; export interface RichBlock extends BlockParams { traces?: Trace[]; transactionReceipts?: TransactionReceiptParams[]; } export declare class SimpleEthersError extends Error { e: Error; constructor(message: string, e: Error, stack?: string); toString(): string; } export declare function transformEtherError(e: unknown, ctx: ContractContext | undefined, stack?: string): Error; export declare function fixEmptyKey(result: LogDescription): Result; export declare class FormattedLog implements LogParams { readonly raw: any; constructor(raw: any); get transactionHash(): string; get blockHash(): string; get blockNumber(): number; get removed(): boolean; _address: string; get address(): string; get topics(): readonly string[]; get transactionIndex(): number; get index(): number; get data(): string; } export declare class TypedEvent = any, TArgsObject = any> extends FormattedLog { readonly log: FormattedLog; readonly name: string; readonly args: TArgsObject & IResult; constructor(log: FormattedLog, name: string, args: TArgsObject & IResult); } export declare function formatEthData(data: { rawLog?: string; rawBlock?: string; rawTrace?: string; rawTransaction?: string; rawTransactionReceipt?: string; __formattedEthData?: any; }): any; export declare function formatTransactionResponse(value: any): TransactionResponseParams; export declare function formatRichBlock(block: RichBlock): RichBlock; export interface TypedCallTrace = any, TArgsObject = any> extends Trace { args: TArgsObject & IResult; name: string; functionSignature: string; } export interface Trace { action: TraceAction; blockHash: string; blockNumber: number; result: TraceResult; subtraces: number; traceAddress: number[]; transactionHash: string; transactionPosition: number; type: string; error?: string; } export interface TraceAction { from: string; to?: string; value: number; gas: number; input?: string; callType?: string; init?: string; address?: string; balance?: string; refundAddress?: string; } export interface TraceResult { gasUsed: number; output?: string; address?: string; code?: string; } export declare function isNullAddress(address: string): boolean; export declare function validateAndNormalizeAddress(address: string): string; export declare function encodeCallData(context: EthCallContext, name: string, funcABI: string, values?: ReadonlyArray): EthCallParam; export declare function newContract(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: ContractRunner | null | undefined): Contract; export declare function newInterface(fragments: InterfaceAbi): Interface; /** * Recursively drop `indexed: false` from ABI fragment objects. * * Upstream ethers' `ParamType.from` throws "parameter cannot be indexed" when a * non-event parameter (function/error/constructor input) carries an explicit * `indexed: false` — some real-world ABIs do. The retired @sentio/ethers fork * tolerated this; we replicate it here by stripping the redundant flag before the * ABI reaches ethers. Dropping `indexed: false` is safe: it is the default for * event params (non-indexed) and meaningless elsewhere; `indexed: true` is kept. */ export declare function sanitizeAbi(abi: InterfaceAbi): InterfaceAbi; //# sourceMappingURL=eth.d.ts.map