UtxoOutput

data class UtxoOutput(val value: BigInteger, val owner: String, val tokenType: String)

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
}

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
)

Constructors

Link copied to clipboard
constructor(value: BigInteger, owner: String, tokenType: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Recipient's unshielded address (Bech32m format)

Link copied to clipboard

Token type identifier (hex string, 64 chars)

Link copied to clipboard

Amount to create (in smallest units)