39 Commits

Author SHA1 Message Date
5be25bbceb fix(worker): complete the checkout session and grant entitlements when the worker confirms a payment
The claimTxHash flow is designed so the worker's payment-confirm job can
finish confirming a payment even after the buyer closes the tab (an agent
that never polls hits the same path). But the job only flipped the payment
to "confirmed" and emitted the webhook — it never completed the checkout
session or created an entitlement, both of which only happened in the
buyer-driven confirmOnce/fulfillOnce flow and the API's /payments/:id/confirm
route.

Result: a payment the worker confirms settles on-chain and fires the
seller's webhook, but the session stays "open" forever, so the success/
receipt page 409s "not paid yet" indefinitely and no entitlement is ever
created — the GitHub/Discord retry jobs have nothing to retry since they
only act on entitlements that already exist.

Add WorkerStore.saveCheckoutSession (in-memory + Postgres) and complete the
session + grant a payment entitlement per line item right after the worker
confirms a payment, guarded against double-granting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-18 00:14:20 +03:00
ccda758d3b fix(worker): sign webhook retries with the job clock; add MIT license
The rotation grace check used the wall clock while the job used ctx.now(),
so the retry test started failing once its fixed grace date passed.
The repo already declared MIT in package.json and contract SPDX headers;
add the LICENSE file so GitHub shows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 17:38:21 +03:00
3efb74f6c5 fix(deploy): set CI=true in API and worker images so the prod install runs without a TTY
Render builds failed at the prod-deps stage with
ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 19:36:07 +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
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
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
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
bcccfb0bf7 feat(discord): real paid-role delivery with Connect Discord at checkout
- 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>
2026-09-29 21:31:32 +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
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
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
d8aed72e3e feat(worker): subscription-charge job for onchain subscriptions
Registers the per-period charge job (WORKER_SUBSCRIPTION_CHARGE_INTERVAL_MS,
default 5 min) over the shared onchain-billing runtime and Postgres
stores; dunning on failure, entitlement suspension when exhausted,
extension on success. No-op until onchain billing is configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:19:14 +03:00
5d4ff5d4b8 chore: move runtime to Node 22 (required by @nktkas/hyperliquid)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:20:13 +03:00
9986da20d9 feat(worker): route-watch job, HyperCore confirmation and Tempo memo enforcement
- jobs/route-watch.ts: polls in-flight any-token routes (Relay / LI.FI) and
  records a payment ONLY after the destination fill passes the session
  network's fail-closed verifier (Transfer to payTo >= amount owed, after
  session creation, hash not used by another payment); provider success
  without such a transfer stays unpaid and backs off; refunds are logged
- payment verification: hypercore via the payee's ledger (HYPERCORE_*),
  routed fills skip only the payer / Solana reference / Tempo memo bindings
  (Solana fills are bound by block time), requireMemo sessions need
  transferWithMemo, pending results carry retryable/claimable
- config: HYPERCORE_*, ROUTING_*, WORKER_ROUTE_WATCH_INTERVAL_MS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 18:34:52 +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
3b5126d99e feat(worker): retry GitHub delivery for pending checkout entitlements
Checkout stores a GitHub entitlement as pending when the merchant's GitHub
App is not set up yet (or GitHub fails) and nothing retried it. The new
github-delivery-retry job (every 2 min, WORKER_GITHUB_RETRY_INTERVAL_MS)
re-delivers pending repo/team entitlements of confirmed payments through
the real GitHub App access client once an installation id is configured,
then marks them active. Targets come from the entitlement or product
metadata and the username from the checkout session; payments owned by the
delivery runner are skipped; failures back off 5 min doubling to 6 h.

The worker also accepts GITHUB_APP_INSTALLATION_ID (the checkout's name)
and gains WorkerStore.getProduct for product delivery metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:15:25 +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
0a86d7af03 fix: harden operator against double execution and payee swaps
- Events and escalation resolutions are claimed atomically in the store
  (operator_claims, INSERT ... ON CONFLICT DO NOTHING) before any money
  moves, so concurrent API/worker processes cannot execute twice; claims
  are released only when nothing was executed.
- x402 purchases pin the policy-approved payee and price: the settler
  refuses a re-read challenge that names another payTo or a higher price.
- A broadcast vault transaction whose receipt is unavailable or reverted
  is recorded as failed with its txHash (VaultTxError) for reconciliation.
- verifyDecision never reports a decision that moved money as valid
  without checking its DecisionAnchored logs on Arc.
- The worker's shared runtime reads the current run's clock and logger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:40:43 +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
1e20ece9df feat: add operator tick job to the worker
Each run expires stale escalations (vault-held ones on-chain, bills closed
as rejected), turns confirmed Arc payments into the operator vault without
a decision into revenue.received (payer read from the USDC transfer), raises
bill.due for open bills inside the due window, and emits one tick per UTC
day. Event ids are deterministic so nothing is decided twice. The API and
worker only run the operator with OPERATOR_VAULT_ADDRESS set or an explicit
OPERATOR_SIMULATION=1; otherwise the job no-ops and the routes answer 503.

Registered with one export in jobs/index.ts and one scheduler entry in
runtime.ts (the scheduler lists jobs explicitly).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:23:29 +03:00
39a69f5123 feat(worker): verify every enabled chain and watch open Zcash sessions
- config: loadEvmChains + Zcash (ZCASH_ENABLED, explorer, confirmations)
  and WORKER_ZCASH_WATCH_INTERVAL_MS (default 90s)
- payment verification routes every EVM key through @settlekit/chains
  (Arc moves onto the same path; chain-id asserted), Solana as before, and
  Zcash against the locked quote; late Zcash payments go to manual review;
  payTo resolves per network and acceptedNetworks is honoured
- new zcash-watch job: no network call unless open watchable Zcash
  sessions exist, one explorer call per payTo, exact-amount match, attaches
  or records the pending payment and never reuses a txid
- chains: transport failures are retryable rpc_unavailable, never paid

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:21:48 +03:00
2a4864dd49 feat: add operator API routes and public proof endpoints
/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>
2026-09-29 16:15:22 +03:00
015899f2c3 feat(chains): add multi-chain registry and fail-closed EVM verifier
@settlekit/chains carries the verified EVM registry (Ethereum, Base,
Arbitrum, Robinhood Chain, HyperEVM, Tempo, Arc; mainnet + testnet), a
generic stablecoin verifier over the arc EvmRpc seam (chain-id assertion,
receipt status, token/payTo/amount, confirmations, block time vs session,
payer binding, Tempo TIP-20 memo), CAIP-2 ids, network-aware tx-hash and
payTo rules, env loaders (SETTLEKIT_CHAIN_ENV, ENABLED_EVM_CHAINS, per-chain
overrides, Zcash) and the settlement-verifier contract. Tests replay
receipts recorded from each chain's public RPC.

PaymentNetwork widens to solana|base|arc|ethereum|arbitrum|robinhood|
hyperevm|tempo|zcash and CheckoutSession gains settlementQuote,
payerAddress, acceptedNetworks and payToByNetwork. The hosted checkout
fails closed on the new networks until its wave-2 UI lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 15:52:34 +03:00
8c1d704a96 feat: add Claude operator agent, tools and decision service
OperatorAgent drives the Anthropic SDK tool runner (betaZodTool) over read
tools (treasury state, open bills, counterparty risk, payment history, x402
quotes) and policy-checked action tools that require rationale,
alternatives and confidence. claude-sonnet-5 handles revenue and ticks,
claude-opus-5-5 bills, refunds and disputes; at most 12 iterations, with
HeuristicOperator fallback when no key is set or the API fails.

OperatorService turns each event into one hash-chained DecisionRecord with
the tool trace, verdict, usage cost and outcome. The vault anchors a
pre-execution commitment hash of the reasoning; owner approvals, rejections
and 72h expiries are recorded as decisions too. Invoice and customer text
is passed as escaped untrusted data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 15:41:33 +03:00
b2c4a50da0 fix: verify worker payment confirmations against the session payTo per network
The payment-confirm job verified every pending payment on Arc with
to = the USDC contract address instead of the merchant's payTo, so a
transfer to anyone could confirm. It now loads the payment's checkout
session (new WorkerStore.getCheckoutSession, in-memory + Pg) and routes
by network: Arc via the Arc client against session.payToAddress, Solana
via @settlekit/solana (base58 signature, session paymentReference, no
0x check). Networks the worker cannot verify (base/ethereum, or solana
without SOLANA_CLUSTER) stay pending — fail closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 14:55:35 +03:00
0dc3728389 fix: verify worker payment confirmations against the session payTo per network
The payment-confirm job verified every pending payment on Arc with
to = the USDC contract address instead of the merchant's payTo, so a
transfer to anyone could confirm. It now loads the payment's checkout
session (new WorkerStore.getCheckoutSession, in-memory + Pg) and routes
by network: Arc via the Arc client against session.payToAddress, Solana
via @settlekit/solana (base58 signature, session paymentReference, no
0x check). Networks the worker cannot verify (base/ethereum, or solana
without SOLANA_CLUSTER) stay pending — fail closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 06:37:40 +03:00
ca4567dea6 feat: add @settlekit/solana package
Solana USDC settlement mirroring @settlekit/arc's injectable RPC seam:
- clusters: mainnet/devnet USDC mints, CAIP-2 ids, public RPCs
- rpc: SolanaRpc interface + createKitSolanaRpc over @solana/kit 5.5.1
- verify: verifySplTransfer balance-delta rules (mint+owner, bigint,
  meta.err, reference in account keys, payer detection)
- pay-url: Solana Pay transfer/transaction request encode + parse
- reference / find-reference: Solana Pay reference keys and lookup
- tx-builder: unsigned v0 buyer-pays tx (idempotent ATA create,
  optional memo, TransferChecked with read-only reference)
- settlement-provider: hot-wallet SolanaSettlementProvider with
  reserve/release idempotency; settlement-core gains the "solana"
  provider name and an injected-provider config variant (no dep cycle)
- x402-verifier: PaymentVerifier adapter enforcing session references

API and worker declare the dependency (filtered lockfile update).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 06:15:50 +03:00
d364fc9c19 fix(vercel): pin Node 20 for deploys; clearer Web Crypto error
- Root cause: isomorphic ids.ts uses globalThis.crypto (a global only in Node 20+, per engines.node>=20). A Vercel project building on Node 18 has no global crypto, so any page generating an id at build time throws and the deploy fails.
- Add .node-version=20 to repo root + every app (Vercel reads it from each app's Root Directory) so deploys use Node 20.
- ids.ts: resolve Web Crypto lazily with an actionable error instead of a cryptic undefined access — still browser-safe (no node:crypto import).
- 1304 tests / 213 suites, typecheck + full build green.
2026-06-21 00:45:43 +03:00
7d0589fb2e feat(arc): live viem adapters (erc8004/erc8183/app-kit) + worker Arc settlement wiring
- @settlekit/erc8004-viem: viem adapter implementing Erc8004Port against deployed ERC-8004 registries (real ABIs, keccak256 hash derivation, Transfer-log agentId lookup).
- @settlekit/erc8183-viem: ABI-injectable viem adapter for Erc8183Port.
- @settlekit/app-kit-viem: viem-backed AppKitSdk (USDC ERC-20 transfer for Send + estimate; bridge/swap/unified throw a clear unsupported error).
- apps/worker: env-gated Arc settlement provider (SETTLEMENT_PROVIDER=arc) via app-kit-viem -> configureAppKit -> ArcSettlementProvider, falling back to local when unconfigured (default unchanged).
- apps/examples: Arc-commerce checkout demo (offline via LocalAppKitSdk).
- fixes: viem chain/account typing, app-kit-viem unsupported methods made async.
1233 tests / 208 suites, typecheck + full build green.
2026-06-20 23:42:01 +03:00
pextacy
71e89bdfd8 feat(lepton): attribution package (RFB 6.01) + creator-dashboard
Adds @settlekit/attribution — reuse-detection, weighted provenance lineage,
and HMAC-signed proofs-of-citation — wired live into the rsshub-citation-toll
sidecar (POST /attribution/{detect,proof,verify}) and persisted via
PgLineageStore/PgProofStore over new lepton_lineage_edges + lepton_citation_proofs
tables.

Adds apps/creator-dashboard — a Next.js earnings view in the Statement
greenbar-ledger design system, driven by real domain logic (createSource +
computeRoyaltyDistribution + detectReuse, not mocks). Statement / Sources /
Payouts / Reuse & proofs (interactive) / Wallet. next build green.

Also bundles in-progress settlement hardening: settlement-core idempotency
concurrency, api env validation, bundles + contracts/worker tweaks.

Verified: 943 vitest tests, 27 Foundry tests, next build all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 01:19:22 +03:00
ff11f7754e feat(lepton): nanopayment modules + production settlement spine
Lepton Agents Hackathon (Canteen × Circle × Arc): agent-native nanopayments
on Arc, built on the existing SettleKit platform.

Hackathon modules (demo-ready, RFB-aligned):
- @settlekit/agent: autonomous paying agent (Claude tool-use loop) — RFB 1/3
- @settlekit/citation-toll: per-access content + recursive royalty splits — RFB 6
- @settlekit/streaming: per-second continuous-authorization settlement — RFB 4
- @settlekit/x402-client: x402 pay-and-retry + pluggable settler (local/Circle)
- @settlekit/agent-economy: closed-loop traction harness + CLI
- apps/api /v1/lepton: public live demo surface

Production settlement spine (Phase 1):
- @settlekit/settlement-core: configurable Gateway/Circle/local providers,
  idempotency, batch accumulator, on-chain reconciliation, nonce + receipt stores
- @settlekit/wallet-fleet: registry, spending caps + kill-switch, balances,
  Circle provisioning
- x402-client: provider-settler adapter + Arc-indexer on-chain verifier
- lepton DB schema (12 tables) + persistence Pg stores (settlements, nonces,
  sources, royalty legs, wallets, streams, payees)
- apps/worker jobs: lepton-settlement-reconcile, lepton-payout-sweep,
  lepton-stream-refund (no-op until the settlement spine is wired)

First real-world traction sidecar (Phase 2):
- @settlekit/payee-registry: identity→wallet payout rule (in-memory + Pg)
- services/sidecars/rsshub-citation-toll: ingest RSS items as priced citeable
  sources, x402-gated, settle per-citation royalties via settlement-core
- shared sweepPendingRoyalties used by the worker job and the sidecar
- services/sidecars/* wired as a TS workspace area (pnpm + vitest)

Docs: LEPTON.md, LEPTON_PRODUCTION_PLAN.md. All green: full typecheck + 870 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 14:37:38 +03:00
3853551433 asad 2026-06-17 02:09:36 +03:00
32b89f0515 firstof 2026-06-16 02:51:34 +03:00
bd3c2a85e5 feat: full-product round 3 — commerce engines wired + worker comms
- apps/api: /v1/refunds, /v1/dunning, /v1/disputes, /v1/payouts routes + context
  services + mounts (refunds/dunning/disputes/payouts engines).
- apps/dashboard: refunds/dunning/disputes/payouts pages + nav + api client + types.
- apps/worker: 9 scheduled jobs incl. receipt, renewal-reminder, dunning, and
  access-granted email jobs via @settlekit/notifications (idempotent, injectable transport).

Full build 0 TS errors; dashboard typecheck clean; 591 tests pass.
2026-06-15 17:25:34 +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
598cd03f05 feat: implement all 8 SettleKit apps + fix x402 nonce round-trip
apps:
- api: Hono REST server, all §26 endpoints, 14 tests
- worker: delivery runner + payment-confirm + access-sync + renewal + webhook-retry jobs wired to real package clients
- dashboard: Next.js merchant dashboard, full §16/§27 sections + §28 product builder
- checkout: Next.js hosted USDC checkout with real delivery materialization
- marketplace: Next.js public marketplace + agent metadata.json route
- admin: Next.js risk/ops console wired to @settlekit/risk + database
- docs: Next.js docs site (9 static routes)
- examples: 5 runnable end-to-end examples

fix(x402): support pinned config.nonce so a stateless verifier can confirm
the challenge nonce round-trips (default stays random; package tests intact).

Full workspace: 590 tests passing (122 files), tsc green for all packages +
api/worker/examples, all 5 Next apps typecheck clean, docs next build green.
2026-06-15 10:49:14 +03:00
3fe0c88942 feat: implement all 77 SettleKit packages with real code
Core engine: entitlements (§14), delivery action runner (§21).
Payment rails: arc (viem USDC verify), circle (REST), x402 middleware, payments, webhooks (HMAC), notifications (Resend).
Integrations: github (Octokit App), discord (REST v10).
Commerce: saas billing, bundles, license-keys, api-keys, file-delivery (signed URLs + SigV4), usage/credits, agent-services, escrow, marketplace-core, risk.
Persistence: database (Drizzle/Postgres, 48 tables §25).
Plus supporting domain packages.

561 tests passing across 117 files; tsc -b green for every package.
2026-06-15 03:24:19 +03:00
4afda54455 feat: monorepo scaffold + @settlekit/common contract package
- pnpm workspace, shared tsconfig, vitest
- common: ids, money (USDC base-unit math), Result/SettleKitError, time
- domain types: product, customer, payment, entitlement, delivery, integration
- 13 passing contract tests
2026-06-15 02:55:22 +03:00