crumburl
v0.0.1
Published
Micropayments for AI Agents
Downloads
8
Readme
The crumburl package facilitate this type of thing:
import { payment } from "crumburl";
const GET = (request: Request, env: Env) => {
const { transactionId, ok, location } = await payment(request, {
amount: 0.001,
address: process.env.CRUMBLE_ADDRESS,
description: "AI Agent Usage",
});
if (!ok) {
return new Response(
"Redirecting to deposit with correct retry redirection after deposit.",
{ headers: { location } },
);
}
};