Releases: tiagosiebler/bybit-api
Fix error handler for failed API requests
Small fix to the error handler when API requests fail.
TypeScript, browser support, loose types
See #45 for details. This was a major transition from a pureJS library into one that is loosely typed, at least as a first iteration.
npm install bybit-api@1.3.1
Copied from the pull request:
Changelog
Summary
- Introduce typescript declarations. API methods are typed including optional parameters. Resolves #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 #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.
Replace deprecated HTTP request library with modern standard. Proxy support.
The primary goal was to transition to axios, since the npm module request is both deprecated and carries a ton of dependency baggage. This version does not change any high level functionality, ensuring no integration changes are required to upgrade to this release.
Difference in dependency baggage
As well as a smaller memory footprint, an additional bonus of this adoption of axios is support for proxied requests as well as other customizations to how HTTP requests are made by the library. See the axios request config for a detailed list of options.
Action Required to Upgrade
None
Summary
- replace the deprecated npm request module with the much lighter axios module. Resolves #4.
- huge reduction in module footprint (see step to 1.2.0): https://bundlephobia.com/result?p=bybit-api@1.2.0
- expose request options in constructor, allowing proxy support (among other settings)
- bump websocket connectivity dependency to latest version.
- validated #12 is not an issue.
- misc refactoring & cleaning.
