import type { JsonRpcProvider } from '@ethersproject/providers'; import { Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core'; import { Pool } from '@uniswap/v3-sdk'; import { BigNumber } from 'ethers'; import { Config } from '../../../../Fct/Config'; import { ChainId, Protocol } from '../../../../Fct/generics'; import { SwapToken, UNISWAP_TYPE, UniswapParams } from '../../../../Fct/plugins/uniswap/helpers'; import { getMethodName } from '../../../../Fct/plugins/uniswap/helpers/getMethodName'; import { Slippage } from '../../../../Fct/plugins/uniswap/helpers/getSlippage'; import { InterfaceTrade, TradeState } from '../../../../Fct/plugins/uniswap/helpers/types/types'; import { UniswapV3ActionPlugin } from '../../uniswap'; interface BestTrade { INPUT: { currency: Currency | undefined; amount: CurrencyAmount | undefined; }; OUTPUT: { currency: Currency | undefined; amount: CurrencyAmount | undefined; }; trade: { trade: InterfaceTrade | undefined; state: TradeState; } | undefined; slippage: Slippage | undefined; type: UNISWAP_TYPE | undefined; } interface SwapAmounts { inputAmount: string | undefined; outputAmount: string | undefined; } export interface SwapCallParamsExactInputSingle { params_tuple: { tokenIn: string; tokenOut: string; fee: number; recipient: string; amountIn: string; amountOutMinimum: string; sqrtPriceLimitX96: string; }; } export interface SwapCallParamsExactInput { params_tuple: { path: string; recipient: string; amountIn: string; amountOutMinimum: string; }; } export interface SwapCallParamsExactOutputSingle { params_tuple: { tokenIn: string; tokenOut: string; fee: number; recipient: string; amountOut: string; amountInMaximum: string; sqrtPriceLimitX96: string; }; } export interface SwapCallParamsExactOutput { params_tuple: { path: string; recipient: string; amountOut: string; amountInMaximum: string; }; } export type SwapCallParams = SwapCallParamsExactInput | SwapCallParamsExactOutput | SwapCallParamsExactInputSingle | SwapCallParamsExactOutputSingle; export interface SwapValues extends SwapAmounts, BestTrade { protocol: Protocol; params?: { methodParams: SwapCallParams | undefined; }; plugin?: UniswapV3ActionPlugin; state?: 'VALID' | 'INVALID'; methodName?: ReturnType; } export declare class UniswapV3 extends Config { private NFTManagerContract; constructor({ chainId, account, provider }: { chainId: ChainId; account?: string; provider?: JsonRpcProvider; }); private promiseReject; getSwapParams: ({ input, output, slippage }: UniswapParams) => Promise; mintPosition: ({ configuredPool, tokenA, tokenB, priceUpper, priceLower, isPriceInverted, }: { configuredPool: Pool; tokenA?: { amount?: string | undefined; } | undefined; tokenB?: { amount?: string | undefined; } | undefined; priceUpper: string; priceLower: string; isPriceInverted?: boolean | undefined; }) => { amount0: string; amount1: string; liquidity: string; tickLower: number; tickUpper: number; plugin: { new (args: { chainId: ChainId; initParams?: Partial<{ to: string | import("../../corelibTypes").Variable | undefined; methodParams: unknown; }> | undefined; walletAddress?: string | undefined; vaultAddress?: string | undefined; provider?: JsonRpcProvider | undefined; }): import("../../..").NewPluginType<"UNISWAP_V3", "ACTION", "mint", string | undefined, { input: { to: import("../../../../Fct/generics").FctAddress; methodParams: { params_tuple: { token0: import("../../../../Fct/generics").FctAddress; token1: import("../../../../Fct/generics").FctAddress; fee: import("../../../../Fct/generics").FctValue24; tickLower: import("../../../../Fct/generics").FctInteger24; tickUpper: import("../../../../Fct/generics").FctInteger24; amount0Desired: import("../../../../Fct/generics").FctValue; amount1Desired: import("../../../../Fct/generics").FctValue; amount0Min: import("../../../../Fct/generics").FctValue; amount1Min: import("../../../../Fct/generics").FctValue; recipient: import("../../../../Fct/generics").FctAddress; deadline: import("../../../../Fct/generics").FctTimestamp; }; }; }; output: { tokenId: import("../../../../Fct/generics").FctValue; liquidity: import("../../../../Fct/generics").FctValue; amount0: import("../../../../Fct/generics").FctValue; amount1: import("../../../../Fct/generics").FctValue; }; }, Partial<{ to: string | import("../../corelibTypes").Variable | undefined; methodParams: unknown; }>>; }; params: { methodParams: { params_tuple: { token0: string; token1: string; fee: import("@uniswap/v3-sdk").FeeAmount; tickLower: number; tickUpper: number; amount0Desired: string; amount1Desired: string; amount0Min: string; amount1Min: string; recipient: string; deadline: { type: string; id: string; }; }; }; }; } | undefined; getAddLiquidity: ({ configuredPool, tokenA, tokenB, tokenId, tickLower, tickUpper, }: { configuredPool: Pool; tokenA?: { amount?: string | undefined; } | undefined; tokenB?: { amount?: string | undefined; } | undefined; tokenId: string; tickLower: number; tickUpper: number; }) => { amount0: string; amount1: string; plugin: { new (args: { chainId: ChainId; initParams?: Partial<{ to: string | import("../../corelibTypes").Variable | undefined; methodParams: unknown; }> | undefined; walletAddress?: string | undefined; vaultAddress?: string | undefined; provider?: JsonRpcProvider | undefined; }): import("../../..").NewPluginType<"UNISWAP_V3", "ACTION", "increaseLiquidity", string | undefined, { input: { to: import("../../../../Fct/generics").FctAddress; methodParams: { params_tuple: { tokenId: import("../../../../Fct/generics").FctValue; amount0Desired: import("../../../../Fct/generics").FctValue; amount1Desired: import("../../../../Fct/generics").FctValue; amount0Min: import("../../../../Fct/generics").FctValue; amount1Min: import("../../../../Fct/generics").FctValue; deadline: import("../../../../Fct/generics").FctTimestamp; }; }; }; output: { liquidity: import("../../../../Fct/generics").FctValue; amount0: import("../../../../Fct/generics").FctValue; amount1: import("../../../../Fct/generics").FctValue; }; }, Partial<{ to: string | import("../../corelibTypes").Variable | undefined; methodParams: unknown; }>>; }; params: { methodParams: { params_tuple: { tokenId: string; amount0Desired: string; amount1Desired: string; amount0Min: string; amount1Min: string; deadline: { type: string; id: string; }; }; }; }; } | undefined; fees: number[]; isPairExist: ({ token0, token1 }: { token0: string; token1: string; }) => Promise; getPoolInstance: ({ tokenA, tokenB, fee }: { tokenA: SwapToken; tokenB: SwapToken; fee: number; }) => Promise<{ tickSpacing: number; price: string; priceNormalised: string; invertedPrice: string; invertedPriceNormalised: string; priceDecimals: number; tick: number; configuredPool: Pool; fee: import("@uniswap/v3-sdk").FeeAmount; } | undefined>; getPosition: (tokenId: string) => Promise; getPoolAddress: ({ tokenA, tokenB, fee }: { tokenA: SwapToken; tokenB: SwapToken; fee: number; }) => string; getUserPositions: (account: string) => Promise<{ tokenId: string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | (string | boolean | BigNumber | any)[])[])[])[])[])[])[])[])[])[])[]; }[]>; priceToTick: (price: string, decimalDiff: number, isPriceInverted: boolean | undefined, tickSpacing: number) => number; private getToken; private getLastSwapParamsV3; getSwapValuesV3: ({ input, output, slippage }: UniswapParams) => Promise; private getTradeState; private getSwapValues; private getSwapInfo; /** * 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 {};