UNPKG

@mstable/protocol

Version:
20 lines (19 loc) 847 B
import { Signer } from "ethers"; import { IUniswapV3Quoter } from "types/generated"; import { BN } from "../math"; export interface EncodedPaths { encoded: string; encodedReversed: string; } export interface SwapQuote { outAmount: BN; exchangeRate: BN; } export interface Token { address: string; decimals: number; } export declare const encodeUniswapPath: (tokenAddresses: string[], fees: number[]) => EncodedPaths; export declare const getWETHPath: (fromPath: string, toPath: string) => Array<string>; export declare const quoteExactInput: (quoter: IUniswapV3Quoter, encodedPath: string, amount: BN, blockNumber?: number | string) => Promise<BN>; export declare const quoteSwap: (signer: Signer, from: Token, to: Token, inAmount: BN, blockNumber: number | string, path?: string[], fees?: number[]) => Promise<SwapQuote>;