Expand description
§xrpl-escrow-stdlib
Smart Escrow entry-point context and host-function wrappers for writing XRPL Smart Escrows in Rust.
This crate is part of the xrpl-wasm-stdlib workspace. It provides EscrowFinishContext, the
control surface a Smart Escrow author interacts with, along with safe, scoped access to
escrow-unique host functions (e.g., update_data). All unsafe FFI is contained here; user code
stays fully safe.
§Usage
ⓘ
use xrpl_escrow_stdlib::*;
fn run(ctx: EscrowFinishContext) -> FinishResult {
let destination = ctx.escrow().fetch_destination()?;
// ... evaluate conditions ...
Ok(true)
}The #[smart_escrow] entry-point macro (in xrpl-macros) constructs the context via
EscrowFinishContext::default() and passes it to your function automatically.
§Crate layout
| Module | Contents |
|---|---|
ctx::escrow_finish | EscrowFinishContext struct and its host-function methods |
§no_std
This crate is no_std when targeting wasm32. The std crate is available for host (non-WASM)
builds so unit tests run normally.
Re-exports§
pub use ctx::escrow_finish::EscrowFinishContext;
Modules§
- core
- Core modules for XRPL transaction and ledger access.
- ctx
- host
- Host bindings and utilities exposed to WASM smart contracts.
- sfield
- types
Macros§
Functions§
- decode_
hex_ 20 - Decode a 40-hex-character string into a 20-byte array.
- decode_
hex_ 32 - Decode a 64-hex-character string into a 32-byte array.