UNPKG

goosefx-amm-sdk

Version:

SDK for the GooseFx AMM

55 lines (52 loc) 1.55 kB
import { PublicKey } from '@solana/web3.js'; import BN from 'bn.js'; import { BigNumberish } from '../../common/number.js'; import { splAccountLayout } from './layout.js'; import { AccountLayout } from '@solana/spl-token'; import '@solana/buffer-layout'; type SplAccountLayout = typeof splAccountLayout; type SplAccount = ReturnType<typeof AccountLayout.decode>; interface TokenAccountRaw { programId: PublicKey; pubkey: PublicKey; accountInfo: SplAccount; } interface TokenAccount { publicKey?: PublicKey; mint: PublicKey; isAssociated?: boolean; amount: BN; isNative: boolean; programId: PublicKey; } interface getCreatedTokenAccountParams { mint: PublicKey; config?: { associatedOnly?: boolean; }; } interface HandleTokenAccountParams { side: "in" | "out"; amount: BigNumberish; mint: PublicKey; programId?: PublicKey; tokenAccount?: PublicKey; payer?: PublicKey; bypassAssociatedCheck: boolean; skipCloseAccount?: boolean; checkCreateATAOwner?: boolean; } interface GetOrCreateTokenAccountParams { mint: PublicKey; owner: PublicKey; createInfo?: { payer: PublicKey; amount?: BigNumberish; }; associatedOnly: boolean; notUseTokenAccount?: boolean; skipCloseAccount?: boolean; tokenProgram?: PublicKey | string; checkCreateATAOwner?: boolean; } export { GetOrCreateTokenAccountParams, HandleTokenAccountParams, SplAccount, SplAccountLayout, TokenAccount, TokenAccountRaw, getCreatedTokenAccountParams };