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>
Refunds no longer depend on a pasted hash alone. POST
/v1/merchant/payments/:id/refund/prepare creates a pending refund and
returns the exact transfer back to the buyer: ERC-20 transfer calldata,
token, chain id and an EIP-681 link on EVM networks, or a Solana Pay
transfer request with a unique reference. The destination is the wallet
that paid when known, else the merchant enters it (validated per chain).
POST /v1/merchant/refunds/:id/confirm verifies the signed transfer
onchain with the payment verifiers (destination, amount, time, Solana
reference, one refund per tx) and only then settles: access revoked,
payment refunded once fully refunded, refund.succeeded with source
wallet. Pending refunds can be canceled. Dashboard refund form gets a
'Send from my wallet' mode (browser wallet or mobile link, auto-verify).
apps/refund-protocol stays unwired.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
- Subscriptions: every buyer subscription with plan, network and collection
method, status, next charge, last charge (explorer link), dunning state and
cancel at period end / now; active count, MRR and dunning totals. Falls back
to the core list when onchain billing is off.
- Payment detail: Refund payment sends the funds on-chain through
POST /v1/onchain-billing/refunds (operator wallet per network, Base escrow
via the escrow) and shows the refund transaction link; when the operator is
not configured for the network it offers "I refunded manually" to record
the tx hash. Refund rows link to the explorer.
- Refunds ledger links each refund to its payment instead of creating
unsent pending refunds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- checkout: buyers connect Discord (OAuth2 identify + guilds.join) in the
delivery-fields step; the callback saves their user id on the session and
joins them to the product's server. After payment the bot adds the role via
PUT /guilds/{guild}/members/{user}/roles/{role}; the grant is recorded for
access-sync revocation. Without DISCORD_BOT_TOKEN the buyer sees
"pending setup" instead of a fake success.
- worker: discord-delivery-retry grants pending Discord entitlements once the
bot is configured (backoff per entitlement); DISCORD_BOT_TOKEN is optional.
- api: a configured bot delivers roles even before GitHub is set up;
checkout subscriptions pass the buyer's Discord / GitHub ids so subscription
delivery reaches the right accounts.
- dashboard: product settings explain server / role ids and link the bot invite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- /onboarding: business name, accepted networks and receiving addresses
(one EVM address for every EVM chain, Solana, HyperCore, Zcash t-address)
validated per chain, first product, shareable link + embed button
- Payments list (network, asset, route, buyer, explorer link, filters) and
detail with created/paid/verified/delivered timeline and refund recording
- Products create/edit with USD price, delivery type, per-network toggles,
pause/re-open; customers with spend and access; live on-chain balances
- Settings: networks and addresses, webhooks, API keys; short sidebar
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- AuthService.unlinkWallet — clears the linked wallet, refusing to strand a
wallet-only account (no password) from its only sign-in method.
- DELETE /v1/auth/wallet (bearer); dashboard Unlink button + /api/wallet/link DELETE.
- InMemoryAuthStore.saveAccount removes the stale wallet index on unlink (Pg: column→NULL).
- docs/DEVELOPMENT_ROADMAP.md: phased feature plan driving the continuous loop.
- 1308 tests / 213 suites, typecheck + builds green.
CRITICAL-1: validate SIWE domain/chainId server-side (EIP-4361 cross-site replay guard); AuthService gains siweDomain/siweChainIds, wired from AUTH_SIWE_DOMAIN/AUTH_SIWE_CHAIN_IDS in apps/api context.
CRITICAL-2: UNIQUE index on auth_accounts.wallet_address (migration 0007) as the final gate against the link/login race; loginWithWallet + linkWallet catch the violation -> conflict. Verified on live Postgres (dup rejected, NULLs allowed).
CRITICAL-3: /api/session (dashboard + portal) now verify the token with the API before persisting the cookie (no session fixation); + same-origin check on cookie-setting + /api/wallet/link routes (MEDIUM-3 CSRF).
HIGH-1: require expirationTime; enforce notBefore + issuedAt skew (shared verifyWalletMessage); clients now set expirationTime.
HIGH-2 (rate-limiting, task a): /v1/auth no longer exempt — stricter AUTH_RATE_LIMIT_PER_MINUTE (default 20) in a separate bucket; opportunistic expired-nonce prune (store + Pg).
HIGH-3: reserve the wallet email domain — block email/magic-link registration on it (no synthetic-email squatting).
HIGH-4: gate X-Forwarded-For trust behind TRUST_PROXY.
LOW-1: require a 65-byte (130-hex) ECDSA signature at the API boundary.
+ web3 tests for domain mismatch, missing-expiration, reserved-email. 1308 tests / 213 suites, typecheck + full build green; migrations 0006/0007 verified on Postgres.