v3.1.0: Introduce custom JSON parser hook
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
- [Snyk] Security upgrade axios from 1.10.0 to 1.12.0 by @tiagosiebler in #585
- feat(ws): add parseWsMessageFn to configure JSON parsing by @merovinh in #588
- feat(v3.1.0, #588): introduce custom JSON parser hook & small refinements by @tiagosiebler in #589
- feat(v3.1.0, #588): introduce custom JSON parser hook & small refinements by @tiagosiebler in #590
New Contributors
Full Changelog: v3.0.9...v3.1.0