Input, rendering, network and WASM

Advanced contracts remain bounded, owned and separately authorized.

Contract 1.0.0 · JavaScript executor documentation

Input leases

input.lease({keys, aim}) accepts supported native keys and optional canvas backing-pixel aim coordinates. Each lease expires after 250 ms. input.release() releases only the session’s input. Physical user holds and other owners are preserved. Unsupported game bindings fail safely. This API is not available to community scripts yet.

Rendering

render.onFrame(listener) returns an unsubscribe function. The synchronous listener receives a CanvasRenderingContext2D, an API snapshot and a document-clock timestamp. Canvas state is restored after the callback. Asynchronous rendering callbacks are unsupported. Do not retain a context and draw after the callback finishes.

Network observations

net.getState() exposes connection state and transport counters. net.onFrame(listener) observes opaque supported transport frames and returns an unsubscribe function. Binary bytes are defensively copied only for supported frames no larger than 1 MiB. Decoded game messages, packet modification, arbitrary send and server acknowledgments are unavailable.

WebAssembly information

wasm.getInfo() exposes a verified build identity, compatibility/binding state, memory size and rawAccess:false. It does not return the game heap, internal exports, offsets or an arbitrary function-call interface.

Diagnostics

debug.getDiagnostics() returns bounded diagnostic information and requires developer.tools. Keep diagnostics out of public logs when they contain local game or script information.