@dexterai/x402 1.7.2 → 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.
- package/README.md +47 -5
- package/dist/adapters/index.cjs +408 -412
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +6 -5
- package/dist/adapters/index.d.ts +6 -5
- package/dist/adapters/index.js +385 -415
- package/dist/adapters/index.js.map +1 -1
- package/dist/client/index.cjs +573 -549
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +584 -556
- package/dist/client/index.js.map +1 -1
- package/dist/react/index.cjs +403 -399
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +399 -397
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.cjs +191 -81
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +53 -36
- package/dist/server/index.d.ts +53 -36
- package/dist/server/index.js +191 -81
- package/dist/server/index.js.map +1 -1
- package/dist/{solana-BWNn6iue.d.cts → solana-BeGAqPta.d.cts} +16 -4
- package/dist/{solana-q6Na2BF-.d.ts → solana-CQD9yMju.d.ts} +16 -4
- package/dist/{types-BzL-q-AE.d.cts → types-B477nBpg.d.cts} +7 -2
- package/dist/{types-By5Hhdmr.d.ts → types-BWnUAPvD.d.ts} +7 -2
- package/dist/{x402-client-rG7xFxSR.d.ts → x402-client-D9b3PHai.d.ts} +23 -2
- package/dist/{x402-client-BvQfgGwD.d.cts → x402-client-Dk9q2QQF.d.cts} +23 -2
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -152,12 +152,37 @@ function PayButton() {
|
|
|
152
152
|
|
|
153
153
|
## Supported Networks
|
|
154
154
|
|
|
155
|
-
|
|
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
|
-
|
|
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)`
|