wip-agent-pay 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.license-guard.json +7 -0
- package/CASH.md +75 -0
- package/CHANGELOG.md +18 -0
- package/CLA.md +17 -0
- package/DEPLOY-WORKER.md +161 -0
- package/LICENSE +21 -0
- package/PARTNERS-402.md +75 -0
- package/PARTNERS-STRIPE.md +69 -0
- package/README.md +80 -0
- package/REFERENCE.md +160 -0
- package/SETUP.md +242 -0
- package/SKILL.md +43 -0
- package/SPEC.md +156 -0
- package/WALLET.md +89 -0
- package/cli.js +265 -0
- package/detect.mjs +13 -0
- package/examples/minimal/README.md +17 -0
- package/install.js +6 -0
- package/lib/cdp-auth.js +131 -0
- package/mcp-server.mjs +105 -0
- package/openclaw.mjs +88 -0
- package/openclaw.plugin.json +17 -0
- package/package.json +43 -0
- package/providers/coinbase.js +55 -0
- package/providers/index.js +155 -0
- package/providers/passthrough.js +139 -0
- package/providers/privy.js +50 -0
- package/providers/stripe.js +54 -0
- package/providers/x402.js +50 -0
- package/skills/agent-pay/SKILL.md +30 -0
- package/worker/index.js +1440 -0
- package/worker/wrangler.toml +25 -0
package/CASH.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# AI CASH
|
|
2
|
+
|
|
3
|
+
**Picture this:** you're browsing a news feed with your AI/agent. It finds a paywalled deep-dive you'd want to read. "This costs $0.67. Use **AI CASH** to pay for this?" You say "let's go."
|
|
4
|
+
|
|
5
|
+
You approve Apple Pay (or Google Pay). The agent unlocks the article. Done.
|
|
6
|
+
|
|
7
|
+
No wallet app. No setup. You just said "let's go" and kept reading.
|
|
8
|
+
|
|
9
|
+
***Give your agent a way to pay.***
|
|
10
|
+
|
|
11
|
+
Works with [partner Stripe stores](https://github.com/wipcomputer/wip-agent-pay/blob/main/PARTNERS-STRIPE.md) like [Modern Weaving](https://modern-weaving.com/products/infinity-single-strap-tall-crossbody-glossed-crimson) and all [x402](https://www.x402.org/) payment gates like [Pawr](https://pawr.link).
|
|
12
|
+
|
|
13
|
+
## How It Works
|
|
14
|
+
|
|
15
|
+
Your AI can find things you want to buy ... but until now, it couldn't actually finish the purchase.
|
|
16
|
+
|
|
17
|
+
1. Your AI spots something worth paying for.
|
|
18
|
+
2. You tap Apple Pay or Google Pay.
|
|
19
|
+
3. The purchase completes instantly.
|
|
20
|
+
|
|
21
|
+
That's **AI CASH** in action.
|
|
22
|
+
|
|
23
|
+
It works wherever you use AI ... in ChatGPT, Claude Code, OpenClaw, or other AI apps.
|
|
24
|
+
|
|
25
|
+
Paywalled articles. Shopify products. SaaS subscriptions. API credits. If your AI finds it, you can buy it instantly.
|
|
26
|
+
|
|
27
|
+
**AI CASH** makes buying with your AI as easy as tapping a button ... no setup, no wallet, no confusion.
|
|
28
|
+
|
|
29
|
+
## Teach Your AI How To Pay
|
|
30
|
+
|
|
31
|
+
To give your AI the ability to pay, just tell it:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Read the SPEC.md and SKILL.md at github.com/wipcomputer/wip-agent-pay.
|
|
35
|
+
Then explain to me:
|
|
36
|
+
1. What is this tool?
|
|
37
|
+
2. What does it do?
|
|
38
|
+
3. What would it change or fix in our current system?
|
|
39
|
+
|
|
40
|
+
Then ask me:
|
|
41
|
+
- Do you have more questions?
|
|
42
|
+
- Do you want to install it?
|
|
43
|
+
- Do you want to use it to pay for something right now?
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Your AI will read the repo, explain everything, and walk you through setup interactively.
|
|
47
|
+
|
|
48
|
+
## Pricing
|
|
49
|
+
|
|
50
|
+
**Partner stores (Stripe):**
|
|
51
|
+
- No extra fees for you. You pay the product price. That's it.
|
|
52
|
+
- Partner Stripe stores (like Shopify) have no cap.
|
|
53
|
+
|
|
54
|
+
**Paywalled content (x402):**
|
|
55
|
+
- $0.25 per transaction + standard card processing.
|
|
56
|
+
- Your AI finds a paywalled article or API ... you tap Apple Pay ... it unlocks.
|
|
57
|
+
- The $0.25 covers the bridge between your card and the seller's payment gate.
|
|
58
|
+
- Transaction limits depend on the seller.
|
|
59
|
+
- **AI CASH** operates a curated network of verified sellers with tiered limits based on trust.
|
|
60
|
+
- New and unverified sellers start with lower limits.
|
|
61
|
+
|
|
62
|
+
Want full purchasing autonomy? See [**AGENT WALLET**](https://github.com/wipcomputer/wip-agent-pay/blob/main/WALLET.md) ... bring your own wallet. No fees. No limits.
|
|
63
|
+
|
|
64
|
+
## Become a Partner
|
|
65
|
+
|
|
66
|
+
- **Do you use Stripe?** See the [Stripe Partner Page](https://github.com/wipcomputer/wip-agent-pay/blob/main/PARTNERS-STRIPE.md).
|
|
67
|
+
- **Do you have a x402 payment gate?** See the [x402 Partner Page](https://github.com/wipcomputer/wip-agent-pay/blob/main/PARTNERS-402.md).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT. See [LICENSE](LICENSE).
|
|
74
|
+
|
|
75
|
+
Built by Parker Todd Brooks, Lēsa (OpenClaw, Claude Opus 4.6), Claude Code CLI (Claude Opus 4.6), Codex, and Grok (4.20 Beta).
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.1 (2026-07-20)
|
|
4
|
+
|
|
5
|
+
# Agent Pay v1.0.1
|
|
6
|
+
|
|
7
|
+
Agent Pay now declares its three runtime tools and explicit startup activation in its OpenClaw manifest. OpenClaw 2026.6.11 can discover and register the payment tools during gateway startup instead of leaving the installed extension dormant.
|
|
8
|
+
|
|
9
|
+
The complete package is now documented consistently under the existing MIT license. This includes the AI Cash payment worker as well as the client libraries, providers, skills, and command-line tools.
|
|
10
|
+
|
|
11
|
+
Closes #14.
|
|
12
|
+
|
|
13
|
+
## [1.0.0] - 2026-02-23
|
|
14
|
+
- Initial release
|
|
15
|
+
- Coinbase isolated-portfolio support
|
|
16
|
+
- pay.wip.computer one-time URL relay
|
|
17
|
+
- Full Universal Interface compatibility
|
|
18
|
+
- Built live with Grok
|
package/CLA.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
###### WIP Computer
|
|
2
|
+
|
|
3
|
+
# Contributor License Agreement
|
|
4
|
+
|
|
5
|
+
By submitting a pull request to this repository, you agree to the following:
|
|
6
|
+
|
|
7
|
+
1. **You grant WIP Computer, Inc. a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license** to use, reproduce, modify, distribute, sublicense, and otherwise exploit your contribution under any license, including commercial licenses.
|
|
8
|
+
|
|
9
|
+
2. **You retain copyright** to your contribution. This agreement does not transfer ownership. You can use your own code however you want.
|
|
10
|
+
|
|
11
|
+
3. **You confirm** that your contribution is your original work, or that you have the right to submit it under these terms.
|
|
12
|
+
|
|
13
|
+
4. **You understand** that your contribution may be used in both open source and commercial versions of this software.
|
|
14
|
+
|
|
15
|
+
This is standard open source governance. The agreement keeps contributions usable by WIP Computer while contributors retain ownership of their work.
|
|
16
|
+
|
|
17
|
+
If you have questions, open an issue or reach out.
|
package/DEPLOY-WORKER.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Deploy pay.wip.computer Worker
|
|
2
|
+
|
|
3
|
+
## Step 1: Create the Worker
|
|
4
|
+
|
|
5
|
+
1. Go to https://dash.cloudflare.com
|
|
6
|
+
2. Workers & Pages ... Create
|
|
7
|
+
3. Click **"Start with Hello World!"**
|
|
8
|
+
4. Name it: `pay-wip-computer`
|
|
9
|
+
5. Click **Deploy**
|
|
10
|
+
6. Click **Edit Code** (opens the editor)
|
|
11
|
+
7. Delete the hello world code
|
|
12
|
+
8. Paste the full Worker code below
|
|
13
|
+
9. Click **Deploy**
|
|
14
|
+
|
|
15
|
+
## Step 2: Create KV Namespace
|
|
16
|
+
|
|
17
|
+
1. Go to Workers & Pages ... KV (left sidebar)
|
|
18
|
+
2. Click **Create a namespace**
|
|
19
|
+
3. Name it: `PAY_TOKENS`
|
|
20
|
+
4. Click **Add**
|
|
21
|
+
|
|
22
|
+
## Step 3: Bind KV to the Worker
|
|
23
|
+
|
|
24
|
+
1. Go to Workers & Pages ... `pay-wip-computer`
|
|
25
|
+
2. Click **Settings**
|
|
26
|
+
3. Click **Bindings** (left sidebar, under Variables)
|
|
27
|
+
4. Click **Add**
|
|
28
|
+
5. Select **KV Namespace**
|
|
29
|
+
6. Variable name: `KV`
|
|
30
|
+
7. KV Namespace: select `PAY_TOKENS`
|
|
31
|
+
8. Click **Save**
|
|
32
|
+
|
|
33
|
+
## Step 4: Add the Worker Secret
|
|
34
|
+
|
|
35
|
+
1. Still in Worker Settings
|
|
36
|
+
2. Click **Variables** (left sidebar, under Variables)
|
|
37
|
+
3. Under **Environment Variables**, click **Add**
|
|
38
|
+
4. Variable name: `WORKER_SECRET`
|
|
39
|
+
5. Value: generate a strong random string (e.g. run `openssl rand -hex 32` in terminal)
|
|
40
|
+
6. Click **Encrypt** (makes it a secret)
|
|
41
|
+
7. Click **Save and deploy**
|
|
42
|
+
|
|
43
|
+
## Step 5: Add Custom Domain
|
|
44
|
+
|
|
45
|
+
1. Still in Worker Settings
|
|
46
|
+
2. Click **Domains & Routes** (left sidebar, under Triggers)
|
|
47
|
+
3. Click **Add** ... **Custom Domain**
|
|
48
|
+
4. Enter: `pay.wip.computer`
|
|
49
|
+
5. Click **Add Domain**
|
|
50
|
+
6. Cloudflare handles DNS + SSL automatically (may take a few minutes)
|
|
51
|
+
|
|
52
|
+
## Step 6: Store the Secret in 1Password
|
|
53
|
+
|
|
54
|
+
Save the same WORKER_SECRET value you used in Step 4:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Vault: Agent Secrets
|
|
58
|
+
Entry name: wip-agent-pay-worker-secret
|
|
59
|
+
Field: password
|
|
60
|
+
Value: (same string from Step 4)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Step 7: Verify
|
|
64
|
+
|
|
65
|
+
Open in browser or run:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
curl https://pay.wip.computer/
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Should return:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{"status":"ok","service":"wip-agent-pay"}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Worker Code
|
|
78
|
+
|
|
79
|
+
Paste this into the Cloudflare editor in Step 1:
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
// pay.wip.computer ... wip-agent-pay relay
|
|
83
|
+
// Source: https://github.com/wipcomputer/wip-agent-pay
|
|
84
|
+
export default {
|
|
85
|
+
async fetch(request, env) {
|
|
86
|
+
const url = new URL(request.url);
|
|
87
|
+
const path = url.pathname;
|
|
88
|
+
|
|
89
|
+
// Health check
|
|
90
|
+
if (path === '/' || path === '/health') {
|
|
91
|
+
return Response.json({ status: 'ok', service: 'wip-agent-pay' });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// === CREATE (protected) ===
|
|
95
|
+
if (path === '/create') {
|
|
96
|
+
// Auth: secret stored in Cloudflare env, same value in 1Password
|
|
97
|
+
const auth = request.headers.get('Authorization');
|
|
98
|
+
if (!env.WORKER_SECRET || auth !== `Bearer ${env.WORKER_SECRET}`) {
|
|
99
|
+
return new Response('Unauthorized', { status: 401 });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let body;
|
|
103
|
+
try {
|
|
104
|
+
body = await request.json();
|
|
105
|
+
} catch {
|
|
106
|
+
return new Response('Bad JSON', { status: 400 });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const { amount, service, note, expiresMin } = body;
|
|
110
|
+
const safeNote = typeof note === 'string' ? note : '';
|
|
111
|
+
const safeTtl = typeof expiresMin === 'number' && expiresMin > 0 ? Math.min(expiresMin, 60) : 10;
|
|
112
|
+
|
|
113
|
+
// Validate
|
|
114
|
+
if (typeof amount !== 'number' || amount <= 0 || amount > 50) {
|
|
115
|
+
return new Response('amount must be > 0 and <= 50', { status: 400 });
|
|
116
|
+
}
|
|
117
|
+
if (typeof service !== 'string' || service.length === 0 || service.length > 50) {
|
|
118
|
+
return new Response('service must be 1-50 chars', { status: 400 });
|
|
119
|
+
}
|
|
120
|
+
if (safeNote.length > 200) {
|
|
121
|
+
return new Response('note must be <= 200 chars', { status: 400 });
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const token = crypto.randomUUID();
|
|
125
|
+
const expiresAt = Date.now() + safeTtl * 60 * 1000;
|
|
126
|
+
|
|
127
|
+
await env.KV.put(token, JSON.stringify({
|
|
128
|
+
amount,
|
|
129
|
+
service,
|
|
130
|
+
note: safeNote,
|
|
131
|
+
expiresAt,
|
|
132
|
+
createdAt: new Date().toISOString()
|
|
133
|
+
}), { expirationTtl: safeTtl * 60 });
|
|
134
|
+
|
|
135
|
+
return Response.json({ url: `${url.origin}/${token}` });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// === CONSUME (atomic delete ... no race condition) ===
|
|
139
|
+
const token = path.slice(1);
|
|
140
|
+
if (!token || token.length < 10) {
|
|
141
|
+
return new Response('Not found', { status: 404 });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const data = await env.KV.get(token, 'json');
|
|
145
|
+
if (!data || Date.now() > data.expiresAt) {
|
|
146
|
+
return new Response('Invalid or expired token', { status: 410 });
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Delete immediately. First reader wins. Second reader gets 410.
|
|
150
|
+
await env.KV.delete(token);
|
|
151
|
+
|
|
152
|
+
return Response.json({
|
|
153
|
+
success: true,
|
|
154
|
+
amount: data.amount,
|
|
155
|
+
service: data.service,
|
|
156
|
+
note: data.note,
|
|
157
|
+
consumedAt: new Date().toISOString()
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
```
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Parker Todd Brooks
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PARTNERS-402.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Become an AI CASH + x402 Partner
|
|
2
|
+
|
|
3
|
+
You built something behind a [402 payment gate](https://www.x402.org/). AI agents are hitting it. Let them pay.
|
|
4
|
+
|
|
5
|
+
## Why Partner
|
|
6
|
+
|
|
7
|
+
AI agents are already discovering your APIs, content, and services. When they hit your 402 gate, they need a way to settle the payment. Most users don't have wallets. They don't hold USDC. They don't know what x402 is.
|
|
8
|
+
|
|
9
|
+
**AI CASH** bridges that gap. The user taps Apple Pay. We settle the x402 payment from our pool. Your gate unlocks. You get paid in USDC.
|
|
10
|
+
|
|
11
|
+
The user never touches crypto. You still get protocol-native settlement.
|
|
12
|
+
|
|
13
|
+
## How It Works
|
|
14
|
+
|
|
15
|
+
1. You run an x402 payment gate (Base or Solana).
|
|
16
|
+
2. You apply to join the **AI CASH** partner network.
|
|
17
|
+
3. We whitelist your domain.
|
|
18
|
+
4. When an AI agent hits your 402 gate, we quote the user an all-in price (your price + $0.25 + card processing).
|
|
19
|
+
5. User approves with Apple Pay or Google Pay.
|
|
20
|
+
6. We sign and settle x402 from our pool wallet.
|
|
21
|
+
7. Your content unlocks. You receive USDC.
|
|
22
|
+
|
|
23
|
+
No Stripe integration on your end. No checkout page. You just run your 402 gate. We handle the fiat side.
|
|
24
|
+
|
|
25
|
+
## What You Get
|
|
26
|
+
|
|
27
|
+
- **Fiat on-ramp for your 402 gate.** Users pay with Apple Pay. You receive USDC.
|
|
28
|
+
- **AI-native discovery.** Your service is discoverable by any AI agent using AI CASH.
|
|
29
|
+
- **No integration work.** If your 402 gate works, AI CASH works with it.
|
|
30
|
+
- **Protocol-native settlement.** USDC on Base or Solana. Same as any x402 payment.
|
|
31
|
+
|
|
32
|
+
## Partner Tiers
|
|
33
|
+
|
|
34
|
+
### Tier 0: New / Unverified
|
|
35
|
+
- Transaction cap: $0.10-$0.25 per request.
|
|
36
|
+
- Limited volume.
|
|
37
|
+
- Monitoring period.
|
|
38
|
+
|
|
39
|
+
### Tier 1: Verified
|
|
40
|
+
- Transaction cap: up to $25 per request.
|
|
41
|
+
- Standard refund window.
|
|
42
|
+
- Domain whitelisted.
|
|
43
|
+
|
|
44
|
+
### Tier 2: Trusted
|
|
45
|
+
- Higher limits.
|
|
46
|
+
- Preferred placement.
|
|
47
|
+
- Performance-based upgrade.
|
|
48
|
+
|
|
49
|
+
## Requirements
|
|
50
|
+
|
|
51
|
+
- Live x402 payment gate on Base or Solana.
|
|
52
|
+
- Clear pricing in the 402 response.
|
|
53
|
+
- Legitimate content or service behind the gate.
|
|
54
|
+
- Agreement to refund cooperation.
|
|
55
|
+
|
|
56
|
+
## Apply
|
|
57
|
+
|
|
58
|
+
Tell your AI:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Read the SPEC.md at github.com/wipcomputer/wip-agent-pay.
|
|
62
|
+
I run a 402 payment gate and want to become an AI CASH partner.
|
|
63
|
+
Walk me through the process.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or reach out directly at [WIP.computer](https://wip.computer).
|
|
67
|
+
|
|
68
|
+
## Current 402 Partners
|
|
69
|
+
|
|
70
|
+
- [Morning Stew](https://x.com/stewsletter) ... newsletter (Solana)
|
|
71
|
+
- [Pawr](https://pawr.link) ... AI skills marketplace (Base)
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
Built by [WIP.computer](https://wip.computer).
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Become an AI CASH + Stripe Partner
|
|
2
|
+
|
|
3
|
+
AI agents are finding your products. Let them buy.
|
|
4
|
+
|
|
5
|
+
## Why Partner
|
|
6
|
+
|
|
7
|
+
Your store is already being discovered by AI. ChatGPT, Claude, and other AI apps are browsing, recommending, and linking to your products right now. But when a user says "buy it" ... the AI can't complete the purchase.
|
|
8
|
+
|
|
9
|
+
**AI CASH** closes that gap. Your customers tap Apple Pay or Google Pay and the purchase completes instantly ... inside the AI conversation.
|
|
10
|
+
|
|
11
|
+
## How It Works
|
|
12
|
+
|
|
13
|
+
1. You apply to join the **AI CASH** partner network.
|
|
14
|
+
2. We connect via Stripe Connect. You stay merchant-of-record.
|
|
15
|
+
3. AI agents can now complete purchases on your store.
|
|
16
|
+
4. You get paid through Stripe. Same as always.
|
|
17
|
+
|
|
18
|
+
No new checkout flow. No integration work. No crypto. Just more sales from a new channel.
|
|
19
|
+
|
|
20
|
+
## What You Get
|
|
21
|
+
|
|
22
|
+
- **AI-native discovery.** Your products show up when AI agents search for what you sell.
|
|
23
|
+
- **Instant checkout.** Customers approve with Apple Pay or Google Pay. No cart abandonment.
|
|
24
|
+
- **No cap.** Partner Stripe stores have no transaction limit.
|
|
25
|
+
- **You stay in control.** You're merchant-of-record. Your refund policy. Your terms.
|
|
26
|
+
|
|
27
|
+
## Partner Tiers
|
|
28
|
+
|
|
29
|
+
### Tier 0: New Seller
|
|
30
|
+
- Application review.
|
|
31
|
+
- Lower initial transaction limits.
|
|
32
|
+
- Monitoring period.
|
|
33
|
+
|
|
34
|
+
### Tier 1: Verified Partner
|
|
35
|
+
- Full transaction limits (up to $25).
|
|
36
|
+
- Standard refund window (15-30 days).
|
|
37
|
+
- Seller agreement signed.
|
|
38
|
+
|
|
39
|
+
### Tier 2: Trusted Partner
|
|
40
|
+
- No transaction cap.
|
|
41
|
+
- Preferred AI-native placement.
|
|
42
|
+
- Performance-based. Sustained low dispute rate.
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
- Stripe account (or willingness to create one).
|
|
47
|
+
- Clear product listings and pricing.
|
|
48
|
+
- Agreement to refund cooperation.
|
|
49
|
+
- Legitimate digital or physical goods.
|
|
50
|
+
|
|
51
|
+
## Apply
|
|
52
|
+
|
|
53
|
+
Tell your AI:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Read the SPEC.md at github.com/wipcomputer/wip-agent-pay.
|
|
57
|
+
I want to become an AI CASH partner store.
|
|
58
|
+
Walk me through the process.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or reach out directly at [WIP.computer](https://wip.computer).
|
|
62
|
+
|
|
63
|
+
## Current Partners
|
|
64
|
+
|
|
65
|
+
- [Modern Weaving](https://modern-weaving.com/) ... handcrafted leather goods, Los Angeles
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
Built by [WIP.computer](https://wip.computer).
|
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# AI Cash + Wallet
|
|
2
|
+
|
|
3
|
+
**Picture this:** you're browsing a news feed with your agent. It finds a paywalled deep-dive you'd want to read. "This costs $0.67. Use **AI CASH** to pay for this?" You say "let's go."
|
|
4
|
+
|
|
5
|
+
You approve Apple Pay (or Google Pay). The agent unlocks the article. Done.
|
|
6
|
+
|
|
7
|
+
No wallet app. No setup. You just said "let's go" and kept reading.
|
|
8
|
+
|
|
9
|
+
*Give your agent a way to pay.*
|
|
10
|
+
|
|
11
|
+
## What This Is
|
|
12
|
+
|
|
13
|
+
Your AI needs to pay for things. [Morning Stew](https://x.com/stewsletter) subscriptions, [Pawr](https://pawr.link) skills, API credits, services from other agents. But Claude, GPT, Gemini, Grok don't have wallets. They can't hold money.
|
|
14
|
+
|
|
15
|
+
**AI Cash + Wallet** lets your agent pay for things. Three ways:
|
|
16
|
+
|
|
17
|
+
1. **AI CASH** ... Agent hits a paywalled URL. Apple Pay checkout opens. You authorize transaction with Face ID. We process the payment for you. Content unlocked. Default. No setup.
|
|
18
|
+
2. **AGENT WALLET** ... You have your own wallet. Your agent works with our agent to process the payment instantly. No fees from us.
|
|
19
|
+
3. **Link** ... Agent doesn't have tool access? It gives you a one-time payment link. You paste it back. Done.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
Open your AI coding tool and say:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Read the SPEC.md and SKILL.md at github.com/wipcomputer/wip-agent-pay.
|
|
27
|
+
Then explain to me:
|
|
28
|
+
1. What is this tool?
|
|
29
|
+
2. What does it do?
|
|
30
|
+
3. What would it change or fix in our current system?
|
|
31
|
+
|
|
32
|
+
Then ask me:
|
|
33
|
+
- Do you have more questions?
|
|
34
|
+
- Do you want to install it?
|
|
35
|
+
- Do you want to use it to pay for something right now?
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Your agent will read the repo, explain everything, and walk you through setup interactively.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## How AI CASH Works
|
|
42
|
+
|
|
43
|
+
- Agent finds paywalled content and quotes you the all-in price
|
|
44
|
+
- You approve with Apple Pay, Google Pay or CC
|
|
45
|
+
- We fulfill the payment and unlock the content
|
|
46
|
+
- The unlock token is one-shot and short-lived. Used once, destroyed.
|
|
47
|
+
- Payments are bound to the specific request being unlocked. Paying for one URL does not unlock others.
|
|
48
|
+
|
|
49
|
+
## For the Fascinated Consumer
|
|
50
|
+
|
|
51
|
+
- You can buy instantly on an AI powered store.
|
|
52
|
+
- Works on any AI app you use.
|
|
53
|
+
- Transparent pricing.
|
|
54
|
+
|
|
55
|
+
## For AI Developers
|
|
56
|
+
|
|
57
|
+
- **x402 native.** Speaks the Coinbase payment protocol natively. Multi-chain (Base, Solana). See [SPEC.md](https://github.com/wipcomputer/wip-agent-pay/blob/main/SPEC.md) for details.
|
|
58
|
+
- **Works on any agent.** Claude Code CLI, Codex CLI, Claude Desktop, OpenClaw, Cursor, any agent with shell access, any Node.js agent.
|
|
59
|
+
- **Bring your own wallet.** Coinbase CDP or Privy. No fees. Instant. No limit.
|
|
60
|
+
- **Open source.** The complete package, including the payment worker, is MIT licensed.
|
|
61
|
+
- **One-time links.** Payment URLs that self-destruct after use. Like magic login links, but for payments.
|
|
62
|
+
- **Free for wallets.** [WIP.computer](https://wip.computer) hosts **AGENT WALLET** infrastructure for free. Self-host everything if you prefer.
|
|
63
|
+
- **Universal Interface.** Our installer follows the [Universal Interface](https://github.com/wipcomputer/wip-universal-installer) spec.
|
|
64
|
+
- See [SETUP.md](https://github.com/wipcomputer/wip-agent-pay/blob/main/SETUP.md) for commands, wallet setup, and security details.
|
|
65
|
+
|
|
66
|
+
## Pricing
|
|
67
|
+
|
|
68
|
+
**AI CASH**: `Total = content price + $0.25 platform fee + card processing fee`
|
|
69
|
+
|
|
70
|
+
Max $25 per transaction. Over $25? Use an **AGENT WALLET**. No limit.
|
|
71
|
+
|
|
72
|
+
**AGENT WALLET**: no fees from us.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT. See [LICENSE](LICENSE).
|
|
79
|
+
|
|
80
|
+
Built by Parker Todd Brooks, Lēsa (OpenClaw, Claude Opus 4.6), Claude Code CLI (Claude Opus 4.6), Codex, and Grok (4.20 Beta).
|
package/REFERENCE.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# REFERENCE.md ... wip-agent-pay
|
|
2
|
+
|
|
3
|
+
Full technical details.
|
|
4
|
+
|
|
5
|
+
## One-time Setup (5 minutes)
|
|
6
|
+
|
|
7
|
+
### Coinbase (isolated portfolio)
|
|
8
|
+
|
|
9
|
+
1. Coinbase ... Advanced Trade ... Portfolios ... Create portfolio named `wip-agent-pay`
|
|
10
|
+
Fund it with $20-50 USDC only.
|
|
11
|
+
2. Coinbase Developer Platform ... API Keys ... Create new key
|
|
12
|
+
- Portfolio: `wip-agent-pay` **only**
|
|
13
|
+
- Permissions: **only** Transfer + View
|
|
14
|
+
- IP allowlist: your home IP
|
|
15
|
+
- Name: `wip-agent-pay-key`
|
|
16
|
+
3. Store API Key + API Secret in 1Password
|
|
17
|
+
Entry name: `wip-agent-pay-coinbase`
|
|
18
|
+
|
|
19
|
+
### Cloudflare Worker (pay.wip.computer)
|
|
20
|
+
|
|
21
|
+
1. Go to https://dash.cloudflare.com
|
|
22
|
+
2. Workers & Pages ... Create application ... Worker
|
|
23
|
+
3. Name it: `pay-wip-computer`
|
|
24
|
+
4. Settings ... Domains & Routes ... Add custom domain ... `pay.wip.computer`
|
|
25
|
+
5. Paste the Worker code below
|
|
26
|
+
6. Create a KV Namespace named `PAY_TOKENS`, bind it as `KV`
|
|
27
|
+
7. Add a secret: `wrangler secret put WORKER_SECRET` (or via dashboard Settings ... Variables)
|
|
28
|
+
8. Store the same secret in 1Password: entry `wip-agent-pay-worker-secret`
|
|
29
|
+
|
|
30
|
+
## Everyday Use
|
|
31
|
+
|
|
32
|
+
You (or your agent) type:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
wip-agent-pay 0.10 morning-stew "MS-#8"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The skill:
|
|
39
|
+
|
|
40
|
+
- pulls Worker secret + Coinbase creds from 1Password (op CLI)
|
|
41
|
+
- sends USDC from the isolated portfolio via Coinbase API
|
|
42
|
+
- calls pay.wip.computer/create with auth header to mint a one-time URL
|
|
43
|
+
- returns the URL ... agent consumes it once ... URL is deleted forever
|
|
44
|
+
|
|
45
|
+
## Cloudflare Worker Code
|
|
46
|
+
|
|
47
|
+
Deploy at pay.wip.computer (free tier).
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
// pay.wip.computer ... wip-agent-pay relay
|
|
51
|
+
// Source: https://github.com/wipcomputer/wip-agent-pay
|
|
52
|
+
export default {
|
|
53
|
+
async fetch(request, env) {
|
|
54
|
+
const url = new URL(request.url);
|
|
55
|
+
const path = url.pathname;
|
|
56
|
+
|
|
57
|
+
// Health check
|
|
58
|
+
if (path === '/' || path === '/health') {
|
|
59
|
+
return Response.json({ status: 'ok', service: 'wip-agent-pay' });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// === CREATE (protected) ===
|
|
63
|
+
if (path === '/create') {
|
|
64
|
+
// Auth: secret stored in Cloudflare env, same value in 1Password
|
|
65
|
+
const auth = request.headers.get('Authorization');
|
|
66
|
+
if (!env.WORKER_SECRET || auth !== `Bearer ${env.WORKER_SECRET}`) {
|
|
67
|
+
return new Response('Unauthorized', { status: 401 });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
let body;
|
|
71
|
+
try {
|
|
72
|
+
body = await request.json();
|
|
73
|
+
} catch {
|
|
74
|
+
return new Response('Bad JSON', { status: 400 });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const { amount, service, note, expiresMin } = body;
|
|
78
|
+
const safeNote = typeof note === 'string' ? note : '';
|
|
79
|
+
const safeTtl = typeof expiresMin === 'number' && expiresMin > 0 ? Math.min(expiresMin, 60) : 10;
|
|
80
|
+
|
|
81
|
+
// Validate
|
|
82
|
+
if (typeof amount !== 'number' || amount <= 0 || amount > 50) {
|
|
83
|
+
return new Response('amount must be > 0 and <= 50', { status: 400 });
|
|
84
|
+
}
|
|
85
|
+
if (typeof service !== 'string' || service.length === 0 || service.length > 50) {
|
|
86
|
+
return new Response('service must be 1-50 chars', { status: 400 });
|
|
87
|
+
}
|
|
88
|
+
if (safeNote.length > 200) {
|
|
89
|
+
return new Response('note must be <= 200 chars', { status: 400 });
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const token = crypto.randomUUID();
|
|
93
|
+
const expiresAt = Date.now() + safeTtl * 60 * 1000;
|
|
94
|
+
|
|
95
|
+
await env.KV.put(token, JSON.stringify({
|
|
96
|
+
amount,
|
|
97
|
+
service,
|
|
98
|
+
note: safeNote,
|
|
99
|
+
expiresAt,
|
|
100
|
+
createdAt: new Date().toISOString()
|
|
101
|
+
}), { expirationTtl: safeTtl * 60 });
|
|
102
|
+
|
|
103
|
+
return Response.json({ url: `${url.origin}/${token}` });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// === CONSUME (atomic delete ... no race condition) ===
|
|
107
|
+
const token = path.slice(1);
|
|
108
|
+
if (!token || token.length < 10) {
|
|
109
|
+
return new Response('Not found', { status: 404 });
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const data = await env.KV.get(token, 'json');
|
|
113
|
+
if (!data || Date.now() > data.expiresAt) {
|
|
114
|
+
return new Response('Invalid or expired token', { status: 410 });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Delete immediately. First reader wins. Second reader gets 410.
|
|
118
|
+
await env.KV.delete(token);
|
|
119
|
+
|
|
120
|
+
return Response.json({
|
|
121
|
+
success: true,
|
|
122
|
+
amount: data.amount,
|
|
123
|
+
service: data.service,
|
|
124
|
+
note: data.note,
|
|
125
|
+
consumedAt: new Date().toISOString()
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**KV Namespace:** Create one called `PAY_TOKENS` and bind it as `KV`.
|
|
132
|
+
|
|
133
|
+
**Worker Secret:** Set via `wrangler secret put WORKER_SECRET` or dashboard. Same value goes in 1Password as `wip-agent-pay-worker-secret`.
|
|
134
|
+
|
|
135
|
+
**Note on consistency:** KV is eventually consistent across Cloudflare edge locations. For $0.10 micropayments, atomic delete per-colo is sufficient. If you ever need strict global single-use, upgrade to Durable Objects.
|
|
136
|
+
|
|
137
|
+
## Pluggable Providers
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
providers/
|
|
141
|
+
coinbase.js ... v1 (shipped)
|
|
142
|
+
ledger.js ... add later
|
|
143
|
+
phantom.js ... add later
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Each provider exports `authorize(amount, service, note)` and returns `{ success, provider, amount, url }`.
|
|
147
|
+
|
|
148
|
+
## Security Guarantees
|
|
149
|
+
|
|
150
|
+
- Main Coinbase balance untouched (isolated portfolio, max $50)
|
|
151
|
+
- API key locked to tiny portfolio only (Transfer + View permissions)
|
|
152
|
+
- Worker /create endpoint requires Bearer token auth
|
|
153
|
+
- URLs are deleted on first use (not marked ... deleted)
|
|
154
|
+
- Worker secret lives in Cloudflare env + 1Password (never in code)
|
|
155
|
+
- Full worker code is public ... nothing hidden
|
|
156
|
+
- Input validation: amount 0-50, service 1-50 chars, note max 200, TTL max 60 min
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
This is the protocol the agent economy has been waiting for.
|