A Construct is a #![no_std] Rust crate compiled to wasm32-unknown-unknown. Version 1 is immutable: later capabilities arrive as cz_v2_* alongside these.
Imports (module cz_v1)
Function
Signature
Meaning
cz_v1_sense
(i32) -> i64
Reads one local sensor channel.
cz_v1_draw_joules
(i64) -> i64
Requests up to the given microjoules from the construct's input. Returns microjoules granted.
cz_v1_emit_wave
(i64) -> i32
Emits a local wave with the given microjoules of strength. Returns 1 if emitted.
Exports
Function
Signature
Meaning
cz_tick
() -> ()
Runs once per tick while the construct is powered.
Limits
Limit
v1 value
Linear memory
2 pages (128 KiB) maximum, 16 KiB stack
Module size
64 KiB
Gas limit
1,000,000 metered instructions per tick maximum, declared in the manifest
Forbidden
Floating-point instructions, SIMD, threads and atomics, any import outside cz_v1