Expand description
Guest-side development kit for Lyquid WASM modules.
lyquid is the crate Lyquid authors import inside contract crates. It exposes the ABI tags,
call context, result and error types, LyteMemory layout constants, HTTP request shapes, guest
memory helpers, runtime host imports, and the method proc-macro facade. Those pieces line up
with the metadata decoded by lyquor-wasm and the entry points executed by lyquor-vm: method
macros generate network, instance, Ethereum-exported, and UPC entry points, while runtime
helpers perform host calls from inside the WASM guest.
Re-exports§
pub use runtime::prelude;pub use hashbrown;pub use lyquor_primitives;pub use alloy_sol_types;
Modules§
- consts
- Method metadata categories and WASM custom-section encoding helpers.
- http
- HTTP request and response types exposed to Lyquid instance functions.
- mem
- Guest pointer and memory-layout helpers.
- method
- Lyquid method syntax (attribute macros).
- runtime
- Guest runtime support for memory, calls, oracle, UPC, and synchronization. Guest runtime internals for Lyquid WASM modules.
- upc
- well_
known - Stable hostnames and endpoint URLs exposed by the Lyquor runtime.
Macros§
- call
- Initiate a inter-lyquid call. Only usable by network functions.
- decode_
eth_ call_ params - encode_
eth_ call_ params - eprint
- Print to the console (error output).
- eprintln
- Print a line to the console (error output).
- log
- Log a custom event that has happened. (Similar to Solidity’s
emitevent, orlog*instruction in EVM.) Only usable by network functions. - Print to the console (standard output).
- println
- Print a line to the console (standard output).
- state
- Defines network-level and instance-level persistent state variables for a Lyquid contract.
- submit_
certified_ call - Submit a certified call to the sequencing backend. Returns the backend-specific submission result as raw bytes (e.g., tx hash for EVM).
- trigger
- Trigger an instance function with a given mode.
TriggerMode::Commitis only valid from network functions and runs after slot commit. - upc
- Initiate a Universal Procedure Call (UPC). Only usable by instance functions.
Structs§
- Func
EthInfo - Ethereum export metadata for a Lyquid method.
- Func
Info - Method metadata decoded from Lyquid WASM custom sections.
Enums§
- Lyquid
Error - Error type shared by generated Lyquid wrappers and host-facing runtime helpers.
Constants§
- ABI_ETH
- Numeric ABI tag for Ethereum-compatible call payloads.
- ABI_
LYQUOR - Numeric ABI tag for native Lyquor call payloads.
- INSTANCE_
MEMSIZE_ IN_ MB - Size cap for the addressable LyteMemory that is locally viewed (and persisted) for one Lyquid instance.
- INTERNAL_
STATE_ PREFIX - Prefix bytes used for runtime-owned state in versioned state.
- LYTEMEM_
BASE - The base address for LyteMemory. Volatile’s upper address is below next to this address. Everything from this base to NETWORK_MEMSIZE_IN_MB and INSTANCE_MEMSIZE_IN_MB are persistent.
- LYTEMEM_
PAGE_ PREFIX - Prefix bytes used for lite pages in versioned state.
- LYTEMEM_
SIZE_ IN_ MB - Total size of the memory in megabytes.
- LYTESTACK_
BASE - The starting address for stacks used by Lyquid.
- NETWORK_
MEMSIZE_ IN_ MB - Size cap for the addressable LyteMemory that is globally viewed (and persisted) by all Lyquid instances.
- VAR_
CATALOG_ PREFIX - Prefix bytes used for varaiable catalog in versioned state.
- VOLATILE_
MEMSIZE_ IN_ MB - Size cap for the volatile memory that can be used by each function call.
- WASM_
CALLSTACK_ LIMIT - The maximum size of a stack per call.
- WASM_
DEFAULT_ STACK_ BASE - Default stack base address for Lyquid guest modules.
- WASM_
INIT_ FUNC - Exported guest initialization function name.
- WASM_
INIT_ VAR_ FUNC - Exported guest state-variable initialization function name.
- WASM_
INSTANCE_ METHOD_ PREFIX - Prefix for exported instance method entry points.
- WASM_
NETWORK_ METHOD_ PREFIX - Prefix for exported network method entry points.
- WASM_
NUKE_ STATE_ FUNC - Exported guest function name that marks Lyquid state uninitialized; the VM calls it to reset network state when a new Lyquid image is loaded.
- WASM_
STACK_ POINTER - WASM global name for the guest stack pointer.
- WASM_
VOLATILE_ ALLOC_ FUNC - Exported guest volatile-memory allocation function name.
- WASM_
VOLATILE_ DEALLOC_ FUNC - Exported guest volatile-memory deallocation function name.
Type Aliases§
- Lyquid
Result - Standard result type for Lyquid runtime and generated wrapper operations.