Intent
Represents a complete Midnight transaction intent.
Purpose:
Top-level transaction container
Contains offers for unshielded assets
Includes TTL (time-to-live) for transaction expiry
Includes dust actions for fee payment
Ledger Mapping: Mirrors the ledger's Intent: an optional guaranteed unshielded offer (segment 0, always executes), an optional fallible unshielded offer, contract actions, dust actions for fee payment, a TTL, and a cryptographic binding commitment. When the dust actions are present they are required for the transaction to be valid; the binding commitment is created by the ledger during signing.
Usage in Transaction:
// Simple unshielded transfer
val intent = Intent(
guaranteedUnshieldedOffer = UnshieldedOffer(
inputs = listOf(utxoSpend),
outputs = listOf(recipientOutput, changeOutput)
),
fallibleUnshieldedOffer = null,
ttl = System.currentTimeMillis() + (5 * 60 * 1000) // 5 minutes
)Important:
At least one offer (guaranteed or fallible) must be present
Guaranteed offer executes unconditionally (always processes)
Fallible offer may fail without invalidating transaction (future use)
TTL must be in future (transaction expires after this time)