import * as _solana_kit from '@solana/kit'; import { TransactionSigner, Address, createSolanaRpcFromTransport, sendAndConfirmTransactionFactory, Instruction, Commitment, TransactionModifyingSigner, Lamports, createSolanaRpcSubscriptions, Account, Decoder, MessageModifyingSigner } from '@solana/kit'; export { RpcTransport } from '@solana/kit'; import { createRecentSignatureConfirmationPromiseFactory } from '@solana/transaction-confirmation'; import { Mint } from '@solana-program/token-2022'; /** * Loads a wallet (KeyPairSigner) from a file. The file should be in the same format as files created by the solana-keygen command. * @param {string} [filepath] - Path to load keypair from file. Defaults to ~/.config/solana/id.json * @returns {Promise} The loaded wallet */ declare const loadWalletFromFile: (filepath?: string) => Promise; /** * Loads a wallet (KeyPairSigner) from an environment variable. The keypair should be in the same 'array of numbers' format as used by solana-keygen. * @param {string} variableName - Name of environment variable containing the keypair * @returns {TransactionSigner} The loaded wallet */ declare const loadWalletFromEnvironment: (variableName: string) => TransactionSigner; declare const checkAddressMatchesPrivateKey: (address: Address, privateKey: Uint8Array) => Promise; /** * Checks if a given address is a valid Ed25519 public key. * @param address - The address key to check, either as a Uint8Array, base58 string, or Address * @returns boolean indicating if the public key is valid */ declare const checkIfAddressIsPublicKey: (address: Uint8Array | string | Address) => Promise; interface ErrorWithTransaction extends Error { transaction: Awaited["getTransaction"]>>; context: { __code: number; code: number; index: number; }; } declare const signatureBytesToBase58String: (signatureBytes: Uint8Array) => string; declare const signatureBase58StringToBytes: (base58String: string) => Uint8Array; declare const sendTransactionFromInstructionsWithWalletAppFactory: (rpc: ReturnType) => ({ feePayer, instructions, abortSignal, }: { feePayer: TransactionModifyingSigner; instructions: Array; abortSignal?: AbortSignal | null; }) => Promise; declare const sendTransactionFromInstructionsFactory: (rpc: ReturnType, needsPriorityFees: boolean, supportsGetPriorityFeeEstimate: boolean, enableClientSideRetries: boolean, sendAndConfirmTransaction: ReturnType) => ({ feePayer, instructions, commitment, skipPreflight, maximumClientSideRetries, abortSignal, timeout, }: { feePayer: TransactionSigner; instructions: Array; commitment?: Commitment; skipPreflight?: boolean; maximumClientSideRetries?: number; abortSignal?: AbortSignal | null; timeout?: number; }) => Promise<_solana_kit.Signature>; declare const getLamportBalanceFactory: (rpc: ReturnType) => (address: string, commitment?: Commitment) => Promise; declare const airdropIfRequiredFactory: (rpc: ReturnType, rpcSubscriptions: ReturnType) => (address: Address, airdropAmount: Lamports, minimumBalance: Lamports, commitment?: Commitment | null) => Promise; /** * Creates a function to watch for changes to a Solana account's lamport balance. * @param rpc - The Solana RPC client for making API calls * @param rpcSubscriptions - The WebSocket client for real-time subscriptions * @returns Function to watch balance changes */ declare const watchLamportBalanceFactory: (rpc: ReturnType, rpcSubscriptions: ReturnType) => (address: Address, callback: (error: Error | null, balance: Lamports | null) => void) => () => void; declare const createWalletFactory: (airdropIfRequired: ReturnType) => (options?: { prefix?: string | null; suffix?: string | null; envFileName?: string | null; envVariableName?: string; fileName?: string | null; airdropAmount?: Lamports | null; commitment?: Commitment | null; }) => Promise; declare const createWalletsFactory: (createWallet: ReturnType) => (amount: number, options?: Parameters>[0]) => Promise>; declare const transferLamportsFactory: (sendTransactionFromInstructions: ReturnType) => ({ source, destination, amount, commitment, skipPreflight, maximumClientSideRetries, abortSignal, }: { source: TransactionSigner; destination: Address; amount: Lamports; commitment?: Commitment; skipPreflight?: boolean; maximumClientSideRetries?: number; abortSignal?: AbortSignal | null; }) => Promise<_solana_kit.Signature>; declare const transferTokensFactory: (getMint: ReturnType, sendTransactionFromInstructions: ReturnType) => ({ sender, destination, mintAddress, amount, maximumClientSideRetries, abortSignal, useTokenExtensions, }: { sender: TransactionSigner; destination: Address; mintAddress: Address; amount: bigint; maximumClientSideRetries?: number; abortSignal?: AbortSignal | null; useTokenExtensions?: boolean; }) => Promise<_solana_kit.Signature>; /** * Gets the address where a wallet's tokens are stored. * Each wallet has a unique storage address for each type of token. * @param {Address} wallet - The wallet that owns the tokens * @param {Address} mint - The type of token * @param {boolean} [useTokenExtensions=false] - Use Token Extensions program instead of classic Token program * @returns {Promise
} The token account address */ declare const getTokenAccountAddress: (wallet: Address, mint: Address, useTokenExtensions?: boolean) => Promise>; declare const createTokenMintFactory: (rpc: ReturnType, sendTransactionFromInstructions: ReturnType) => ((params: { mintAuthority: TransactionSigner; decimals: number; name?: string; symbol?: string; uri?: string; additionalMetadata?: Record | Map; useTokenExtensions?: boolean; }) => Promise
); declare const mintTokensFactory: (sendTransactionFromInstructions: ReturnType) => (mintAddress: Address, mintAuthority: TransactionSigner, amount: bigint, destination: Address, useTokenExtensions?: boolean) => Promise<_solana_kit.Signature>; declare const getMintFactory: (rpc: ReturnType) => (mintAddress: Address, commitment?: Commitment) => Promise>; declare const getTokenAccountBalanceFactory: (rpc: ReturnType) => (options: { wallet?: Address; mint?: Address; tokenAccount?: Address; useTokenExtensions?: boolean; }) => Promise<{ amount: bigint; decimals: any; uiAmount: any; uiAmountString: any; }>; declare const checkTokenAccountIsClosedFactory: (getTokenAccountBalance: ReturnType) => (options: { wallet?: Address; mint?: Address; tokenAccount?: Address; useTokenExtensions?: boolean; }) => Promise; declare const getTokenMetadataFactory: (rpc: ReturnType) => (mintAddress: Address, commitment?: Commitment) => Promise<{ updateAuthority: Uint8Array; mint: Uint8Array; name: string; symbol: string; uri: string; additionalMetadata: Record; } | { updateAuthority: Address | null; mint: Address; name: string; symbol: string; uri: string; additionalMetadata: Record; }>; /** * Creates a function to update Token-2022 metadata fields. * @param rpc - The Solana RPC client for making API calls * @param sendTransactionFromInstructions - Function to send transactions * @returns Function to update token metadata */ declare const updateTokenMetadataFactory: (rpc: ReturnType, sendTransactionFromInstructions: ReturnType) => ({ mintAddress, updateAuthority, name, symbol, uri, additionalMetadata, commitment, }: { mintAddress: Address; updateAuthority: TransactionSigner; name?: string; symbol?: string; uri?: string; additionalMetadata?: Record; commitment?: Commitment; }) => Promise<_solana_kit.Signature>; /** * Creates a function to watch for changes to a token balance. * @param rpc - The Solana RPC client for making API calls * @param rpcSubscriptions - The WebSocket client for real-time subscriptions * @returns Function to watch token balance changes */ declare const watchTokenBalanceFactory: (rpc: ReturnType, rpcSubscriptions: ReturnType) => (ownerAddress: Address, mintAddress: Address, callback: (error: Error | null, balance: { amount: bigint; decimals: number; uiAmount: number | null; uiAmountString: string; } | null) => void, useTokenExtensions?: boolean) => () => void; declare const burnTokensFactory: (getMint: ReturnType, sendTransactionFromInstructions: ReturnType) => ({ mintAddress, owner, amount, useTokenExtensions, skipPreflight, maximumClientSideRetries, abortSignal, }: { mintAddress: Address; owner: TransactionSigner; amount: bigint; useTokenExtensions?: boolean; skipPreflight?: boolean; maximumClientSideRetries?: number; abortSignal?: AbortSignal | null; }) => Promise<_solana_kit.Signature>; declare const closeTokenAccountFactory: (sendTransactionFromInstructions: ReturnType) => ({ owner, tokenAccount, wallet, mint, destination, useTokenExtensions, skipPreflight, maximumClientSideRetries, abortSignal, }: { owner: TransactionSigner; tokenAccount?: Address; wallet?: Address; mint?: Address; destination?: Address; useTokenExtensions?: boolean; skipPreflight?: boolean; maximumClientSideRetries?: number; abortSignal?: AbortSignal | null; }) => Promise<_solana_kit.Signature>; declare const getTokenAccountsFactory: (rpc: ReturnType) => (walletAddress: Address, excludeZeroBalance?: boolean) => Promise; declare const getLogsFactory: (rpc: ReturnType) => (signature: string) => Promise>; declare const getExplorerLinkFactory: (clusterNameOrURL: string) => (linkType: "transaction" | "tx" | "address" | "block", id: string) => string; /** * Calculates a Program Derived Address (PDA) and its bump seed from a program address and seeds. * Handles encoding of different seed types: * - Strings: encoded as UTF-8 * - Addresses: encoded using the address encoder * - BigInts: encoded as 8-byte Uint8Array (little-endian by default, big-endian if specified) * - Uint8Array: used as-is * * @param {Address} programAddress - The program address to derive the PDA from * @param {Array} seeds - Array of seeds to derive the PDA * @param {boolean} useBigEndian - Whether to use big-endian byte order for BigInt seeds (default: false) * @returns {Promise<{pda: Address, bump: number}>} The derived PDA and its bump seed */ declare const getPDAAndBump: (programAddress: Address, seeds: Array, useBigEndian?: boolean) => Promise<{ pda: Address; bump: _solana_kit.ProgramDerivedAddressBump; }>; declare const getAccountsFactoryFactory: (rpc: ReturnType) => (programAddress: Address, discriminator: Uint8Array, decoder: Decoder) => () => Promise<_solana_kit.MaybeAccount[]>; declare const signMessageFromWalletApp: (message: string, messageSigner: MessageModifyingSigner) => Promise; declare const getLatestBlockhashFactory: (rpc: ReturnType) => (commitment?: Commitment) => Promise; declare const checkHealthFactory: (rpc: ReturnType) => () => Promise; declare const getCurrentSlotFactory: (rpc: ReturnType) => (commitment?: Commitment) => Promise; declare const getMinimumBalanceFactory: (rpc: ReturnType) => (dataLength: bigint) => Promise; declare const getTransactionFactory: (rpc: ReturnType) => (signature: string, commitment?: Commitment, maxSupportedTransactionVersion?: number) => Promise; interface KitePluginConfig { clusterNameOrURL?: string; webSocketURL?: string; } /** * Creates a Kite plugin that extends a Solana Kit RPC client with helpful utility functions. * This plugin adds wallet creation, token operations, transaction helpers, and more. * * @param {KitePluginConfig} [config={}] - Configuration for the plugin * @param {string} [config.clusterNameOrURL="localnet"] - Cluster name or HTTP URL * @param {string} [config.webSocketURL] - WebSocket URL for subscriptions (auto-derived if not provided) * @returns A plugin function that extends RPC clients with Kite functionality * * @example * // Use as a plugin * const client = createSolanaRpc(url).use(createKitePlugin({ clusterNameOrURL: 'devnet' })); */ declare const createKitePlugin: (config?: KitePluginConfig) => >>(rpc: T) => T & Connection; /** * Creates a connection to a Solana cluster with all helper functions pre-configured. * This is a convenience wrapper around the Kite plugin. * * @param {string | ReturnType} [clusterNameOrURLOrRpc="localnet"] - Either: * - A cluster name, from this list: * Public clusters (note these are rate limited, you should use a commercial RPC provider for production apps) * "mainnet", "testnet", "devnet", "localnet" * QuickNode: * "quicknode-mainnet", "quicknode-devnet", "quicknode-testnet" * Helius: * "helius-mainnet" or "helius-devnet" (Helius does not have testnet) * Triton: * "triton-mainnet", "triton-devnet", "triton-testnet" * - An HTTP URL * - A pre-configured RPC client * @param {string | ReturnType | null} [clusterWebSocketURLOrRpcSubscriptions=null] - Either: * - WebSocket URL for subscriptions (required if using custom HTTP URL) * - A pre-configured RPC subscriptions client * @returns {Connection} Connection object with all helper functions configured * @throws {Error} If using QuickNode cluster without QUICKNODE_SOLANA_MAINNET_ENDPOINT or QUICKNODE_SOLANA_DEVNET_ENDPOINT or QUICKNODE_SOLANA_TESTNET_ENDPOINT environment variable set * @throws {Error} If using Helius cluster without HELIUS_API_KEY environment variable set * @throws {Error} If using Triton cluster without TRITON_SOLANA_MAINNET_ENDPOINT or TRITON_SOLANA_DEVNET_ENDPOINT or TRITON_SOLANA_TESTNET_ENDPOINT environment variable set * @throws {Error} If using custom HTTP URL without WebSocket URL * @throws {Error} If cluster name is invalid */ declare const connect: (clusterNameOrURLOrRpc?: string | ReturnType>, clusterWebSocketURLOrRpcSubscriptions?: string | ReturnType | null) => Connection; interface Connection { /** * The core RPC client for making direct Solana API calls. Use this when you need * access to raw Solana JSON RPC methods not covered by helper functions. */ rpc: ReturnType>; /** * The WebSocket client for real-time Solana event subscriptions like new blocks, * program logs, account changes etc. */ rpcSubscriptions: ReturnType; /** * Submits a transaction and waits for it to be confirmed on the network. * @param {VersionedTransaction} transaction - The complete signed transaction to submit * @param {Object} [options] - Optional configuration * @param {Commitment} [options.commitment] - Confirmation level to wait for: * 'processed' = processed by current node, * 'confirmed' = confirmed by supermajority of the cluster, * 'finalized' = confirmed by supermajority and unlikely to revert * @param {boolean} [options.skipPreflight] - Skip pre-flight transaction checks to reduce latency * @returns {Promise} */ sendAndConfirmTransaction: ReturnType; /** * Builds, signs and sends a transaction containing multiple instructions. * @param {Object} params - Transaction parameters * @param {TransactionSigner} params.feePayer - Account that will pay the transaction fees * @param {Array} params.instructions - List of instructions to execute in sequence * @param {Commitment} [params.commitment="confirmed"] - Confirmation level to wait for: * 'processed' = processed by current node, * 'confirmed' = confirmed by supermajority of the cluster, * 'finalized' = confirmed by supermajority and unlikely to revert * @param {boolean} [params.skipPreflight=true] - Skip pre-flight transaction checks to reduce latency * @param {number} [params.maximumClientSideRetries=0] - Number of times to retry if the transaction fails * @param {AbortSignal | null} [params.abortSignal=null] - Signal to cancel the transaction * @param {number} [params.timeout=undefined] - Timeout for the transaction in milliseconds * @returns {Promise} The transaction signature */ sendTransactionFromInstructions: ReturnType; /** * Gets an account's SOL balance in lamports (1 SOL = 1,000,000,000 lamports). * @param {string} address - The account address to check * @param {Commitment} commitment - Confirmation level of data: * 'processed' = maybe outdated but fast, * 'confirmed' = confirmed by supermajority, * 'finalized' = definitely permanent but slower * @returns {Promise} The balance in lamports */ getLamportBalance: ReturnType; /** * Watches for changes to a Solana account's lamport balance. * @param {Address} address - The Solana address to watch * @param {(error: Error | null, balance: Lamports | null) => void} callback - Called with (error, balance) on each balance change * @returns {() => void} Cleanup function to stop watching */ watchLamportBalance: ReturnType; /** * Watches for changes to a token balance. * @param {Address} ownerAddress - The wallet address that owns the tokens * @param {Address} mintAddress - The token mint address * @param {(error: Error | null, balance: object | null) => void} callback - Called with (error, balance) on each balance change * @returns {Promise<() => void>} Cleanup function to stop watching */ watchTokenBalance: ReturnType; /** * Creates a URL to view any Solana entity on Solana Explorer. * Automatically configures the URL for the current network/cluster. * @param {("transaction" | "tx" | "address" | "block")} linkType - What type of entity to view * @param {string} id - Identifier (address, signature, or block number) * @returns {string} A properly configured Solana Explorer URL */ getExplorerLink: ReturnType; /** * Checks if a transaction has been confirmed on the network. * Useful for verifying that time-sensitive transactions have succeeded. * @param {string} signature - The unique transaction signature to verify * @returns {Promise} True if the transaction is confirmed */ getRecentSignatureConfirmation: ReturnType; /** * Checks if a token account is closed or doesn't exist. * A token account can be specified directly or derived from a wallet and mint address. * @param {Object} params - Parameters for checking token account * @param {Address} [params.tokenAccount] - Direct token account address to check * @param {Address} [params.wallet] - Wallet address (required if tokenAccount not provided) * @param {Address} [params.mint] - Token mint address (required if tokenAccount not provided) * @param {boolean} [params.useTokenExtensions=false] - Use Token Extensions program instead of classic Token program * @returns {Promise} True if the token account is closed or doesn't exist, false if it exists and is open * @throws {Error} If neither tokenAccount nor both wallet and mint are provided * @throws {Error} If there's an error checking the account that isn't related to the account not existing */ checkTokenAccountIsClosed: ReturnType; /** * Gets token metadata using the metadata pointer extension. * @param {Address} mintAddress - The token mint address * @param {Commitment} [commitment="confirmed"] - Confirmation level to wait for * @returns {Promise} The token metadata including name, symbol, uri, and additional metadata */ getTokenMetadata: ReturnType; /** * Updates Token-2022 metadata fields. * @param {Object} params - Parameters for updating metadata * @param {Address} params.mintAddress - The token mint address * @param {TransactionSigner} params.updateAuthority - The update authority signer * @param {string} [params.name] - New token name * @param {string} [params.symbol] - New token symbol * @param {string} [params.uri] - New metadata URI * @param {Record} [params.additionalMetadata] - Additional metadata key-value pairs * @param {Commitment} [params.commitment="confirmed"] - Confirmation level to wait for * @returns {Promise} Transaction signature */ updateTokenMetadata: ReturnType; /** * Requests free test SOL from a faucet if an account's balance is too low. * Only works on test networks (devnet/testnet). * @param {Address} address - The account that needs SOL * @param {Lamports} airdropAmount - How much SOL to request (in lamports) * @param {Lamports} minimumBalance - Only request SOL if balance is below this amount * @param {Commitment} commitment - Confirmation level to wait for: * 'processed' = processed by current node, * 'confirmed' = confirmed by supermajority of the cluster, * 'finalized' = confirmed by supermajority and unlikely to revert * @returns {Promise} Transaction signature if SOL was airdropped, null if no airdrop was needed */ airdropIfRequired: ReturnType; /** * Creates a new Solana wallet with optional vanity address and automatic funding. * @param {Object} [options={}] - Configuration options * @param {string | null} [options.prefix] - Generate address starting with these characters * @param {string | null} [options.suffix] - Generate address ending with these characters * @param {string | null} [options.envFileName] - Save private key to this .env file * @param {string} [options.envVariableName] - Environment variable name to store the key * @param {Lamports | null} [options.airdropAmount] - Amount of test SOL to request from faucet * @returns {Promise} The new wallet, ready to use */ createWallet: ReturnType; /** * Creates multiple Solana wallets in parallel with identical configuration. * @param {number} amount - How many wallets to create * @param {Object} options - Same configuration options as createWallet * @returns {Promise>} Array of new wallets */ createWallets: ReturnType; /** * Retrieves the program output messages from a transaction. * Useful for debugging failed transactions or understanding program behavior. * @param {string} signature - Transaction signature to analyze * @returns {Promise>} Program log messages in order of execution */ getLogs: ReturnType; /** * Transfers SOL from one account to another. * @param {Object} params - Transfer details * @param {TransactionSigner} params.source - Account sending the SOL (must sign) * @param {Address} params.destination - Account receiving the SOL * @param {Lamports} params.amount - Amount of SOL to send (in lamports) * @param {boolean} [params.skipPreflight=true] - Skip pre-flight checks to reduce latency * @param {number} [params.maximumClientSideRetries=0] - Number of retry attempts if transfer fails * @param {AbortSignal | null} [params.abortSignal=null] - Signal to cancel the transfer * @returns {Promise} Transaction signature */ transferLamports: ReturnType; /** * Creates a new SPL token with metadata and minting controls. * @param {Object} params - Token configuration * @param {TransactionSigner} params.mintAuthority - Account that will have permission to mint tokens * @param {number} params.decimals - Number of decimal places (e.g. 9 decimals means 1 token = 1,000,000,000 base units) * @param {string} params.name - Display name of the token * @param {string} params.symbol - Short ticker symbol (e.g. "USDC") * @param {string} params.uri - URL to token metadata (image, description etc.) * @param {Record | Map} [params.additionalMetadata={}] - Extra metadata key-value pairs * @returns {Promise
} Address of the new token mint */ createTokenMint: (params: { mintAuthority: TransactionSigner; decimals: number; name?: string; symbol?: string; uri?: string; additionalMetadata?: Record | Map; useTokenExtensions?: boolean; }) => Promise
; /** * Creates new tokens from a token mint. * @param {Address} mintAddress - The token mint to create tokens from * @param {TransactionSigner} mintAuthority - Account authorized to mint new tokens (must sign) * @param {bigint} amount - Number of base units to mint (adjusted for decimals) * @param {Address} destination - Account to receive the new tokens * @param {boolean} [useTokenExtensions=true] - Use Token Extensions program instead of classic Token program * @returns {Promise} Transaction signature */ mintTokens: (mintAddress: Address, mintAuthority: TransactionSigner, amount: bigint, destination: Address, useTokenExtensions?: boolean) => Promise; /** * Transfers SPL tokens between accounts. * @param {Object} params - Transfer details * @param {TransactionSigner} params.sender - Account sending the tokens (must sign) * @param {Address} params.destination - Account receiving the tokens * @param {Address} params.mintAddress - The type of token to transfer * @param {bigint} params.amount - Number of base units to transfer (adjusted for decimals) * @param {number} [params.maximumClientSideRetries=0] - Number of retry attempts if transfer fails * @param {AbortSignal | null} [params.abortSignal=null] - Signal to cancel the transfer * @param {boolean} [params.useTokenExtensions=true] - Use Token Extensions program instead of classic Token program * @returns {Promise} Transaction signature */ transferTokens: ReturnType; /** * Retrieves information about a token mint including supply and decimals. * @param {Address} mintAddress - Address of the token mint to query * @param {Commitment} [commitment="confirmed"] - Confirmation level of data: * 'processed' = maybe outdated but fast, * 'confirmed' = confirmed by supermajority, * 'finalized' = definitely permanent but slower * @returns {Promise} Token information if found, null if not */ getMint: ReturnType; /** * Gets the token balance for a specific account. You can either provide a token account address directly, or provide a wallet address and a mint address to derive the token account address. * @param {Object} params - Parameters for getting token balance * @param {Address} [params.tokenAccount] - Direct token account address to check balance for * @param {Address} [params.wallet] - Wallet address (required if tokenAccount not provided) * @param {Address} [params.mint] - Token mint address (required if tokenAccount not provided) * @param {boolean} [params.useTokenExtensions=false] - Use Token Extensions program instead of classic Token program * @returns {Promise<{amount: BigInt, decimals: number, uiAmount: number | null, uiAmountString: string}>} Balance information including amount and decimals * @throws {Error} If neither tokenAccount nor both wallet and mint are provided */ getTokenAccountBalance: (params: { tokenAccount?: Address; wallet?: Address; mint?: Address; useTokenExtensions?: boolean; }) => Promise<{ amount: BigInt; decimals: number; uiAmount: number | null; uiAmountString: string; }>; /** * Gets the address where a wallet's tokens are stored. * Each wallet has a unique storage address for each type of token. * @param {Address} wallet - The wallet that owns the tokens * @param {Address} mint - The type of token * @param {boolean} [useTokenExtensions=false] - Use Token Extensions program instead of classic Token program * @returns {Promise
} The token account address */ getTokenAccountAddress: typeof getTokenAccountAddress; /** * Loads a wallet from a file containing a keypair. * Compatible with keypair files generated by 'solana-keygen'. * @param {string} [filepath] - Location of the keypair file (defaults to ~/.config/solana/id.json) * @returns {Promise} The loaded wallet */ loadWalletFromFile: typeof loadWalletFromFile; /** * Loads a wallet from an environment variable containing a keypair. * The keypair must be in the same format as 'solana-keygen' (array of numbers). * @param {string} variableName - Name of environment variable storing the keypair * @returns {TransactionSigner} The loaded wallet */ loadWalletFromEnvironment: typeof loadWalletFromEnvironment; /** * Derives a Program Derived Address (PDA) and its bump seed. * PDAs are deterministic addresses that programs can sign for. * @param {Address} programAddress - The program that will control this PDA * @param {Array} seeds - Values used to derive the PDA * @returns {Promise<{pda: Address, bump: number}>} The derived address and bump seed */ getPDAAndBump: typeof getPDAAndBump; /** * Creates a factory function for getting program accounts with a specific discriminator. */ getAccountsFactory: ReturnType; /** * Gets all token accounts owned by a wallet address. * Queries both the classic SPL Token program and Token Extensions program. * @param {Address} walletAddress - The wallet address to get token accounts for * @param {boolean} [excludeZeroBalance=false] - If true, only returns accounts with balance > 0 * @returns {Promise} All token accounts from both programs */ getTokenAccounts: ReturnType; /** * Converts signature bytes to a base58 string. * @param {Uint8Array} signatureBytes - The signature bytes to convert * @returns {string} The base58 encoded signature string */ signatureBytesToBase58String: typeof signatureBytesToBase58String; /** * Converts a base58 string to signature bytes. * @param {string} base58String - The base58 encoded signature string * @returns {Uint8Array} The signature bytes */ signatureBase58StringToBytes: typeof signatureBase58StringToBytes; /** * Builds, signs and sends a transaction containing multiple instructions using a wallet app. * @param {Object} params - Transaction parameters * @param {TransactionSigner} params.feePayer - Account that will pay the transaction fees * @param {Array} params.instructions - List of instructions to execute in sequence * @param {AbortSignal | null} [params.abortSignal=null] - Signal to cancel the transaction * @returns {Promise} The transaction signature */ sendTransactionFromInstructionsWithWalletApp: ReturnType; /** * Signs a message using a wallet app. * @param {string} message - The message to sign * @param {MessageModifyingSigner} messageSigner - The signer that will sign the message * @returns {Promise} The base58 encoded signature */ signMessageFromWalletApp: typeof signMessageFromWalletApp; /** * Verifies if a given private key corresponds to a specific Solana address. * This is useful for validating that a private key matches an expected address * without exposing the private key in the process. * * @param {Address} address - The Solana address to verify against * @param {Uint8Array} privateKey - The raw private key bytes to check * @returns {Promise} True if the private key corresponds to the address, false otherwise */ checkAddressMatchesPrivateKey: typeof checkAddressMatchesPrivateKey; /** * Checks if a given address is a valid Ed25519 public key. * This verifies that the address represents a valid public key point on the Ed25519 curve, * as opposed to a Program Derived Address (PDA). * * @param {Uint8Array | string | Address} address - The address to check, either as bytes, base58 string, or Address type * @returns {Promise} True if the address is a valid Ed25519 public key, false otherwise */ checkIfAddressIsPublicKey: typeof checkIfAddressIsPublicKey; /** * Burns (permanently destroys) tokens from an account. * @param {Object} params - Burn parameters * @param {Address} params.mintAddress - The token mint address * @param {KeyPairSigner} params.owner - The owner of the tokens to burn * @param {bigint} params.amount - Number of base units to burn (adjusted for decimals) * @param {boolean} [params.useTokenExtensions=true] - Use Token Extensions program instead of classic Token program * @param {boolean} [params.skipPreflight=true] - Skip pre-flight checks * @param {number} [params.maximumClientSideRetries=0] - Number of retry attempts * @param {AbortSignal | null} [params.abortSignal=null] - Signal to cancel the operation * @returns {Promise} Transaction signature */ burnTokens: ReturnType; /** * Closes a token account and reclaims rent. * The account must have a zero balance before it can be closed. * @param {Object} params - Close account parameters * @param {KeyPairSigner} params.owner - The owner of the token account * @param {Address} [params.tokenAccount] - Direct token account address to close * @param {Address} [params.wallet] - Wallet address (required if tokenAccount not provided) * @param {Address} [params.mint] - Token mint address (required if tokenAccount not provided) * @param {Address} [params.destination] - Where to send reclaimed rent (defaults to owner) * @param {boolean} [params.useTokenExtensions=true] - Use Token Extensions program instead of classic Token program * @param {boolean} [params.skipPreflight=true] - Skip pre-flight checks * @param {number} [params.maximumClientSideRetries=0] - Number of retry attempts * @param {AbortSignal | null} [params.abortSignal=null] - Signal to cancel the operation * @returns {Promise} Transaction signature */ closeTokenAccount: ReturnType; /** * Gets the latest blockhash from the network. * @param {Commitment} [commitment="finalized"] - Confirmation level to use * @returns {Promise} Object containing blockhash, lastValidBlockHeight, and context */ getLatestBlockhash: ReturnType; /** * Checks the health status of the cluster node. * @returns {Promise} true if the node is healthy, false otherwise */ checkHealth: ReturnType; /** * Gets the current slot the node is processing. * @param {Commitment} [commitment="finalized"] - Confirmation level to use * @returns {Promise} The current slot number */ getCurrentSlot: ReturnType; /** * Calculates the minimum balance required for rent exemption for a given data size. * @param {bigint} dataLength - The size of the account data in bytes * @returns {Promise} The minimum balance in lamports needed for rent exemption */ getMinimumBalance: ReturnType; /** * Gets transaction details by signature. * @param {string} signature - The transaction signature to look up * @param {Commitment} [commitment="finalized"] - Confirmation level to use * @param {number} [maxSupportedTransactionVersion=0] - Maximum transaction version to return * @returns {Promise} Transaction details or null if not found */ getTransaction: ReturnType; } declare const TOKEN_PROGRAM: _solana_kit.Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">; declare const TOKEN_EXTENSIONS_PROGRAM: _solana_kit.Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">; declare const ASSOCIATED_TOKEN_PROGRAM: _solana_kit.Address<"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL">; declare const SOL = 1000000000n; export { ASSOCIATED_TOKEN_PROGRAM, type Connection, type ErrorWithTransaction, type KitePluginConfig, SOL, TOKEN_EXTENSIONS_PROGRAM, TOKEN_PROGRAM, airdropIfRequiredFactory, burnTokensFactory, checkAddressMatchesPrivateKey, checkHealthFactory, checkIfAddressIsPublicKey, checkTokenAccountIsClosedFactory, closeTokenAccountFactory, connect, createKitePlugin, createTokenMintFactory, createWalletFactory, createWalletsFactory, getAccountsFactoryFactory, getCurrentSlotFactory, getExplorerLinkFactory, getLamportBalanceFactory, getLatestBlockhashFactory, getLogsFactory, getMinimumBalanceFactory, getMintFactory, getPDAAndBump, getTokenAccountAddress, getTokenAccountBalanceFactory, getTokenAccountsFactory, getTokenMetadataFactory, getTransactionFactory, loadWalletFromEnvironment, loadWalletFromFile, mintTokensFactory, sendTransactionFromInstructionsFactory, sendTransactionFromInstructionsWithWalletAppFactory, signatureBase58StringToBytes, signatureBytesToBase58String, transferLamportsFactory, transferTokensFactory, watchLamportBalanceFactory, watchTokenBalanceFactory };