Skip to content

fix(billing): address accounts by :account_id; harden /wallets/:address/projects auth#433

Merged
MajorTal merged 1 commit into
mainfrom
claude/angry-lumiere-37f75a
Jun 4, 2026
Merged

fix(billing): address accounts by :account_id; harden /wallets/:address/projects auth#433
MajorTal merged 1 commit into
mainfrom
claude/angry-lumiere-37f75a

Conversation

@MajorTal
Copy link
Copy Markdown
Collaborator

@MajorTal MajorTal commented Jun 4, 2026

Mirrors the gateway api-cleanup-batch-1-accounts contract (Batch 1, piece 3 + exposure hardening) in the public SDK/CLI/MCP. Verified against the gateway implementation + tests on run402-private.

Account reads → :account_id (UUID)

  • GET /billing/v1/accounts/:id (wallet|email-in-path) → canonical :account_id. New GET /billing/v1/accounts?wallet=|?email= lookup resolves a wallet/email → account.
  • SDK getAccount/checkBalance: UUID → by-id read; wallet/email → lookup (returns detail directly). getHistory/history: resolve to account id, then /accounts/:account_id/history.
  • New billing.lookupAccount(identifier) primitive.
  • Response shape: dropped identifier_type, added billing_account_id. BillingBalance → deprecated alias of BillingAccountDetail; BillingHistoryResult keyed by billing_account_id.

Exposure hardening

  • projects.list (GET /wallets/v1/:address/projects) now signs SIWX — endpoint went from public to owner-only (admin bypasses).

Surfaces

  • MCP tool descriptions (check_balance, list_projects, billing_history), CLI billing help, and comprehensive docs (llms-cli.txt, llms-sdk.txt, sdk/README.md, both SKILL.md).
  • Tests: billing/projects URL+auth assertions rewritten, lookupAccount coverage, CLI-e2e lookup mock, sync.test.ts endpoint registry.

Full suite green (1282 unit/sync/skill + 619 e2e, 0 fail; 43 doc snippets compile).

⚠️ Do not deploy the gateway until this is merged + republished, or published clients break.

Closes #432

🤖 Generated with Claude Code

…ss/projects auth

Mirror the gateway api-cleanup-batch-1-accounts contract in SDK/CLI/MCP:

- Account reads are keyed by the canonical billing_account_id (UUID). SDK
  getAccount/checkBalance route a UUID to GET /billing/v1/accounts/:account_id
  and a wallet/email through the new GET /billing/v1/accounts?wallet=|?email=
  lookup; getHistory resolves wallet/email to the account id first, then reads
  /accounts/:account_id/history. Add billing.lookupAccount as the resolve
  primitive. Response shape drops identifier_type and adds billing_account_id
  (BillingBalance kept as a deprecated alias of BillingAccountDetail).
- Exposure hardening: projects.list (GET /wallets/v1/:address/projects) now
  sends SIWX — the endpoint went from public to owner-only (admin bypasses).
- MCP tool descriptions, CLI billing help, and the comprehensive docs
  (llms-cli.txt, llms-sdk.txt, sdk/README.md, SKILL/openclaw SKILL) updated.
- Tests: rewrote billing/projects URL+auth assertions, added lookupAccount
  coverage and a CLI-e2e lookup mock; sync.test endpoint registry updated.

Closes #432

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MajorTal MajorTal merged commit 8a8b547 into main Jun 4, 2026
4 checks passed
@MajorTal MajorTal deleted the claude/angry-lumiere-37f75a branch June 4, 2026 19:58
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.

API cleanup (Batch 1, piece 3 + exposure): mirror billing account read renames + /wallets/projects auth in SDK/CLI/MCP

1 participant