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

# Referência da API

> Referência completa da API Go para o LiteSVM

Documentação completa da API para `litesvm-go` v0.3.0 e posteriores. Os nomes dos métodos
espelham o builder `LiteSVM` do Rust sempre que possível; os pares getter / setter seguem a
mesma convenção do Go (`Clock` / `SetClock`, `Rent` / `SetRent`, ...). As contas são
valores simples `*solana.Account` e os sysvars são os tipos de
`github.com/gagliardetto/solana-go/sysvar`.

## Seções da API

<Columns cols={2}>
  <Card title="Gerenciamento de contas" href="/developers/docs/tools/litesvm/go/api-reference/account-management">
    Airdrop, Balance, GetAccount, SetAccount, NewAccount, programas
  </Card>
  <Card title="Transações" href="/developers/docs/tools/litesvm/go/api-reference/transactions">
    Enviar / simular transações legacy + versionadas, TxOutcome
  </Card>
  <Card title="Configuração" href="/developers/docs/tools/litesvm/go/api-reference/configuration">
    Alternadores para sigverify, verificação de blockhash, histórico, limites de logs, programas padrão
  </Card>
  <Card title="Tempo e Sysvars" href="/developers/docs/tools/litesvm/go/api-reference/time-and-sysvars">
    WarpToSlot, Clock, Rent, EpochSchedule, EpochRewards, SlotHashes, SlotHistory, StakeHistory
  </Card>
</Columns>

## Referência rápida

### Configuração do 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()
```

### Gerenciamento de contas

| Método                                                                       | Descrição                                          |
| ---------------------------------------------------------------------------- | ---------------------------------------------------- |
| `Airdrop(pubkey, lamports) error`                                            | Financia uma conta                                      |
| `Balance(pubkey) (uint64, bool, error)`                                      | Saldo em SOL; o bool indica se a conta existe |
| `GetAccount(pubkey) *solana.Account`                                         | Cópia da conta (nil se não existir)                 |
| `SetAccount(pubkey, *solana.Account) error`                                  | Armazena o estado da conta diretamente                         |
| `MinimumBalanceForRentExemption(dataLen int) (uint64, error)`                | Calcula o mínimo isento de rent                          |
| `NewAccount(lamports, data, owner, executable, rentEpoch) (*solana.Account, error)` | Cria uma conta para o SetAccount (um literal `&solana.Account{...}` também funciona) |

### Gerenciamento de programas

| Método                                                   | Descrição                             |
| -------------------------------------------------------- | --------------------------------------- |
| `AddProgram(programID, bytes) error`                     | Carrega um programa a partir de bytes                 |
| `AddProgramFromFile(programID, path) error`              | Carrega um programa a partir de um arquivo `.so`            |
| `AddProgramWithLoader(programID, bytes, loaderID) error` | Carrega usando um loader específico (avançado) |

### Transações

| Método                                                                        | Descrição                                                                     |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `SendLegacyTransaction(txBytes) (*TxOutcome, error)`                          | Executa uma transação legacy                                                    |
| `SendVersionedTransaction(txBytes) (*TxOutcome, error)`                       | Executa uma transação v0+                                                       |
| `SimulateLegacyTransaction(txBytes) (*TxOutcome, error)`                      | Simula sem alterar o estado                                                  |
| `SimulateVersionedTransaction(txBytes) (*TxOutcome, error)`                   | Simula v0+ sem alterar o estado                                              |
| `LatestBlockhash() (solana.Hash, error)`                                      | Blockhash atual                                                               |
| `ExpireBlockhash() error`                                                     | Avança para um novo blockhash                                                      |
| `GetTransaction(signature) *TxOutcome`                                        | Consulta uma transação no histórico (nil se não existir)                                  |
| `litesvm.BuildTransferTx(payerSeed, to, lamports, blockhash) ([]byte, error)` | Helper de teste que cria uma transferência legacy assinada sem precisar importar o `solana-go` |

### Configuração

| Método                                         | Descrição                                             |
| ---------------------------------------------- | ------------------------------------------------------- |
| `SetSigverify(bool) error`                     | Ativa / desativa a verificação de assinaturas                 |
| `Sigverify() (bool, error)`                    | Lê a configuração atual                                |
| `SetBlockhashCheck(bool) error`                | Ativa / desativa a validação de blockhash                   |
| `SetTransactionHistory(int) error`             | Capacidade do histórico de transações em memória (0 desativa)           |
| `SetLogBytesLimit(int) error`                  | Limite de bytes de log por transação (negativo = ilimitado)              |
| `SetLamports(uint64) error`                    | Redefine o saldo do pool de airdrop                          |
| `SetSysvars() error`                           | Redefine os sysvars para os valores padrão                               |
| `SetBuiltins() error`                          | Recarrega os programas integrados                                |
| `SetDefaultPrograms() error`                   | Recarrega SPL Token, Memo etc.                            |
| `SetPrecompiles() error`                       | Ativa os precompiles ed25519 / secp256k1                  |
| `WithNativeMints() error`                      | Inicializa o mint de wrapped-SOL                                   |
| `SetFeatureSet(*FeatureSet) error`             | Instala um conjunto de feature gates                              |
| `SetComputeBudget(ComputeBudget) error`        | Aplica um orçamento de computação                                  |
| `ComputeBudget() (ComputeBudget, bool, error)` | Lê o orçamento atual (o bool indica "definido explicitamente") |

### Tempo e Sysvars

| Método                                       | Descrição                          |
| -------------------------------------------- | ------------------------------------ |
| `WarpToSlot(slot uint64) error`              | Avança para um slot específico              |
| `Clock() (*sysvar.Clock, error)`             | Lê o sysvar Clock                |
| `SetClock(*sysvar.Clock) error`              | Sobrescreve o sysvar Clock           |
| `Rent() (*sysvar.Rent, error)`               | Lê o sysvar Rent                 |
| `SetRent(*sysvar.Rent) error`                | Sobrescreve o sysvar Rent            |
| `EpochSchedule() (*sysvar.EpochSchedule, error)` | Lê o sysvar EpochSchedule    |
| `SetEpochSchedule(*sysvar.EpochSchedule) error` | Sobrescreve o sysvar EpochSchedule |
| `EpochRewards() (*sysvar.EpochRewards, error)` | Lê o sysvar EpochRewards       |
| `SetEpochRewards(*sysvar.EpochRewards) error` | Sobrescreve o sysvar EpochRewards   |
| `LastRestartSlot() (*sysvar.LastRestartSlot, error)` | Lê o last-restart-slot       |
| `SetLastRestartSlot(*sysvar.LastRestartSlot) error` | Define o last-restart-slot         |
| `SlotHashes() (sysvar.SlotHashes, error)`    | Lê o sysvar SlotHashes           |
| `SetSlotHashes(sysvar.SlotHashes) error`     | Sobrescreve o sysvar SlotHashes      |
| `SlotHistory() (*sysvar.SlotHistory, error)` | Lê o sysvar SlotHistory          |
| `SetSlotHistory(*sysvar.SlotHistory) error`  | Sobrescreve o sysvar SlotHistory     |
| `StakeHistory() (sysvar.StakeHistory, error)` | Lê o sysvar StakeHistory        |
| `SetStakeHistory(sysvar.StakeHistory) error` | Sobrescreve o sysvar StakeHistory    |

### Utilitários

| Método                     | Descrição                                                    |
| -------------------------- | -------------------------------------------------------------- |
| `litesvm.Version() string` | Descrição do motor (`litesvm-go (mithril svm, pure go)`) |
