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
Account Management
setAccount, getAccount, airdrop, getBalance
Transactions
sendTransaction, simulateTransaction, blockhash management
Configuration
Builder methods for configuring LiteSVM
Time & Sysvars
Clock manipulation and sysvar access
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 layerAccount Management (client.svm)
| Method | Description |
|---|---|
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)
| Method | Description |
|---|---|
addProgram(programId, bytes) | Load program from bytes |
addProgramFromFile(programId, path) | Load program from .so file |
Transactions (client.svm)
| Method | Description |
|---|---|
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)
| Method | Description |
|---|---|
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)
| Method | Description |
|---|---|
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)
| Method | Description |
|---|---|
getAccountInfo(address) | Fetch single account (base64 only) |
getMultipleAccounts(addresses) | Fetch multiple accounts |
getLatestBlockhash() | Get current blockhash |