Meta SDK
Features
Example
import { MetaAgQuoter, Exchange } from '@flowx-finance/sdk';
// Use all supported exchanges
const quoter = new MetaAgQuoter('mainnet');
// Or specify only certain exchanges
const quoterCetusOnly = new MetaAgQuoter('mainnet', [Exchange.CETUS]);
const params = {
tokenIn: '0x2::sui::SUI',
tokenOut: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
amountIn: '10000000000',
};
const quote = await quoter.getBestRoute(params);
const txb = new Transaction()
const { coinOut, tx } = await quoter.buildTransaction(txb, quote, sender, 0.01); //slippage 1%, 1/100 = 0.01
tx.transferObjects([coinOut], '0xAddesss');Methods
getBestRoute(params: QuoteQueryParams): Promise<QuoteResult | null>
getBestRoute(params: QuoteQueryParams): Promise<QuoteResult | null>buildTransaction(tx: Transaction, quote: QuoteResult, sender: string, slippage: number, coinIn?: TransactionObjectArgument): Promise<any>
buildTransaction(tx: Transaction, quote: QuoteResult, sender: string, slippage: number, coinIn?: TransactionObjectArgument): Promise<any>Last updated
Was this helpful?

