UNPKG

@rainfi/sdk

Version:

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

103 lines (102 loc) 3.74 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 { NftBoxType } from '../types/NftBoxType'; import { NftBoxState } from '../types/NftBoxState'; /** * Arguments used to create {@link NftPairBox} * @category Accounts * @category generated */ export type NftPairBoxArgs = { pair: web3.PublicKey; nftMint: web3.PublicKey; nftMetadata: web3.PublicKey; nftBoxType: NftBoxType; vaultTokenAccount: web3.PublicKey; status: NftBoxState; }; /** * Holds the data for the {@link NftPairBox} Account and provides de/serialization * functionality for that data * * @category Accounts * @category generated */ export declare class NftPairBox implements NftPairBoxArgs { readonly pair: web3.PublicKey; readonly nftMint: web3.PublicKey; readonly nftMetadata: web3.PublicKey; readonly nftBoxType: NftBoxType; readonly vaultTokenAccount: web3.PublicKey; readonly status: NftBoxState; private constructor(); /** * Creates a {@link NftPairBox} instance from the provided args. */ static fromArgs(args: NftPairBoxArgs): NftPairBox; /** * Deserializes the {@link NftPairBox} 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): [NftPairBox, number]; /** * Retrieves the account info from the provided address and deserializes * the {@link NftPairBox} 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<NftPairBox>; /** * Deserializes the {@link NftPairBox} 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): [NftPairBox, number]; /** * Serializes the {@link NftPairBox} 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 NftPairBox} */ static get byteSize(): number; /** * Fetches the minimum balance needed to exempt an account holding * {@link NftPairBox} 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 NftPairBox} data. */ static hasCorrectByteSize(buf: Buffer, offset?: number): boolean; /** * Returns a readable version of {@link NftPairBox} properties * and can be used to convert to JSON and/or logging */ pretty(): { pair: string; nftMint: string; nftMetadata: string; nftBoxType: string; vaultTokenAccount: string; status: string; }; } /** * @category Accounts * @category generated */ export declare const nftPairBoxBeet: beet.BeetStruct<NftPairBox, NftPairBoxArgs & { accountDiscriminator: number[]; }>;