How to use the bfx-api-node-models.OrderBook.checksumArr function in bfx-api-node-models

To help you get started, we’ve selected a few bfx-api-node-models examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bitfinexcom / bitfinex-api-node / lib / transports / ws2.js View on Github external
_verifyManagedOBChecksum (symbol, prec, cs) {
    const ob = this._orderBooks[symbol]

    if (!ob) return null

    const localCS = ob instanceof OrderBook
      ? ob.checksum()
      : OrderBook.checksumArr(ob, prec === 'R0')

    return localCS !== cs
      ? new Error(`OB checksum mismatch: got ${localCS}, want ${cs}`)
      : null
  }