Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Introduction #45

Merged
merged 7 commits into from
Dec 26, 2020
Merged

TypeScript Introduction #45

merged 7 commits into from
Dec 26, 2020

Conversation

tiagosiebler
Copy link
Owner

@tiagosiebler tiagosiebler commented Dec 13, 2020

First iteration typescript introduction to the module. Methods are sorted in the same order as those in the Bybit API docs.

Checklist:

  • Tested functionality in testnet.
  • Tested functionality in livenet.
  • Documented any changes to existing methods.
  • Documented any method deprecations.
  • Updated package.json version release.

Beta testing

If you've beta tested this, please comment with both good & bad news:

npm install --save bybit-api@beta

I highly recommend first using testnet for beta testing. Once your implementation works well on testnet, please do try livenet.

Changelog

Summary

  • Introduce typescript declarations. API methods are typed including optional parameters. Resolves Introduce typescript types #18.
  • Introduce webpack, although not published to npm yet. TODO: log issue to trim bundle size.
  • Deprecate assert() calls. This caused a nuisance when API parameter requirements changed.
  • Fix browser websocket support. Resolves Native WebSocket should be used in browser environments #33.
  • Organise API methods per API documentation, including the categories also used in official documentation.
  • Mark deprecated API methods.

Breaking Changes

These changes were enforced by bybit:

  • getActiveOrder() uses deprecated endpoint. Use getActiveOrderList() instead.
    • Requires symbol param. Otherwise it's the same.
  • getPositions() uses deprecated endpoint. Use getPosition() instead.

Deprecations

These are a consequence of module improvements:

  • getPublicTradingRecords() deprecated. Use getTrades() instead.
    • Same params & response.
  • getPublicLiquidations() deprecated. Use getLiquidations() instead.
    • Same params & response.
  • getLatestInformation() deprecated. Use getTickers() instead.
    • Same params & response.
  • changeUserLeverage() deprecated. Use setUserLeverage() instead.
    • Same params & response.

@tiagosiebler tiagosiebler changed the title Typescript introduction TypeScript Introduction Dec 13, 2020
@tiagosiebler tiagosiebler merged commit fa4a7fe into master Dec 26, 2020
@tiagosiebler tiagosiebler deleted the feat/ts branch December 26, 2020 17:53
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.

Native WebSocket should be used in browser environments Introduce typescript types
1 participant