| 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') |