20 Commits

Author SHA1 Message Date
1d92fa23f2 feat: branded hosted storefront per merchant (G12)
Merchants can publish a store (slug, title, tagline, https logo, accent
colour, search description, optional custom domain) through settings or
the dashboard. The checkout app serves it at /store/<slug> with SEO and
Open Graph metadata, listing active products (invoice products hidden)
that each open their payment link, and a middleware rewrites '/' on a
merchant's custom domain to its store when CHECKOUT_PRIMARY_HOSTS is set.
Slugs and domains are unique; public data at /v1/public/stores. Carts of
several products stay out of scope because hosted checkout fulfils one
product per session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:32:06 +03:00
132efd87b3 feat: cash-out hand-off to off-ramp partners (G11)
GET /v1/merchant/offramp builds sell links for Transak, MoonPay (signed
server-side with the secret key) and Ramp with the amount, network and
the merchant's own receiving wallet prefilled. SettleKit takes no
custody; partners appear only once the owner configures their keys
(TRANSAK_API_KEY, MOONPAY_PUBLISHABLE_KEY/MOONPAY_SECRET_KEY,
RAMP_HOST_API_KEY). The dashboard Balances page gets a Cash out action per
mainnet network.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:24:40 +03:00
c14d0ab735 feat: team roles with invitations and enforced API key scopes (G9)
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>
2026-09-30 06:09:06 +03:00
330d111510 feat: fiat pricing with live ECB rates locked per checkout (G7)
Prices can now be set in EUR, GBP and other ECB reference currencies
(displayCurrency + displayAmount, or currency on quick products). Each
checkout converts them to USDC at the live rate from a frankfurter
service (MIT, FX_RATES_URL), rounded half-up to the cent with exact
bigint math, and locks the quote on the session (fxQuote) until it
expires, so onchain verification expects exactly the quoted USDC. Promo,
tax, receipts and the hosted checkout lines use the locked rate; the
payment link page shows the fiat price and today's USDC amount. Missing
or implausible rates fail closed (503); fiat subscriptions and mixed
fiat currencies are refused. Dashboard product form gets a currency
picker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 05:13:37 +03:00
a4d0f3f5cb feat: tax at checkout and tax-grade receipts (G4)
Sellers can turn on checkout tax in settings (label, own country and tax
ID, legal name, per-country rates, default rate, EU reverse charge).
Sessions add tax on top of the net price after any promo, so onchain
verification expects the tax-inclusive total. Buyers set billing country
and VAT ID via the API (billingCountry, vatId) or on the hosted checkout
until a payment is recorded; EU cross-border B2B with a VAT ID of the
right shape is zero-rated. Settled checkouts get a PDF receipt (pdfkit)
with the seller's tax ID, buyer country / VAT ID, tax rate and the
settlement transaction, linked from the success page, the receipt email
and the customer portal. packages/tax calculateTax is now used at
checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 04:30:53 +03:00
e0caf4bace feat: monthly platform fee statements with plan limits after grace (G1)
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>
2026-09-30 03:50:08 +03:00
2b2c8b471d chore: merge Tameion operator into main alongside multi-chain SettleKit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 22:43:33 +03:00
def5b16ede chore(deploy): Colosseum Render blueprint for api, worker, checkout, dashboard and web
- render.yaml deploys the five buyer/seller services on Node 22 with every
  env var the new surfaces read (chains, routing, HyperCore, Zcash, x402/MPP,
  onchain billing, service token, Discord, fee); Node builds install only the
  app and its workspace deps (pnpm --filter <app>...). Free plans everywhere
  except the worker (Render has no free background workers: starter).
- API/worker Dockerfiles install filtered; the API runs migrations on boot
  because preDeployCommand is paid-only.
- worker boots without GitHub App / Resend / Discord credentials: those
  deliveries stay pending and emails are skipped with a warning.
- .env.example documents the service token, manage-link secret and Discord OAuth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:43:12 +03:00
39b29903b2 fix(pricing): default platform fee to 1% with no fixed fee to match the landing page
DEFAULT_FEE_SCHEDULE in packages/platform-billing is the single source of truth;
.env.example documents how the API and web env mirror it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:11:28 +03:00
95c6e6f003 chore: merge agent payments, onchain billing and x402 facilitator into colosseum branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:07:16 +03:00
9dade882f4 chore: document checkout URL, fee and proof-exclusion env for the new surfaces
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:01:06 +03:00
220e502c34 feat(onchain-billing): HyperCore refunds, delivery on activation, tenant guards
- @settlekit/hyperliquid createHyperCoreUsdSender: operator-signed usdSend
  (EIP-712 via viem), submitted through the HyperCore client; the L1 hash is
  read back from the operator ledger (action digest as a labelled fallback).
  The API wires it as the HyperCore refund sender when HYPERCORE_ENABLED and
  an operator key (HYPERCORE_REFUND_PRIVATE_KEY or the billing operator key)
  are set. BillingNetwork is now PaymentNetwork; the renewal-invoice and
  access-hook network casts are gone.
- Access hooks call queueDelivery on the first successful charge and when an
  expired (suspended) subscription is paid again. API: runs the product's
  delivery actions inline through the real handler registry and persists the
  run (retryable via /v1/delivery-runs/:id/retry), minting the entitlement
  first when needed. Worker: enqueues a pending run on the worker delivery
  queue for the delivery-runner job. Both idempotent per charge payment id;
  a delivery failure never undoes the charge.
- deliveryActionsFor moved into @settlekit/delivery (zod-free) and shared by
  the API agent-payments path and the worker.
- Onchain billing routes use requireOwned / requireOwnedPayment: product
  ownership on subscription create, linked core subscription ownership,
  foreign customer ids refused on subscription and escrow create.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:59:58 +03:00
1b38e24f1f feat(x402-facilitator): Postgres nonce store and closed-by-default recipient allowlist
- PgX402NonceStore (x402_nonces, migration 0012): reserve is INSERT ... ON
  CONFLICT DO NOTHING on the primary key, so one settle wins across replicas.
  The API wires it whenever DATABASE_URL is set; otherwise the facilitator
  falls back to the in-memory store and logs a boot warning. One store is
  now shared by every per-environment facilitator part.
- allowedPayTo defaults to this deployment's own EVM receiving addresses
  (X402_EVM_PAY_TO + X402_PAY_TO_<CHAIN>); an empty allowlist refuses every
  recipient, and only X402_FACILITATOR_ALLOWED_PAY_TO=* opens the relayer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:59:42 +03:00
a679c2f38b feat(x402-facilitator): default the relayer allowlist to the deployment's own recipients
When X402_FACILITATOR_ALLOWED_PAY_TO is unset, the API's facilitator only
settles to its configured EVM payTo addresses, so a leaked facilitator
token cannot spend relayer gas on third-party payments. Documents the
agent-payment env in .env.example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 18:57:02 +03:00
eb57108fa9 docs: add TAMEION.md with pitch, architecture, run guide and disclosure
Also defaults the console's CHECKOUT_URL to the checkout app's dev port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:22:39 +03:00
43c331ad20 chore: add Tameion Render blueprint and operator env documentation
render.tameion.yaml provisions db, api, worker and operator-console with
every operator variable documented (secrets as sync: false, the console's
key sourced from the API bootstrap key); .env.example gains the operator
and console variables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:21:25 +03:00
ed7a2d10ae docs: chain-support matrix, checkout env example and worker retry env
Honest labels: Robinhood Chain settles USDG, Tempo settles bridged USDC.e,
Arc is testnet only, Zcash is transparent (not shielded) and mainnet only.
Adds apps/checkout/.env.example, the checkout routes and OSS licenses, and
the next-waves composition plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:16:40 +03:00
ab302a4b2f chore: document multi-chain env and wire project references
.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>
2026-09-29 16:25:24 +03:00
3853551433 asad 2026-06-17 02:09:36 +03:00
e84506c61d feat: distribution layer — SDK, React, migrations, deploy infra (no CI/CD)
- @settlekit/sdk: typed fetch HTTP client over the REST API; one resource
  client per /v1 resource (products, checkout, payments, entitlements,
  licenseKeys, apiKeys, bundles, github, discord, saas, escrow, agentServices…),
  AbortController timeouts, idempotency keys, SettleKitApiError envelope mapping.
- @settlekit/react: SettleKitProvider, useEntitlement/useCheckout/useCredits
  hooks, <Paywall> + <UpgradeButton> (React 18, plan §4).
- database: drizzle.config.ts + generated drizzle/0000_init.sql (48 tables,
  indexes, FKs) + db:generate/migrate/push/studio scripts.
- infra: README, ARCHITECTURE, CONTRIBUTING, .env.example, .dockerignore,
  docker-compose.yml, per-app Dockerfiles + Dockerfile.next, Makefile.

No tests. No CI/CD pipelines.
2026-06-15 11:02:39 +03:00