import { EthqlContext, EthqlServiceDefinition } from '@ethql/base'; import { EthqlLog, EthqlTransaction } from '../../model'; declare module '@ethql/base' { interface EthqlServices { decoder: DecodingEngine; } interface EthqlServiceDefinitions { decoder: EthqlServiceDefinition<{ decoders: Array>; }, DecodingEngine>; } } declare type Entity = 'token' | undefined; export declare type AbiDecoder = { decodeMethod: Function; decodeLogs: Function; }; /** * A definition for a transaction decoder, where TxBindings is a dictionary of ABI * function names mapped to their decoded types, and txTransformers is a dictionary of * functions that transform the raw transaction into a typed transaction, for each function * in the ABI. */ export interface DecoderDefinition { readonly entity: Entity; readonly standard: string; readonly abiDecoder: AbiDecoder; readonly txTransformers: { [P in keyof TxBindings]: (decoded: any, tx: EthqlTransaction, context: EthqlContext) => TxBindings[P]; }; readonly logTransformers: { [P in keyof LogBindings]: (decoded: any, tx: EthqlTransaction, context: EthqlContext) => LogBindings[P]; }; } /** * A decoded transaction. */ export declare type DecodedTransaction = { entity: Entity; standard: string; operation: string; __typename: string; }; /** * A decoded log. */ export declare type DecodedLog = { entity: Entity; standard: string; event: string; }; /** * A decoding engine. */ export declare type DecodingEngine = { register: (decoder: DecoderDefinition) => void; decodeTransaction(tx: EthqlTransaction, context: EthqlContext): DecodedTransaction; decodeLog(tx: EthqlLog, context: EthqlContext): DecodedLog; }; /** * * @param params * @param name */ export declare function extractParamValue(params: [any], name: string): any; export declare function createAbiDecoder(path: string): AbiDecoder; export {}; //# sourceMappingURL=index.d.ts.map