import { Currency, CurrencyAmount, Percent, Price, TradeType } from '@ape.swap/sdk-core'; import { Pair, Route as V2RouteSDK } from '@ape.swap/v2-sdk'; import { Pool, Route as V3RouteSDK } from '@ape.swap/v3-sdk'; import { MixedRouteSDK } from './mixedRoute/route'; import { IRoute } from './route'; export declare class Trade { readonly routes: IRoute[]; readonly tradeType: TTradeType; private _outputAmount; private _inputAmount; /** * The swaps of the trade, i.e. which routes and how much is swapped in each that * make up the trade. May consist of swaps in v2 or v3. */ readonly swaps: { route: IRoute; inputAmount: CurrencyAmount; outputAmount: CurrencyAmount; }[]; constructor({ v2Routes, v3Routes, tradeType, mixedRoutes, }: { v2Routes: { routev2: V2RouteSDK; inputAmount: CurrencyAmount; outputAmount: CurrencyAmount; }[]; v3Routes: { routev3: V3RouteSDK; inputAmount: CurrencyAmount; outputAmount: CurrencyAmount; }[]; tradeType: TTradeType; mixedRoutes?: { mixedRoute: MixedRouteSDK; inputAmount: CurrencyAmount; outputAmount: CurrencyAmount; }[]; }); get inputAmount(): CurrencyAmount; get outputAmount(): CurrencyAmount; private _executionPrice; /** * The price expressed in terms of output amount/input amount. */ get executionPrice(): Price; /** * The cached result of the price impact computation * @private */ private _priceImpact; /** * Returns the percent difference between the route's mid price and the price impact */ get priceImpact(): Percent; /** * Get the minimum amount that must be received from this trade for the given slippage tolerance * @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade * @returns The amount out */ minimumAmountOut(slippageTolerance: Percent, amountOut?: CurrencyAmount): CurrencyAmount; /** * Get the maximum amount in that can be spent via this trade for the given slippage tolerance * @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade * @returns The amount in */ maximumAmountIn(slippageTolerance: Percent, amountIn?: CurrencyAmount): CurrencyAmount; /** * Return the execution price after accounting for slippage tolerance * @param slippageTolerance the allowed tolerated slippage * @returns The execution price */ worstExecutionPrice(slippageTolerance: Percent): Price; static fromRoutes(v2Routes: { routev2: V2RouteSDK; amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount; }[], v3Routes: { routev3: V3RouteSDK; amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount; }[], tradeType: TTradeType, mixedRoutes?: { mixedRoute: MixedRouteSDK; amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount; }[]): Promise>; static fromRoute(route: V2RouteSDK | V3RouteSDK | MixedRouteSDK, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount, tradeType: TTradeType): Promise>; }