STAS-BTG transaction factories.
Pure functions that build complete, signed transactions for STAS-BTG token operations: transfer, split, merge, and checkpoint.
Summary
Functions
Build a BTG checkpoint transaction.
Build a BTG merge transaction.
Build a BTG split transaction.
Build a BTG transfer transaction.
Types
@type btg_checkpoint_config() :: %{ token_utxo: BSV.Tokens.Payment.t(), issuer_private_key: BSV.PrivateKey.t(), destination: BSV.Tokens.Destination.t(), redemption_pkh: <<_::160>>, splittable: boolean(), funding: BSV.Tokens.Payment.t(), fee_rate: non_neg_integer() }
@type btg_merge_config() :: %{ token_utxos: [btg_payment()], destination: BSV.Tokens.Destination.t(), redemption_pkh: <<_::160>>, splittable: boolean(), funding: BSV.Tokens.Payment.t(), fee_rate: non_neg_integer() }
@type btg_payment() :: %{ txid: binary(), vout: non_neg_integer(), satoshis: non_neg_integer(), locking_script: BSV.Script.t(), private_key: BSV.PrivateKey.t(), prev_raw_tx: binary() }
@type btg_split_config() :: %{ token_utxo: btg_payment(), destinations: [BSV.Tokens.Destination.t()], redemption_pkh: <<_::160>>, funding: BSV.Tokens.Payment.t(), fee_rate: non_neg_integer() }
@type btg_transfer_config() :: %{ token_utxo: btg_payment(), destination: BSV.Tokens.Destination.t(), redemption_pkh: <<_::160>>, splittable: boolean(), funding: BSV.Tokens.Payment.t(), fee_rate: non_neg_integer() }
Functions
@spec build_btg_checkpoint_tx(btg_checkpoint_config()) :: {:ok, BSV.Transaction.t()} | {:error, term()}
Build a BTG checkpoint transaction.
@spec build_btg_merge_tx(btg_merge_config()) :: {:ok, BSV.Transaction.t()} | {:error, term()}
Build a BTG merge transaction.
@spec build_btg_split_tx(btg_split_config()) :: {:ok, BSV.Transaction.t()} | {:error, term()}
Build a BTG split transaction.
@spec build_btg_transfer_tx(btg_transfer_config()) :: {:ok, BSV.Transaction.t()} | {:error, term()}
Build a BTG transfer transaction.