import { DexExchangeBuildParam } from '../types'; import { OptimalRate } from '@paraswap/core'; import { DepositWithdrawReturn } from '../dex/weth/types'; import { Executors, Flag } from './types'; import { DexCallDataParams, ExecutorBytecodeBuilder, SingleSwapCallDataParams } from './ExecutorBytecodeBuilder'; export type Executor01SingleSwapCallDataParams = {}; export type Executor01DexCallDataParams = {}; /** * Class to build bytecode for Executor01 - simpleSwap (SINGLE_STEP) with 100% on a path and multiSwap with 100% amounts on each path (HORIZONTAL_SEQUENCE) */ export declare class Executor01BytecodeBuilder extends ExecutorBytecodeBuilder { type: Executors; /** * Executor01 Flags: * switch (flag % 4): * case 0: don't instert fromAmount * case 1: sendEth equal to fromAmount * case 2: sendEth equal to fromAmount + insert fromAmount * case 3: insert fromAmount * switch (flag % 3): * case 0: don't check balance after swap * case 1: check eth balance after swap * case 2: check destToken balance after swap */ protected buildSimpleSwapFlags(priceRoute: OptimalRate, exchangeParams: DexExchangeBuildParam[], routeIndex: number, swapIndex: number, swapExchangeIndex: number, exchangeParamIndex: number, maybeWethCallData?: DepositWithdrawReturn): { dexFlag: Flag; approveFlag: Flag; }; /** * Executor01 Flags: * switch (flag % 4): * case 0: don't insert fromAmount * case 1: sendEth equal to fromAmount * case 2: sendEth equal to fromAmount + insert fromAmount * case 3: insert fromAmount * switch (flag % 3): * case 0: don't check balance after swap * case 1: check eth balance after swap * case 2: check destToken balance after swap */ protected buildMultiMegaSwapFlags(priceRoute: OptimalRate, exchangeParams: DexExchangeBuildParam[], routeIndex: number, swapIndex: number, swapExchangeIndex: number, exchangeParamIndex: number, maybeWethCallData?: DepositWithdrawReturn): { dexFlag: Flag; approveFlag: Flag; }; protected buildSingleSwapCallData(params: SingleSwapCallDataParams): string; /** * Build a revertable fallback group (Style 2): a special-dex step (0xFF) whose calldata payload is * [tryLen(4)][fallbackLen(4)][try-block][fallback-block]. The try-block is the primary exchange's * per-swap calldata; the fallback-block is the alternative's, built by substituting the fallback * param at this hop and recomputing its flags. Executor01 runs the try-block in a self-call and, * on revert, runs the fallback-block from the original pre-group input. */ protected buildRevertableGroup(params: SingleSwapCallDataParams): string; protected buildDexCallData(params: DexCallDataParams): string; getAddress(): string; buildByteCode(priceRoute: OptimalRate, exchangeParams: DexExchangeBuildParam[], sender: string, maybeWethCallData?: DepositWithdrawReturn): string; }