moltspay 1.3.0 → 1.4.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.
Files changed (58) hide show
  1. package/.env.example +14 -0
  2. package/README.md +319 -89
  3. package/dist/cdp/index.d.mts +4 -4
  4. package/dist/cdp/index.d.ts +4 -4
  5. package/dist/cdp/index.js +57 -0
  6. package/dist/cdp/index.js.map +1 -1
  7. package/dist/cdp/index.mjs +57 -0
  8. package/dist/cdp/index.mjs.map +1 -1
  9. package/dist/chains/index.d.mts +9 -8
  10. package/dist/chains/index.d.ts +9 -8
  11. package/dist/chains/index.js +57 -0
  12. package/dist/chains/index.js.map +1 -1
  13. package/dist/chains/index.mjs +57 -0
  14. package/dist/chains/index.mjs.map +1 -1
  15. package/dist/cli/index.js +2021 -285
  16. package/dist/cli/index.js.map +1 -1
  17. package/dist/cli/index.mjs +2023 -277
  18. package/dist/cli/index.mjs.map +1 -1
  19. package/dist/client/index.d.mts +39 -3
  20. package/dist/client/index.d.ts +39 -3
  21. package/dist/client/index.js +563 -37
  22. package/dist/client/index.js.map +1 -1
  23. package/dist/client/index.mjs +571 -35
  24. package/dist/client/index.mjs.map +1 -1
  25. package/dist/facilitators/index.d.mts +220 -1
  26. package/dist/facilitators/index.d.ts +220 -1
  27. package/dist/facilitators/index.js +664 -1
  28. package/dist/facilitators/index.js.map +1 -1
  29. package/dist/facilitators/index.mjs +670 -1
  30. package/dist/facilitators/index.mjs.map +1 -1
  31. package/dist/{index-On9ZaGDW.d.mts → index-D_2FkLwV.d.mts} +6 -2
  32. package/dist/{index-On9ZaGDW.d.ts → index-D_2FkLwV.d.ts} +6 -2
  33. package/dist/index.d.mts +2 -1
  34. package/dist/index.d.ts +2 -1
  35. package/dist/index.js +1440 -153
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +1448 -151
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/server/index.d.mts +13 -3
  40. package/dist/server/index.d.ts +13 -3
  41. package/dist/server/index.js +909 -54
  42. package/dist/server/index.js.map +1 -1
  43. package/dist/server/index.mjs +919 -54
  44. package/dist/server/index.mjs.map +1 -1
  45. package/dist/verify/index.d.mts +1 -1
  46. package/dist/verify/index.d.ts +1 -1
  47. package/dist/verify/index.js +57 -0
  48. package/dist/verify/index.js.map +1 -1
  49. package/dist/verify/index.mjs +57 -0
  50. package/dist/verify/index.mjs.map +1 -1
  51. package/dist/wallet/index.d.mts +3 -3
  52. package/dist/wallet/index.d.ts +3 -3
  53. package/dist/wallet/index.js +57 -0
  54. package/dist/wallet/index.js.map +1 -1
  55. package/dist/wallet/index.mjs +57 -0
  56. package/dist/wallet/index.mjs.map +1 -1
  57. package/package.json +5 -2
  58. package/schemas/moltspay.services.schema.json +27 -132
@@ -42,6 +42,7 @@ interface ProviderConfig {
42
42
  name: string;
43
43
  description?: string;
44
44
  wallet: string;
45
+ solana_wallet?: string;
45
46
  chain?: string;
46
47
  chains?: ChainConfig[];
47
48
  }
@@ -212,16 +213,25 @@ declare class MoltsPayServer {
212
213
  /**
213
214
  * POST /proxy - Handle payment for external services (moltspay-creators)
214
215
  *
215
- * This endpoint allows other services to delegate x402 payment handling.
216
+ * This endpoint allows other services to delegate x402/MPP payment handling.
216
217
  * It does NOT execute any skill - just handles payment verification/settlement.
217
218
  *
218
219
  * Request body:
219
220
  * { wallet, amount, currency, chain, memo, serviceId, description }
220
221
  *
221
- * Without X-Payment header: returns 402 with payment requirements
222
- * With X-Payment header: verifies payment and returns result
222
+ * For x402 (base, polygon, base_sepolia):
223
+ * Without X-Payment header: returns 402 with X-Payment-Required
224
+ * With X-Payment header: verifies payment via CDP
225
+ *
226
+ * For MPP (tempo_moderato):
227
+ * Without Authorization header: returns 402 with WWW-Authenticate
228
+ * With Authorization: Payment header: verifies tx on Tempo chain
223
229
  */
224
230
  private handleProxy;
231
+ /**
232
+ * Handle MPP payment flow for /proxy endpoint (tempo_moderato chain)
233
+ */
234
+ private handleProxyMPP;
225
235
  /**
226
236
  * Build payment requirements for proxy endpoint (uses provided wallet)
227
237
  */
@@ -42,6 +42,7 @@ interface ProviderConfig {
42
42
  name: string;
43
43
  description?: string;
44
44
  wallet: string;
45
+ solana_wallet?: string;
45
46
  chain?: string;
46
47
  chains?: ChainConfig[];
47
48
  }
@@ -212,16 +213,25 @@ declare class MoltsPayServer {
212
213
  /**
213
214
  * POST /proxy - Handle payment for external services (moltspay-creators)
214
215
  *
215
- * This endpoint allows other services to delegate x402 payment handling.
216
+ * This endpoint allows other services to delegate x402/MPP payment handling.
216
217
  * It does NOT execute any skill - just handles payment verification/settlement.
217
218
  *
218
219
  * Request body:
219
220
  * { wallet, amount, currency, chain, memo, serviceId, description }
220
221
  *
221
- * Without X-Payment header: returns 402 with payment requirements
222
- * With X-Payment header: verifies payment and returns result
222
+ * For x402 (base, polygon, base_sepolia):
223
+ * Without X-Payment header: returns 402 with X-Payment-Required
224
+ * With X-Payment header: verifies payment via CDP
225
+ *
226
+ * For MPP (tempo_moderato):
227
+ * Without Authorization header: returns 402 with WWW-Authenticate
228
+ * With Authorization: Payment header: verifies tx on Tempo chain
223
229
  */
224
230
  private handleProxy;
231
+ /**
232
+ * Handle MPP payment flow for /proxy endpoint (tempo_moderato chain)
233
+ */
234
+ private handleProxyMPP;
225
235
  /**
226
236
  * Build payment requirements for proxy endpoint (uses provided wallet)
227
237
  */