UNPKG

@symmetry-hq/baskets-v2-sdk

Version:

Symmetry Baskets V2 SDK

62 lines (61 loc) 1.89 kB
import { Program } from "@coral-xyz/anchor"; import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js"; import { BasketsProgram } from "./idl/types"; import { VersionedTxs } from "./utils/txUtils"; import { WithdrawState } from "./state/withdrawState"; export declare function buyBasketHandler(sdkParams: { program: Program<BasketsProgram>; payer: PublicKey; connection: Connection; priorityFee: number; }, params: { basket: PublicKey; depositAmount: number; depositMint: PublicKey; }): Promise<VersionedTxs>; export declare function sellBasketHandler(sdkParams: { payer: PublicKey; connection: Connection; program: Program<BasketsProgram>; priorityFee: number; jupiterApiKey: string; maxAllowedAccounts: number; }, params: { basket: PublicKey; withdrawStateSeed: number[]; amountToWithdraw: number; destinationMint: PublicKey; rebalance: boolean; }): Promise<VersionedTxs>; export declare function sellRebalanceTokensIxs(sdkParams: { payer: PublicKey; connection: Connection; program: Program<BasketsProgram>; priorityFee: number; jupiterApiKey: string; maxAllowedAccounts: number; }, params: { withdrawStateData: WithdrawState; fromToken: PublicKey; }): Promise<{ ixs: TransactionInstruction[]; luts: PublicKey[]; }>; export declare function sellRebalanceHandler(sdkParams: { payer: PublicKey; connection: Connection; program: Program<BasketsProgram>; priorityFee: number; jupiterApiKey: string; maxAllowedAccounts: number; }, params: { withdrawState: PublicKey; }): Promise<VersionedTxs>; export declare function claimTokensHandler(sdkParams: { program: Program<BasketsProgram>; payer: PublicKey; connection: Connection; priorityFee: number; }, params: { withdrawState: PublicKey; }): Promise<VersionedTxs>;