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

# 設定

> TypeScriptでLiteSVMを設定するためのビルダーメソッド

LiteSVMは設定にビルダーパターンを採用しています。すべてのメソッドはメソッドチェーンができるように `LiteSVM` を返します。

## 典型的なテストのセットアップ

```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
  .withSigverify(false) // Skip signature verification (faster)
  .withBlockhashCheck(false) // Skip blockhash validation (simpler)
  .withTransactionHistory(100n); // Store last 100 transactions
```

`litesvm()` クライアントには、sysvar、組み込みプログラム、プリコンパイル、デフォルトプログラムがすでにロードされているため、典型的なセットアップでは必要なチェックだけを変更します。

## 署名とブロックハッシュ

### withSigverify

```typescript
withSigverify(sigverify: boolean): LiteSVM
```

署名検証を有効または無効にします。

```typescript
// Disable for faster tests (default is enabled)
client.svm.withSigverify(false);

// Enable for production-like testing
client.svm.withSigverify(true);
```

<Info>
  署名検証を無効にするとテストは高速になりますが、現実の動作からは離れます。
</Info>

### withBlockhashCheck

```typescript
withBlockhashCheck(check: boolean): LiteSVM
```

ブロックハッシュの有効期限チェックを有効または無効にします。

```typescript
// Disable for simpler tests
client.svm.withBlockhashCheck(false);
```

## プログラムとSysvar

これらのメソッドは、プログラムとsysvarをVMにロードします。`litesvm()` クライアントにはすでにすべてロードされているため、クライアントをリセットする場合や、`litesvm` パッケージの素の `LiteSVM.default()` インスタンスをセットアップする場合にのみ必要です。

### withSysvars

```typescript
withSysvars(): LiteSVM
```

Clock、Rent、EpochSchedule、その他のsysvarをデフォルトにリセットします。sysvarは新しいクライアントですでに利用可能なため、変更を元に戻したい場合にのみ必要です。`setClock` や `warpToSlot` の後に呼び出すと、設定したクロックは破棄されます。

```typescript
client.svm.setClock(myClock);
client.svm.withSysvars(); // the clock is back to its default
```

### withBuiltins

```typescript
withBuiltins(): LiteSVM
```

ランタイムの組み込みプログラム(System Program、BPFローダー、Vote、Compute Budget)を追加します。

```typescript
client.svm.withBuiltins();
```

### withPrecompiles

```typescript
withPrecompiles(): LiteSVM
```

署名検証用のプリコンパイル(ed25519、secp256k1、secp256r1)を追加します。

```typescript
client.svm.withPrecompiles();
```

### withDefaultPrograms

```typescript
withDefaultPrograms(): LiteSVM
```

デフォルトプログラム(Token、Token-2022、Associated Token Account、Memo、Stake、Address Lookup Table)を追加します。

```typescript
client.svm.withDefaultPrograms();
```

## リソース制限

### withLamports

```typescript
withLamports(lamports: bigint): LiteSVM
```

`airdrop()` の資金元となる内部ファウセットアカウントの残高を設定します。この残高を超えるエアドロップは失敗します。

```typescript
client.svm.withLamports(1_000_000_000n); // the faucet holds 1 SOL
```

### withLogBytesLimit

```typescript
withLogBytesLimit(limit?: bigint): LiteSVM
```

ログ出力のバイト数上限を設定します。

```typescript
client.svm.withLogBytesLimit(10000n);
```

### withTransactionHistory

```typescript
withTransactionHistory(capacity: bigint): LiteSVM
```

トランザクション履歴の保存を有効にします。

```typescript
// Store last 100 transactions
client.svm.withTransactionHistory(100n);
```

## フィーチャーセット

### withFeatureSet

```typescript
withFeatureSet(featureSet: FeatureSet): LiteSVM
```

特定のSolanaバージョンをテストするためのフィーチャーセットを設定します。
