UNPKG

@rainfi/sdk

Version:

This package is used to interact with Rain.fi protocol on Solana

186 lines (185 loc) 6.65 kB
/** * This code was GENERATED using the solita package. * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality. * * See: https://github.com/metaplex-foundation/solita */ /// <reference types="node" /> import * as web3 from '@solana/web3.js'; import * as beet from '@metaplex-foundation/beet'; import { PairType } from '../types/PairType'; import { PairState } from '../types/PairState'; import { PairAuthorityType } from '../types/PairAuthorityType'; import { BondingCurve } from '../types/BondingCurve'; /** * Arguments used to create {@link NftSwapPair} * @category Accounts * @category generated */ export type NftSwapPairArgs = { hadoMarket: web3.PublicKey; pairType: PairType; pairState: PairState; pairAuthorityType: PairAuthorityType; pairAuthorityAdapterProgram: web3.PublicKey; lpTokensMint: web3.PublicKey; lpTokensInCirculation: beet.bignum; bondingCurve: BondingCurve; baseSpotPrice: beet.bignum; fee: beet.bignum; mathCounter: beet.bignum; currentSpotPrice: beet.bignum; feeTokenAccount: web3.PublicKey; feeVaultSeed: number; solOrTokenFeeAmount: beet.bignum; fundsTokenAccount: web3.PublicKey; fundsSolVaultSeed: number; fundsSolOrTokenBalance: beet.bignum; initialFundsSolOrTokenBalance: beet.bignum; buyOrdersQuantity: beet.bignum; nftsSeed: number; nftsCount: beet.bignum; lastTransactedAt: beet.bignum; concentrationIndex: beet.bignum; assetReceiver: web3.PublicKey; }; /** * Holds the data for the {@link NftSwapPair} Account and provides de/serialization * functionality for that data * * @category Accounts * @category generated */ export declare class NftSwapPair implements NftSwapPairArgs { readonly hadoMarket: web3.PublicKey; readonly pairType: PairType; readonly pairState: PairState; readonly pairAuthorityType: PairAuthorityType; readonly pairAuthorityAdapterProgram: web3.PublicKey; readonly lpTokensMint: web3.PublicKey; readonly lpTokensInCirculation: beet.bignum; readonly bondingCurve: BondingCurve; readonly baseSpotPrice: beet.bignum; readonly fee: beet.bignum; readonly mathCounter: beet.bignum; readonly currentSpotPrice: beet.bignum; readonly feeTokenAccount: web3.PublicKey; readonly feeVaultSeed: number; readonly solOrTokenFeeAmount: beet.bignum; readonly fundsTokenAccount: web3.PublicKey; readonly fundsSolVaultSeed: number; readonly fundsSolOrTokenBalance: beet.bignum; readonly initialFundsSolOrTokenBalance: beet.bignum; readonly buyOrdersQuantity: beet.bignum; readonly nftsSeed: number; readonly nftsCount: beet.bignum; readonly lastTransactedAt: beet.bignum; readonly concentrationIndex: beet.bignum; readonly assetReceiver: web3.PublicKey; private constructor(); /** * Creates a {@link NftSwapPair} instance from the provided args. */ static fromArgs(args: NftSwapPairArgs): NftSwapPair; /** * Deserializes the {@link NftSwapPair} from the data of the provided {@link web3.AccountInfo}. * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. */ static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [NftSwapPair, number]; /** * Retrieves the account info from the provided address and deserializes * the {@link NftSwapPair} from its data. * * @throws Error if no account info is found at the address or if deserialization fails */ static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey): Promise<NftSwapPair>; /** * Deserializes the {@link NftSwapPair} from the provided data Buffer. * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. */ static deserialize(buf: Buffer, offset?: number): [NftSwapPair, number]; /** * Serializes the {@link NftSwapPair} into a Buffer. * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it. */ serialize(): [Buffer, number]; /** * Returns the byteSize of a {@link Buffer} holding the serialized data of * {@link NftSwapPair} */ static get byteSize(): number; /** * Fetches the minimum balance needed to exempt an account holding * {@link NftSwapPair} data from rent * * @param connection used to retrieve the rent exemption information */ static getMinimumBalanceForRentExemption(connection: web3.Connection, commitment?: web3.Commitment): Promise<number>; /** * Determines if the provided {@link Buffer} has the correct byte size to * hold {@link NftSwapPair} data. */ static hasCorrectByteSize(buf: Buffer, offset?: number): boolean; /** * Returns a readable version of {@link NftSwapPair} properties * and can be used to convert to JSON and/or logging */ pretty(): { hadoMarket: string; pairType: string; pairState: string; pairAuthorityType: string; pairAuthorityAdapterProgram: string; lpTokensMint: string; lpTokensInCirculation: number | { toNumber: () => number; }; bondingCurve: BondingCurve; baseSpotPrice: number | { toNumber: () => number; }; fee: number | { toNumber: () => number; }; mathCounter: number | { toNumber: () => number; }; currentSpotPrice: number | { toNumber: () => number; }; feeTokenAccount: string; feeVaultSeed: number; solOrTokenFeeAmount: number | { toNumber: () => number; }; fundsTokenAccount: string; fundsSolVaultSeed: number; fundsSolOrTokenBalance: number | { toNumber: () => number; }; initialFundsSolOrTokenBalance: number | { toNumber: () => number; }; buyOrdersQuantity: number | { toNumber: () => number; }; nftsSeed: number; nftsCount: number | { toNumber: () => number; }; lastTransactedAt: number | { toNumber: () => number; }; concentrationIndex: number | { toNumber: () => number; }; assetReceiver: string; }; } /** * @category Accounts * @category generated */ export declare const nftSwapPairBeet: beet.BeetStruct<NftSwapPair, NftSwapPairArgs & { accountDiscriminator: number[]; }>;