-
released this
2021-09-16 10:26:09 -07:00 | 9 commits to main since this releaseAdded a few (deprecated) legacy settings and
.call()
to ease the upgrade process.- As before,
.call()
configurably parses responses (dates and numbers by default), but does not use a rate limiter, queueing, or retries. - Function signature maintained from 0.4.1.
Updated 0.4.1 migration guide:
Added
- Complete WS 1.8.3 functionality
- Typings
- New REST methods
Deprecated
- Custom response parsing (
Settings.parse
,Settings.dataFormatter
)- To ensure type consistency, it is best to leave parsing to the user.
- Used only for the deprecated
.call()
function.
- Method name settings (
Settings.pubMethods
,Settings.privMethods
)- Previously, settings were used to differentiate between public and private methods rather than requiring the user to specify for each call.
- Instead, named requests are provided to hard-code these differences.
- Used only for the deprecated
.call()
function.
.call()
- Replaced by
.request()
and the named REST methods.
- Replaced by
Removed
- Ratelimiting (
Settings.limiter
andSettings.tier
)- The aim of this API is to maximize clear and accurate communication with the server; ratelimiting makes assumptions about the client setup and should be left to the user.
- REST retries (
Settings.retryCt
)- This was originally included due to the occasional nonce and timeout error.
- To reduce this possibility, increase your API key nonce window and the
.timeout
setting.
- To reduce this possibility, increase your API key nonce window and the
- This was originally included due to the occasional nonce and timeout error.
- REST syncing (
Settings.syncIntervals
)- With the introduction of the WebSocket connection, REST syncing is no longer required for many data sources.
- For all other sources, simply use an asynchronous loop.
- With the introduction of the WebSocket connection, REST syncing is no longer required for many data sources.
- Server Settings (
Settings.hostname
,Settings.version
)- These values should be constants.
- OTP value setting (
Settings.otp
and.setOTP()
)- Replaced by
Settings.genotp
- Replaced by
- Direct construction using
module.exports()
- Changed to class export for modern standards.
Changed
- Errors have changed to named classes. Please review the synopsis.
Upgrade Guide
- Replace all calls to
.call()
with the corresponding named method or.request()
.- Make sure to view the expected response types; they have changed since 0.4.1.
- Replace all sync instances with an async loop that requests every few seconds.
- If you are syncing one of the endpoints provided by WS, use that instead.
- Ensure that your REST calls are not being made too quickly.
- Ratelimiting has been removed; you may encounter server errors if you were relying on the limiter.
- See the rate limits documentation.
- Increase your api key nonce window if you're getting invalid nonce errors.
- Calls may now be performed concurrently (global queueing is removed).
- Remove calls to
.setOTP()
andSettings.otp
; provide.genotp
in the settings. - Review the error classes; if you were parsing errors you will need to update your catch statements.
- Note: calls are no longer automatically retried
retryCt
times.
- Note: calls are no longer automatically retried
- If you're constructing using module.exports (e.g.
const kraken = require('node-kraken-api')({...})
), you will need to use themodule.exports.Kraken
class instead:import { Kraken } from "node-kraken-api"; const kraken = new Kraken({...});
Downloads
- As before,