# `BSV.Tokens.SpendType`
[🔗](https://github.com/Bittoku/bsv_sdk_elixir/blob/main/lib/bsv/tokens/spend_type.ex#L1)

STAS protocol spending-type parameter.

Every STAS unlocking script includes a spending-type value that tells the
locking script which operation is being performed. This is a protocol-level
concept shared across all STAS templates (standard, BTG, STAS 3.0).

## Values

| Value | Atom                | Operation                              |
|-------|---------------------|----------------------------------------|
| 1     | `:transfer`         | Regular spending (transfer/split/merge/redeem) |
| 2     | `:freeze_unfreeze`  | Freeze or unfreeze a token UTXO        |
| 3     | `:confiscation`     | Forcible reassignment of ownership     |
| 4     | `:swap_cancellation`| Cancel a standing swap offer           |

# `t`

```elixir
@type t() :: :transfer | :freeze_unfreeze | :confiscation | :swap_cancellation
```

# `from_byte`

```elixir
@spec from_byte(byte()) :: {:ok, t()} | {:error, :unknown_spend_type}
```

Convert a wire-format byte value to a spend type atom.

# `to_byte`

```elixir
@spec to_byte(t()) :: byte()
```

Convert a spend type atom to its wire-format byte value.

---

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