Module escrow

Source
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§

EscrowEntry
Escrow entry for a single actor.
EscrowStats
Aggregate escrow statistics.
SettlementResult
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.