@frakters/nft-lending-v2
Version:
Client library for interacting with nft lenging solana program
22 lines (21 loc) • 2.6 kB
TypeScript
/// <reference types="node" />
import { Keypair, PublicKey, TransactionInstruction, AccountInfo, Connection } from '@solana/web3.js';
import { StringPublicKey } from './vault';
export declare const TokenAccountParser: (pubKey: StringPublicKey, info: AccountInfo<Buffer>) => TokenAccount;
export interface TokenAccount {
pubkey: string;
account: AccountInfo<Buffer>;
info: AccountInfo<Buffer>;
}
export declare function approve(instructions: TransactionInstruction[], cleanupInstructions: TransactionInstruction[], account: PublicKey, owner: PublicKey, amount: number, autoRevoke?: boolean, delegate?: PublicKey, existingTransferAuthority?: Keypair): Keypair;
export declare function ensureSplAccount(instructions: TransactionInstruction[], cleanupInstructions: TransactionInstruction[], toCheck: TokenAccount, payer: PublicKey, amount: number, signers: Keypair[]): PublicKey;
export declare const DEFAULT_TEMP_MEM_SPACE = 65548;
export declare function createTempMemoryAccount(instructions: TransactionInstruction[], payer: PublicKey, signers: Keypair[], owner: PublicKey, space?: number): PublicKey;
export declare function createUninitializedMint(instructions: TransactionInstruction[], payer: PublicKey, amount: number, signers: Keypair[]): PublicKey;
export declare function createUninitializedAccount(instructions: TransactionInstruction[], payer: PublicKey, amount: number, signers: Keypair[]): PublicKey;
export declare function createAssociatedTokenAccountInstruction(instructions: TransactionInstruction[], associatedTokenAddress: PublicKey, payer: PublicKey, walletAddress: PublicKey, splTokenMintAddress: PublicKey): void;
export declare function createMint(instructions: TransactionInstruction[], payer: PublicKey, mintRentExempt: number, decimals: number, owner: PublicKey, freezeAuthority: PublicKey, signers: Keypair[]): PublicKey;
export declare function createTokenAccount(instructions: TransactionInstruction[], payer: PublicKey, accountRentExempt: number, mint: PublicKey, owner: PublicKey, signers: Keypair[]): PublicKey;
export declare function ensureWrappedAccount(instructions: TransactionInstruction[], cleanupInstructions: TransactionInstruction[], toCheck: TokenAccount | undefined, payer: PublicKey, amount: number, signers: Keypair[]): string;
export declare function findOrCreateAccountByMint(payer: PublicKey, owner: PublicKey, instructions: TransactionInstruction[], cleanupInstructions: TransactionInstruction[], accountRentExempt: number, mint: PublicKey, // use to identify same type
signers: Keypair[], connection: Connection): Promise<PublicKey>;