CompactEnum

value class CompactEnum(val ordinal: Int)

A Compact enum value passed as a circuit argument (e.g. a struct field like Recipient.kind).

Compact enums marshal to a JS number at the circuit boundary — the generated wrapper guards enum fields with typeof(x) === 'number'. Plain Kotlin Int/Long marshal to a JS BigInt (1n) because Compact's Uint/Field types require BigInt, so an enum field needs this distinct type to be emitted as a bare number (1) instead.

Constructors

Link copied to clipboard
constructor(ordinal: Int)

Properties

Link copied to clipboard

the enum's declaration index (0-based), matching the Compact enum order.