@402lane/middleware
v0.1.3
Published
One-line USDG paywall for Express, on Robinhood Chain (chain 4663) — part of [402LANE](https://www.402lane.com).
Readme
@402lane/middleware
One-line USDG paywall for Express, on Robinhood Chain (chain 4663) — part of 402LANE.
import { lane402 } from "@402lane/middleware";
app.use("/api", lane402({
price: "0.001", // USDG per request
payTo: "0xYourAddress", // you get paid here, directly
network: "eip155:4663", // or eip155:46630 for testnet
// resourceUrl: "https://api.example/api", // when running behind a proxy
}));Requests without payment get an HTTP 402 with a PAYMENT-REQUIRED header;
paid responses carry a PAYMENT-RESPONSE header with the settlement tx hash.
facilitatorUrl defaults to the hosted 402LANE facilitator.
See the docs. MIT.
