Skip to content

feat(marketplace): wire production billing with hybrid on-chain $AI settlement#38

Merged
zooqueen merged 1 commit intomainfrom
feat/marketplace-billing-production
Feb 27, 2026
Merged

feat(marketplace): wire production billing with hybrid on-chain $AI settlement#38
zooqueen merged 1 commit intomainfrom
feat/marketplace-billing-production

Conversation

@zooqueen
Copy link

Summary

  • Fix critical billing bugs: send actual marketplace price in usage reports, deposit seller earnings via Commerce /billing/deposit, fix broken seller userId resolution
  • Add hybrid on-chain $AI token settlement: ERC-20 transfer on Hanzo chain (36963) for seller payouts, Commerce API ledger for audit trail
  • Add MarketplaceChainConfig (RPC URL, token contract, treasury address) for on-chain settlement
  • Wire marketplace.process-payouts (trigger payout batch) and marketplace.transactions (audit log) WS methods
  • Support HANZO_API_KEY env var alongside ANTHROPIC_API_KEY for seller nodes

Test plan

  • tsc --noEmit passes (verified locally)
  • All 6903 tests pass (verified locally)
  • CI passes on PR
  • Buyer charged actual marketplace price (60% of list) not $0
  • Seller receives Commerce deposit after marketplace request completes
  • Transaction log persists and is queryable via marketplace.transactions
  • marketplace.process-payouts aggregates earnings and triggers payouts
  • $AI token payout sends ERC-20 transfer when chain config is set
  • USD payout calls Commerce Stripe Connect affiliate endpoint

🤖 Generated with Claude Code

…ettlement

Fix critical billing gaps for real money flow:
- Send actual marketplace price (not 0) in buyer usage reports
- Deposit seller earnings into Commerce wallet via /billing/deposit
- Fix broken seller userId resolution (was always nodeId in both branches)
- Persist marketplace transactions in audit log for payout aggregation
- Add on-chain ERC-20 $AI token transfer for seller payouts on Hanzo chain
- Add MarketplaceChainConfig for RPC/contract/treasury configuration
- Wire marketplace.process-payouts and marketplace.transactions WS methods
- Support HANZO_API_KEY env var alongside ANTHROPIC_API_KEY for seller nodes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zooqueen zooqueen merged commit 57207ef into main Feb 27, 2026
5 of 7 checks passed
zooqueen added a commit that referenced this pull request Mar 6, 2026
…ettlement (#38)

Fix critical billing gaps for real money flow:
- Send actual marketplace price (not 0) in buyer usage reports
- Deposit seller earnings into Commerce wallet via /billing/deposit
- Fix broken seller userId resolution (was always nodeId in both branches)
- Persist marketplace transactions in audit log for payout aggregation
- Add on-chain ERC-20 $AI token transfer for seller payouts on Hanzo chain
- Add MarketplaceChainConfig for RPC/contract/treasury configuration
- Wire marketplace.process-payouts and marketplace.transactions WS methods
- Support HANZO_API_KEY env var alongside ANTHROPIC_API_KEY for seller nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant