MCPcopy Create free account
hub / github.com/ccxt/ccxt / reset

Method reset

python/ccxt/async_support/base/ws/order_book.py:35–47  ·  view source on GitHub ↗
(self, snapshot={})

Source from the content-addressed store, hash-verified

33 return self
34
35 def reset(self, snapshot={}):
36 self['asks']._index.clear()
37 self['asks'].clear()
38 for ask in snapshot.get('asks', []):
39 self['asks'].storeArray(ask)
40 self['bids']._index.clear()
41 self['bids'].clear()
42 for bid in snapshot.get('bids', []):
43 self['bids'].storeArray(bid)
44 self['nonce'] = snapshot.get('nonce')
45 self['timestamp'] = snapshot.get('timestamp')
46 self['datetime'] = Exchange.iso8601(self['timestamp'])
47 self['symbol'] = snapshot.get('symbol')
48
49 def update(self, snapshot):
50 nonce = snapshot.get('nonce')

Callers 15

updateMethod · 0.95
test_ws_order_bookFunction · 0.95
load_order_bookMethod · 0.45
pongMethod · 0.45
handle_order_bookMethod · 0.45
handle_order_bookMethod · 0.45
handle_order_bookMethod · 0.45
handle_order_bookMethod · 0.45
handle_ws_errorMethod · 0.45

Calls 4

storeArrayMethod · 0.65
clearMethod · 0.45
getMethod · 0.45
iso8601Method · 0.45

Tested by 1

test_ws_order_bookFunction · 0.76