question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CCXT.pro Issue with Coinbasepro watchOrderBook with limit

See original GitHub issue
  • OS: Windows
  • Programming Language version: node.js V14.16
  • CCXT version: CCXT.pro 1.0.21

Watching coinbasepro orderbook with a limit defined causes an error handling updates from coinbase. This was not an issue in ccxt.pro version 1.0.15.

const ccxtpro = require('ccxt.pro');
console.log(ccxtpro.version);

(async () => {
    const exchange = new ccxtpro.coinbasepro()
    const orderbook = await exchange.watchOrderBook('BTC/USD', 25)
    console.log(new Date(), orderbook['asks'][0], orderbook['bids'][0])
}
)()
Exception has occurred: TypeError: Cannot set property '1' of undefined
  at Bids.storeArray ([c:\Users\sb\Documents\code\scratchPad\node_modules\ccxt.pro\js\base\OrderBookSide.js:59:32]())
    at Bids.store ([c:\Users\sb\Documents\code\scratchPad\node_modules\ccxt.pro\js\base\OrderBookSide.js:85:14]())
    at coinbasepro.handleOrderBook ([c:\Users\sb\Documents\code\scratchPad\node_modules\ccxt.pro\js\coinbasepro.js:650:26]())
    at coinbasepro.handleMessage ([c:\Users\sb\Documents\code\scratchPad\node_modules\ccxt.pro\js\coinbasepro.js:698:27]())
    at WsClient.onMessage ([c:\Users\sb\Documents\code\scratchPad\node_modules\ccxt.pro\js\base\Client.js:277:14]())
    at WebSocket.onMessage ([c:\Users\sb\Documents\code\scratchPad\node_modules\ws\lib\event-target.js:132:16]())
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage ([c:\Users\sb\Documents\code\scratchPad\node_modules\ws\lib\websocket.js:1047:20]())
    at Receiver.emit (events.js:315:20)
    at Receiver.dataMessage ([c:\Users\sb\Documents\code\scratchPad\node_modules\ws\lib\receiver.js:517:14]())

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
lostless13commented, Mar 9, 2022

@kroitor in my quick test, everything looks good. If any issues arise I’ll circle back.

1reaction
frosty00commented, Mar 8, 2022

can confirm this issue arises when using the limit argument to watchOrderBook

Read more comments on GitHub >

github_iconTop Results From Across the Web

ccxt-dev/ccxt - Gitter
Coinbase Pro sent out an email saying all clients need to be using Server Name Indication, in their TLS negotiation, or else they'll...
Read more >
CCXT — ccxt 2.4.60 documentation
A JavaScript / Python / PHP library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs.
Read more >
scxt - PyPI
FIX protocol transports planned. Exchanges. The CCXT Pro library currently supports the following 36 cryptocurrency exchange markets and ...
Read more >
scxt - Python Package Health Analysis - Snyk
FIX protocol transports planned. Exchanges. The CCXT Pro library currently supports the following 36 cryptocurrency exchange markets and WebSocket trading APIs: ...
Read more >
Live Demo – WebSocket Order Books - CCXT Pro
Demo. Live BTC/USD WebSocket Order Books. Bitfinex · Coinbase Pro · Poloniex. © 2019-2022 CCXT Pro. About. License · CCXT · FAQ. Product....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found