@swaptoshi/dex-module
Version:
Klayr decentralized exchange (dex) on-chain module
47 lines (46 loc) • 1.78 kB
TypeScript
import { Modules } from 'klayr-framework';
import { Uint256String, Int24String, Int128String, Uint128String, Int16String } from '../int';
import { ImmutableSwapContext, QuoteExactInputSingleParams, QuoteExactOutputSingleParams } from '../../../types';
interface PopulatedTick {
tick: Int24String;
liquidityNet: Int128String;
liquidityGross: Uint128String;
}
export declare class Quoter {
constructor(context: ImmutableSwapContext, stores: Modules.NamedRegistry);
getPopulatedTicksInWord(tokenA: Buffer, tokenB: Buffer, fee: Int24String, tickBitmapIndex: Int16String): Promise<PopulatedTick[]>;
quoteExactInputSingle(params: QuoteExactInputSingleParams): Promise<{
amountOut: string;
sqrtPriceX96After: string;
initializedTicksCrossed: string;
}>;
quoteExactInput(path: Buffer, amountIn: Uint256String): Promise<{
amountOut: string;
sqrtPriceX96AfterList: string[];
initializedTicksCrossedList: string[];
}>;
quoteExactOutputSingle(params: QuoteExactOutputSingleParams): Promise<{
amountIn: string;
sqrtPriceX96After: string;
initializedTicksCrossed: string;
}>;
quoteExactOutput(path: Buffer, amountOut: Uint256String): Promise<{
amountIn: string;
sqrtPriceX96AfterList: string[];
initializedTicksCrossedList: string[];
}>;
quotePrice(path: Buffer): Promise<{
price: number;
pair: string;
}>;
private _createPayload;
private _swapCallback;
private _parseRevertReason;
private _handleRevert;
private readonly senderAddress;
private readonly immutableContext;
private readonly poolStore;
private readonly tickBitmapStore;
private readonly tokenSymbolStore;
}
export {};