Skip to content

v3.1.0: Introduce custom JSON parser hook

Choose a tag to compare

@tiagosiebler tiagosiebler released this 29 Sep 15:38
7ef27c6

Summary

In niche cases, WS events from Binance include orderIds with very large numbers. These cannot be safely represented as integers (larger than Number.MAX_SAFE_INTEGER. In most cases this might not affect you, but for those that do depend on these properties (see #208), this provides an alternative.

A custom parser can now be injected via the customParseJSONFn parameter. This allows alternatives such as using RegEx to wrap orderId fields in a string or using a 3rd party big-number safe JSON.parsing library, to parse incoming WebSocket events. For detailed examples, refer to ws-custom-parser.ts in the examples folder.

No breaking changes are expected, as the custom parser method is only used if provided via the customParseJSONFn method.

What's Changed

New Contributors

Full Changelog: v3.0.9...v3.1.0