import { Currency } from '@sushiswap/sdk'; import { BigNumber } from 'ethers'; import { Config } from '../../../../Fct/Config'; import { UnionToIntersection } from '../../../../Fct/Fct'; import { getMethodName } from '../../../../Fct/plugins/uniswap/helpers/getMethodName'; import { SwapCallParamsIn, SwapField, UNISWAP_TYPE } from '../../../../Fct/plugins/uniswap/helpers/Uniswap'; import { TradeContext } from 'simple-sushiswap-sdk'; import { Sushiswap as SushiswapPlugins } from '../Sushiswap'; import { Slippage } from './getSlippage'; import { TradeState } from './types/types'; interface BestTrade { INPUT: { currency: Currency | undefined; amount: string | undefined; }; OUTPUT: { currency: Currency | undefined; amount: string | undefined; }; trade: { trade: Partial | undefined; state: TradeState; } | undefined; slippage: Slippage | undefined; type: UNISWAP_TYPE | undefined; } interface SwapAmounts { inputAmount: string | undefined; outputAmount: string | undefined; } type ActionPlugin = UnionToIntersection<(typeof SushiswapPlugins)['actions'][keyof (typeof SushiswapPlugins)['actions']]>; type GetterPlugin = UnionToIntersection<(typeof SushiswapPlugins)['getters'][keyof (typeof SushiswapPlugins)['getters']]>; export interface SushiswapValues extends SwapAmounts, BestTrade { state?: 'VALID' | 'INVALID'; methodName?: ReturnType; params?: { value?: string; methodParams: SwapCallParamsIn | undefined; }; plugin?: ActionPlugin; } export type SushiswapParams = { input: SwapField; output: SwapField; }; export declare class Sushiswap extends Config { values: SushiswapValues | undefined; private promiseReject; getSwapParams: ({ input, output }: SushiswapParams) => Promise; getPairAddress: ({ token0, token1 }: { token0: string; token1: string; }) => string; isPairExist: ({ token0, token1 }: { token0: string; token1: string; }) => Promise; getPathAmountOut: ({ amountIn, path }: { amountIn: string; path: string[]; }) => Promise; getAmountParams: ({ input, output }: SushiswapParams) => Promise<{ inputAmount: string | undefined; outputAmount: string | undefined; plugin: GetterPlugin; methodName: 'getAmountsOut' | 'getAmountsIn'; params: { methodParams: { path?: string[]; amountIn?: string; } | { path?: string[]; amountOut?: string; }; }; } | undefined>; private getToken; private getTokenAddress; private getLastInputValuesV2; private setLastInputValuesV2; getSwapValuesV2: ({ input, output }: { input: SwapField; output: SwapField; }) => Promise; getSwapValuesV3: ({ input, output }: { input: SwapField; output: SwapField; }) => Promise; getSwapValues: ({ input, output, }: { input: SwapField; output: SwapField; }) => Promise; private getSwapInfo; private getGoerliTrade; private getGoerliPath; /** * Returns the best v2+v3 trade for a desired swap. * @param tradeType whether the swap is an exact in/out * @param amountSpecified the exact amount to swap in/out * @param otherCurrency the desired output/payment currency */ private getBestTrade; } export {};