@dexterai/x402 1.7.1 → 1.8.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 (36) hide show
  1. package/README.md +47 -5
  2. package/dist/adapters/index.cjs +408 -412
  3. package/dist/adapters/index.cjs.map +1 -1
  4. package/dist/adapters/index.d.cts +7 -6
  5. package/dist/adapters/index.d.ts +7 -6
  6. package/dist/adapters/index.js +385 -415
  7. package/dist/adapters/index.js.map +1 -1
  8. package/dist/client/index.cjs +583 -548
  9. package/dist/client/index.cjs.map +1 -1
  10. package/dist/client/index.d.cts +8 -8
  11. package/dist/client/index.d.ts +8 -8
  12. package/dist/client/index.js +594 -555
  13. package/dist/client/index.js.map +1 -1
  14. package/dist/react/index.cjs +413 -398
  15. package/dist/react/index.cjs.map +1 -1
  16. package/dist/react/index.d.cts +4 -4
  17. package/dist/react/index.d.ts +4 -4
  18. package/dist/react/index.js +409 -396
  19. package/dist/react/index.js.map +1 -1
  20. package/dist/server/index.cjs +211 -81
  21. package/dist/server/index.cjs.map +1 -1
  22. package/dist/server/index.d.cts +88 -38
  23. package/dist/server/index.d.ts +88 -38
  24. package/dist/server/index.js +211 -81
  25. package/dist/server/index.js.map +1 -1
  26. package/dist/{solana-CnW6P4lJ.d.cts → solana-BeGAqPta.d.cts} +17 -5
  27. package/dist/{solana-CJdhHls8.d.ts → solana-CQD9yMju.d.ts} +17 -5
  28. package/dist/{types-ClEZ34n4.d.ts → types-B477nBpg.d.cts} +8 -3
  29. package/dist/{types-BB-2vowq.d.cts → types-BWnUAPvD.d.ts} +8 -3
  30. package/dist/{types-C6ty4U6C.d.ts → types-DYLi7SuF.d.cts} +2 -0
  31. package/dist/{types-C6ty4U6C.d.cts → types-DYLi7SuF.d.ts} +2 -0
  32. package/dist/utils/index.cjs.map +1 -1
  33. package/dist/utils/index.js.map +1 -1
  34. package/dist/{x402-client-B9ECWy7k.d.ts → x402-client-D9b3PHai.d.ts} +24 -3
  35. package/dist/{x402-client-BhLOoqwa.d.cts → x402-client-Dk9q2QQF.d.cts} +24 -3
  36. package/package.json +9 -3
package/README.md CHANGED
@@ -152,12 +152,37 @@ function PayButton() {
152
152
 
153
153
  ## Supported Networks
154
154
 
155
- | Network | Identifier | Client | Server |
156
- |---------|------------|--------|--------|
157
- | Solana Mainnet | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` | ✅ Verified | ✅ Verified |
158
- | Base Mainnet | `eip155:8453` | ✅ Verified | ✅ Verified |
155
+ All networks supported by the [Dexter facilitator](https://x402.dexter.cash/supported). USDC on every chain.
159
156
 
160
- All networks use USDC. Both client and server SDKs are production-tested with real payments.
157
+ **Mainnets:**
158
+
159
+ | Network | CAIP-2 | Status |
160
+ |---------|--------|--------|
161
+ | Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` | Production |
162
+ | Base | `eip155:8453` | Production |
163
+ | Polygon | `eip155:137` | Production |
164
+ | Arbitrum | `eip155:42161` | Production |
165
+ | Optimism | `eip155:10` | Production |
166
+ | Avalanche | `eip155:43114` | Production |
167
+ | SKALE Base | `eip155:1187947933` | Production (zero gas) |
168
+
169
+ **Testnets:**
170
+
171
+ | Network | CAIP-2 |
172
+ |---------|--------|
173
+ | Solana Devnet | `solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1` |
174
+ | Base Sepolia | `eip155:84532` |
175
+ | SKALE Sepolia | `eip155:324705682` |
176
+
177
+ Accept payments on multiple chains simultaneously:
178
+
179
+ ```typescript
180
+ app.get('/api/data', x402Middleware({
181
+ payTo: '0xYourAddress',
182
+ amount: '0.01',
183
+ network: ['eip155:8453', 'eip155:137', 'eip155:42161', 'eip155:10'],
184
+ }));
185
+ ```
161
186
 
162
187
  ---
163
188
 
@@ -530,6 +555,23 @@ tiktoken's default encoding works well for most transformer models. Only use a c
530
555
 
531
556
  ---
532
557
 
558
+ ## Sponsored Access (v1.7.2)
559
+
560
+ **Server middleware** accepts `sponsoredAccess: true` in its config. When enabled, it reads `extensions["sponsored-access"]` from the facilitator's settlement response and injects `_x402_sponsored` into the JSON response body so agents can see recommendations.
561
+
562
+ ```typescript
563
+ app.use(x402Middleware({
564
+ facilitatorUrl: "https://x402.dexter.cash",
565
+ sponsoredAccess: true, // opt-in to recommendation injection
566
+ }));
567
+ ```
568
+
569
+ **Client SDK** decodes the `PAYMENT-RESPONSE` header from x402 responses and attaches the full settlement receipt (including extensions) as `response._x402` for programmatic access.
570
+
571
+ **Types:** `SettleResponse` now includes an optional `extensions` field.
572
+
573
+ ---
574
+
533
575
  ## API Reference
534
576
 
535
577
  ### `createX402Client(options)`