Buyer deposits amount of token into escrow for seller, tracked
under escrow_id. Transfers the funds from the buyer's wallet into
this contract. Requires the buyer's authorization.
fn create_escrow(
env: soroban_sdk::Env,
escrow_id: soroban_sdk::String,
buyer: soroban_sdk::Address,
seller: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
) -> Escrow
Buyer approves the deal. Starts the 48h countdown to auto-release. Requires the buyer's authorization.
fn approve(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> Escrow
Permissionless: releases escrowed funds to the seller once the
buyer has approved AND at least RELEASE_DELAY_SECS have passed
since approval. No signature is required from either party for this
call — only the on-chain time condition is enforced — so the seller
(or anyone) can always claim once eligible.
fn release(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> Escrow
Buyer reclaims funds, only allowed before approval (i.e. before the countdown has started). Requires the buyer's authorization.
fn cancel_escrow(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> Escrow
Read-only lookup of an escrow's current state.
fn get_escrow(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> Escrow
Seconds remaining before release becomes callable. 0 if already
eligible or not yet approved/found in a releasable state.
fn seconds_until_release(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> u64