fix(ts-sdk): validate hosted limit order price#1291
Conversation
|
CI note: the scoped TypeScript hosted price-validation change is covered by the targeted regression test, but generated-sync checks are currently red from unrelated repo-wide drift on Local checks run:
Blocked checks observed on GitHub:
|
PR Review: PASS (NOT VERIFIED)What This DoesAdds client-side validation in the TypeScript hosted order build path so limit orders must include a positive Blast RadiusTypeScript SDK hosted trading helper Consumer VerificationBefore (base branch): await api.buildOrder({ outcomeId, side: "buy", type: "limit", amount: 5 } as any)
// base: local body construction did not reject before fetchAfter (PR branch): if (orderType !== "market" && !(Number(params.price) > 0)) {
throw new InvalidOrder("limit orders require a positive price");
}The added test asserts Test Results
FindingsNo blocking findings. PMXT Pipeline Check
Semver Impactpatch -- client-side validation fix for an invalid limit-order path. RiskThis intentionally rejects |
Summary
buildOrdervalidation for limit-orderpricepresence and positivity.Fixes #1287
Test Plan
npm test -- --runTestsByPath tests/hosted-dispatch.test.ts -t "positive price" --runInBand(pass; used local untrackedgenerated/srcstubs because this checkout cannot regenerate TypeScript OpenAPI output:javais unavailable)npm test -- --runTestsByPath tests/hosted-dispatch.test.ts --runInBand(blocked by pre-existing/local generated-stub limitations outside this change:fetchBalanceempty stub response andNotSupportedinstanceof mismatch)npm run generate:sdk:typescript --workspace=pmxt-core(blocked locally:java: not found)git diff --check