BSV.Transaction.Template behaviour (bsv_sdk v2.0.0)

Copy Markdown View Source

Behaviour for transaction signing templates.

Summary

Callbacks

estimate_length(template, tx, input_index)

@callback estimate_length(
  template :: any(),
  tx :: BSV.Transaction.t(),
  input_index :: non_neg_integer()
) :: non_neg_integer()

sign(template, tx, input_index)

@callback sign(
  template :: any(),
  tx :: BSV.Transaction.t(),
  input_index :: non_neg_integer()
) ::
  {:ok, BSV.Script.t()} | {:error, term()}