Rust Usage
Addprism-core to your Cargo.toml:
WASM Usage
Embed Prism into your JavaScript/TypeScript applications:Public API Highlights
decode_error: Returns a structured diagnostic report.resolve_contract_error: Decodes custom error codes via WASM.replay_transaction: Runs a full Tier 2/3 simulation.
HostError API
TheHostError enum is the central type the decode engine works with.
It covers every Soroban host error category, contract-specific errors,
and an Unknown variant for forward compatibility.
summary() -> String
Returns a one-line plain-English sentence explaining what went wrong.
This is the headline shown by prism decode ā the first thing a developer
reads when diagnosing a failed transaction.
- Every variant returns a non-empty string ā no error is ever silent.
- Known code
0summaries are under 120 characters. - Unknown codes within known categories fall back to a formatted message including the code number.
ContractSpecificalways mentions--resolveto guide the developer to the next step.Unknownalways includes bothtype_codeandsub_codefor diagnostic purposes.
category_name() -> &str
Returns the human-readable category name for the error variant,
e.g. "Budget", "Auth", "ContractSpecific".