# `Spectre.GAM.Ledger.Store.Support`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/ledger/store/support.ex#L1)

Storage-neutral helpers for ledger adapters.

This module owns portable result shapes and storage-neutral batch checks.
Locking, transactions, durability barriers, encoding and recovery remain in
each adapter, where their guarantees can be audited without indirection.

# `append_status`

```elixir
@spec append_status(
  map(),
  String.t(),
  Spectre.GAM.Ledger.Entry.digest(),
  non_neg_integer(),
  atom() | nil
) :: :new | {:existing, non_neg_integer()} | {:error, term()}
```

Classifies a prospective append against a serialized adapter's cached Domain.

# `batch_info`

```elixir
@spec batch_info(
  String.t(),
  Spectre.GAM.Ledger.Entry.digest(),
  non_neg_integer(),
  Spectre.GAM.Ledger.Entry.t()
) :: Spectre.GAM.Ledger.batch_info()
```

Builds metadata for an already verified non-empty logical batch.

# `batch_info`

```elixir
@spec batch_info(
  String.t(),
  Spectre.GAM.Ledger.Entry.digest(),
  non_neg_integer(),
  integer(),
  integer(),
  integer(),
  Spectre.GAM.Ledger.Entry.digest()
) :: Spectre.GAM.Ledger.batch_info()
```

Builds batch metadata from already decoded storage columns.

# `empty_domain`

```elixir
@spec empty_domain() :: map()
```

Returns the initial in-memory state shared by serialized adapters.

# `install_batch`

```elixir
@spec install_batch(
  map(),
  String.t(),
  Spectre.GAM.Ledger.Entry.digest(),
  non_neg_integer(),
  [
    Spectre.GAM.Ledger.Entry.t()
  ]
) :: {map(), Spectre.GAM.Ledger.Entry.t()}
```

Installs an already verified batch in a serialized adapter's cached Domain.

# `snapshot`

```elixir
@spec snapshot(String.t(), map()) :: Spectre.GAM.Ledger.snapshot()
```

Builds the portable snapshot returned by a serialized adapter.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
