14 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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