UNPKG

thena-v3-sdk

Version:

⚒️ An SDK for building applications on top of Thena V3 Fusion

38 lines (37 loc) 1.35 kB
import { Currency, Price, Token } from 'thena-sdk-core'; import { Pool } from './pool'; /** * Represents a list of pools through which a swap can occur * @template TInput The input token * @template TOutput The output token */ export declare class Route<TInput extends Currency, TOutput extends Currency> { readonly pools: Pool[]; readonly tokenPath: Token[]; readonly input: TInput; readonly output: TOutput; private _midPrice; /** * Creates an instance of route. * @param pools An array of `Pool` objects, ordered by the route the swap will take * @param input The input token * @param output The output token */ constructor(pools: Pool[], input: TInput, output: TOutput); get chainId(): number; /** * Returns the mid price of the route */ get midPrice(): Price<TInput, TOutput>; } export interface IRoute<TInput extends Currency, TOutput extends Currency, TPool extends Pool> { pools: TPool[]; path: Token[]; midPrice: Price<TInput, TOutput>; input: TInput; output: TOutput; } export declare class V3Route<TInput extends Currency, TOutput extends Currency> extends Route<TInput, TOutput> implements IRoute<TInput, TOutput, Pool> { readonly path: Token[]; constructor(v3Route: Route<TInput, TOutput>); }