108 Commits

Author SHA1 Message Date
64c74c7446 fix(checkout): restore checkout build after robinhoodWif registry key
robinhoodWif (18-decimal $wif) is a chain-registry/facilitator asset, not a
PaymentNetwork, so onchain-billing now skips non-PaymentNetwork chains and the
checkout EVM helpers carry the narrowed PaymentNetwork & EvmChainKey type.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-10 18:18:27 +03:00
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
dc88a1f91f fix(solana): payer binding was never enforced on Solana payment verification
The EVM and Zcash on-chain verifiers both enforce the session's declared
`payer` and `notBefore` bindings (packages/chains/src/evm-verifier.ts,
settlement.ts). The Solana verifier (packages/solana/src/x402-verifier.ts,
verify.ts) read neither field, even though payment-verification.ts's
sessionCheck() passes both to every network's verifier identically.

Concretely: a checkout session created with a declared payerAddress (the
pre-authorized-wallet / recurring on-chain-billing flow in
apps/api/src/routes/onchain-billing.ts) accepted a Solana payment of the
right amount to the right address from ANY wallet, not just the declared
payer - the exact binding EVM/Zcash already enforce.

Add payer + notBefore to VerifySplTransferParams/evaluateSplTransfer and
wire them through createSolanaPaymentVerifier, matching the EVM verifier's
semantics (fail closed, including when a tx has no on-chain block time).
The route-provider "routedFill" path (no Solana Pay reference) already has
its own independent notBefore check in
apps/api/src/config/verifier-registry.ts's verifyRoutedSolanaFill, which
bypasses this adapter and is unaffected.

28 solana-package tests pass (8 new), plus full chains (211) and api (231)
suites green; tsc --noEmit clean on both packages.
2026-10-26 22:42:47 +03:00
dea78f6eeb test: pin checkout test clock and cover x402_nonces in schema test
Checkout fixtures are dated 2026-09-29 but expiry reads the wall clock, so
24 tests started failing once the real date passed the checkout window.
The schema test predated the x402_nonces table, which is keyed by the
claimed authorization instead of id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 19:36:07 +03:00
b2f9e31fa5 fix: close org takeover at registration and harden fee statements and invoice bindings
- POST /v1/auth/register: a merchant always gets a fresh organization; a
  caller-supplied organizationId let anyone join an existing seller's org and
  receive a platform:admin key (tenant takeover, present on main too).
- Customer (portal) sessions carry the seller's org id; they are now refused
  on the management API instead of being treated as the org owner.
- Fee statements: issuance is serialized per merchant+period in-process and a
  duplicate raced in by another instance is voided before sending; a draft
  left by an interrupted run is sent on the next run. Overlapping runs
  previously issued (and emailed) several statements for one month.
- Invoices: SettleKit-owned metadata keys (pay token, session bindings,
  settlement facts, fee-statement markers) are stripped from API input, and a
  payment from another organization never settles an invoice.
- Scope map: /v1/merchant/refunds/* needs payments:write (was reports:write).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 07:08:31 +03:00
29de477e0f feat: Spanish hosted checkout via packages/localization (G14, part 2)
packages/localization gains the hosted checkout catalog (English source,
complete Spanish), a q-weighted Accept-Language picker limited to en/es
and a placeholder formatter. The checkout app (now depending on
@settlekit/localization) localizes the checkout, payment link, invoice
and success pages plus the order summary, promo, tax and start
components; ?lang=en|es or an sk_lang cookie override the browser
language and <html lang> follows. English output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:42:02 +03:00
c724bf1700 feat: conversion, per-link, churn and LTV metrics (G14, part 1)
GET /v1/analytics/metrics computes, from live sessions, payments,
subscriptions and catalog: checkout conversion, per-payment-link opened /
paid / conversion / revenue, repeat customers, average revenue per
customer, subscription churn, ARPU and an estimated lifetime value, with
exact bigint money. Checkout repositories gain listCreatedSince
(in-memory and Postgres). The dashboard Analytics page shows the new
cards and a payment-link table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:37:57 +03:00
35563d758d chore: prepare SDK releases at 0.1.0 with a publish workflow (G13)
@settlekit/common, @settlekit/sdk and @settlekit/react move to 0.1.0 with
publish metadata (description, MIT licence, repository, public access,
LICENSE and README in the tarball; verified with npm pack --dry-run).
.github/workflows/release-sdks.yml publishes npm, PyPI (trusted
publishing) and crates.io on an sdk-v* tag or as a manual dry run.
docs/RELEASING-SDKS.md lists the owner-only registry setup. Nothing is
published from here. The Python, Go and Rust webhook verifiers already
accept rotated secrets (G8).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:34:16 +03:00
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
6ba53b7a92 feat: refund to payer with prepared transfers verified onchain (G10)
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>
2026-09-30 06:21:27 +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
40f90f1c5a feat: webhook event log with resend, test events, secret rotation and auto-disable (G8)
Every seller webhook delivery now keeps an attempt log (status code,
error, time, next retry) in the worker queue (Postgres) or in memory.
New routes: GET /v1/webhooks/deliveries(/:id), POST
/v1/webhooks/events/:id/resend, POST /v1/webhooks/endpoints/:id/test
(signed webhook.test event), rotate-secret with a 0-168h grace window
(both secrets sign as two v1 values, verified by @settlekit/webhooks, the
TS/Python/Go/Rust SDKs and the WooCommerce plugin), and disable/enable.
The worker retries on a 1m..6h exponential schedule instead of every tick,
signs with the live endpoint secret, skips disabled endpoints and
auto-disables one after 100 failed attempts in a row
(WEBHOOK_DISABLE_AFTER_FAILURES). Outbound requests get a 10s timeout.
The dashboard Webhooks page shows the event log with Resend and endpoint
actions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 05:34:39 +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
91c637a470 feat: WooCommerce gateway ported from the BTCPay Greenfield plugin (G6, part 2)
plugins/woocommerce/settlekit-for-woocommerce charges WooCommerce orders
in USDC: checkout creates a SettleKit payment request for the order total
(no email, return to the order received page) and redirects to the hosted
pay page, reusing an open payment when the buyer comes back. The signed
invoice.paid webhook (?wc-api=settlekit) completes the order after
checking invoice id and amount, and the thank-you page double-checks the
status. Structure ported from btcpayserver/woocommerce-greenfield-plugin
(MIT, 371ebfc) with LICENSE and NOTICE kept. A standalone PHP suite runs
under plain PHP CLI and from vitest, including a cross-check of the PHP
signature verifier against @settlekit/webhooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 04:55:31 +03:00
f1647a5a81 feat: embeddable checkout overlay (embed.js) with allow-listed success callback (G6, part 1)
apps/checkout/public/embed.js opens a payment link, checkout or invoice
from the same checkout origin in an overlay iframe on any site; links
marked data-settlekit-checkout bind automatically, SettleKit.open() is
available from code, and there is an open-in-new-tab fallback for
wallets that block iframes. The success page posts settlekit:success
only to a site the seller listed under Settings > Embedding
(org embedOrigins, validated https origins), and embed.js only accepts
messages from its checkout frame. Payment requests gain sendEmail and
successUrl so store plugins can redirect buyers and bring them back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 04:52:19 +03:00
22c3208b60 feat: merchant accounting exports with Xero and QuickBooks imports (G5)
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>
2026-09-30 04:35:58 +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
4e97fcc409 feat: promo codes at checkout (G3)
Coupons now reach checkout. POST /v1/checkout-sessions takes an optional
couponCode, payment links accept ?promo=CODE (a refused code falls back to
full price with a notice), and the hosted checkout gets a promo field
while the session is open and unpaid. The discounted total becomes the
session amount before network bindings, so onchain verification expects
the discounted amount and a locked Zcash quote is re-priced. Codes are
tenant-scoped, product-scoped codes discount only their products, and
free-trial or 100% codes are refused. The redemption is counted once
after the payment confirms (API confirm and hosted checkout).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 04:09:54 +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
466c662ac3 feat: payable invoices and payment requests (G2)
Invoices can now be paid onchain. POST /v1/invoices/:id/send issues the
invoice, binds a public pay page (/i/<token> on the hosted checkout),
opens a checkout session for the invoice total on the merchant's
networks and emails the link. POST /v1/invoices/requests sends an
ad-hoc amount + memo to an email. The invoice turns paid only when a
confirmed onchain payment exists for one of its sessions (on read in the
API and in the new worker invoice-settle job) and emits invoice.paid.
Invoice and receipt PDFs render with pdfkit (MIT). Voiding cancels open
sessions. Dashboard gets a request-a-payment form, send buttons, pay
links and PDF downloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 03:35:06 +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
9691cf7c48 feat(webhooks): signed seller webhooks for payments and subscription charges
Shared outbox in @settlekit/persistence writes one idempotent webhook_events
row per (org, type, business key) and queues a worker_webhook_jobs delivery per
subscribed endpoint; the worker signs and retries them (capped attempts).
payment.confirmed is emitted from checkout, worker confirmations, API confirms
and agent payments; subscription.charged (+ payment.confirmed) from every
collected onchain period. In-memory API mode delivers in-process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:19: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
2a8d6f16d5 fix(api): scope refunds, disputes, dunning, invoices, license keys, coupons and entitlement lists to the caller's org
Coupons gain an organizationId (column + migration 0010); legacy rows with no
owner stay hidden from every tenant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:09:48 +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
05ece31dff feat(api): accept routed Solana fills on payment confirm
When the confirmed tx is the route provider's destination fill stored on the
session (session.route), the Solana Pay reference, payer and memo bindings
are dropped and the fill is bound by payTo, mint, amount and block time
(>= session creation - 120s), matching the checkout and worker verifiers.
Adds SettlementRequirements.routedFill to carry the flag to verifiers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:59:58 +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
e169731b42 chore: merge feat/solana-colosseum into feat/x402-multichain
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>
2026-09-29 20:39:32 +03:00
547ec1ba71 feat(api): merchant workspace, reusable payment links and public proof
- /v1/merchant: networks + receiving addresses validated per chain and
  stored on the org, enriched payments with timeline, refunds that revoke
  access, one-step products with payment links, customers with
  entitlements, live on-chain balances per network
- /v1/public: payment-link summary, fresh checkout session per visit,
  proof of confirmed payments across sellers (test orgs excluded)
- self-serve orgs get their organizations/merchants rows on first save

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:37:40 +03:00
ec04f3ddb5 feat(persistence): Postgres store for onchain subscriptions, charges and escrow
Migration 0010 adds onchain_subscriptions, onchain_charges (UNIQUE per
subscription+period) and onchain_escrow_payments. PgOnchainBillingStore
claims a period under a row lock so API and worker replicas can never
charge the same period twice. Adds shared access hooks (extend/suspend
core subscription, record payments, expire entitlements) and links
escrow payments to their checkout session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:19:14 +03:00
9dff6e0e9a fix(api): scope refunds, disputes, dunning, invoices, license keys, coupons and entitlement lists to the caller's org
Coupons gain an organizationId (column + migration 0010); legacy rows with no
owner stay hidden from every tenant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:18:39 +03:00
f76a3824e1 fix(hyperliquid): stop the submission fallback from claiming earlier transfers
The bySubmission time-window match allowed 2 minutes of negative skew and a
10-minute window, and trusted a client-supplied nonce on every poll, so it
could attribute an earlier transfer from the same sender to a new session.
It now requires the transfer at or after session creation with no skew,
narrows the window (30s before / 2 min after the signed nonce), and the
checkout persists the submitted action (signer + nonce, then the ledger
hash once found) so later polls match exactly that action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:12:36 +03:00
948ebfd761 fix(zcash): assign amount tags atomically per payTo
Tag assignment was read-then-write, so concurrent sessions paying the same
transparent address could lock the same tag and one payment would match
both. The base quote is now locked with tag 0 and the tag is chosen and
saved under a per-payTo lock (pg_advisory_xact_lock(hashtext(key)) shared
by the API and checkout when Postgres is wired, an in-process mutex
otherwise), with a post-save uniqueness re-check that retries on the next
tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:04:13 +03:00
1b07510926 feat(onchain-billing): onchain subscriptions, Base escrow and per-network refunds
New @settlekit/onchain-billing package:
- commerce-escrow: base/commerce-payments v1.1 AuthCaptureEscrow on Base
  mainnet + Sepolia (authorize/charge/capture/void/refund via
  OperatorRefundCollector, reclaim/pre-approve payer calls). PaymentInfo
  hash matches the deployed getHash (golden vectors recorded on-chain).
- spend-permission: Base Account SpendPermissionManager recurring
  allowances (Ethereum, Base, Arbitrum, Robinhood), spend + forward.
- permit2-allowance: Permit2 AllowanceTransfer caps (price x N periods)
  with one transferFrom per period on every EVM chain.
- spl-delegate: Solana SPL ApproveChecked delegate pulls.
- renewal-invoice: per-period checkout links for HyperCore/Zcash/any.
- charge-engine: idempotent (subscription, period) charging with leases,
  step recording and crash reconciliation, dunning and suspension.
- refund-dispatch: escrow refund / ERC-20 / Solana / HyperCore sender.
- Base-fork integration test (FORK_RPC_URL) against the real contracts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:00:36 +03:00
d7afb992a6 fix(hyperliquid): make UsdSendAction a type alias so it satisfies the SDK signer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:15:47 +03:00
2545aeddfb fix(x402): require exact authorization value and map tx-hash races to 409
The facilitator policy now refuses any authorization whose value differs
from the requirements amount before settling (also on direct /settle).
Agent purchases treat a lost race on the payments tx-hash unique index as
409 conflict, so one settlement never delivers twice. The MPP buy route
fails fast if mppx does not expose the tempo/charge intent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:06: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
27b21d20d4 feat(examples): agent-buy scripts for Solana, EVM chains and Tempo
agent-buy-solana (x402 SVM via PayAI), agent-buy-evm <network> (x402 EVM
on Base/Arbitrum/Ethereum/HyperEVM/Robinhood) and agent-buy-tempo (MPP via
the mppx client with a spend guard). Adds resolveX402Network to
@settlekit/x402-client for registry network names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 18:48:17 +03:00
18465d07ee feat(routing): origin explorers, deposit payment URIs and amount formatting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 18:20:34 +03:00
0b429ca971 feat(x402-client): x402 v2 agent payer with SettleKit spend controls
createSpecX402Fetch wraps fetch with the x402-foundation client schemes
(EVM EIP-3009/Permit2, SVM SPL transfer). Registry stablecoins on every
chain are opted in with an atomic per-payment cap, unknown tokens are
refused, and a selector prefers the caller's networks. The existing
tx-hash payer for the Arc scheme is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:59:04 +03:00
ef35154de3 feat(routing): any-token routing via Relay with LI.FI fallback
New @settlekit/routing: RouteProvider interface; hand-written Relay REST
client (EXACT_OUTPUT quote to the merchant payTo, refundTo = buyer, app fees,
strict deposit addresses, /intents/status/v3); LI.FI fallback (quote/toAmount,
status by origin tx); policy (max fee bps, max slippage, origin allowlist,
quote TTL, guaranteed destination amount, recipient/token/chain match);
PaymentNetwork -> destination map (Solana/Base/Arbitrum/Ethereum/HyperEVM
USDC, Robinhood USDG, Tempo USDC.e or pathUSD, HyperCore 1337 perps USDC);
session route record helpers; ROUTING_* env. Tests replay Relay/LI.FI
responses recorded live on 2026-09-29 (no network).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:56:28 +03:00
68a9070a75 feat(hyperliquid): HyperCore usdSend typed data, submission and ledger verification
New @settlekit/hyperliquid on @nktkas/hyperliquid (MIT): EIP-712 usdSend
typed data pinned by golden vectors against the SDK signer, submission of
buyer-signed actions, and fail-closed verification through the payee's
userNonFundingLedgerUpdates (destination == payTo, USDC >= expected, time >=
session creation, payer binding). HYPERCORE_ENABLED / NETWORK / API_URL env.
Registers the workspace packages in the lockfile (filtered install; unrelated
peer rewrites reverted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:56:14 +03:00
e01422d388 feat(chains): add hypercore network, session route record and Tempo memo requirement
- PaymentNetwork gains hypercore (Hyperliquid L1; EVM-style addresses and
  hashes, its own family, hlcore:* CAIP-2 ids, explorer link in ui/format)
- CheckoutSession gains route (any-token route record) and requireMemo
- EVM verifier requireMemo: on Tempo only a transferWithMemo carrying
  keccak256(sessionId) counts; plain transfers fail with memo_missing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:56:13 +03:00
4391c98dcc feat(x402): x402 v2 facilitator routing on @x402/core 2.27
Network-scoped facilitator clients so each network is served by exactly
one facilitator (PayAI for Solana/Base/Arbitrum, the self-hosted one for
the rest) and a misrouted payment fails closed. The Arc tx-hash scheme
is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:55:31 +03:00
b3ecc53966 feat(x402-facilitator): self-hosted x402 facilitator for Ethereum, HyperEVM and Robinhood
Wraps the x402-foundation exact EVM scheme (EIP-3009, Permit2 via the
x402 proxy) with SettleKit policy: per-network enable list, kill switch,
registry-pinned token + on-chain-verified EIP-712 domain (USDC/2 on
HyperEVM, Global Dollar/1 for Robinhood USDG), recipient allowlist, max
amount per settlement, nonce replay protection before any gas is spent
and a gas budget guard (per-settlement cap, rolling daily cap, relayer
balance floor). Tempo USDC.e and Robinhood testnet Mock USDC settle via
Permit2 and are experimental (explicit opt-in). Includes a viem relayer,
/supported + /assets + bearer-guarded /verify and /settle HTTP handler,
and env wiring. Tests sign real fixtures with the x402 client scheme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:55:31 +03:00
88e842f39d chore(deps): add x402-foundation @x402/* 2.27 and mppx for agent payments
@x402/core, evm, svm, hono, fetch 2.27 (Apache-2.0) and mppx 0.11 (MIT)
for x402 v2 on every chain and MPP on Tempo. Scaffolds the
@settlekit/x402-facilitator package manifest. Lockfile peer churn in
unrelated importers (checkout, app-kit-viem) reverted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:55:31 +03:00
b110508926 feat: expose operator vault state for the console
Adds buildOperatorState (bucket balances, held total, today's UTC-day spend
vs caps, pending escalations) and OperatorRuntime.state(), read from the
vault executor (on-chain reads when OperatorVault is configured), served at
GET /v1/operator/state for the operator org.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:59:41 +03:00
2134532ba3 fix: drop Solana from the Tameion branch while keeping fail-closed confirmation
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>
2026-09-29 16:55:28 +03:00
e9823d3ce7 feat(zcash): flag pending verifications whose transaction was found
Checkout claims a txid for a session only once the explorer has the
transaction and it pays the session; not-found and explorer outages stay
unclaimed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:46:16 +03:00