UnshieldedOffer
data class UnshieldedOffer(val inputs: List<UtxoSpend>, val outputs: List<UtxoOutput>, val signatures: List<ByteArray> = emptyList())
Represents an unshielded offer in a Midnight transaction.
An offer pairs the UTXOs being spent (inputs) with the new UTXOs being created (outputs), plus the signatures authorizing each input.
Purpose:
Contains inputs (UTXOs being spent)
Contains outputs (new UTXOs being created)
Will contain signatures (added during signing)
Important:
Inputs and outputs are automatically SORTED by the ledger
Signatures must match the sorted input order
Usage in Transaction:
val offer = UnshieldedOffer(
inputs = listOf(
UtxoSpend(intentHash = "0x123...", outputNo = 0, value = 150M, ...)
),
outputs = listOf(
UtxoOutput(value = 100M, owner = "recipient...", ...), // Send
UtxoOutput(value = 50M, owner = "sender...", ...) // Change
)
)
// Later, during signing: add signatures
val signed = offer.copy(signatures = listOf(...))Content copied to clipboard