---
title: API Reference
description: Complete TypeScript API reference for LiteSVM
---

Complete API documentation for using LiteSVM with `@solana/kit` and its plugin
ecosystem.

## API Sections

<Cards>
  <Card
    title="Account Management"
    description="setAccount, getAccount, airdrop, getBalance"
    href="/docs/tools/litesvm/typescript/api-reference/account-management"
  />
  <Card
    title="Transactions"
    description="sendTransaction, simulateTransaction, blockhash management"
    href="/docs/tools/litesvm/typescript/api-reference/transactions"
  />
  <Card
    title="Configuration"
    description="Builder methods for configuring LiteSVM"
    href="/docs/tools/litesvm/typescript/api-reference/configuration"
  />
  <Card
    title="Time & Sysvars"
    description="Clock manipulation and sysvar access"
    href="/docs/tools/litesvm/typescript/api-reference/time-and-sysvars"
  />
</Cards>

## Quick Reference

### Plugin Setup

```typescript
import { createClient, generateKeyPairSigner } from "@solana/kit";
import { litesvm } from "@solana/kit-plugin-litesvm";
import { signer } from "@solana/kit-plugin-signer";

const mySigner = await generateKeyPairSigner();
const client = createClient().use(signer(mySigner)).use(litesvm());
// client.svm: LiteSVM instance
// client.rpc: RPC compatibility layer
```

### Account 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          |
| `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              |
