Skip to content

feat: CCXT dynamic credentials + snapshot management + wizard refactor#117

Merged
luokerenx4 merged 3 commits intomasterfrom
dev
Apr 10, 2026
Merged

feat: CCXT dynamic credentials + snapshot management + wizard refactor#117
luokerenx4 merged 3 commits intomasterfrom
dev

Conversation

@luokerenx4
Copy link
Copy Markdown
Contributor

Summary

Big quality-of-life batch covering broker configuration, snapshot management, and account creation UX.

CCXT dynamic credentials (Hyperliquid support)

  • Reads each exchange's requiredCredentials map at runtime instead of hardcoding apiKey + secret + password
  • Supports all 10 CCXT standard credential fields including walletAddress + privateKey (Hyperliquid, dYdX), password (OKX passphrase), uid, twofa, etc.
  • New endpoints: GET /ccxt/exchanges and GET /ccxt/exchanges/:name/credentials
  • Frontend dynamically loads exchange list and credential fields based on selection
  • Backwards-compatible with legacy `apiSecret` field name

Snapshot management

  • New `SnapshotStore.deleteByTimestamp()` with chunk-aware delete + index rewrite
  • `DELETE /accounts/:id/snapshots/:timestamp` API endpoint
  • New Snapshots tab in Dev page: browse per-account, expand to view positions detail, delete with confirm
  • Helps debugging when snapshot data gets polluted

New Account wizard refactor

  • Two-step wizard collapsed to single-page form, consistent with EditDialog and other config dialogs
  • Each broker now has a multi-paragraph `setupGuide` explaining what it is, how to get credentials, and prerequisites (CCXT, Alpaca, IBKR all written)
  • Fixes Hyperliquid wallet credentials being awkwardly split across pages

CLAUDE.md

  • Added pre-commit verification rule: always run `tsc --noEmit` (tsup is lenient on type errors)
  • Added pre-PR rule: always `git fetch origin master` first to avoid stale-ref PRs

Bumps to `0.9.0-beta.11`.

Test plan

  • `npx tsc --noEmit` zero errors
  • `pnpm test` — 974 tests pass (50 files)
  • `pnpm test:e2e` — IBKR currency tracking tests confirm HKD positions work
  • Manual: New Account → CCXT → Hyperliquid → Wallet Address + Private Key on same page
  • Manual: Dev page Snapshots tab can list/expand/delete snapshots

🤖 Generated with Claude Code

Ame and others added 3 commits April 9, 2026 18:23
Controlled <select> with no matching value caused React state to stay empty
while browser visually displayed the first option — user thinks it's selected
but onChange never fires, leading to Zod validation failure on submit.

Closes #92

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- SnapshotStore.deleteByTimestamp(): chunk-aware delete with index update
- SnapshotService.deleteSnapshot() + DELETE API endpoint
- Dev page Snapshots tab: browse per-account, expand details, delete with confirm
- CLAUDE.md: add tsc --noEmit pre-commit rule, git fetch before PR rule

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes inability to configure wallet-based exchanges like Hyperliquid:
CcxtBroker previously hardcoded apiKey + secret + password fields, but
each CCXT exchange declares its own requiredCredentials map (10 standard
fields including walletAddress, privateKey, uid, twofa, etc.).

Backend
- CcxtBroker.configSchema accepts all 10 CCXT credential fields, with
  legacy `apiSecret` aliased to `secret` for back-compat
- Constructor passes all set fields through to ccxt[exchange]() generically
- init() validates via the exchange's own checkRequiredCredentials() and
  reports which fields are missing
- New endpoints: GET /ccxt/exchanges (list all CCXT-supported exchanges)
  and GET /ccxt/exchanges/:name/credentials (read requiredCredentials)
- BrokerRegistryEntry gets a setupGuide field; ccxt/alpaca/ibkr each
  have a multi-paragraph guide explaining what they are, how to get
  credentials, and prerequisites

Frontend
- TradingPage CreateWizard refactored from two-step to single-page form
  (consistent with EditDialog and other config dialogs); deleted
  StepIndicator and the sensitive/non-sensitive field split that put
  Hyperliquid's walletAddress and privateKey on different pages
- Selecting a platform shows the broker's setupGuide as a description
  block before the configuration fields
- For CCXT: exchange dropdown is populated dynamically from
  /ccxt/exchanges, and credential fields are loaded based on the
  selected exchange via /ccxt/exchanges/:name/credentials
- EditDialog also wired with dynamic CCXT credential fetching
- Bump version to 0.9.0-beta.11

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@luokerenx4 luokerenx4 merged commit da4d5f2 into master Apr 10, 2026
2 checks passed
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