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

# Başlarken

> LiteSVM'i yükleyin ve ilk testlerinizi yazın.

Bu rehber temel konuları kapsar: hesap oluşturma, hesaba fon ekleme ve
işlem gönderme.

<Steps titleSize="h2">

<Step title="Bağımlılıkları Yükleyin">
<Tabs>
<Tab title="Rust">

LiteSVM'i geliştirme bağımlılıklarınıza ekleyin:

```bash
cargo add --dev litesvm
```

Çeşitli Solana crate'leri, temel türleri ve yardımcı araçları sağlayarak test
deneyimini geliştirir. Bu sayfadaki örnekler `solana-sdk` kolaylık crate'ini
(LiteSVM 0.18'in kullandığı 4.x sürüm hattına sabitlenmiş) ve System Program
arayüz crate'ini kullanır:

```bash
cargo add --dev solana-sdk@4
cargo add --dev solana-system-interface --features bincode
```

<Warning>
  En güncel ana sürümü değil, `solana-sdk@4` sürümünü kullanın. Daha yeni bir `solana-sdk`,
  bileşen crate'lerinin (`solana-keypair`, `solana-transaction` ve diğerleri)
  ikinci bir kopyasını getirir ve türler artık LiteSVM'in beklediği türlerle
  eşleşmez. İsterseniz `solana-sdk` yerine LiteSVM'in yeniden dışa aktardığı
  tekil bileşen crate'lerini ekleyebilirsiniz.
</Warning>

</Tab>
<Tab title="TypeScript">

```bash
npm install @solana/kit @solana/kit-plugin-litesvm @solana/kit-plugin-signer @solana-program/system
```

</Tab>
</Tabs>

</Step>

<Step title="Test Dosyası Oluşturun">
<Tabs>
<Tab title="Rust">

Çalışma alanınızın içinde `tests` adlı bir klasör oluşturun.

```bash
mkdir tests
```

</Tab>
<Tab title="TypeScript">

Testiniz için yeni bir TypeScript dosyası oluşturun. Testler üst düzey `await`
kullandığından, önce `package.json` dosyanızda `"type": "module"` ayarını yapın
(aksi halde `tsx`, `Top-level await is currently not supported with the "cjs" output format`
hatasıyla başarısız olur):

```bash
npm pkg set type=module
touch basic-test.ts
```

</Tab>
</Tabs>

</Step>

<Step title="Hesap Oluşturun ve Hesaba Fon Ekleyin">
<Tabs>
<Tab title="Rust">

İlk LiteSVM testinizi yazalım.

`tests` klasörünüzün içinde yeni bir dosya oluşturun ve bu kodu kopyalayın:

```rust tests/create_account.rs
use litesvm::LiteSVM;
use solana_sdk::signature::{Keypair, Signer};

#[test]
fn create_account() {
    // Create the test environment
    let mut svm = LiteSVM::new();

    // Create a test account
    let user = Keypair::new();

    // Fund the account with SOL
    svm.airdrop(&user.pubkey(), 1_000_000_000).unwrap();

    // Check the balance
    let balance = svm.get_balance(&user.pubkey()).unwrap();
    assert_eq!(balance, 1_000_000_000);

    println!("Account funded with {} SOL", balance as f64 / 1e9);
}
```

</Tab>
<Tab title="TypeScript">

Bu kodu test dosyanıza kopyalayın:

```typescript basic-test.ts
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 and check balance
client.svm.airdrop(client.payer.address, lamports(5_000_000_000n));
const balance = client.svm.getBalance(client.payer.address);
console.log("Balance:", balance, "lamports");
```

</Tab>
</Tabs>

</Step>

<Step title="Testinizi Çalıştırın">
<Tabs>
<Tab title="Rust">

```bash
cargo test create_account -- --show-output
```

Şunu görmelisiniz:

```
running 1 test
test create_account ... ok

successes:

---- create_account stdout ----
Account funded with 1 SOL


successes:
    create_account
```

</Tab>
<Tab title="TypeScript">

```bash
npx tsx basic-test.ts
```

Şunu görmelisiniz:

```
Balance: 5000000000n lamports
```

</Tab>
</Tabs>

<Info>
  İlk LiteSVM testinizi yazdınız; bu test, bir hesap oluşturmayı ve
  hesaba fon eklemeyi kapsıyor.
</Info>

</Step>

<Step title="Bir İşlem Yürütün">
Şimdi bir transfer işlemi oluşturalım.

<Tabs>
<Tab title="Rust">

Yeni bir test dosyası oluşturun ve bu kodu kopyalayın:

```rust tests/transfer_test.rs
use litesvm::LiteSVM;
use solana_sdk::{
    signature::{Keypair, Signer},
    transaction::Transaction,
};
use solana_system_interface::instruction as system_instruction;

#[test]
fn test_transfer() {
    let mut svm = LiteSVM::new();

    // Create two accounts
    let alice = Keypair::new();
    let bob = Keypair::new();

    // Fund Alice
    svm.airdrop(&alice.pubkey(), 2_000_000_000).unwrap();

    // Create transfer instruction
    let transfer = system_instruction::transfer(
        &alice.pubkey(),
        &bob.pubkey(),
        1_000_000_000, // 1 SOL
    );

    // Build and sign transaction
    let tx = Transaction::new_signed_with_payer(
        &[transfer],
        Some(&alice.pubkey()),
        &[&alice],
        svm.latest_blockhash(),
    );

    // Send it (execution happens immediately)
    svm.send_transaction(tx).unwrap();

    // Check new balances
    assert_eq!(svm.get_balance(&bob.pubkey()).unwrap(), 1_000_000_000);
    assert!(svm.get_balance(&alice.pubkey()).unwrap() < 1_000_000_000);

    println!("Transfer successful!");
}
```

</Tab>
<Tab title="TypeScript">

Yeni bir dosya oluşturun ve bu kodu kopyalayın:

```typescript transfer-test.ts
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";

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

// Airdrop SOL to the payer
client.svm.airdrop(client.payer.address, lamports(2_000_000_000n));

// Build and send the transfer
await client.system.instructions
  .transferSol({
    source: client.payer,
    destination: recipient.address,
    amount: lamports(1_000_000_000n) // 1 SOL
  })
  .sendTransaction();

// Check new balances
const recipientBalance = client.svm.getBalance(recipient.address) ?? 0n;
console.log("Recipient balance:", Number(recipientBalance) / 1e9, "SOL");
console.log("Transfer successful!");
```

</Tab>
</Tabs>

<Info>
  Bu test, System Program'ın transfer talimatının
  yürütülmesini kapsar.
</Info>

</Step>

<Step title="Tüm Testleri Çalıştırın">
<Tabs>
<Tab title="Rust">

```bash
cargo test -- --show-output
```

Şunu görmelisiniz:

```
running 1 test
test create_account ... ok

successes:

---- create_account stdout ----
Account funded with 1 SOL


successes:
    create_account

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

     Running tests/transfer_test.rs (target/debug/deps/transfer_test-f174954e7483f36b)

running 1 test
test test_transfer ... ok

successes:

---- test_transfer stdout ----
Transfer successful!


successes:
    test_transfer

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

   Doc-tests litesvm_quickstart

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
```

</Tab>
<Tab title="TypeScript">

```bash
npx tsx basic-test.ts && npx tsx transfer-test.ts
```

Şunu görmelisiniz:

```
Balance: 5000000000n lamports
Recipient balance: 1 SOL
Transfer successful!
```

</Tab>
</Tabs>

<Info>
  Artık hesap oluşturan, hesaplara fon ekleyen ve işlem yürüten LiteSVM testleri yazdınız.
</Info>
</Step>

</Steps>

## Sonraki Adımlar

**[Neden LiteSVM →](/developers/docs/tools/litesvm/core-concepts)** Test için neden
LiteSVM kullanmak isteyebileceğinizi öğrenin

<Tabs>
  <Tab title="Rust">
    **[Programınızı Test Etme →](/developers/docs/tools/litesvm/testing-your-program)** Kendi
    Solana programınızı nasıl test edeceğinizi öğrenin <br /> **[Örnekler
    →](/developers/docs/tools/litesvm/examples)** Yaygın senaryolar için kopyala-yapıştır
    çözümlerini ve tam depo örneklerini görüntüleyin <br /> **[API Referansı
    →](/developers/docs/tools/litesvm/api-reference)** Gelişmiş özellikleri ve özel
    yapılandırmaları öğrenin
  </Tab>
  <Tab title="TypeScript">
    **[Programınızı Test Etme →](/developers/docs/tools/litesvm/typescript/getting-started)**
    LiteSVM for TypeScript ile kendi Solana programınızı nasıl test edeceğinizi öğrenin{" "}
    <br /> **[Örnekler →](/developers/docs/tools/litesvm/typescript/examples)** Yaygın senaryolar için
    kopyala-yapıştır çözümlerini görüntüleyin <br /> **[API Referansı
    →](/developers/docs/tools/litesvm/typescript/api-reference)** Gelişmiş özellikleri
    ve özel yapılandırmaları öğrenin
  </Tab>
</Tabs>
