User locks funds while online. Sets a 24-hour timelock to guarantee the merchant has time to text the receipt.
fn deposit(
env: soroban_sdk::Env,
customer: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
)
Customer withdraws remaining funds once the 24-hour escrow window closes.
fn withdraw(
env: soroban_sdk::Env,
customer: soroban_sdk::Address,
token: soroban_sdk::Address,
)
View function for frontend dashboards
fn get_vault(env: soroban_sdk::Env, customer: soroban_sdk::Address) -> i128
The Trusted Gateway (Next.js) submits the offline SMS transaction.
fn spend_offline(
env: soroban_sdk::Env,
gateway: soroban_sdk::Address,
customer: soroban_sdk::Address,
merchant: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
nonce: soroban_sdk::BytesN<32>,
expiry_ledger: u32,
)