@renec-foundation/redex-sdk
Version:
Typescript SDK to interact with Orca's Whirlpool program.
13 lines (12 loc) • 520 B
TypeScript
import { u64 } from "@solana/spl-token";
import BN from "bn.js";
import { WhirlpoolData } from "../../types/public";
import { TickArraySequence } from "./tick-array-sequence";
export declare type SwapResult = {
amountA: BN;
amountB: BN;
nextTickIndex: number;
nextSqrtPrice: BN;
totalFeeAmount: BN;
};
export declare function computeSwap(whirlpoolData: WhirlpoolData, tickSequence: TickArraySequence, tokenAmount: u64, sqrtPriceLimit: BN, amountSpecifiedIsInput: boolean, aToB: boolean): SwapResult;