Loops HousePayPerCall on NEAR

NEAR HACKATHON
Links
Team
1 member- MUOwner
Muhammad Usman
Overview
Problem: AI agents increasingly pay per API call, but they pay up front. If the API is down or returns garbage, the money is gone, while providers will not serve before they are paid. Product: PayPerCall is a NEAR contract that escrows the price of exactly one call. The agent pays with request_call (NEAR) or ft_transfer_call (NEP-141, e.g. USDC), then sends the request to the service. The operator answers and calls fulfill with sha256(answer). The escrow is split between provider and referrer in the same transaction, and the agent verifies the answer against the on-chain hash. If the operator rejects, the agent is refunded at once. If it stays silent past the deadline, anyone can call refund_expired. No admin, no upgrade method; failed payouts fall back to pull-claims. How NEAR fits: named accounts make services readable; an agent's function-call key can be limited to request_call, so it can buy calls but move funds nowhere else; NEP-141 transfer-call gives one-transaction token payments with automatic excess refunds; NEP-297 events let indexers follow every call. Live on testnet (devx-paypercall.testnet) with a working operator bot and agent: answered-and-paid, rejected-and-refunded and expired-and-refunded runs linked on https://paypercall-near.madebydevx.com; 22 unit tests plus a sandbox e2e.