Expand description
Chain-agnostic escrow types and pure logic functions.
This module provides data structures for escrow operations and pure functions for escrow logic. Storage implementation is left to chain-specific executors (NEAR, Soroban, etc.).
Re-exports§
pub use crate::types::EscrowSettlement;
Structs§
- Escrow
Entry - Escrow entry for a single actor.
- Escrow
Stats - Aggregate escrow statistics.
- Settlement
Result - Result of applying a settlement to an escrow entry.
Functions§
- apply_
settlement - Apply an escrow settlement to an escrow entry.
- can_
apply_ settlement - Validate that an escrow entry has sufficient shares for a settlement.
- compute_
escrow_ stats - Compute aggregate escrow statistics from an iterator of entries.
- find_
by_ owner - Find an escrow entry by owner.
- is_
stale - Check if an escrow entry is stale (past its expected settlement time).
- settle_
proportional - Compute a proportional settlement based on actual vs expected assets.
- total_
burn - Calculate total shares that would be burned across multiple settlements.
- total_
refund - Calculate total shares that would be refunded across multiple settlements.