Hold Funds in Escrow in Larzscript
Hold a payer's funds, then release them to a payee or refund them back - using the language's own wallet and pay keywords, not a bolted-on library.
wallet and pay are real Larzscript primitives (like let or fn), so escrow.open()/release()/refund() are just named wrappers around a real pay statement - there's no separate accounting system to keep in sync.
larzscript pkg install escrow
Code
import "escrow" as escrow
wallet buyer = $100.00
wallet seller
wallet held
escrow.open($40.00, buyer, held)
print("buyer balance:", buyer.balance)
print("held balance:", held.balance)
escrow.release($40.00, held, seller)
print("seller balance:", seller.balance)Output
buyer balance: $60.00 held balance: $40.00 seller balance: $40.00
Why this matters in Larzscript
No other mainstream language has wallet/pay as reserved keywords with their own runtime semantics - here, an escrow bug can't accidentally move money without a real pay statement doing it.
Related
larzescrowHold/release/refund on top of wallet/pay→Split a Bill Fairly in LarzscriptDivide a bill among people so it reconciles exactly to the cent - no language other than Larzscript treats this as a stack primitive rather than app-level logic.→Rate-Limit API Requests in LarzscriptToken-bucket rate limiting in about 20 lines - cap a caller to N requests with a steady refill rate instead of a blunt fixed window.→