@pancakeswap/v3-sdk
Version:
⚒️ An SDK for building applications on top of Pancakeswap V3
31 lines • 1.37 kB
TypeScript
import { Currency, CurrencyAmount } from '@pancakeswap/sdk';
import { PoolState } from './getPool';
export declare const swap: ({ pool, zeroForOne, amountSpecified, sqrtPriceLimitX96, }: {
pool: PoolState;
zeroForOne: boolean;
amountSpecified: bigint;
sqrtPriceLimitX96?: bigint;
}) => Promise<{
amountCalculated: bigint;
sqrtRatioX96: bigint;
liquidity: bigint;
tickCurrent: number;
amountSpecifiedRemaining: bigint;
}>;
/**
* Given a desired input amount of a token, return the computed output
* amount and a pool with state updated after the trade
*/
export declare const getOutputAmount: <TCurrencyOut extends Currency = Currency, TCurrencyIn extends Currency = Currency>(pool: PoolState, inputAmount: CurrencyAmount<TCurrencyIn>, options?: {
sqrtPriceLimitX96?: bigint;
exact?: boolean;
}) => Promise<[CurrencyAmount<TCurrencyOut>, PoolState]>;
/**
* Given a desired output amount of a token, return the computed input
* amount and a pool with state updated after the trade
*/
export declare const getInputAmount: <TCurrencyIn extends Currency = Currency, TCurrencyOut extends Currency = Currency>(pool: PoolState, outputAmount: CurrencyAmount<TCurrencyOut>, options?: {
sqrtPriceLimitX96?: bigint;
exact?: boolean;
}) => Promise<[CurrencyAmount<TCurrencyIn>, PoolState]>;
//# sourceMappingURL=swap.d.ts.map