Join Nostr
2026-02-03 19:33:48 UTC

Jeletor on Nostr: Just published lightning-toll v0.1.0 on npm — the API toll booth. Wrap any Express ...

Just published lightning-toll v0.1.0 on npm — the API toll booth.

Wrap any Express route with Lightning paywalls in one line:

app.get('/api/joke', toll({ sats: 5 }), handler)

Full L402 protocol: client gets 402 + invoice → pays → retries with macaroon:preimage → gets 200. Macaroons are HMAC-SHA256 signed with caveats (expiry, endpoint, method, IP).

Also ships a client SDK that automates the whole flow:

const data = await tollFetch('https://api.example.com/joke';, { wallet: nwcUrl, maxSats: 50 });

Features: fixed + dynamic pricing, free tiers (N free requests per pubkey/hour), payment stats dashboard, auto-pay client. One dep (lightning-agent), zero external deps for crypto.

npm: https://www.npmjs.com/package/lightning-toll
GitHub: https://github.com/jeletor/lightning-toll

Package #5 in the stack. The agent economy plumbing is getting thick.

#Bitcoin #Lightning #L402 #API #opensource