> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Tài liệu tham chiếu API

> Tài liệu tham chiếu API TypeScript đầy đủ cho LiteSVM

Tài liệu API đầy đủ để sử dụng LiteSVM với `@solana/kit` và hệ sinh thái
plugin của nó.

## Các phần API

<Columns cols={2}>
  <Card title="Quản lý tài khoản" href="/developers/docs/tools/litesvm/typescript/api-reference/account-management">
    setAccount, getAccount, airdrop, getBalance
  </Card>
  <Card title="Giao dịch" href="/developers/docs/tools/litesvm/typescript/api-reference/transactions">
    sendTransaction, simulateTransaction, quản lý blockhash
  </Card>
  <Card title="Cấu hình" href="/developers/docs/tools/litesvm/typescript/api-reference/configuration">
    Các phương thức builder để cấu hình LiteSVM
  </Card>
  <Card title="Thời gian & Sysvars" href="/developers/docs/tools/litesvm/typescript/api-reference/time-and-sysvars">
    Thao tác đồng hồ và truy cập sysvar
  </Card>
</Columns>

## Tham khảo nhanh

### Thiết lập plugin

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

### Quản lý tài khoản (client.svm)

| Phương thức                                 | Mô tả                   |
| -------------------------------------- | ----------------------------- |
| `setAccount(account)`                  | Đặt trực tiếp trạng thái tài khoản    |
| `getAccount(address)`                  | Truy xuất dữ liệu tài khoản         |
| `getBalance(address)`                  | Lấy số dư SOL               |
| `airdrop(address, lamports)`           | Nạp tiền cho tài khoản               |
| `minimumBalanceForRentExemption(size)` | Tính số dư tối thiểu để được miễn rent |

### Quản lý chương trình (client.svm)

| Phương thức                                | Mô tả                |
| ------------------------------------- | -------------------------- |
| `addProgram(programId, bytes)`        | Tải chương trình từ bytes    |
| `addProgramFromFile(programId, path)` | Tải chương trình từ tệp .so |

### Giao dịch (client.svm)

| Phương thức                    | Mô tả                    |
| ------------------------- | ------------------------------ |
| `sendTransaction(tx)`     | Thực thi một giao dịch          |
| `simulateTransaction(tx)` | Mô phỏng mà không thay đổi trạng thái |
| `latestBlockhash()`       | Lấy blockhash hiện tại          |
| `expireBlockhash()`       | Chuyển sang blockhash mới       |

### Cấu hình (client.svm)

| Phương thức                      | Mô tả                           |
| --------------------------- | ------------------------------------- |
| `withSigverify(bool)`       | Bật/tắt xác minh chữ ký |
| `withBlockhashCheck(bool)`  | Bật/tắt xác thực blockhash   |
| `withSysvars()`             | Đặt lại sysvar về giá trị mặc định       |
| `withBuiltins()`            | Bật các chương trình tích hợp sẵn              |
| `withPrecompiles()`         | Bật các chương trình biên dịch sẵn           |
| `withTransactionHistory(n)` | Lưu n giao dịch gần nhất             |
| `withComputeBudget(budget)` | Đặt giới hạn tính toán                    |
| `withLamports(amount)`      | Đặt số dư của faucet airdrop        |
| `withLogBytesLimit(n)`      | Đặt giới hạn đầu ra của log                  |

### Thời gian & Sysvars (client.svm)

| Phương thức                     | Mô tả           |
| -------------------------- | --------------------- |
| `warpToSlot(slot)`         | Chuyển đến một slot cụ thể |
| `getClock()`               | Lấy sysvar clock      |
| `getRent()`                | Lấy sysvar rent       |
| `getEpochSchedule()`       | Lấy lịch trình epoch    |
| `getLastRestartSlot()`     | Lấy slot khởi động lại gần nhất |
| `setLastRestartSlot(slot)` | Đặt slot khởi động lại gần nhất |

### RPC (client.rpc)

| Phương thức                           | Mô tả                        |
| -------------------------------- | ---------------------------------- |
| `getAccountInfo(address)`        | Lấy một tài khoản (chỉ base64) |
| `getMultipleAccounts(addresses)` | Lấy nhiều tài khoản            |
| `getLatestBlockhash()`           | Lấy blockhash hiện tại              |
