Hosted Stripe Crypto Onramp service for funding Bitterbot agent wallets.
The Bitterbot desktop client calls this service to get a clientSecret + publishableKey for the Stripe Crypto Onramp widget, so end users can fund their agent wallet without managing Stripe API keys themselves.
Bitterbot desktop client
→ POST https://onramp.bitterbot.ai/session
→ this service (Hono on Railway / Cloudflare Workers)
→ Stripe Crypto Onramp API (with server-held secret key)
← { clientSecret, publishableKey }
→ Stripe Onramp widget loads in the Bitterbot wallet view
Health check. Returns:
{ "ok": true, "service": "bitterbot-funding-onramp" }Creates a Stripe Crypto Onramp session.
Request body:
{
"walletAddress": "0x...", // required, 0x-prefixed 40-hex-digit address
"network": "base", // required, live-only (see note below)
"amount": 50 // optional, USDC
}Response:
{ "clientSecret": "cos_...", "publishableKey": "pk_..." }Rate-limited to 10 requests per IP+wallet per 60 seconds.
Live-only: this service does not accept testnet destinations. Wallet-funding code is not an open contributor surface, so there is no testnet path to exercise. Requests with any network other than "base" are rejected with 400.
railway upConfigured via railway.json. Sets PORT automatically; the Node entry (src/node.ts) reads it.
wrangler deployConfigured via wrangler.toml. Secrets set via wrangler secret put.
Two env vars are required on the deploy target:
STRIPE_SECRET_KEY_LIVE
STRIPE_PUBLISHABLE_KEY_LIVE
Never commit these. Use wrangler secret put (Workers) or the Railway dashboard Variables tab.
For local development: copy .env.example to .env with live keys (or a personal Stripe sandbox account).
pnpm install
cp .env.example .env # fill in Stripe live keys
pnpm dev # tsx watch src/node.ts on :8787Health check:
curl http://localhost:8787/Session test:
curl -X POST http://localhost:8787/session \
-H 'Content-Type: application/json' \
-d '{"walletAddress":"0x0000000000000000000000000000000000000000","network":"base"}'- Desktop client:
Bitterbot-AI/bitterbot-desktop— seesrc/services/hosted-onramp.ts - Tracker: Bitterbot-AI/bitterbot-desktop#14