executeCircuit
Execute a contract circuit and assemble an UnprovenTransaction.
Return
The assembled UnprovenTransaction as hex-encoded SCALE bytes
Parameters
Compiled contract JavaScript (IIFE format, no ES module imports)
Hex-encoded contract address (64 chars)
The impure circuit to execute (e.g., "post", "takeDown")
JS expressions for circuit arguments (inserted into JS code)
Map of witness name → WitnessProvider callback.
JS expression for the initial private state object
The coin public key bytes (32 bytes)
Network ID for the transaction (default: "undeployed")
SCALE-encoded on-chain contract state from the indexer. When provided, circuit execution uses this state instead of contract.initialState(). Required for calling already-deployed contracts where the on-chain state may differ from the contract's initial state.
SCALE-encoded ledger parameters from the indexer. Required for correct gas computation — the node uses these parameters' cost model to validate the transaction. If omitted, falls back to the initial cost model (only correct on a fresh chain with no parameter updates).
Throws
if circuit execution or tx assembly fails