@onekeyfe/blockchain-libs
Version:
OneKey Blockchain Libs
24 lines (23 loc) • 1.2 kB
TypeScript
import BigNumber from 'bignumber.js';
import { ProviderController } from '../../provider';
import { CoinInfo } from '../../types/chain';
import { Price, PriceChannel } from '../interfaces';
declare abstract class ABCUniswap implements PriceChannel {
static BATCH_SIZE: number;
readonly config: Record<string, Record<string, any>>;
readonly providerController: ProviderController;
constructor(config: Record<string, Record<string, any>>, providerController: ProviderController);
pricing(coins: Array<CoinInfo>): Promise<Array<Price>>;
callContract(chainCode: string, contract: string, calls: Array<string>): Promise<Array<BigNumber | undefined>>;
abstract getContract(configPerChain: Record<string, any>): string;
abstract encodeCallData(coin: CoinInfo, path: Array<string>): string;
}
declare class UniswapV2 extends ABCUniswap {
getContract(configPerChain: Record<string, any>): string;
encodeCallData(coin: CoinInfo, path: Array<string>): string;
}
declare class UniswapV3 extends ABCUniswap {
getContract(configPerChain: Record<string, any>): string;
encodeCallData(coin: CoinInfo, path: Array<string>): string;
}
export { UniswapV2, UniswapV3 };