(self, client: Client, message)
| 794 | return orderbook |
| 795 | |
| 796 | def handle_order_book(self, client: Client, message): |
| 797 | # |
| 798 | # { |
| 799 | # "action":"snapshot", |
| 800 | # "arg":{ |
| 801 | # "instType":"SPOT", |
| 802 | # "channel":"books5", |
| 803 | # "instId":"BTCUSDT" |
| 804 | # }, |
| 805 | # "data":[ |
| 806 | # { |
| 807 | # "asks":[ |
| 808 | # ["21041.11","0.0445"], |
| 809 | # ["21041.16","0.0411"], |
| 810 | # ["21041.21","0.0421"], |
| 811 | # ["21041.26","0.0811"], |
| 812 | # ["21041.65","1.9465"] |
| 813 | # ], |
| 814 | # "bids":[ |
| 815 | # ["21040.76","0.0417"], |
| 816 | # ["21040.71","0.0434"], |
| 817 | # ["21040.66","0.1141"], |
| 818 | # ["21040.61","0.3004"], |
| 819 | # ["21040.60","1.3357"] |
| 820 | # ], |
| 821 | # "checksum": -1367582038, |
| 822 | # "ts":"1656413855484" |
| 823 | # } |
| 824 | # ] |
| 825 | # } |
| 826 | # |
| 827 | # { |
| 828 | # "action": "snapshot", |
| 829 | # "arg": {"instType": "usdt-futures", "topic": "books", "symbol": "BTCUSDT"}, |
| 830 | # "data": [ |
| 831 | # { |
| 832 | # "a": [Array], |
| 833 | # "b": [Array], |
| 834 | # "checksum": 0, |
| 835 | # "pseq": 0, |
| 836 | # "seq": "1343064377779269632", |
| 837 | # "ts": "1755937421270" |
| 838 | # } |
| 839 | # ], |
| 840 | # "ts": 1755937421337 |
| 841 | # } |
| 842 | # |
| 843 | arg = self.safe_value(message, 'arg') |
| 844 | channel = self.safe_string_2(arg, 'channel', 'topic') |
| 845 | instType = self.safe_string_lower(arg, 'instType') |
| 846 | marketType = 'spot' if (instType == 'spot') else 'contract' |
| 847 | marketId = self.safe_string_2(arg, 'instId', 'symbol') |
| 848 | market = self.safe_market(marketId, None, None, marketType) |
| 849 | symbol = market['symbol'] |
| 850 | messageHash = 'orderbook:' + symbol |
| 851 | data = self.safe_value(message, 'data') |
| 852 | rawOrderBook = self.safe_value(data, 0) |
| 853 | timestamp = self.safe_integer(rawOrderBook, 'ts') |
no test coverage detected