bennycode / coinbase-pro-node

Coinbase API written in TypeScript and covered by tests.
https://bennycode.com/coinbase-pro-node
MIT License
254 stars 62 forks source link

granularity for websockets #772

Closed kenchambers closed 2 years ago

kenchambers commented 2 years ago

Hello!

I need stats for 1 hour to generate a dynamic candle, is there any way to adjust for granularity with the websocket connection"?

bennycode commented 2 years ago

Hi @kenchambers, you can define the granularity of the candles that you are watching:

https://github.com/bennycode/coinbase-pro-node/blob/v6.0.0/src/product/ProductAPI.ts#L256

There is the availability to choose CandleGranularity.ONE_HOUR.