caelum0x d82a1b448b feat(robinhood): add real $wif mainnet support + mainnet proof script + fix API boot hang
World is Flat hackathon eligibility requires using $wif onchain on Robinhood
Chain; the existing integration only proved testnet Mock-USDC. Adds a real
robinhoodWif registry entry (18-decimal $wif, contract and chain id verified
live via eth_call), a Permit2 facilitator asset entry, and a ready-to-run
LIVE=1-gated mainnet settlement proof script (scripts/wif-mainnet-proof.ts)
with a safe default SIMULATE mode (no funds, no key) smoke-tested against
the live chain.

Also diagnoses and partially fixes settlekit-api.onrender.com timing out:
neither the migration client nor the app's DB connection set a
connect_timeout, so a stale DATABASE_URL hung boot indefinitely, and the
Dockerfile CMD's `&&` meant a migration failure blocked the server from even
starting. Adds a bounded default timeout and decouples server start from
migration success so failures are fast and visible instead of silent.

packages/chains + packages/x402-facilitator: 194/194 tests pass (registry
invariants updated for the two intentional exceptions: $wif=18 decimals,
robinhoodWif is mainnet-only).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-10 17:16:08 +03:00
..

@settlekit/api

The SettleKit REST API — Hono on Node via @hono/node-server.

Real route modules per resource are mounted under /v1. Every handler calls the real @settlekit/* domain services wired to the in-memory repositories those packages ship, so the API runs end-to-end with no external infrastructure. When DATABASE_URL is set, a drizzle Database handle is created via @settlekit/database.

Layout

src/
  server.ts            createServer + serve (Node entrypoint)
  app.ts               Hono app: mounts routers, error handler
  context.ts           builds service singletons (real services + in-memory repos)
  index.ts             public exports
  middleware/
    auth.ts            Bearer api-key auth (@settlekit/api-keys)
    error.ts           maps SettleKitError -> { error } with httpStatus
  http/
    respond.ts         { data } / { error } envelope helpers
    validate.ts        zod body validation -> 400 SettleKitError
    internal.ts        Result unwrap helper
  clients/             in-process GitHub / Discord / delivery clients
  stores/              generic in-memory record store
  routes/*.ts          one router per resource
test/
  app.test.ts          app.request() end-to-end tests

Endpoints

Core commerce: products, prices, customers, checkout-sessions, payments, subscriptions, entitlements, api-keys, license-keys, files, webhooks.

Plan §26: GitHub (/v1/integrations/github/*, /v1/github/access/*), Discord (/v1/integrations/discord/*, /v1/discord/access/*), SaaS (/v1/saas/*), Bundles (/v1/bundles*), Delivery (/v1/delivery-runs*, /v1/delivery-actions/test), Agent services (/v1/agent-services*), Escrow (/v1/escrow/tasks*).

Auth

Every /v1/* route requires Authorization: Bearer <api-key>. Set API_BOOTSTRAP_KEY to allow a static bootstrap key before any keys exist.

Responses

{ data: ... } on success; { error: { code, message, details? } } on failure with the HTTP status taken from the SettleKitError.

Run

pnpm --filter @settlekit/api dev     # tsx watch
pnpm --filter @settlekit/api build
pnpm --filter @settlekit/api start
pnpm --filter @settlekit/api test