Skip to content

fix(ts-sdk): make history params optional#1617

Open
realfishsam wants to merge 1 commit into
mainfrom
fix/issue-1556-optional-history-params
Open

fix(ts-sdk): make history params optional#1617
realfishsam wants to merge 1 commit into
mainfrom
fix/issue-1556-optional-history-params

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

Make the TypeScript SDK's fetchOHLCV and fetchTrades history-filter argument optional, matching the Python SDK and preventing one-argument calls from dereferencing undefined.

fetchOHLCV now also omits an unset resolution from the sidecar query instead of serializing an undefined field.

Fixes #1556

Test plan

  • RED: npm test --workspace=pmxtjs -- --runTestsByPath tests/history-optional-params.test.ts --runInBand failed with TS2554 because both methods required a second argument.
  • GREEN: the same target passed (2 tests).
  • npm test --workspace=pmxtjs -- --runInBand (17 suites, 86 tests passed).
  • node sdks/typescript/scripts/generate-client-methods.js
  • git diff --check

The checkout does not contain committed generated TypeScript client artifacts, so local Jest used a temporary untracked sdks/typescript/generated/src/index.ts import stub. The stub was removed before staging and is not part of this PR.

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.

SDK drift: fetchOHLCV/fetchTrades crash when called without a params argument in TypeScript; Python's equivalents are fully optional

1 participant