tiagosiebler / bybit-api

Node.js SDK for the Bybit APIs and WebSockets, with TypeScript & browser support.
https://www.npmjs.com/package/bybit-api
MIT License
244 stars 80 forks source link

"crypto" module seems depreciated #157

Closed Amais26 closed 2 years ago

Amais26 commented 2 years ago

Got error when compiling

image

It seems to be bound to file node-support.js line 13

image

https://www.npmjs.com/package/crypto

How do you handle this error ?

tiagosiebler commented 2 years ago

Which nodejs version are you using? It's a built-in module included with node, that's why it's not listed in the package dependencies.

In case you're trying to use this in a frontend environment (and you're aware of the CORS errors you're likely to see from bybit's APIs), there's a webpack config that swaps node-support with browser-support, for the browser-equivalent of the crypto module: https://github.com/tiagosiebler/bybit-api/blob/master/webpack/webpack.config.js#L18-L25