WitnessKind

How the witness's WitnessResult.data bytes should be presented to the Compact runtime when the witness function is called from JS.

The Compact type system distinguishes between byte-string types (Bytes<N> → JS Uint8Array(N)) and vector-of-int types (Vector<N, Uint<8>> → JS Array<bigint> of length N). The SDK historically only emitted the byte-string form, which silently broke any contract whose witness was typed as a Vector<N, Uint<…>> (the Compact runtime's type validator rejected the Uint8Array as "expected Vector<…> but received {0:…, 1:…}").

Callers pick the right kind per witness; the default (BYTES) preserves the historical behavior so consumers that haven't adopted the new param continue to work.

Entries

Link copied to clipboard

Default — multi-byte payload becomes a JS Uint8Array; a single-byte payload becomes a BigInt. Matches Compact's Bytes<N> and scalar Uint<…> types.

Link copied to clipboard

Multi-byte payload becomes a JS Array<bigint> where each element is one byte from WitnessResult.data lifted to a BigInt. Matches Compact's Vector<N, Uint<8>> (also written as Vector<N, Uint<0..256>> in runtime error messages).

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.