commit
4d8b22dd8f
|
@ -460,11 +460,19 @@ async def stream_quotes(
|
||||||
syminfo = Pair(**d) # validation
|
syminfo = Pair(**d) # validation
|
||||||
|
|
||||||
si = sym_infos[sym] = syminfo.to_dict()
|
si = sym_infos[sym] = syminfo.to_dict()
|
||||||
|
filters = {}
|
||||||
|
for entry in syminfo.filters:
|
||||||
|
ftype = entry.pop('filterType')
|
||||||
|
filters[ftype] = entry
|
||||||
|
|
||||||
# XXX: after manually inspecting the response format we
|
# XXX: after manually inspecting the response format we
|
||||||
# just directly pick out the info we need
|
# just directly pick out the info we need
|
||||||
si['price_tick_size'] = float(syminfo.filters[0]['tickSize'])
|
si['price_tick_size'] = float(
|
||||||
si['lot_tick_size'] = float(syminfo.filters[2]['stepSize'])
|
filters['PRICE_FILTER']['tickSize']
|
||||||
|
)
|
||||||
|
si['lot_tick_size'] = float(
|
||||||
|
filters['LOT_SIZE']['stepSize']
|
||||||
|
)
|
||||||
si['asset_type'] = 'crypto'
|
si['asset_type'] = 'crypto'
|
||||||
|
|
||||||
symbol = symbols[0]
|
symbol = symbols[0]
|
||||||
|
|
|
@ -26,6 +26,7 @@ import json
|
||||||
|
|
||||||
import trio
|
import trio
|
||||||
import trio_websocket
|
import trio_websocket
|
||||||
|
from wsproto.utilities import LocalProtocolError
|
||||||
from trio_websocket._impl import (
|
from trio_websocket._impl import (
|
||||||
ConnectionClosed,
|
ConnectionClosed,
|
||||||
DisconnectionTimeout,
|
DisconnectionTimeout,
|
||||||
|
@ -51,6 +52,7 @@ class NoBsWs:
|
||||||
ConnectionRejected,
|
ConnectionRejected,
|
||||||
HandshakeError,
|
HandshakeError,
|
||||||
ConnectionTimeout,
|
ConnectionTimeout,
|
||||||
|
LocalProtocolError,
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
Loading…
Reference in New Issue