`kraken`: Explicitly report missing `Pair` fields in error
parent
de93da202b
commit
0de2f863bd
|
@ -352,7 +352,13 @@ async def stream_quotes(
|
||||||
# transform to upper since piker style is always lower
|
# transform to upper since piker style is always lower
|
||||||
sym = sym.upper()
|
sym = sym.upper()
|
||||||
sym_info = await client.symbol_info(sym)
|
sym_info = await client.symbol_info(sym)
|
||||||
|
try:
|
||||||
si = Pair(**sym_info) # validation
|
si = Pair(**sym_info) # validation
|
||||||
|
except TypeError:
|
||||||
|
fields_diff = set(sym_info) - set(Pair.__struct_fields__)
|
||||||
|
raise TypeError(
|
||||||
|
f'Missing msg fields {fields_diff}'
|
||||||
|
)
|
||||||
syminfo = si.to_dict()
|
syminfo = si.to_dict()
|
||||||
syminfo['price_tick_size'] = 1 / 10**si.pair_decimals
|
syminfo['price_tick_size'] = 1 / 10**si.pair_decimals
|
||||||
syminfo['lot_tick_size'] = 1 / 10**si.lot_decimals
|
syminfo['lot_tick_size'] = 1 / 10**si.lot_decimals
|
||||||
|
|
Loading…
Reference in New Issue