LiteSVM Docs
API Reference

API Reference

Complete TypeScript API reference for LiteSVM

TypeScript API Reference

Complete API documentation for using LiteSVM with @solana/kit-plugins.

API Sections

Quick Reference

Plugin Setup

import { createEmptyClient } from '@solana/kit';
import { litesvm } from '@solana/kit-plugins';

const client = createEmptyClient().use(litesvm());
// client.svm: LiteSVM instance
// client.rpc: RPC compatibility layer

Account Management (client.svm)

MethodDescription
setAccount(account)Set account state directly
getAccount(address)Retrieve account data
getBalance(address)Get SOL balance
airdrop(address, lamports)Fund an account
minimumBalanceForRentExemption(size)Calculate rent-exempt minimum

Program Management (client.svm)

MethodDescription
addProgram(programId, bytes)Load program from bytes
addProgramFromFile(programId, path)Load program from .so file

Transactions (client.svm)

MethodDescription
sendTransaction(tx)Execute a transaction
simulateTransaction(tx)Simulate without state changes
latestBlockhash()Get current blockhash
latestBlockhashLifetime()Get blockhash with lifetime
expireBlockhash()Advance to new blockhash

Configuration (client.svm)

MethodDescription
withSigverify(bool)Enable/disable signature verification
withBlockhashCheck(bool)Enable/disable blockhash validation
withSysvars()Enable sysvar accounts
withBuiltins()Enable built-in programs
withPrecompiles()Enable precompiled programs
withTransactionHistory(n)Store last n transactions
withComputeBudget(budget)Set compute limits
withLamports(amount)Set default lamports
withLogBytesLimit(n)Set log output limit

Time & Sysvars (client.svm)

MethodDescription
warpToSlot(slot)Jump to specific slot
getClock()Get clock sysvar
getRent()Get rent sysvar
getEpochSchedule()Get epoch schedule
getLastRestartSlot()Get last restart slot
setLastRestartSlot(slot)Set last restart slot

RPC (client.rpc)

MethodDescription
getAccountInfo(address)Fetch single account (base64 only)
getMultipleAccounts(addresses)Fetch multiple accounts
getLatestBlockhash()Get current blockhash