Security fix plus team access. Before this change any valid API key,
including access keys the delivery system hands to BUYERS, authenticated
as the merchant on the whole management API, and GET /v1/api-keys listed
every organization's keys. Now only platform keys (issued at sign-up or
via POST /v1/api-keys/platform, marked with the platform product id) can
call the API, and each request needs its resource scope
(<resource>:read|write, write implies read; platform:admin or * for
full access), answered with 403 and details.requiredScope otherwise.
Keys cannot mint broader keys, customer keys cannot carry management
scopes, key listing is tenant-scoped and keys can be revoked by id.
Dashboard sessions get team roles (owner, admin, developer, support,
viewer) mapped to scopes. /v1/team manages members and email
invitations (packages/invitations, token hash only, 7-day expiry);
/v1/auth/invitations/accept joins the org and creates the account. The
last owner is protected and only owners grant owner. Dashboard: Team
page, invite accept page, and an API keys page that creates restricted
keys and shows the secret once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New tenant-scoped /v1/exports routes: payments, refunds, invoices and
payouts CSVs, a full USDC ledger, and bank statement files that Xero
(DD/MM/YYYY statement import) and QuickBooks Online (three-column bank
upload) import directly, with optional date ranges. packages/exports
gains a formula-injection guard (opt-in, admin unchanged) and the
accounting formatters. The dashboard Payments page links every export
through a session-authenticated download route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SettleKit's advertised per-payment fee was never collected because buyers
pay merchants' wallets directly. When PLATFORM_BILLING_ORG_ID is set, the
API now issues each merchant a monthly statement (confirmed payments x the
fee schedule) as an invoice from SettleKit's own org, paid through the
hosted checkout on the G2 payable-invoice path. Totals below the minimum
carry forward, test accounts are skipped, runs are idempotent and happen
automatically every six hours (or via POST /v1/billing/statements/run).
A statement unpaid past due + grace restricts new products to the free
plan limit from packages/pricing (402 with the pay link). Merchants see
accrued fees, statements and a Pay button on the Balances page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in packages/routing, packages/hyperliquid (hypercore network), checkout
AnyTokenPay/HyperCorePay, Node 22 pins, tenant-ownership guards and the zcash
tag lock. Only conflict: drizzle _journal.json (kept 0010_onchain_billing and
0011_coupons_organization in order).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/v1/onchain-billing: networks, subscription intents (what the buyer
signs or sends per network), grant submission with immediate first
charge and entitlement grant, cancel with revoke actions, Base escrow
authorize/capture/void/reclaim, and owner refunds recorded in
@settlekit/refunds and dispatched per network.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- HYPERCORE_* config; the registry registers a hypercore SettlementVerifier
(payee ledger via @settlekit/hyperliquid) only when enabled
- checkout sessions accept requireMemo (Tempo only); confirmations then need
transferWithMemo(keccak256(session id))
- a route provider's stored destination fill skips only the payer and memo
bindings; hypercore joins the observable networks
- drop the unused @settlekit/routing dependency from the API
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /v1/x402/research (x402 paymentMiddleware) and
POST /v1/x402/products/:productId/buy: one 402 challenge lists every
configured network; Solana/Base/Arbitrum settle through PayAI and
Ethereum/HyperEVM/Robinhood through the self-hosted facilitator, with
explicit per-network facilitator routing. Purchases use the upfront
flow: the facilitator settles BEFORE the handler, then the Payment is
recorded (tx hash unique, 409 on reuse), the entitlement granted and the
product's delivery actions run inline; the artifact is returned with the
PAYMENT-RESPONSE receipt. Product, price and required buyer fields are
validated before any challenge. Also exposes the facilitator's
/supported, /assets and bearer-guarded /verify and /settle, and
GET /v1/x402/networks. Runtime is built from env once at boot.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cherry-picked fail-closed payment fixes imported @settlekit/solana, which
does not exist on this branch, breaking tsc -b and the api/worker suites.
Solana verification, env and session references are removed; arc/base/
ethereum keep the per-network verifier registry and the worker keeps
payTo-bound verification. A solana network is now rejected as unsupported
(400 on checkout/observe, unsupported in the worker). Also adds the missing
packages/circle project reference to the api, points the api/worker test
scripts at the root vitest config, and removes the operator's
vitest.apps.config.ts workaround.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
.env.example and render.yaml (api + worker) list SETTLEKIT_CHAIN_ENV,
ENABLED_EVM_CHAINS, per-chain RPC/NETWORK/MIN_CONFIRMATIONS, Solana and
Zcash settings; api/worker tsconfig reference @settlekit/chains and
@settlekit/zcash; the UI explorer map covers every PaymentNetwork.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/v1/operator (API key or dashboard session, scoped to the vault's org):
POST /events (caller org forced, duplicate event ids replay the recorded
decision, single-flight per event), GET /decisions[/:id], POST|GET /bills,
GET /escalations, owner-only POST /escalations/:id/approve|reject, GET and
owner-only PUT /policy which refuses drift from on-chain caps and allowlist.
/v1/public/operator: GET /proof (cached aggregates, demo org excluded) and
GET /verify/:id. Mounted with one route line in app.ts ahead of the v1
API-key group. Escalated bills close when the owner resolves them.
App-level operator tests run through vitest.apps.config.ts because the api
and worker tsconfigs reference packages/solana, absent on this branch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Security: POST /v1/payments/:id/confirm only verified Arc payments; any
other network confirmed with an arbitrary txHash and granted
entitlements. The API now keeps a per-network verifier registry
(ctx.verifiers: arc via the existing Arc client, base via the generic
EVM client + BASE_RPC_URL + Base USDC, solana via @settlekit/solana)
and confirm/observe reject any network without one.
- a transaction hash settles at most one payment (409 on reuse, also
on record); EVM hashes are normalized to lowercase
- checkout sessions accept network solana, require a base58 payTo and
get a fresh Solana Pay paymentReference the tx must include
- observe validates hash/address formats per network (base58 vs 0x)
- compliance screening maps solana to Circle's SOL chain
- env: SOLANA_CLUSTER, SOLANA_RPC_URL, SOLANA_USDC_MINT, BASE_RPC_URL,
BASE_MIN_CONFIRMATIONS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Security: POST /v1/payments/:id/confirm only verified Arc payments; any
other network confirmed with an arbitrary txHash and granted
entitlements. The API now keeps a per-network verifier registry
(ctx.verifiers: arc via the existing Arc client, base via the generic
EVM client + BASE_RPC_URL + Base USDC, solana via @settlekit/solana)
and confirm/observe reject any network without one.
- a transaction hash settles at most one payment (409 on reuse, also
on record); EVM hashes are normalized to lowercase
- checkout sessions accept network solana, require a base58 payTo and
get a fresh Solana Pay paymentReference the tx must include
- observe validates hash/address formats per network (base58 vs 0x)
- compliance screening maps solana to Circle's SOL chain
- env: SOLANA_CLUSTER, SOLANA_RPC_URL, SOLANA_USDC_MINT, BASE_RPC_URL,
BASE_MIN_CONFIRMATIONS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add @settlekit/oss-fund: read package.json / requirements.txt (+ optional
lockfile), map the (transitive) dependency graph to maintainer wallets, and
split a small monthly budget across them — settled over the existing
nanopayment spine (payee-registry, x402 Settler, RecursiveSplitDistributor).
The allocation is the core: an engine weighs four signals per package —
directness, reach (criticality), usage, and maintainer underfunding — and the
capability layer converts a proposed weighting into a conserved integer
allocation (legs sum to the budget exactly, only resolvable wallets paid,
unregistered maintainers earmarked to escrow). Two engines, mirroring the paying
agent: a deterministic heuristic (default/CI) and a Claude (claude-opus-4-8)
tool-use brain that proposes weights under the same enforced policy.
- packages/oss-fund: manifest/lockfile parsing, graph + reach, signals,
resolver, conserved allocation, heuristic + Claude engines, settlement +
on-chain distributor calldata, realistic seed, CLI, tests (12 passing).
- apps/api: public PUBLIC routes GET /v1/fund/demo and POST /v1/fund/plan.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>