import { TypeTag, U64, U8 } from '@manahippo/move-to-ts'; import { Types, TxnBuilderTypes } from 'aptos'; import { CoinInfo } from '../generated/coin_list/coin_list'; import { App } from '../generated'; import { CoinListClient } from '../coinList'; export declare type UITokenAmount = number; export declare type UITokenAmountRatio = number; export declare type PriceType = { xToY: UITokenAmountRatio; yToX: UITokenAmountRatio; }; export declare type QuoteType = { inputSymbol: string; outputSymbol: string; inputUiAmt: UITokenAmount; outputUiAmt: UITokenAmount; avgPrice: UITokenAmountRatio; initialPrice?: UITokenAmountRatio; finalPrice?: UITokenAmountRatio; priceImpact?: number; }; export declare enum DexType { Hippo = 1, Econia = 2, Pontem = 3, Basiq = 4, Ditto = 5, Tortuga = 6, Aptoswap = 7, Aux = 8, AnimeSwap = 9 } export declare const DEX_TYPE_NAME: Record; export declare type PoolType = U64; export declare abstract class TradingPool { abstract get dexType(): DexType; abstract get poolType(): PoolType; abstract get isRoutable(): boolean; abstract get xCoinInfo(): CoinInfo; abstract get yCoinInfo(): CoinInfo; get xTag(): TypeTag; get yTag(): TypeTag; abstract isStateLoaded(): boolean; abstract reloadState(app: App): Promise; abstract getPrice(): PriceType; abstract getQuote(inputUiAmt: UITokenAmount, isXtoY: boolean): QuoteType; abstract makePayload(inputUiAmt: UITokenAmount, minOutAmt: UITokenAmount): Types.EntryFunctionPayload; getTagE(): TypeTag; } export declare class TradeStep { readonly pool: TradingPool; readonly isXtoY: boolean; constructor(pool: TradingPool, isXtoY: boolean); get xCoinInfo(): CoinInfo; get yCoinInfo(): CoinInfo; get xTag(): TypeTag; get yTag(): TypeTag; getPrice(): PriceType; getQuote(inputUiAmt: UITokenAmount): QuoteType; getTagE(): TypeTag; } export declare type SwapParamType = { numSteps: U8; firstDexType: U8; firstPoolType: U64; firstIsReversed: boolean; secondDexType: U8; secondPoolType: U64; secondIsReversed: boolean; thirdDexType: U8; thirdPoolType: U64; thirdIsReversed: boolean; inAmt: U64; minOutAmt: U64; types: [TypeTag, TypeTag, TypeTag, TypeTag, TypeTag, TypeTag, TypeTag]; }; export declare class TradeRoute { readonly steps: TradeStep[]; tokens: CoinInfo[]; constructor(steps: TradeStep[]); get xCoinInfo(): CoinInfo; get yCoinInfo(): CoinInfo; get xTag(): TypeTag; get yTag(): TypeTag; getPrice(): PriceType; getQuote(inputUiAmt: UITokenAmount): QuoteType; hasRoundTrip(): boolean; getSwapParams(inputUiAmt: UITokenAmount, minOutAmt: UITokenAmount): SwapParamType; makeSwapPayload(inputUiAmt: UITokenAmount, minOutAmt: UITokenAmount, isJSONPayload?: boolean): TxnBuilderTypes.TransactionPayloadEntryFunction | Types.TransactionPayload_EntryFunctionPayload; makePayload(inputUiAmt: UITokenAmount, minOutAmt: UITokenAmount, isJSONPayload?: boolean): TxnBuilderTypes.TransactionPayloadEntryFunction | Types.TransactionPayload_EntryFunctionPayload; debugPrint(): void; } export interface RouteAndQuote { route: TradeRoute; quote: QuoteType; } export declare abstract class TradingPoolProvider { app: App; netConfig: import("../config").NetworkConfiguration; registry: CoinListClient; constructor(app: App, netConfig: import("../config").NetworkConfiguration, registry: CoinListClient); abstract loadPoolList(): Promise; reloadAllPoolState(): Promise; } export declare type TokenTypeFullname = string; //# sourceMappingURL=types.d.ts.map