import { DexRouter, DexFactory, DexPair } from '../contracts'; import { ContractTransaction } from 'ethers'; export declare class Swap { router: DexRouter; factory: DexFactory; constructor(routerAddress: string, factoryAddress: string, privKey: string, rpcURL: string); /** * A function to swap exact amount of Tokens for a given amount of Tokens. * @param {string[]} path - a pair of tokens addresses, path[0] should be the address of input Token & path[1] should be the address of output Token. * @param {string} amountIn - amount of Token to be swapped. * @param {string} amountDesiredOut - minimum amount of Tokens expecting to receive. * @param {number} deadline - UTC timestamp as deadline of this transaction, once deadline passed on-chain transaction should be reverted. * * @return {Promise} - ContractTransaction object. */ exactTokensForTokens(amountIn: string, amountDesiredOut: string, path: string[], deadline: string): Promise; /** * A function to swap given amount of Tokens for exact amount of KLAYs. * @param {string[]} path - a pair of tokens addresses, path[0] should be the address of Token & path[1] should be the address of WKLAY. * @param {string} amountDesiredMaxIn - max amount of Tokens to be swapped. * @param {string} amountOut - exact amount of KLAYs expecting to receive. * @param {number} deadline - UTC timestamp as deadline of this transaction, once deadline passed on-chain transaction should be reverted. * @return {Promise} - ContractTransaction object. */ tokensForExactTokens(amountOut: string, amountDesiredMaxIn: string, path: string[], deadline: string): Promise; /** * A function to swap exact amount of KLAY for a given amount of Tokens. * @param {string[]} path - a pair of tokens address, path[0] should be the address of WKLAY & path[1] should be the address of out Token. * @param {string} amountKlayIn - amount of WKLAY tokens to be swapped. * @param {string} amountDesiredOutMin - minimum amount of tokens expecting to receive. * @param {number} deadline - UTC timestamp as deadline of this transaction, once deadline passed on-chain transaction should be reverted. * @return {Promise} - ContractTransaction object. */ exactKlayForTokens(amountKlayIn: string, amountDesiredOutMin: string, path: string[], deadline: string): Promise; /** * A function to swap given amount of Tokens for exact amount of KLAYs. * @param {string[]} path - a pair of tokens addresses, path[0] should be the address of Token & path[1] should be the address of WKLAY. * @param {string} amountDesiredTokenMaxIn - max amount of Tokens to be swapped. * @param {string} amountKlayOut - exact amount of KLAYs expecting to receive. * @param {number} deadline - UTC timestamp as deadline of this transaction, once deadline passed on-chain transaction should be reverted. * @return {Promise} - ContractTransaction object. */ tokensForExactKlay(amountKlayOut: string, amountDesiredTokenMaxIn: string, path: string[], deadline: string): Promise; /** * A function to swap exact amount of Tokens for a given amount of KLAY. * @param {string[]} path - a pair of tokens addresses, path[0] should be the address of Token & path[1] should be the address of WKLAY. * @param {string} amountIn - amount of Token to be swapped. * @param {string} amountDesiredKlayOut - minimum amount of KLAYs expecting to receive. * @param {number} deadline - UTC timestamp as deadline of this transaction, once deadline passed on-chain transaction should be reverted. * @return {Promise} - ContractTransaction object. */ exactTokensForKlay(amountIn: string, amountDesiredKlayOut: string, path: string[], deadline: string): Promise; /** * A function to swap KLAYs for a given exact amount of Tokens. * @param {string[]} path - a pair of tokens addresses, path[0] should be the address of WKLAY & path[1] should be the address of output Token. * @param {string} amountKlayIn - max amount of WKLAY to be swapped. * @param {string} amountDesiredOut - exact amount of Tokens expecting to receive. * @param {number} deadline - UTC timestamp as deadline of this transaction, once deadline passed on-chain transaction should be reverted. * @return {Promise} - ContractTransaction object. */ klayForExactTokens(amountKlayIn: string, amountDesiredOut: string, path: string[], deadline: string): Promise; /** * A getter function to return DexRouter contract's instance * @return {DexRouter} - DexRouter contract's instance. */ getRouter(): DexRouter; /** * A getter function to fetch instance of DexPair contract. * @param {string} tokenA - Address of token0 contract. * @param {string} tokenB - Address of token1 contract. * @param {string} privKey - private key of signer account. * @param {string} rpcURL - RPC URL of blockchain provider. * @return {Promise} - DexPair contract's instance. */ getPair(tokenA: string, tokenB: string, privKey: string, rpcURL: string): Promise; /** * A getter function to get WKLAY contract's address * @return {string} - WKLAY address. */ getAddressOfWKLAY(): Promise; }