@swaptoshi/dex-module
Version:
Klayr decentralized exchange (dex) on-chain module
35 lines (34 loc) • 1.51 kB
TypeScript
import { Modules } from 'klayr-framework';
import { Uint256String } from '../library/int';
import { MutableSwapContext, ExactInputParams, ExactInputSingleParams, ExactOutputParams, ExactOutputSingleParams, DexModuleConfig, TokenMethod } from '../../types';
export declare class SwapRouter {
constructor(stores: Modules.NamedRegistry, config: DexModuleConfig, moduleName: string);
addDependencies(context: MutableSwapContext, tokenMethod: TokenMethod): void;
setSender(senderAddress: Buffer): void;
setConfig(config: DexModuleConfig): void;
exactInputSingle(params: ExactInputSingleParams): Promise<Uint256String>;
exactInput(_params: ExactInputParams): Promise<Uint256String>;
exactOutputSingle(params: ExactOutputSingleParams): Promise<Uint256String>;
exactOutput(params: ExactOutputParams): Promise<Uint256String>;
private _checkDependencies;
private _checkDeadline;
private _pay;
private _createPayload;
private _getPool;
private _swapCallback;
private _exactInputInternal;
private _exactOutputInternal;
private _checkRemainingBalance;
private _checkFeeProtocol;
private _validateFeeProtocol;
readonly address: Buffer<ArrayBufferLike>;
private readonly _DEFAULT_AMOUNT_IN_CACHED;
private readonly poolStore;
private readonly moduleName;
private feeProtocol;
private feeProtocolPool;
private _amountInCached;
private mutableContext;
private tokenMethod;
private mutableDependencyReady;
}