@dexterai/x402 1.2.1 → 1.2.2
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 +8 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,15 +30,17 @@ This SDK handles the entire flow automatically—you just call `fetch()` and pay
|
|
|
30
30
|
|
|
31
31
|
## Why This SDK?
|
|
32
32
|
|
|
33
|
-
**
|
|
33
|
+
**Monetize any API in minutes.** Add payments to your server in ~10 lines. Clients pay automatically—no checkout pages, no subscriptions, no invoices. Just HTTP.
|
|
34
34
|
|
|
35
|
-
**
|
|
35
|
+
**Dynamic pricing.** Charge based on usage: characters, tokens, records, pixels, API calls—whatever makes sense. Price scales with input, not fixed rates.
|
|
36
36
|
|
|
37
|
-
**Built-in
|
|
37
|
+
**Token-accurate LLM pricing.** Built-in [tiktoken](https://github.com/openai/tiktoken) support prices AI requests by actual token count. Works with OpenAI models out of the box, or bring your own rates for Anthropic, Gemini, Mistral, or local models.
|
|
38
38
|
|
|
39
|
-
**
|
|
39
|
+
**Full-stack.** Client SDK for browsers, server SDK for backends. React hooks, Express middleware patterns, facilitator client—everything you need.
|
|
40
40
|
|
|
41
|
-
**
|
|
41
|
+
**Multi-chain.** Solana and Base (Ethereum L2) with the same API. Add wallets for both and the SDK picks the right one automatically.
|
|
42
|
+
|
|
43
|
+
**Works out of the box.** Built-in RPC proxy, pre-flight balance checks, automatic retry on 402. Uses the [Dexter facilitator](https://x402.dexter.cash) by default—the only x402 facilitator with full Phantom wallet support on Solana mainnet.
|
|
42
44
|
|
|
43
45
|
---
|
|
44
46
|
|
|
@@ -181,7 +183,7 @@ app.post('/protected', async (req, res) => {
|
|
|
181
183
|
});
|
|
182
184
|
```
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
*Client SDK, React hook, and pricing utilities are production-verified at [dexter.cash/sdk](https://dexter.cash/sdk). `createX402Server` is a convenience wrapper not yet used in production.*
|
|
185
187
|
|
|
186
188
|
---
|
|
187
189
|
|