> ## 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.

# Memulai

> Gunakan LiteSVM dengan @solana/kit untuk pengujian Solana yang cepat dan berjalan di dalam proses

Test suite Solana yang menjalankan `solana-test-validator` membutuhkan beberapa detik per pengujian —
Anda harus menunggu startup proses, koneksi RPC, dan round-trip jaringan.
LiteSVM menjalankan pengujian yang sama dalam hitungan milidetik. Tanpa proses eksternal, tanpa jaringan,
semuanya berjalan di memori di dalam test runner Anda.

<Info>
  **Diuji dengan:** `@solana/kit@8.6.0`, `@solana/kit-plugin-litesvm@0.23.0`,
  `@solana/kit-plugin-signer@0.23.0`, `@solana-program/system@0.16.0`,
  `@solana-program/token@0.18.0`, dan `litesvm@1.6.1`. Paket-paket plugin ini
  masih baru dan berubah dengan cepat. Jika Anda mengalami ketidakcocokan, instal versi persis ini,
  misalnya `npm install @solana/kit@8.6.0 @solana/kit-plugin-litesvm@0.23.0`.
</Info>

Anda merakit client Kit dari `@solana/kit` dengan memasang plugin melalui
`.use()`: plugin signer
([`@solana/kit-plugin-signer`](https://www.npmjs.com/package/@solana/kit-plugin-signer)),
plugin LiteSVM
([`@solana/kit-plugin-litesvm`](https://www.npmjs.com/package/@solana/kit-plugin-litesvm)),
dan plugin program apa pun yang Anda butuhkan. Hasilnya menyediakan `client.sendTransaction()`,
`client.rpc`, serta akses langsung ke state akun, clock, dan sysvar — semuanya
tanpa keluar dari proses Anda.

## Mulai Cepat

<Steps titleSize="h3">

<Step title="Instal Dependensi">
```bash
npm install @solana/kit @solana/kit-plugin-litesvm @solana/kit-plugin-signer @solana-program/system
```

</Step>

<Step title="Buat Client Anda">
```typescript
import { createClient, generateKeyPairSigner, lamports } from "@solana/kit";
import { litesvm } from "@solana/kit-plugin-litesvm";
import { signer } from "@solana/kit-plugin-signer";

// Payer first, then the LiteSVM transport.
const mySigner = await generateKeyPairSigner();
const client = createClient().use(signer(mySigner)).use(litesvm());

// Fund the payer
client.svm.airdrop(client.payer.address, lamports(5_000_000_000n));

// Check the balance
const balance = client.svm.getBalance(client.payer.address);
console.log("Balance:", balance, "lamports");
```

<Info>
  `createClient()` mengembalikan shell kosong — setiap `.use(plugin)` menambahkan
  kapabilitas ke dalamnya. Plugin `signer()` harus dipasang **sebelum** `litesvm()`,
  karena `litesvm()` membaca `client.payer` saat dipasang. `signer(mySigner)` adalah singkatan untuk memasang keypair yang sama sebagai
  `payer` sekaligus `identity` — gunakan `payer()` atau `identity()` dari paket
  yang sama jika Anda ingin memisahkan kedua peran tersebut.
</Info>

<Info>
  Ingin penyiapan satu baris untuk eksperimen cepat? Lewati `signer()` dan gunakan
  `generatedPayer` dan `airdropPayer` dari `@solana/kit-plugin-signer`:
  `const client = await createClient().use(generatedPayer()).use(litesvm()).use(airdropPayer(lamports(10_000_000_000n)));`
  `generatedPayer()` dipasang sebelum `litesvm()`, dan `airdropPayer()` dipasang setelahnya
  karena membutuhkan fungsi airdrop yang disediakan oleh `litesvm()`. Jangan
  menggabungkannya dengan `signer()` (payer akan terdefinisi dua kali).
</Info>

</Step>

</Steps>

## Memahami Client

Setelah `.use(signer(...)).use(litesvm())`, client menyediakan:

| Properti                    | Deskripsi                                                                                                                                                                                              |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `client.payer`              | `TransactionSigner` yang Anda pasang dengan plugin `signer()` (juga diatur sebagai `client.identity`)                                                                                                         |
| `client.identity`           | Signer wallet yang memiliki akun, token, dan otoritas                                                                                                                                            |
| `client.svm`                | Instance [`LiteSVM`](https://www.npmjs.com/package/litesvm) langsung untuk manajemen akun, transaksi, dan konfigurasi                                                                               |
| `client.rpc`                | Antarmuka RPC yang kompatibel dengan Kit (subset: `getAccountInfo`, `getBalance`, `getEpochSchedule`, `getLatestBlockhash`, `getMinimumBalanceForRentExemption`, `getMultipleAccounts`, `getSlot`, `requestAirdrop`) |
| `client.sendTransaction(s)` | Merencanakan, menandatangani, dan mengirim instruksi sebagai transaksi                                                                                                                                                       |
| `client.airdrop`            | Meminta SOL dari faucet LiteSVM                                                                                                                                                                      |
| `client.getMinimumBalance`  | Menghitung lamports minimum untuk pembebasan rent                                                                                                                                                              |

### Menggunakan client.svm

Akses langsung ke LiteSVM untuk:

- Manajemen akun (`setAccount`, `getAccount`, `airdrop`)
- Eksekusi transaksi (`sendTransaction`, `simulateTransaction`)
- Konfigurasi (`withSigverify`, `withBlockhashCheck`, dll.)
- Manipulasi waktu (`warpToSlot`, `getClock`)

```typescript
import { address, generateKeyPairSigner, lamports } from "@solana/kit";

const myAddress = (await generateKeyPairSigner()).address;

// Fund an account
client.svm.airdrop(myAddress, lamports(1_000_000_000n));

// Set account state directly
client.svm.setAccount({
  address: myAddress,
  data: new Uint8Array([1, 2, 3]),
  executable: false,
  lamports: lamports(1_000_000n),
  programAddress: address("11111111111111111111111111111111"),
  space: 3n
});

// Get the latest blockhash
const blockhash = client.svm.latestBlockhash();
```

### Menggunakan client.rpc

Antarmuka RPC yang kompatibel dengan Kit untuk operasi standar:

```typescript
// Get account info (returns base64-encoded data)
const { value: account } = await client.rpc.getAccountInfo(myAddress).send();

// Get multiple accounts in one call
const { value: accounts } = await client.rpc
  .getMultipleAccounts([myAddress, client.payer.address])
  .send();

// Get latest blockhash
const { value: latestBlockhash } = await client.rpc.getLatestBlockhash().send();
```

<Warning>
  Lapisan RPC hanya mendukung **encoding base64**. Meminta encoding lain
  akan memunculkan error.
</Warning>

## Konfigurasi

Konfigurasikan LiteSVM menggunakan builder method pada `client.svm`:

```typescript
const client = createClient().use(signer(mySigner)).use(litesvm());

// Configure for testing
client.svm
  .withSigverify(false) // Skip signature verification
  .withBlockhashCheck(false) // Skip blockhash validation
  .withSysvars() // Reset Clock, Rent, and other sysvars to their defaults
  .withBuiltins() // Enable ed25519, secp256k1
  .withTransactionHistory(100n); // Store transaction history
```

## Mengirim Transaksi

Tambahkan plugin program setelah transport — plugin ini menempelkan instruction builder
pada client sehingga Anda tidak perlu menyentuh `TransactionMessage` mentah:

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

const mySigner = await generateKeyPairSigner();
const client = createClient()
  .use(signer(mySigner))
  .use(litesvm())
  .use(systemProgram());

client.svm.airdrop(client.payer.address, lamports(10_000_000_000n));

const recipient = await generateKeyPairSigner();

// Build and send in one call
await client.system.instructions
  .transferSol({
    source: client.payer,
    destination: recipient.address,
    amount: lamports(1_000_000_000n)
  })
  .sendTransaction();
```

## Alur SVM → RPC

Anda dapat mengatur state melalui SVM dan membacanya melalui RPC:

```typescript
import { address, lamports } from "@solana/kit";

// Set account directly via SVM
client.svm.setAccount({
  address: myAddress,
  data: new Uint8Array([0xde, 0xad, 0xbe, 0xef]),
  executable: false,
  lamports: lamports(1_000_000n),
  programAddress: address("11111111111111111111111111111111"),
  space: 4n
});

// Read via RPC (returns base64-encoded data)
const { value } = await client.rpc.getAccountInfo(myAddress).send();
console.log("Data:", value?.data); // ['3q2+7w==', 'base64']
```

## Langkah Selanjutnya

Bagian ini membahas client inti — membuat akun, mengirim instruksi, dan
membaca state. Jika pengujian Anda melibatkan token SPL (mint, ATA, transfer),
[panduan pengujian token](/developers/docs/tools/litesvm/typescript/tokens) menunjukkan bagaimana plugin
`tokenProgram()` meringkas ~40 baris penyiapan menjadi 3 pemanggilan. Untuk referensi
API lengkap, lihat [dokumentasi API](/developers/docs/tools/litesvm/typescript/api-reference).
