fix(uta): CCXT-custom boolean create bug + demoTrading guard + Binance preset#357
Merged
Conversation
…leans
The CCXT Custom create wizard sent sandbox/demoTrading as the strings
"true"/"false" because the schema-form renderer had no boolean field type —
they fell through to a text input. The backend z.boolean() then rejected
them ("expected boolean, received string"), breaking every CCXT-custom
create (the user-reported Binance bug). Add a 'boolean' field type that
renders the existing themed <Toggle> and converts to a real boolean at the
submit boundary — z.coerce.boolean() can't be used backend-side because
Boolean("false") === true. Booleans seed unconditionally so a required
boolean with no .default() still submits.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e endpoint CCXT's base enableDemoTrading sets urls.api = urls.demo; on an exchange with no demo domain (e.g. okx, whose demo IS the sandbox x-simulated-trading header) urls.api becomes undefined and the next request crashes deep in sign() with a cryptic "Cannot read properties of undefined (reading 'rest')". Detect the broken post-state and throw a clear CONFIG error instead, and wrap setSandboxMode symmetrically. Real-ccxt construct-time regression spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Binance — the world's largest crypto exchange — gets a dedicated preset. Modes: live + Demo Trading (the unified demo-*.binance.com simulator via enableDemoTrading, spot + futures). Legacy Testnet is deliberately omitted: futures testnet is deprecated (CCXT hard-throws) and spot-only testnet would need a market-type-scoped account (tracked in ANG-111's sibling work). Verified end-to-end on a real Binance demo account via the alice-uta CLI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sandbox/demoTradingas the strings"true"/"false"— the schema-form renderer had no boolean field type, so they fell through to a text input and the backendz.boolean()rejected them ("expected boolean, received string"). Boolean preset fields now render as the existing themed<Toggle>and convert to a real boolean at the submit boundary.enableDemoTradinglefturls.apiundefined and the next request crashed deep in ccxt with a crypticCannot read properties of undefined (reading 'rest'). Now it fails fast with a clear CONFIG error;setSandboxModewrapped symmetrically.demo-*.binance.comsimulator). Legacy testnet deliberately omitted (futures testnet deprecated; spot-only needs a scoped-account engine change).Test plan
npx tsc --noEmit(Alice) cleanpnpm -F @traderalice/uta-protocol typecheckcleancd ui && npx tsc -bcleanpnpm test— 1990 pass (newuseSchemaForm,CcxtBroker.guard, Binance preset specs)alice-uta: create → connect → spot buy fill → perp open → spot + perp coexist in portfolio, reads aggregate (no silent slice-drop)Boundary touch
Touches trading / broker config (UTA preset catalog +
CcxtBroker). Demo/paper accounts only in testing. Follow-up tracked in ANG-111:getAccountnetLiquidation only reads the spot wallet and counts perp notional as equity — a pre-existing, venue-general issue surfaced during this dogfood, intentionally NOT fixed here.🤖 Generated with Claude Code