BSV.Tokens.SpendType (bsv_sdk v1.4.0)

Copy Markdown View Source

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

ValueAtomOperation
1:transferRegular spending (transfer/split/merge/redeem)
2:freeze_unfreezeFreeze or unfreeze a token UTXO
3:confiscationForcible reassignment of ownership
4:swap_cancellationCancel a standing swap offer

Summary

Functions

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

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

Types

t()

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

Functions

from_byte(arg1)

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

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

to_byte(atom)

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

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