Expand description
Low-level WASM host environment bindings.
This module provides direct access to the TruthLinked runtime host functions via WASM imports. These are the raw building blocks used by higher-level SDK APIs.
Most contract developers should use the higher-level APIs in other modules rather than calling these functions directly.
Modules§
- oracle_
rc - Oracle error codes returned by
http_call.
Constants§
- MAX_
CALLDATA_ SIZE - Maximum size of calldata in bytes (256 KB).
- MAX_
LOG_ DATA_ SIZE - Maximum size of log data in bytes (64 KB).
- MAX_
LOG_ TOPICS - Maximum number of topics per log event.
- MAX_
RETURN_ DATA_ SIZE - Maximum size of return data in bytes (256 KB).
- STORAGE_
KEY_ BYTES - Size of storage keys in bytes (32 bytes / 256 bits).
- STORAGE_
VALUE_ BYTES - Size of storage values in bytes (32 bytes / 256 bits).
Functions§
- call_
contract_ legacy - Calls another contract (legacy version without value transfer).
- call_
contract_ v2_ with_ value - Calls another contract with value transfer (v2 API).
- emit_
log_ bytes - Emits a log event with topics and data.
- get_
caller_ 32 - Retrieves the caller’s address (32 bytes).
- get_
contract_ id_ 32 - Retrieves the current contract’s ID (32 bytes).
- get_
height_ u64 - Retrieves the current block height.
- get_
owner_ 32 - Retrieves the contract owner’s address (32 bytes).
- get_
timestamp_ u64 - Retrieves the current block timestamp (Unix seconds).
- get_
value_ u128 - Retrieves the value sent with the current call (in smallest units).
- http_
call_ bytes - Makes an HTTP oracle call.
- read_
calldata - Reads the calldata into the provided buffer.
- set_
return_ data_ bytes - Sets the return data for the current contract call.
- storage_
read_ 32 - Reads a 32-byte value from storage at the given 32-byte key.
- storage_
write_ 32 - Writes a 32-byte value to storage at the given 32-byte key.