UNPKG

@symmetry-hq/baskets-sdk

Version:

Software Development Kit for interacting with Symmetry Baskets Program

47 lines (46 loc) 4.42 kB
import { AddressLookupTableAccount, PublicKey, TransactionInstruction } from "@solana/web3.js"; import { TokenSettings, SimpleCreateParams, SimpleEditParams, TransactionToSend } from "./config"; import { Program } from "@coral-xyz/anchor"; import { BasketsIDL } from "./basketsIDL"; import { Basket } from "./basketState"; import { BuyState } from "./buyState"; import { FetchSignaturesMultiResponse } from "@switchboard-xyz/on-demand"; export declare function buildCreateBasketIx(program: Program<BasketsIDL>, tokenList: TokenSettings[], basketParams: SimpleCreateParams): Promise<TransactionInstruction>; export declare function buildEditBasketIx(program: Program<BasketsIDL>, tokenList: TokenSettings[], basketObj: Basket, basketParams: SimpleEditParams): Promise<TransactionInstruction>; export declare function buildEditManagetIx(program: Program<BasketsIDL>, basketState: Basket, newManager: PublicKey): Promise<TransactionInstruction>; export declare function buildCloseBasketIx(program: Program<BasketsIDL>, basketState: Basket): Promise<TransactionInstruction>; export declare function buildCreateMetadataIx(program: Program<BasketsIDL>, creator: PublicKey, basket: PublicKey, tokenMint: PublicKey, metadata: { symbol: string; name: string; uri: string; }): Promise<TransactionInstruction>; export declare function buildUpdateMetadataIx(program: Program<BasketsIDL>, creator: PublicKey, basket: PublicKey, tokenMint: PublicKey, metadata: { symbol: string; name: string; uri: string; }): Promise<TransactionInstruction>; export declare function buildSetMetadataIx(program: Program<BasketsIDL>, basket: Basket, metadata: { symbol: string; name: string; uri: string; }): Promise<TransactionInstruction>; export declare function buildBuyBasketIx(program: Program<BasketsIDL>, tokenList: TokenSettings[], user: PublicKey, basketObj: Basket, amount: number): Promise<TransactionInstruction>; export declare function buildClaimTokensFromBuyStateIxs(program: Program<BasketsIDL>, tokenList: TokenSettings[], feePayer: PublicKey, basketObj: Basket, buyStateObj: BuyState): Promise<TransactionInstruction[]>; export declare function buildMintFromBuyStateIx(program: Program<BasketsIDL>, tokenList: TokenSettings[], feePayer: PublicKey, basketObj: Basket, buyStateObj: BuyState): Promise<TransactionInstruction>; export declare function buildBuyBasketWithMultipleTokensIx(program: Program<BasketsIDL>, tokenList: TokenSettings[], user: PublicKey, basketObj: Basket, contribution: { token: PublicKey; amount: number; }[]): Promise<TransactionInstruction>; export declare function buildBuyBasketWithSingleTokenIx(program: Program<BasketsIDL>, tokenList: TokenSettings[], user: PublicKey, basketObj: Basket, contributionToken: PublicKey, contributionAmount: number): Promise<TransactionInstruction>; export declare function buildSellBasketToSingleTokenIx(program: Program<BasketsIDL>, tokenList: TokenSettings[], user: PublicKey, basketObj: Basket, withdrawToken: PublicKey, amount: number): Promise<TransactionInstruction>; export declare function buildSellBasketIx(program: Program<BasketsIDL>, user: PublicKey, basketObj: Basket, amount: number, rebalance: number): Promise<TransactionInstruction>; export declare function buildClaimTokensFromSellStateIxs(program: Program<BasketsIDL>, tokenList: TokenSettings[], feePayer: PublicKey, basketObj: Basket): Promise<TransactionInstruction[]>; export declare function buildUpdateCurrentWeightsIx(program: Program<BasketsIDL>, basket: Basket, tokenList: TokenSettings[]): Promise<TransactionInstruction>; export declare function buildWithdrawBeforeRebalanceIx(program: Program<BasketsIDL>, feePayer: PublicKey, basket: Basket, tokenList: TokenSettings[], fromToken: number, toToken: number, fromAmount: number): Promise<TransactionInstruction>; export declare function buildDepositAfterRebalanceIx(program: Program<BasketsIDL>, feePayer: PublicKey, basket: Basket, tokenList: TokenSettings[], toToken: number): Promise<TransactionInstruction>; export declare function getSwbFeedsUpdateIxs(program: Program, payer: PublicKey, feeds: PublicKey[], numSignatures?: number): Promise<[ TransactionInstruction, AddressLookupTableAccount[], FetchSignaturesMultiResponse ][]>; export declare function updateOraclesTxs(swbProgram: Program, payer: PublicKey, feeds: PublicKey[], lamports: number): Promise<TransactionToSend[]>;