LedgerEvent

data class LedgerEvent(val id: Long, val type: EventType, val amount: BigInteger, val tokenType: String = "MIDNIGHT", val sender: String? = null, val receiver: String, val blockHeight: Long, val timestamp: Long)

Deserialized ledger event from Midnight blockchain.

Represents a single event on the Midnight ledger (coinbase, transfer, shield, unshield, etc.)

Input Validation:

  • id must be non-negative

  • amount must be positive (cannot transfer 0 or negative tokens)

  • tokenType cannot be blank

  • sender must be null for COINBASE events, non-null otherwise

  • receiver cannot be blank

  • blockHeight must be non-negative

  • timestamp must be positive

Throws

if validation fails

Constructors

Link copied to clipboard
constructor(id: Long, type: EventType, amount: BigInteger, tokenType: String = "MIDNIGHT", sender: String? = null, receiver: String, blockHeight: Long, timestamp: Long)

Properties

Link copied to clipboard

Token amount involved

Link copied to clipboard

Block height where event occurred

Link copied to clipboard
val id: Long

Event ID (sequential)

Link copied to clipboard

Receiver address

Link copied to clipboard
val sender: String? = null

Sender address (null for coinbase events)

Link copied to clipboard

Event timestamp in milliseconds

Link copied to clipboard

Token type (native MIDNIGHT, or custom token)

Link copied to clipboard

Type of ledger event