@@ -13,17 +13,17 @@ Live at **[onsight.photo](https://onsight.photo)**.
1313
1414Onsight is a crowdsourced ground-truth photography marketplace:
1515
16- - A ** requester** posts a * mission * — "photograph the queue outside this address,
16+ - A ** requester** posts a _ mission _ — "photograph the queue outside this address,
1717 today, from the street" — and funds a reward in USDC.
1818- Local ** photographers** nearby fulfill it and submit photos.
1919- The requester picks a winner; the escrowed reward pays out on-chain.
2020
2121There are ** two front doors onto the same rail** :
2222
23- | Requester | How they order | How they pay |
24- | ---| ---| ---|
25- | ** Human** | web UI at [ onsight.photo] ( https://onsight.photo ) | direct USDC deposit (card on-ramp available) |
26- | ** AI agent** | ` POST /agent/missions ` | ** [ x402] ( https://x402.org ) ** — pays USDC per call, no account, no key |
23+ | Requester | How they order | How they pay |
24+ | ------------ | ------------------------------------------------ | --------------------------------------------------------------------- |
25+ | ** Human** | web UI at [ onsight.photo] ( https://onsight.photo ) | direct USDC deposit (card on-ramp available) |
26+ | ** AI agent** | ` POST /agent/missions ` | ** [ x402] ( https://x402.org ) ** — pays USDC per call, no account, no key |
2727
2828Same escrow, same photographer supply, same payout. Only how the order is placed
2929and paid differs.
@@ -63,13 +63,13 @@ payments, since the money is already escrowed.
6363
6464Base URL: ` https://onsight.photo `
6565
66- | Agent action | Endpoint | Auth |
67- | ---| ---| ---|
68- | Post + fund a mission (place a photo order) | ` POST /agent/missions?rewardUsd=N ` | ** x402** (payment = escrow funding) |
69- | Read a mission + submitted photos | ` GET /agent/missions/:id ` | public |
70- | Update brief / extend dates | ` PATCH /agent/missions/:id ` | wallet signature |
71- | Pick + pay a winner | ` POST /agent/missions/:id/select ` ` { photoId } ` | wallet signature |
72- | Refund / cancel | ` POST /agent/missions/:id/refund ` | wallet signature |
66+ | Agent action | Endpoint | Auth |
67+ | ------------------------------------------- | ----------------------------------------------- | ----------------------------------- |
68+ | Post + fund a mission (place a photo order) | ` POST /agent/missions?rewardUsd=N ` | ** x402** (payment = escrow funding) |
69+ | Read a mission + submitted photos | ` GET /agent/missions/:id ` | public |
70+ | Update brief / extend dates | ` PATCH /agent/missions/:id ` | wallet signature |
71+ | Pick + pay a winner | ` POST /agent/missions/:id/select ` ` { photoId } ` | wallet signature |
72+ | Refund / cancel | ` POST /agent/missions/:id/refund ` | wallet signature |
7373
7474** Wallet-signature auth** (owner actions): send ` X-Wallet-Address ` ,
7575` X-Wallet-Signature ` , and ` X-Wallet-Timestamp ` , signing the message
@@ -102,16 +102,34 @@ curl -i -X POST "https://onsight.photo/agent/missions?rewardUsd=20" \
102102To actually place and fund the order, an agent signs the payment and retries with an
103103` X-PAYMENT ` header. The full runnable flow — using [ ` x402-fetch ` ] ( https://www.npmjs.com/package/x402-fetch )
104104so payment is handled automatically — is in
105- ** [ ` examples/x402-agent-order.js ` ] ( examples/x402-agent-order.js ) ** .
105+ ** [ ` examples/x402-agent-order.ts ` ] ( examples/x402-agent-order.ts ) ** :
106+
107+ ``` bash
108+ npm install
109+ AGENT_PRIVATE_KEY=0x... npm run example
110+ ```
106111
107112Buying as a human? See ** [ ` examples/human-order.md ` ] ( examples/human-order.md ) ** .
108113
109114## Examples
110115
111- - [ ` examples/x402-agent-order.js ` ] ( examples/x402-agent-order.js ) — an agent places and
112- funds a photo order via x402, then reads it back.
116+ - [ ` examples/x402-agent-order.ts ` ] ( examples/x402-agent-order.ts ) — an agent places and
117+ funds a photo order via x402, reads it back, then picks a winner with a signed
118+ owner action.
113119- [ ` examples/human-order.md ` ] ( examples/human-order.md ) — walkthrough for human buyers.
114120
121+ ## Signing helper
122+
123+ Owner actions (pick a winner, refund, edit a brief) are authorized by signing a
124+ canonical, body-bound message — get the format wrong and the server rejects you, or
125+ you sign something you didn't mean to. [ ` src/onsight.ts ` ] ( src/onsight.ts ) encodes it
126+ once (` signOwnerActionHeaders ` , ` ownerActionMessage ` , ` missionOrderUrl ` ), and its
127+ tests mirror the server guard so they break loudly if the scheme ever drifts.
128+
129+ ``` bash
130+ npm run lint && npm run typecheck && npm test # or all four via the pre-commit hook
131+ ```
132+
115133## Status
116134
117135The USDC escrow rail is live on Base mainnet; the x402 agent channel is rolling out.
0 commit comments