import * as BigNumber from 'bignumber.js'; import BigNumber__default from 'bignumber.js'; import * as _mysten_sui_js from '@mysten/sui.js'; import { TransactionBlock, JsonRpcProvider, SuiObjectDataOptions, SuiObjectDataFilter, SuiObjectResponse } from '@mysten/sui.js'; interface PairStats { volume7D: number | string; volume24H: number | string; transaction24H: number | string; totalLiquidity: number | string; fee24H: number | string; aprPerformance7D: number | string; totalLiquidityInUSD: string | number; } interface PairRanking { reserveY: number | string; reserveX: number | string; lpType: string; explorerUrl?: string; coinYType: string; coinXType: string; isNewPair?: boolean; createdBy?: string; lpObjectId: string; lpName?: string; createdAtTimestamp: number | null; stats: PairStats; } interface CoinStats { totalLiquidityInUSD: number | string; priceChange24H: number | string; price: number | string; volume7D: number | string; volume24H: number | string; transaction24H: number | string; totalLiquidity: number | string; fee24H: number | string; } interface CoinMetadata { type: string; decimals: number; description?: string; iconUrl?: string; isVerified?: boolean; symbol?: string; balance?: string; derivedSUI?: string; derivedPriceInUSD?: string; name?: string; id?: string; stats?: CoinStats; twitterUrl?: string; websiteUrl?: string; coinMarketcapUrl?: string; coingeckoUrl?: string; __typename?: string; } interface ICoinBalance { balance: string; type: string; } type Reserve = { fields: { balance: string; }; type: string; }; interface IPoolInfo { objectId?: string; reserveX?: Reserve; reserveY?: Reserve; totalLpSupply?: string; coinX?: string; coinY?: string; lpType?: string; feeRate?: number; } interface IRawCoins { coinX?: string; coinY?: string; } interface IFullDataCoins { coinX?: CoinMetadata; coinY?: CoinMetadata; apr?: string; lpValue?: string; userLpBalance?: string; } interface IPools { coinXType?: string; coinYType?: string; createdAtTimestamp?: number; createdBy?: string; explorerUrl?: string; feeRate?: number; lpName?: string; lpObjectId?: string; lpType?: string; objectId?: string; stats?: { aprPerformance7D?: string; fee24H?: string; totalLiquidity?: string; totalLiquidityInUSD?: string; transaction24H?: number; volume7D: string; volume24H?: string; __typename?: string; }; totalLpSupply?: string; reserveX?: Reserve; reserveY?: Reserve; __typename?: string; } interface IGetLpPrice { poolInfo: IPools; coinX: CoinMetadata; coinY: CoinMetadata; } interface ILiquidity extends IFullDataCoins, IPools { } interface IPoolInfos extends IRawCoins, IPools { } interface IFaasUserRw { token: CoinMetadata; amount: string; } interface IGenesisUserJoin { type: string; lp_locked_amount: string; xflx_locked_amount: string; id: string; pool_id: string; pool_idx: string; acc_pending_rewards: string; } interface IGenesisPoolsData { totalLpDeposit: string; totalXFlxDeposit: string; totalPendingReward: string; coinX: CoinMetadata; coinY: CoinMetadata; } interface IAprPdrwposition { apr: string; pendingReward: string; __typename: string; } interface IFaasData { coinX: CoinMetadata; coinY: CoinMetadata; userReward: IFaasUserRw[]; totalLpDeposit: string; } interface IPairsRankingItem { reserveX: number; reserveY: number; stats: { volume7D: string; volume24H: string; transaction24H: number; totalLiquidityInUSD: string; totalLiquidity: string; fee24H: string; aprPerformance7D: string; }; lpType: string; lpObjectId: string; lpName: string; explorerUrl: string; createdBy: string; createdAtTimestamp: number; coinY: string; coinX: string; } interface IFaasV2 { id: string; poolIndex: string; started_at_ms: string | number; ended_at_ms: string | number; creator: string; totalLiquid: string | number; totalLiquidDecimal: string | number; totalLpDeposit: string; rewardApr: string; tradingApr: string; userReward: IFaasUserRw[]; poolReward: IFaasUserRw[]; isLegacy: boolean; lpPrice: string; poolLiquid: IPoolInfo; } declare class Coin { coinType: string; } type Amount = { amount: number | string; decimalAmount: number | string; }; interface GetSplitSmartRoute { path: { routes: Route[]; amountIn: string; amountOut: string; coinTypeOut: string; coinTypeIn: string; }; rate: number; } interface PairSetting { _id?: string; coinXType: string; coinYType: string; createdBy?: string; createdAt?: string; isNewPair?: boolean; lpType?: string; lpName?: string; userLpBalance?: string; reserveX?: string; reserveY?: string; lpObjectId?: string; inRate?: string; outRate?: string; stats?: PairStats; } type PoolInfo = { objectId?: string; reserveX?: Reserve; reserveY?: Reserve; totalLpSupply?: string; coinX?: string; coinY?: string; lpType?: string; feeRate?: number; kLast?: string; }; type SmartRoute = { amountIn?: string | number; amountOut?: string | number; routes?: { coinTypeIn?: string; coinTypeOut?: string; amountIn?: string | number; amountOut?: string | number; pair?: PairSetting; }[]; }; interface SwapArgs { typeArguments: string[]; args: any[]; tx: TransactionBlock; callFunction: string; } interface ICalcAmountExact { amountIn: Amount; amountOut: Amount; trades: PairSetting[]; smartRoute: SmartRoute; } interface IGetPools { poolInfos: IPools[]; pairs: PairSetting[]; } declare class Route { protocol?: string; lpObjectId?: string; pairId?: string; pairType?: string; fee?: number; coinX?: Coin; coinY?: Coin; reserveX?: number; reserveY?: number; amountIn?: BigNumber__default; amountOut?: BigNumber__default; poolId?: string; sourceType?: string; sqrtPrice?: string; liquidity?: string; tickIndex?: string; swapXtoY?: boolean; lpType?: string; } interface ISmartPathV3 { info: { routes: Route[]; amountIn: BigNumber__default; amountOut: BigNumber__default; coinTypeOut: string; coinTypeIn: string; }; rate: number; } interface ISmartRouting { paths: ISmartPathV3[]; amountOut: string; } interface ITradeRateItem { coinInType: string; coinOutType: string; outRate: string; inRate: string; } interface IEstimateGasResult { fee: string; amountOut: string; pathsAmountOut: string[]; } type TSourceSmartRouting = "FLOWX" | "FLOWX_CLMM" | "KRIYA" | "TURBOS" | "CETUS" | "AFTERMATH" | "DEEPBOOK"; interface IPriceWithTick { price: string; sqrtPrice?: string; tickIndex: number; } interface IPortionItem { amount: string; amountInUsd: string; } interface IPortionItemWithPercent extends IPortionItem { percentage: string; } interface ILpCoinPortionWithPercent { coinX: IPortionItemWithPercent; coinY: IPortionItemWithPercent; } interface ILpCoinPortion { coinX: IPortionItem; coinY: IPortionItem; } interface ILpV3Rw { rewardX: string; rewardY: string; } interface ILpV3Unclaimed extends ILpCoinPortion { totalInUsd: string; } interface ICurrentPricePD extends IPriceWithTick { sqrtPrice: string; } interface IPoolRewardV3 { amount: string; coin: CoinMetadata; } interface IUserLiquidV3Position { coinX: CoinMetadata; coinY: CoinMetadata; currentPortion: ILpCoinPortion; positionLiquid: string; positionId: string; minPrice: ICurrentPricePD; maxPrice: ICurrentPricePD; currentPrice: ICurrentPricePD; poolLiquid: string; feeRate: string; reward: ILpV3Rw; apr: string; id: string; poolReward: IPoolRewardV3[]; } interface IPoolInfoV3Brief { feeGrowthGlobalX: string; feeGrowthGlobalY: string; liquidity: string; locked: boolean; maxLiquidityPerTick: string; protocolFeeRate: string; protocolFeeX: string; protocolFeeY: string; sqrtPrice: string; feeRate: string; } interface ILpCoin { coinX: CoinMetadata | null; coinY: CoinMetadata | null; } interface ITransactionClmm { amountXIn: string; amountXOut: string; amountYIn: string; amountYOut: string; coinX: CoinMetadata; coinY: CoinMetadata; eventSeq: string; sender: string; timestamp: string; totalAmountInUSD: string; txDigest: string; type: string; } interface IPDV3State extends IPoolInfoV3Brief, ILpCoin { currentPrice: ICurrentPricePD; currentPortion: ILpCoinPortionWithPercent; positionLiquid: string; isOwned: boolean; minPrice: ICurrentPricePD; maxPrice: ICurrentPricePD; reward: ILpV3Rw; unClaimedLiquid: ILpV3Unclaimed; id: string; apr: string; poolReward: IPoolRewardV3[]; ticks: ChartEntry[]; history: ITransactionClmm[]; } interface ITickClmm { liquidityNet: string; liquidityGross: string; tick: number; } interface ChartEntry { activeLiquidity: number; price0: number; liquidityNet: number; tick: number; } interface IGetTransactionClmm { poolId: string; positionId: string; page: number; size: number; sender: string; } type TCachingRequest = "no-cache" | "no-store" | "force-cache" | "only-if-cached" | "reload" | "default"; interface IFeeTierV3 { value: number; valueDecimal: number; spacing: number; } interface IDataPools { typeCoinX: string; typeCoinY: string; feeRate: string; id: string; } interface IGetClmmPoolDetail { volume24H?: string; fee24H?: string; fee7D?: string; apr?: string; totalLiquidityInUSD?: string; liquidityUSDX?: string; liquidityUSDY?: string; } interface IPoolInfoV3 extends IGetClmmPoolDetail { typeCoinX: string; typeCoinY: string; liquidity: string; sqrtPrice: string; feeRate: number; reserveX: string; reserveY: string; id: string; totalLiquid: string; volume24h?: string; fee24h?: string; fee7d?: string; apr?: string; rewardApr: string; currentPrice: string; currentTickIndex: number; } interface IGetClmmTicks { _id: string; liquidityGross: string; liquidityNet: string; pool: string; tick: number; } declare const nowInMilliseconds: () => number; declare const wait: (ms: number) => Promise; declare function last(collections: T[]): T; declare const fetchOwnedObjects: (owner: string, objectType: string, jsonRpcProvider: JsonRpcProvider) => Promise; declare const callGraphQL: (url: string, payload: { query: string; variables: any; }, extractor?: (res: any) => any) => Promise; declare const SuiTypeMiniNormalize: (type: string) => string; declare const removeLeadingZeros: (hexString: any) => any; declare const convertAmountDecimal: (amount: number, decimals: number) => number; declare const stripZeros: (a: string) => string; declare const addZerosX: (text: string) => string; declare const getLpType: (lpType: string, coinX: string, coinY: string) => string; declare const formatCoinType: (type: string) => string; declare const getDecimalAmount: (amount: string | number, decimals?: number) => string; declare const getBalanceAmount: (amount: string | number, decimals?: number) => BigNumber.BigNumber; declare const calculateReceiveAmount: (poolInfo: IPoolInfo, coinX: CoinMetadata, coinY: CoinMetadata) => { amountX: number; amountY: number; }; declare const standardizeType: (type: string, fullTypeIfSui?: boolean) => any; declare const getLpPrice: ({ poolInfo, coinX, coinY }: IGetLpPrice) => string; declare const sortData: (inputData: any[], sortType?: string, order?: "asc" | "desc" | string) => any[]; declare const getFullyOwnedObjects: (account: string, options: SuiObjectDataOptions, filter?: SuiObjectDataFilter) => Promise; declare const extractTypeFaas: (type: string) => { coinXType: string; coinYType: string; }; declare const getPoolInfos: (lpObjectIds: string[]) => Promise; declare const getPairs: () => Promise; declare const getPools: () => Promise; declare const getCoinsFlowX: () => Promise; declare const getCoinsBalance: (address?: string) => Promise; declare const getAllCoinsWithBalance: (address: string) => Promise<{ coins: CoinMetadata[]; coinBalances: ICoinBalance[]; }>; declare const getBasicData: (address?: string) => Promise<{ coins: CoinMetadata[]; coinBalances: ICoinBalance[]; poolInfos: any[]; }>; declare const initTxBlock: (packageId: string, moduleName: string, functionName: string, params: any[], types?: string[], tx?: TransactionBlock) => Promise; declare const getPairsRankingFlowX: () => Promise; declare const getMultipleObjectIds: (lpObjectIds: string[]) => Promise; declare const extractPair: (type: string) => string[]; declare const orderByKey: (array: any[], key: string, sortBy: "desc" | "asc") => any[]; declare const estimateDealine: () => number; declare const getAmountOut: (amountIn: string | number, reserveIn: string, reserveOut: string, fee: number) => string; declare const getReserveByCoinType: (coinX: string, pairSetting: PoolInfo) => { reserveX: string; reserveY: string; }; declare const getFullyMultiObject: (objectIds: string[]) => Promise; declare const getFullyDynamicFields: (id: string) => Promise; declare const createZeroCoin: (tx: TransactionBlock, coinType: string) => { kind: "Input"; index: number; type?: "object" | "pure"; value?: any; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; }; declare const getAprPdrwPosition: (farmObjectId: string, posArr: string[]) => Promise; declare const getGenesisFarm: (account?: string) => Promise; declare const getFaas: (account?: string) => Promise; declare const getFaasV2: (account?: string) => Promise; declare const getLiquidity: (account: string, sortType?: string, sortOrder?: string) => Promise; declare const getUserLiquidityV3: (account: string) => Promise; declare const buildTxAddLiquidV3: (coinX: CoinMetadata, coinY: CoinMetadata, slippage: string, fee: IFeeTierV3, lowerTick: number, upperTick: number, amountX: string, amountY: string, account: string) => Promise; declare const buildTxIncreaseLiquidV3: (amountX: string, amountY: string, account: string, coinX: CoinMetadata, coinY: CoinMetadata, positionObjectId: string, slippage: string) => Promise; declare const buildTxRemoveLiquidV3: (coinX: CoinMetadata, coinY: CoinMetadata, positionObjectId: string, liquid2Remove: string, amountX: string, amountY: string, account: string, poolReward: IPoolRewardV3[], removeAll?: boolean) => Promise; declare const getTxCollectRewardLiquidV3: (rewardType: string[], positionObjectId: string, account: string, inheritTx?: TransactionBlock) => Promise<({ kind: "Input"; index: number; type?: "object" | "pure"; value?: any; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; }) & ({ kind: "Input"; index: number; type?: "object" | "pure"; value?: any; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; })[]>; declare const getTickClmm: (poolId: string) => Promise; declare const getSmartRoute: (amount: string | number, coinInType: string, coinOutType: string, isExactIn: boolean, poolInfosData?: IPools[], pairsData?: PairSetting[]) => Promise; declare const handleCalcAmountOut: (value: string | number, coinIn: CoinMetadata, coinOut: CoinMetadata, coinsData?: CoinMetadata[], pairsData?: PairSetting[], poolInfosData?: IPools[]) => Promise; declare const handleCalcAmountIn: (value: string | number, coinIn: CoinMetadata, coinOut: CoinMetadata, coinsData?: CoinMetadata[], pairsData?: PairSetting[], poolInfosData?: IPools[]) => Promise; declare const calculateAmountOut: (value: string | number, coinIn: CoinMetadata, coinOut: CoinMetadata) => Promise; declare const calculateAmountIn: (value: string | number, coinIn: CoinMetadata, coinOut: CoinMetadata) => Promise; declare const swapExactInput: (isExactIn: boolean, amountIn: Amount, amountOut: Amount, trades: PairSetting[], coinIn: CoinMetadata, coinOut: CoinMetadata, account: string, valueSlippage: number) => Promise; declare const computeSwapExactIn: (paths: ISmartPathV3[], amountIn: string | number, amountOut: string | number, coinIn: CoinMetadata, coinOut: CoinMetadata, slippage: number, account: string) => Promise<{ gasFee: string; priceChange: boolean; totalAmountOutInspec: string; inRate: string; outRate: string; tx: TransactionBlock; priceImpact: string; }>; declare const estimatePriceImpact: (amountInDecimal: string | number, amountOutDecimal: string | number, coinIn?: CoinMetadata, coinOut?: CoinMetadata) => string; declare const getSmartRouting: (tokenIn: string, tokenOut: string, amountIn: string, signal: any, source?: TSourceSmartRouting[]) => Promise; declare const txBuild: (listSmartPath: ISmartPathV3[], slippage: number, amountIn: string, amountOut: string, coinInType: string, account: string, pathsAmountOut?: string[]) => Promise<_mysten_sui_js.TransactionBlock>; declare const estimateGasFee: (tx: TransactionBlock | any, account?: string) => Promise; export { Amount, ChartEntry, Coin, CoinMetadata, CoinStats, GetSplitSmartRoute, IAprPdrwposition, ICalcAmountExact, ICoinBalance, ICurrentPricePD, IDataPools, IEstimateGasResult, IFaasData, IFaasUserRw, IFaasV2, IFeeTierV3, IFullDataCoins, IGenesisPoolsData, IGenesisUserJoin, IGetClmmPoolDetail, IGetClmmTicks, IGetLpPrice, IGetPools, IGetTransactionClmm, ILiquidity, ILpCoin, ILpCoinPortion, ILpCoinPortionWithPercent, ILpV3Rw, ILpV3Unclaimed, IPDV3State, IPairsRankingItem, IPoolInfo, IPoolInfoV3, IPoolInfoV3Brief, IPoolInfos, IPoolRewardV3, IPools, IPortionItem, IPortionItemWithPercent, IPriceWithTick, IRawCoins, ISmartPathV3, ISmartRouting, ITickClmm, ITradeRateItem, ITransactionClmm, IUserLiquidV3Position, PairRanking, PairSetting, PairStats, PoolInfo, Reserve, Route, SmartRoute, SuiTypeMiniNormalize, SwapArgs, TCachingRequest, TSourceSmartRouting, addZerosX, buildTxAddLiquidV3, buildTxIncreaseLiquidV3, buildTxRemoveLiquidV3, calculateAmountIn, calculateAmountOut, calculateReceiveAmount, callGraphQL, computeSwapExactIn, convertAmountDecimal, createZeroCoin, estimateDealine, estimateGasFee, estimatePriceImpact, extractPair, extractTypeFaas, fetchOwnedObjects, formatCoinType, getAllCoinsWithBalance, getAmountOut, getAprPdrwPosition, getBalanceAmount, getBasicData, getCoinsBalance, getCoinsFlowX, getDecimalAmount, getFaas, getFaasV2, getFullyDynamicFields, getFullyMultiObject, getFullyOwnedObjects, getGenesisFarm, getLiquidity, getLpPrice, getLpType, getMultipleObjectIds, getPairs, getPairsRankingFlowX, getPoolInfos, getPools, getReserveByCoinType, getSmartRoute, getSmartRouting, getTickClmm, getTxCollectRewardLiquidV3, getUserLiquidityV3, handleCalcAmountIn, handleCalcAmountOut, initTxBlock, last, nowInMilliseconds, orderByKey, removeLeadingZeros, sortData, standardizeType, stripZeros, swapExactInput, txBuild, wait };