astra-universal-router-sdk
Version:
sdk for integrating with the Astra Router contracts
58 lines (57 loc) • 1.66 kB
TypeScript
import { Trade as RouterTrade } from 'astra-router-sdk';
import { Currency, TradeType } from 'astra-sdk-core';
export declare type TokenInRoute = {
address: string;
chainId: number;
symbol: string;
decimals: string;
name?: string;
buyFeeBps?: string;
sellFeeBps?: string;
};
export declare enum PoolType {
ClassicPool = "classic-pool",
CLPool = "cl-pool"
}
export declare type ClassicReserve = {
token: TokenInRoute;
quotient: string;
};
export declare type ClassicPoolInRoute = {
type: PoolType.ClassicPool;
address?: string;
tokenIn: TokenInRoute;
tokenOut: TokenInRoute;
reserve0: ClassicReserve;
reserve1: ClassicReserve;
amountIn?: string;
amountOut?: string;
};
export declare type CLPoolInRoute = {
type: PoolType.CLPool;
address?: string;
tokenIn: TokenInRoute;
tokenOut: TokenInRoute;
sqrtRatioX96: string;
liquidity: string;
tickCurrent: string;
fee: string;
amountIn?: string;
amountOut?: string;
};
export declare type PartialClassicQuote = {
tokenIn: string;
tokenOut: string;
tradeType: TradeType;
route: Array<(CLPoolInRoute | ClassicPoolInRoute)[]>;
};
export declare const isNativeCurrency: (address: string) => boolean;
export declare class RouterTradeAdapter {
static fromClassicQuote(quote: PartialClassicQuote): RouterTrade<Currency, Currency, TradeType>;
private static toCurrency;
private static toPoolOrPair;
private static toToken;
private static toPool;
private static toPair;
private static isVersionedRoute;
}