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

# Riferimento API

> Riferimento completo dell'API Go per LiteSVM

Documentazione API completa per `litesvm-go` v0.3.0 e successive. I nomi dei metodi
ricalcano il builder Rust `LiteSVM` dove possibile; le coppie getter / setter seguono la
stessa convenzione Go (`Clock` / `SetClock`, `Rent` / `SetRent`, ...). Gli account sono
semplici valori `*solana.Account` e i sysvar sono i tipi di
`github.com/gagliardetto/solana-go/sysvar`.

## Sezioni dell'API

<Columns cols={2}>
  <Card title="Gestione degli account" href="/developers/docs/tools/litesvm/go/api-reference/account-management">
    Airdrop, Balance, GetAccount, SetAccount, NewAccount, programmi
  </Card>
  <Card title="Transazioni" href="/developers/docs/tools/litesvm/go/api-reference/transactions">
    Invio / simulazione di transazioni legacy e versioned, TxOutcome
  </Card>
  <Card title="Configurazione" href="/developers/docs/tools/litesvm/go/api-reference/configuration">
    Opzioni per sigverify, controllo del blockhash, cronologia, limiti dei log, programmi predefiniti
  </Card>
  <Card title="Tempo e sysvar" href="/developers/docs/tools/litesvm/go/api-reference/time-and-sysvars">
    WarpToSlot, Clock, Rent, EpochSchedule, EpochRewards, SlotHashes, SlotHistory, StakeHistory
  </Card>
</Columns>

## Riferimento rapido

### Configurazione dell'handle

```go
import (
    litesvm "github.com/LiteSVM/litesvm-go"
    solana "github.com/gagliardetto/solana-go"
)

svm, err := litesvm.New()
if err != nil {
    // handle error
}
defer svm.Close()
```

### Gestione degli account

| Metodo                                                                       | Descrizione                                          |
| ---------------------------------------------------------------------------- | ---------------------------------------------------- |
| `Airdrop(pubkey, lamports) error`                                            | Finanzia un account                                      |
| `Balance(pubkey) (uint64, bool, error)`                                      | Saldo in SOL; il bool indica se l'account esiste |
| `GetAccount(pubkey) *solana.Account`                                         | Copia dell'account (nil se assente)                 |
| `SetAccount(pubkey, *solana.Account) error`                                  | Salva direttamente lo stato dell'account                         |
| `MinimumBalanceForRentExemption(dataLen int) (uint64, error)`                | Calcola il minimo per l'esenzione dal rent                          |
| `NewAccount(lamports, data, owner, executable, rentEpoch) (*solana.Account, error)` | Costruisce un account da passare a SetAccount (funziona anche un literal `&solana.Account{...}`) |

### Gestione dei programmi

| Metodo                                                   | Descrizione                             |
| -------------------------------------------------------- | --------------------------------------- |
| `AddProgram(programID, bytes) error`                     | Carica un programma dai byte                 |
| `AddProgramFromFile(programID, path) error`              | Carica un programma da un file `.so`            |
| `AddProgramWithLoader(programID, bytes, loaderID) error` | Carica con un loader specifico (avanzato) |

### Transazioni

| Metodo                                                                        | Descrizione                                                                     |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `SendLegacyTransaction(txBytes) (*TxOutcome, error)`                          | Esegue una transazione legacy                                                    |
| `SendVersionedTransaction(txBytes) (*TxOutcome, error)`                       | Esegue una transazione v0+                                                       |
| `SimulateLegacyTransaction(txBytes) (*TxOutcome, error)`                      | Simula senza modificare lo stato                                                  |
| `SimulateVersionedTransaction(txBytes) (*TxOutcome, error)`                   | Simula una transazione v0+ senza modificare lo stato                                              |
| `LatestBlockhash() (solana.Hash, error)`                                      | Blockhash corrente                                                               |
| `ExpireBlockhash() error`                                                     | Passa a un nuovo blockhash                                                      |
| `GetTransaction(signature) *TxOutcome`                                        | Cerca la transazione nella cronologia (nil se assente)                                  |
| `litesvm.BuildTransferTx(payerSeed, to, lamports, blockhash) ([]byte, error)` | Helper di test che costruisce un trasferimento legacy firmato senza richiedere `solana-go` |

### Configurazione

| Metodo                                         | Descrizione                                             |
| ---------------------------------------------- | ------------------------------------------------------- |
| `SetSigverify(bool) error`                     | Abilita / disabilita la verifica delle firme                 |
| `Sigverify() (bool, error)`                    | Legge l'impostazione corrente                                |
| `SetBlockhashCheck(bool) error`                | Abilita / disabilita la validazione del blockhash                   |
| `SetTransactionHistory(int) error`             | Capacità della cronologia delle tx in memoria (0 la disabilita)           |
| `SetLogBytesLimit(int) error`                  | Limite di byte di log per tx (negativo = illimitato)              |
| `SetLamports(uint64) error`                    | Reimposta il saldo del pool di airdrop                          |
| `SetSysvars() error`                           | Ripristina i sysvar ai valori predefiniti                               |
| `SetBuiltins() error`                          | Ricarica i programmi integrati                                |
| `SetDefaultPrograms() error`                   | Ricarica SPL Token, Memo, ecc.                            |
| `SetPrecompiles() error`                       | Abilita i precompilati ed25519 / secp256k1                  |
| `WithNativeMints() error`                      | Inizializza il mint wrapped-SOL                                   |
| `SetFeatureSet(*FeatureSet) error`             | Installa un insieme di feature gate                              |
| `SetComputeBudget(ComputeBudget) error`        | Applica un compute budget                                  |
| `ComputeBudget() (ComputeBudget, bool, error)` | Legge il budget corrente (il bool indica "impostato esplicitamente") |

### Tempo e sysvar

| Metodo                                       | Descrizione                          |
| -------------------------------------------- | ------------------------------------ |
| `WarpToSlot(slot uint64) error`              | Salta a uno slot specifico              |
| `Clock() (*sysvar.Clock, error)`             | Legge il sysvar Clock                |
| `SetClock(*sysvar.Clock) error`              | Sovrascrive il sysvar Clock           |
| `Rent() (*sysvar.Rent, error)`               | Legge il sysvar Rent                 |
| `SetRent(*sysvar.Rent) error`                | Sovrascrive il sysvar Rent            |
| `EpochSchedule() (*sysvar.EpochSchedule, error)` | Legge il sysvar EpochSchedule    |
| `SetEpochSchedule(*sysvar.EpochSchedule) error` | Sovrascrive il sysvar EpochSchedule |
| `EpochRewards() (*sysvar.EpochRewards, error)` | Legge il sysvar EpochRewards       |
| `SetEpochRewards(*sysvar.EpochRewards) error` | Sovrascrive il sysvar EpochRewards   |
| `LastRestartSlot() (*sysvar.LastRestartSlot, error)` | Legge last-restart-slot       |
| `SetLastRestartSlot(*sysvar.LastRestartSlot) error` | Imposta last-restart-slot         |
| `SlotHashes() (sysvar.SlotHashes, error)`    | Legge il sysvar SlotHashes           |
| `SetSlotHashes(sysvar.SlotHashes) error`     | Sovrascrive il sysvar SlotHashes      |
| `SlotHistory() (*sysvar.SlotHistory, error)` | Legge il sysvar SlotHistory          |
| `SetSlotHistory(*sysvar.SlotHistory) error`  | Sovrascrive il sysvar SlotHistory     |
| `StakeHistory() (sysvar.StakeHistory, error)` | Legge il sysvar StakeHistory        |
| `SetStakeHistory(sysvar.StakeHistory) error` | Sovrascrive il sysvar StakeHistory    |

### Utilità

| Metodo                     | Descrizione                                                    |
| -------------------------- | -------------------------------------------------------------- |
| `litesvm.Version() string` | Descrizione del motore (`litesvm-go (mithril svm, pure go)`) |
