// middleware.ts
import { paymentMiddleware } from 'x402-next';
// Use facilitator URL instead of import
export const middleware = paymentMiddleware(
"0xYourAddress",
{
'/api/premium': {
price: '$0.05',
network: "sei-testnet",
config: {
description: 'Premium API access',
maxTimeoutSeconds: 120,
}
},
'/api/data-feed': {
price: '$0.01',
network: "sei-testnet",
config: {
description: 'Real-time data feed',
mimeType: 'application/json',
}
}
},
facilitator,
{
appName: 'My Next.js App',
appLogo: '/logo.png'
}
);
export const config = {
matcher: [
'/api/premium/:path*',
'/api/data-feed/:path*',
]
};