execute_hook
Simulate a Xahau Hook by running its real WebAssembly bytecode in a local VM against a mock transaction and ledger state, reporting the accept or reject decision, state writes, and emitted transactions.
Instructions
GROUNDBREAKING: actually RUN a Hook's real WebAssembly bytecode in a local VM against a simulated transaction + ledger state, and report the true accept/rollback decision, return code/string, state writes, emitted txns and execution trace. The first dev-accessible Hook simulator that needs no xahaud node. Implements a subset of the Hook API; unsupported calls are recorded (fidelity LOCAL_VM, never faked).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | initial hook state: 32-byte key hex -> value hex | |
| txType | No | originating tx type, e.g. "Payment" | |
| feeBase | No | ||
| network | No | mainnet | |
| wasmHex | No | ||
| otxnBlob | No | full originating-txn serialized blob hex (enables otxn_slot) | |
| ledgerSeq | No | ||
| hookParams | No | ||
| otxnFields | No | field-id -> hex value of originating-txn fields the hook reads | |
| otxnParams | No | otxn param name -> hex value | |
| wasmBase64 | No | ||
| keyletBlobs | No | 32-byte ledger index hex -> serialized object hex, for slot_set | |
| hookAccountId | No | 20-byte account-id hex the hook is installed on | |
| resolveKeylets | No | if true, fetch any slot_set'd ledger objects live and re-run (async pre-resolve) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exit | No | ||
| error | No | ||
| trace | No | ||
| caveat | No | ||
| emitted | No | ||
| degraded | No | ||
| fidelity | No | ||
| returnCode | No | ||
| stateWrites | No | ||
| returnString | No | ||
| stateApplied | No | ||
| wantedKeylets | No | ||
| syntheticCalls | No | ||
| resolvedKeylets | No | ||
| unsupportedCalls | No | ||
| foreignStateWrites | No | ||
| wantedForeignState | No | ||
| resolvedForeignState | No |