DSTAS transaction factories.
Pure functions that build complete, signed transactions for dSTAS token operations: two-tx issuance, base spend, freeze, unfreeze, and swap.
Summary
Functions
Build a generic DSTAS spend transaction.
Build a DSTAS freeze transaction.
Build the two-transaction DSTAS issuance flow.
Build a DSTAS swap flow transaction.
Build a DSTAS unfreeze transaction.
Types
@type base_config() :: %{ token_inputs: [BSV.Tokens.TokenInput.t()], fee_txid: binary(), fee_vout: non_neg_integer(), fee_satoshis: non_neg_integer(), fee_locking_script: BSV.Script.t(), fee_private_key: BSV.PrivateKey.t(), destinations: [BSV.Tokens.DstasOutputParams.t()], spend_type: BSV.Tokens.DstasSpendType.t(), fee_rate: non_neg_integer() }
@type issue_config() :: %{ scheme: BSV.Tokens.Scheme.t(), funding_txid: binary(), funding_vout: non_neg_integer(), funding_satoshis: non_neg_integer(), funding_locking_script: BSV.Script.t(), funding_private_key: BSV.PrivateKey.t(), outputs: [ %{satoshis: non_neg_integer(), owner_pkh: <<_::160>>, freezable: boolean()} ], fee_rate: non_neg_integer() }
Functions
@spec build_dstas_base_tx(base_config()) :: {:ok, BSV.Transaction.t()} | {:error, term()}
Build a generic DSTAS spend transaction.
@spec build_dstas_freeze_tx(base_config()) :: {:ok, BSV.Transaction.t()} | {:error, term()}
Build a DSTAS freeze transaction.
@spec build_dstas_issue_txs(issue_config()) :: {:ok, %{contract_tx: BSV.Transaction.t(), issue_tx: BSV.Transaction.t()}} | {:error, term()}
Build the two-transaction DSTAS issuance flow.
@spec build_dstas_swap_flow_tx(base_config()) :: {:ok, BSV.Transaction.t()} | {:error, term()}
Build a DSTAS swap flow transaction.
@spec build_dstas_unfreeze_tx(base_config()) :: {:ok, BSV.Transaction.t()} | {:error, term()}
Build a DSTAS unfreeze transaction.