xrpl_wasm_stdlib/ctx/mod.rs
1//! Smart Feature context primitives shared by all entry points.
2//!
3//! This module exposes the [`SmartFeatureContext`] trait — the narrow context
4//! type implemented by feature-specific contexts (e.g., `EscrowFinishContext`)
5
6use crate::core::current_tx::traits::TransactionCommonFields;
7
8/// Narrow context trait shared by all Smart Escrow and Smart Contract entry points.
9///
10/// Provides access to the current transaction via an associated type bound to
11/// [`TransactionCommonFields`]. Kept intentionally minimal.
12///
13/// Concrete context types (`EscrowFinishContext`, `ContractCallContext`) implement
14/// this trait and expose their feature-unique host functions as inherent methods.
15pub trait SmartFeatureContext {
16 type Tx: TransactionCommonFields;
17 fn tx(&self) -> &Self::Tx;
18}