UtxoOutput
Represents a UTXO being created (output) in an unshielded transaction.
Source: Based on midnight-ledger UtxoOutput structure File: midnight-ledger/ledger/src/structure.rs
Purpose:
Specifies a new UTXO to be created
Defines recipient address, amount, and token type
Used for both recipient outputs and change outputs
Midnight SDK Equivalent:
interface UtxoOutput {
value: bigint; // Amount to create
owner: UnshieldedAddress; // Recipient address
tokenType: TokenType; // Token being created
}Content copied to clipboard
Usage in Transaction:
// Recipient output
val recipientOutput = UtxoOutput(
value = BigInteger("100000000"), // 100.0 NIGHT
owner = "mn_addr_undeployed1...", // Recipient address
tokenType = UtxoOutput.NATIVE_TOKEN_TYPE
)
// Change output
val changeOutput = UtxoOutput(
value = BigInteger("50000000"), // 50.0 NIGHT (change)
owner = "mn_addr_undeployed1...", // Sender's address
tokenType = UtxoOutput.NATIVE_TOKEN_TYPE
)Content copied to clipboard