aptos-x402 2.2.4 → 2.3.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/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.3.1] - 2026-01-18
6
+
7
+ ### 📚 Documentation
8
+ - Updated facilitator URL to use the official public one: `https://aptos-x402.org/api/facilitator`
9
+
10
+ ## [2.3.0] - 2026-01-17
11
+
12
+ ### 🔴 Breaking Change (V2 Protocol Compliance)
13
+ - **402 Response Format**: Payment requirements now sent via `PAYMENT-REQUIRED` header (base64 JSON) instead of response body
14
+ - **Header Constants**: Added `PAYMENT_REQUIRED_HEADER` export
15
+
16
+ ### ✨ Improvements
17
+ - **Backward Compatibility**: Client (`x402axios`) still reads from body if header is missing (V1 fallback)
18
+ - **Protocol Compliance**: Now fully compliant with official x402 V2 specification
19
+
5
20
  ## [2.2.4] - 2026-01-17
6
21
 
7
22
  ### 🐛 Bug Fixes
package/README.md CHANGED
@@ -30,7 +30,7 @@ Built for **machine-to-machine micropayments**, this SDK provides zero-friction
30
30
  - 🚚 **Header-Based Spec**: Payment specs and proofs handling moved entirely to headers.
31
31
  - ⚡ **Performance**: Significant speed improvements with bug fixes and optimizations.
32
32
 
33
- > ⚡ **Performance:** Latest optimizations deliver **faster settlement** with verification caching, async confirmation, and smart deduplication. See [PERFORMANCE_OPTIMIZATIONS.md](./PERFORMANCE_OPTIMIZATIONS.md) for details.
33
+ > ⚡ **Performance:** Latest optimizations deliver **faster settlement** with verification caching, async confirmation, and smart deduplication.
34
34
 
35
35
  <!-- ## Key Features
36
36
 
@@ -68,25 +68,7 @@ npm install aptos-x402
68
68
  - **TypeScript:** 5.x (recommended)
69
69
  - **Aptos SDK:** 1.26.0 or higher (included as peer dependency)
70
70
 
71
- ---
72
-
73
- ## 🤖 AI-Powered Setup (Cursor IDE)
74
-
75
- Get started in seconds with AI-assisted integration:
76
-
77
- ```bash
78
- mkdir -p .cursor/rules
79
- curl -o .cursor/rules/aptos-x402.mdc https://raw.githubusercontent.com/adipundir/aptos-x402/main/integration/aptos-x402.mdc
80
- ```
81
-
82
- **Restart Cursor IDE**, then ask:
83
- > "Set up Aptos x402 in my Next.js app with payment middleware and a test client component"
84
-
85
- The MDC context file provides Cursor with complete API documentation, types, and examples for accurate code generation.
86
71
 
87
- **Learn more:** [Cursor Integration Guide](./docs/guides/cursor-integration.md)
88
-
89
- ---
90
72
 
91
73
  ## 🛒 Client Integration (Consuming Paid APIs)
92
74
 
@@ -186,7 +168,8 @@ export const middleware = paymentMiddleware(
186
168
  }
187
169
  },
188
170
  {
189
- url: process.env.FACILITATOR_URL!
171
+ // Use the official public facilitator for free
172
+ url: "https://aptos-x402.org/api/facilitator"
190
173
  }
191
174
  );
192
175
 
@@ -655,7 +638,7 @@ The facilitator handles blockchain operations (verification and settlement) sepa
655
638
 
656
639
  | Option | Best For | Setup |
657
640
  |--------|----------|-------|
658
- | **Public Facilitator** | Development, testing, POCs | `FACILITATOR_URL=https://aptos-x402.org/api/facilitator` |
641
+ | **Public Facilitator** | Development, testing, POCs | `url: "https://aptos-x402.org/api/facilitator"` |
659
642
  | **Self-Hosted (Same App)** | Small to medium deployments | Copy facilitator routes to your Next.js app |
660
643
  | **Self-Hosted (Separate)** | Production, high scale | Deploy as standalone service |
661
644