import { AsyncOrSync } from 'ts-essentials'; import { OptimalSwapExchange } from '@paraswap/core'; import { SwapSide } from '../constants'; import { ExchangeTxInfo, GetDexParamOptions, NumberAsString, PreprocessTransactionOptions, Token } from '../types'; export type PreProcessTransactionFn = (optimalSwapExchange: OptimalSwapExchange, srcToken: Token, destToken: Token, side: SwapSide, options: PreprocessTransactionOptions) => AsyncOrSync<[OptimalSwapExchange, ExchangeTxInfo]>; export type GetDexParamPreProcessErrorCode = 'MISSING_CONTEXT' | 'INVALID_CONTEXT' | 'PREPROCESS_FAILED' | 'MISSING_DATA'; export declare class GetDexParamPreProcessError extends Error { dexKey: string; side: SwapSide; code: GetDexParamPreProcessErrorCode; originalError?: unknown | undefined; isGetDexParamPreProcessError: boolean; cause: string; constructor(dexKey: string, side: SwapSide, code: GetDexParamPreProcessErrorCode, message: string, originalError?: unknown | undefined); } export declare function unwrapPreProcessError(error: unknown): unknown; export declare function resolvePreProcessedData({ dexKey, data, side, isPreProcessed, preProcessTransaction, options, }: { dexKey: string; data: T; side: SwapSide; isPreProcessed: boolean; preProcessTransaction: PreProcessTransactionFn; options?: GetDexParamOptions; }): Promise<{ data: T; minDeadline?: NumberAsString; }>;