ContractRuntime
Native bridge to the Rust contract runtime.
Exposes functions that match the WASM onchain-runtime exactly:
persistentHashAligned: binary_repr + SHA-256 (proper field-aligned encoding)
bigIntToValue / valueToBigInt: field element encoding
contractQuery: VM opcode execution via state handles
Functions
Assemble a contract call transaction from circuit execution output.
Assemble a contract DEPLOY transaction from constructor output.
Convert BigInt (hex string) to Value (JSON).
Execute opcodes against a contract state handle.
Compute persistent commit: SHA-256(opening || binary_repr(value)).
Raw persistent hash (SHA-256) of hex bytes.
Persistent hash with proper AlignedValue encoding (matches WASM).
Clone a state handle (saves initial state before circuit queries).
Create a contract state from SCALE hex, return handle.
Create state from a JSON structure descriptor (nested arrays of nulls).
Read contract state fields as JSON.
Set an operation on a state handle.
Convert Value (JSON) to BigInt (decimal string).