Parser
crates/core decodes Soroban governance data without IO. crates/wasm exposes
it to JavaScript. crates/cli is the operator tool, and network calls live
there (crates/cli/src/rpc.rs), not in the core.
What it decodes
| Input | Output |
|---|---|
base64 XDR ScVal | JSON, total over the stellar-xdr 28 type set |
| contract WASM | contractspecv0 parsed into functions, structs, unions, enums, errors and events |
| raw event | a NormalizedEvent through a governor adapter, or unverified |
| proposal call | a DecodedCall with named arguments when the spec is verified |
| proposal votes | tally and power reconstructed through pure replicas |
simulateTransaction response | an ExecutionImpact estimate with simulatedAtLedger |
What it refuses to do
- Guess an argument name without a contract spec: the result is
decoding: "unverified", not a plausible label. - Downgrade an unknown function to
low: it isUNVERIFIEDwith the reason. - Coerce a value into JSON: integers at 64 bits and above become decimal strings, and non-representable maps are errors.
- Emit a dry-run without a ledger:
simulatedAtLedgeris required, and every impact carriesestimate: true.
Design rules
- Adapters own governor knowledge. The
GovernorAdaptertrait (crates/core/src/adapter.rs) is where a governor’s events, calls and state are understood. See the adapter model and the authoring guide. - Rules are data. Risk tiers come from the published table in
crates/core/src/risk.rs; every classification exposes the matched rule. See Risk rules. - The core does no IO. Network access is confined to
crates/cli/src/rpc.rs.