@alleyboss/micropay-solana-x402-paywall 3.0.0 → 3.0.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/README.md +24 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -58,6 +58,30 @@ app.get('/premium', x402Middleware(server, {
|
|
|
58
58
|
});
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
## 📦 Next.js (App Router)
|
|
62
|
+
|
|
63
|
+
Use the official `@x402/next` adapter with our session management:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
// app/api/premium/route.ts
|
|
67
|
+
import { withX402 } from '@x402/next';
|
|
68
|
+
import { x402ResourceServer } from '@x402/core/server';
|
|
69
|
+
|
|
70
|
+
const server = new x402ResourceServer({ ... });
|
|
71
|
+
|
|
72
|
+
const handler = (req) => {
|
|
73
|
+
return Response.json({ content: "Premium Data" });
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const GET = withX402(handler, {
|
|
77
|
+
accepts: {
|
|
78
|
+
scheme: 'exact',
|
|
79
|
+
amount: '1000000',
|
|
80
|
+
network: 'solana-mainnet'
|
|
81
|
+
}
|
|
82
|
+
}, server);
|
|
83
|
+
```
|
|
84
|
+
|
|
61
85
|
## 🔧 Modules
|
|
62
86
|
|
|
63
87
|
Import only what you need:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alleyboss/micropay-solana-x402-paywall",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Production-ready Solana micropayments library wrapper for official x402 SDK",
|
|
5
5
|
"author": "AlleyBoss",
|
|
6
6
|
"license": "MIT",
|
|
@@ -119,4 +119,4 @@
|
|
|
119
119
|
"engines": {
|
|
120
120
|
"node": ">=18"
|
|
121
121
|
}
|
|
122
|
-
}
|
|
122
|
+
}
|