fix(typescript): replace any with proper types for Exchange router methods - #1419
fix(typescript): replace any with proper types for Exchange router methods#1419AbhilashG12 wants to merge 9 commits into
Conversation
PR Review: FAILWhat This DoesThis PR is intended to tighten TypeScript SDK typings for router/matching methods. In the final head commit, however, the regenerated Blast RadiusTypeScript SDK only ( Consumer VerificationBefore (base branch): After (PR branch): Test Results
Findings
PMXT Pipeline Check
Semver Impactpatch if fixed -- intended SDK type-only bug fix, but current head contains a breaking hosted SDK regression. RiskI could not run the full TypeScript build because generated SDK artifacts are absent in the review checkout, but the blocking issues above are visible in the checked-in source and do not depend on build output. |
PR Review: FAILWhat This DoesThis PR is intended to replace Blast RadiusTypeScript SDK client method declarations in Consumer VerificationBefore (base branch): async fetchMarketMatches(params?: any): Promise<any[]>
async compareMarketPrices(params: any): Promise<any[]>This is the issue the PR title/body says it fixes. After (PR branch): // sdks/typescript/pmxt/client.ts:1552
async fetchMarketMatches(params?: any): Promise<any[]>
// sdks/typescript/pmxt/client.ts:1602
async fetchEventMatches(params?: any): Promise<any[]>
// sdks/typescript/pmxt/client.ts:1627
async compareMarketPrices(params: any): Promise<any[]>
// sdks/typescript/pmxt/client.ts:1677
async fetchMatchedMarkets(params?: any): Promise<any[]>So a TypeScript SDK consumer still receives no typed params/results for these Exchange methods. Test Results
Findings
PMXT Pipeline Check
Semver Impactpatch -- intended type-only SDK fix, but the current head does not deliver the advertised type improvement. RiskBecause |
PR Updated ✅The rebase is complete and all conflicts are resolved. Changes:
Ready for review! 🙏 |
PR Review: FAILWhat This DoesReplaces several Blast RadiusTypeScript SDK hand-written/generated client surface and generator: Consumer VerificationBefore (base branch): After (PR branch): Test Results
Findings
PMXT Pipeline Check
Semver Impactpatch if limited to type tightening, but the current diff contains breaking hosted SDK behavior. RiskHigh for hosted TypeScript SDK consumers: trading/account methods can silently use the wrong transport or return empty lists. |
…enerate SDKs - Add FetchMarketMatchesParams, FetchEventMatchesParams - Add CompareMarketPricesParams, FetchMatchedPricesParams, FetchArbitrageParams - Update BaseExchange.ts with proper types - Update generator to recognize new types - Regenerate client.ts with proper types Fixes pmxt-dev#1403
2b86396 to
3a86f80
Compare
PR Review: FAILWhat This DoesAttempts to replace Blast Radius
Consumer VerificationBefore (base branch): After (PR branch): npm install
npm run build --workspace=pmxtjsRelevant output: I also inspected the generated Python exchange wrapper signatures with AST. Test Results
Findings
PMXT Pipeline Check
Semver Impactmajor if shipped as-is -- removes/changes Python constructor parameters and breaks TypeScript package builds. RiskThe intended TypeScript type improvements are not consumable until the import/generator issue is fixed and the unrelated Python wrapper regressions are reverted or deliberately handled as a breaking change. |
…hon wallet_address/signer - Add GENERATED_IMPORTS to inject router types - Restore wallet_address and signer in Python generator - Regenerate client.ts, _exchanges.py, and docs Fixes pmxt-dev#1403
|
FIxed the imports |
…1129, #1670) Implements the intended net changes of two broken PRs onto current main: - #1129: Router.sql(query) POSTs { query } to ${baseUrl}/v0/sql with the SDK's normal auth headers and returns a typed result. Adds SqlResult / SqlMeta / SqlColumn types to both SDKs, exported from each package root. - #1670: Router.fetchOrderBook(outcomeId) — a cross-venue order book that routes through the /api/router/fetchOrderBook surface and returns a single merged book. In Python it is a proper Router method (4-space indent). Adds focused unit tests (HTTP layer mocked) plus an AST check that Router still exposes all pre-existing methods. #1419 (any->types) skipped: the remaining any usages are raw wire JSON with no safe importable type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Second wave of reworked community PRs: Router.sql (#1129), cross-venue Router.fetchOrderBook (#1670), WebSocket config (#1126), baozi error codes (#1118), limitless pagination (#1119), nullable model fields (#1578). Excludes #1614 (security) and #1419 (superseded). Triggers auto-tag v2.53.0f and package publish. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Superseded / not merging: the branch didn't compile (an |
…1419) Land the safe, buildable core of #1419: introduce a precise CompareMarketPricesParams type and use it for the base compareMarketPrices signature instead of the loose FetchMatchesParams. The base method is a stub; concrete behavior in Router.ts is unchanged. Dropped the PR's broken SDK-generator import and the private_key=wallet_address bug. Co-Authored-By: AbhilashG12 <abhilashggg15@gmail.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Landed on |
Type compareMarketPrices with CompareMarketPricesParams (#1419). Triggers auto-tag v2.53.1f and package publish. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What this PR does
Adds proper TypeScript types to Exchange router methods.
The Problem
Five Exchange methods used
params?: anyinstead of typed params:fetchMarketMatchesfetchEventMatchescompareMarketPricesfetchMatchedPricesfetchArbitrageThe Fix
router.tsWhy it matters
TypeScript users now get proper type checking when calling these methods.
Fixes #1403