caelum0x 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
..