import { facilitator } from "thirdweb/x402";
import { createThirdwebClient } from "thirdweb";
const client = createThirdwebClient({
secretKey: "your-secret-key",
});
const thirdwebX402Facilitator = facilitator({
client: client,
serverWalletAddress: "0x1234567890123456789012345678901234567890",
});
// add the facilitator to any x402 payment middleware
const middleware = paymentMiddleware(
"0x1234567890123456789012345678901234567890",
{
"/api/paywall": {
price: "$0.01",
network: "base-sepolia",
config: {
description: "Access to paid content",
},
},
},
thirdwebX402Facilitator,
);