moltspay 1.2.1 → 1.3.0

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.
Files changed (58) hide show
  1. package/README.md +89 -14
  2. package/dist/cdp/index.d.mts +1 -1
  3. package/dist/cdp/index.d.ts +1 -1
  4. package/dist/cdp/index.js +53 -30368
  5. package/dist/cdp/index.js.map +1 -1
  6. package/dist/cdp/index.mjs +37 -30360
  7. package/dist/cdp/index.mjs.map +1 -1
  8. package/dist/cdp-DeohBe1o.d.ts +66 -0
  9. package/dist/cdp-p_eHuQpb.d.mts +66 -0
  10. package/dist/chains/index.d.mts +1 -1
  11. package/dist/chains/index.d.ts +1 -1
  12. package/dist/chains/index.js +29 -0
  13. package/dist/chains/index.js.map +1 -1
  14. package/dist/chains/index.mjs +29 -0
  15. package/dist/chains/index.mjs.map +1 -1
  16. package/dist/cli/index.js +863 -109
  17. package/dist/cli/index.js.map +1 -1
  18. package/dist/cli/index.mjs +867 -109
  19. package/dist/cli/index.mjs.map +1 -1
  20. package/dist/client/index.d.mts +25 -2
  21. package/dist/client/index.d.ts +25 -2
  22. package/dist/client/index.js +195 -12
  23. package/dist/client/index.js.map +1 -1
  24. package/dist/client/index.mjs +185 -12
  25. package/dist/client/index.mjs.map +1 -1
  26. package/dist/facilitators/index.d.mts +15 -53
  27. package/dist/facilitators/index.d.ts +15 -53
  28. package/dist/facilitators/index.js +234 -1
  29. package/dist/facilitators/index.js.map +1 -1
  30. package/dist/facilitators/index.mjs +233 -1
  31. package/dist/facilitators/index.mjs.map +1 -1
  32. package/dist/{index-DgJPZMBG.d.mts → index-On9ZaGDW.d.mts} +1 -1
  33. package/dist/{index-DgJPZMBG.d.ts → index-On9ZaGDW.d.ts} +1 -1
  34. package/dist/index.d.mts +2 -2
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +718 -30584
  37. package/dist/index.js.map +1 -1
  38. package/dist/index.mjs +711 -30587
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/server/index.d.mts +17 -0
  41. package/dist/server/index.d.ts +17 -0
  42. package/dist/server/index.js +443 -5
  43. package/dist/server/index.js.map +1 -1
  44. package/dist/server/index.mjs +443 -5
  45. package/dist/server/index.mjs.map +1 -1
  46. package/dist/verify/index.d.mts +1 -1
  47. package/dist/verify/index.d.ts +1 -1
  48. package/dist/verify/index.js +29 -0
  49. package/dist/verify/index.js.map +1 -1
  50. package/dist/verify/index.mjs +29 -0
  51. package/dist/verify/index.mjs.map +1 -1
  52. package/dist/wallet/index.d.mts +1 -1
  53. package/dist/wallet/index.d.ts +1 -1
  54. package/dist/wallet/index.js +29 -0
  55. package/dist/wallet/index.js.map +1 -1
  56. package/dist/wallet/index.mjs +29 -0
  57. package/dist/wallet/index.mjs.map +1 -1
  58. package/package.json +5 -2
package/README.md CHANGED
@@ -98,21 +98,36 @@ npx moltspay pay https://server.com text-to-video --chain polygon --prompt "a ca
98
98
 
99
99
  ### Testnet Quick Start
100
100
 
101
- Want to test before using real money? Use our testnet faucet:
101
+ Want to test before using real money? Use our testnet faucets:
102
102
 
103
103
  ```bash
104
104
  # 1. Create wallet (if you don't have one)
105
105
  npx moltspay init
106
106
 
107
- # 2. Get free testnet USDC (1 USDC per request, once per 24h)
108
- npx moltspay faucet
107
+ # 2. Get free testnet tokens
108
+ npx moltspay faucet # Base Sepolia (1 USDC, once per 24h)
109
+ npx moltspay faucet --chain tempo_moderato # Tempo testnet (pathUSD)
109
110
 
110
- # 3. Test payments on Base Sepolia
111
+ # 3. Test payments
112
+ # Option A: Base Sepolia
111
113
  npx moltspay pay https://moltspay.com/a/yaqing text-to-video \
112
114
  --chain base_sepolia --prompt "a robot dancing"
115
+
116
+ # Option B: Tempo Moderato (gas-free, MPP protocol)
117
+ npx moltspay pay https://server.com service-id \
118
+ --chain tempo_moderato --prompt "test"
113
119
  ```
114
120
 
115
- ## How x402 Protocol Works
121
+ ## Payment Protocols
122
+
123
+ MoltsPay supports two payment protocols:
124
+
125
+ | Protocol | Chains | Gas | Description |
126
+ |----------|--------|-----|-------------|
127
+ | x402 | Base, Polygon, Ethereum | Gasless (CDP pays) | HTTP 402 + EIP-3009 signatures |
128
+ | MPP | Tempo Moderato | Gas-free native | HTTP 402 + WWW-Authenticate |
129
+
130
+ ### How x402 Protocol Works
116
131
 
117
132
  ```
118
133
  Client Server CDP Facilitator
@@ -138,6 +153,33 @@ Client Server CDP Facilitator
138
153
 
139
154
  **Key insight:** Client signs a payment authorization, server submits it. Neither party pays gas - the CDP facilitator handles settlement.
140
155
 
156
+ ### How MPP Protocol Works (Tempo)
157
+
158
+ MPP (Machine Payments Protocol) is simpler - client executes the transfer directly:
159
+
160
+ ```
161
+ Client Server
162
+ │ │
163
+ │ POST /service │
164
+ │ ─────────────────────────> │
165
+ │ │
166
+ │ 402 + WWW-Authenticate │
167
+ │ <───────────────────────── │
168
+ │ │
169
+ │ [Execute TIP-20 transfer] │
170
+ │ [No gas needed on Tempo] │
171
+ │ │
172
+ │ POST + Authorization: Payment│
173
+ │ ─────────────────────────> │
174
+ │ │
175
+ │ [Server verifies on-chain] │
176
+ │ │
177
+ │ 200 OK + Payment-Receipt │
178
+ │ <───────────────────────── │
179
+ ```
180
+
181
+ **Key insight:** On Tempo, the client executes the transfer directly (gas-free), then retries with the transaction hash. No CDP facilitator needed.
182
+
141
183
  ## Skill Structure
142
184
 
143
185
  MoltsPay reads your skill's existing structure:
@@ -265,12 +307,22 @@ Clients can then pay using `--chain base_sepolia` and get free testnet USDC via
265
307
  # === Client Commands ===
266
308
  npx moltspay init # Create wallet
267
309
  npx moltspay fund <amount> # Fund wallet via Coinbase (US)
268
- npx moltspay faucet # Get free testnet USDC (Base Sepolia)
269
- npx moltspay status # Check balance
310
+ npx moltspay faucet # Get free testnet USDC
311
+ npx moltspay faucet --chain tempo_moderato # Get Tempo testnet tokens
312
+ npx moltspay status # Check balance (all chains)
270
313
  npx moltspay config # Update limits
271
314
  npx moltspay services <url> # List provider's services
272
315
  npx moltspay pay <url> <service> # Pay and execute service
273
316
 
317
+ # === Service Discovery ===
318
+ npx moltspay services # List all from registry
319
+ npx moltspay services https://provider.com # List from specific provider
320
+ npx moltspay services -q "video" # Search by keyword
321
+ npx moltspay services --max-price 1.00 # Filter by max price
322
+ npx moltspay services --type api_service # Filter by type
323
+ npx moltspay services --tag ai # Filter by tag
324
+ npx moltspay services --json # Output as JSON
325
+
274
326
  # === Pay with Chain Selection ===
275
327
  npx moltspay pay <url> <service> --chain base # Pay on Base (default)
276
328
  npx moltspay pay <url> <service> --chain polygon # Pay on Polygon
@@ -283,10 +335,11 @@ npx moltspay validate <path> # Validate manifest
283
335
 
284
336
  # === Options ===
285
337
  --port <port> # Server port (default 3000)
286
- --chain <chain> # Chain: base, polygon, base_sepolia
338
+ --chain <chain> # Chain: base, polygon, base_sepolia, tempo_moderato
287
339
  --token <token> # Token: USDC, USDT
288
340
  --max-per-tx <amount> # Spending limit per transaction
289
341
  --max-per-day <amount> # Daily spending limit
342
+ --config-dir <dir> # Custom wallet directory
290
343
  ```
291
344
 
292
345
  ## Programmatic Usage
@@ -324,12 +377,34 @@ server.listen(3000);
324
377
 
325
378
  ## Supported Chains
326
379
 
327
- | Chain | ID | Type |
328
- |-------|-----|------|
329
- | Base | 8453 | Mainnet |
330
- | Polygon | 137 | Mainnet |
331
- | Ethereum | 1 | Mainnet |
332
- | Base Sepolia | 84532 | Testnet |
380
+ | Chain | ID | Type | Notes |
381
+ |-------|-----|------|-------|
382
+ | Base | 8453 | Mainnet | Primary chain |
383
+ | Polygon | 137 | Mainnet | |
384
+ | Ethereum | 1 | Mainnet | |
385
+ | Base Sepolia | 84532 | Testnet | For testing |
386
+ | Tempo Moderato | 42431 | Testnet | MPP protocol, gas-free |
387
+
388
+ ### Tempo Testnet (New!)
389
+
390
+ Tempo Moderato is a gas-free testnet that supports the **MPP (Machine Payments Protocol)**. Perfect for testing agent-to-agent payments without any gas fees.
391
+
392
+ **Tempo Stablecoins:**
393
+ - pathUSD (USDC equivalent): `0x20c0000000000000000000000000000000000000`
394
+ - alphaUSD (USDT equivalent): `0x20c0000000000000000000000000000000000001`
395
+
396
+ ```bash
397
+ # Get free Tempo testnet tokens
398
+ npx moltspay faucet --chain tempo_moderato
399
+
400
+ # Pay on Tempo (gas-free!)
401
+ npx moltspay pay https://server.com service-id --chain tempo_moderato --prompt "test"
402
+
403
+ # Check Tempo balance
404
+ npx moltspay status
405
+ ```
406
+
407
+ **Explorer:** https://explore.testnet.tempo.xyz
333
408
 
334
409
  ## Live Example: Zen7 Video Generation
335
410
 
@@ -1,4 +1,4 @@
1
- import { C as ChainName } from '../index-DgJPZMBG.mjs';
1
+ import { C as ChainName } from '../index-On9ZaGDW.mjs';
2
2
  import { getChain } from '../chains/index.mjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { C as ChainName } from '../index-DgJPZMBG.js';
1
+ import { C as ChainName } from '../index-On9ZaGDW.js';
2
2
  import { getChain } from '../chains/index.js';
3
3
 
4
4
  /**