parent
bedbbc3025
commit
d2f3a79c09
|
@ -485,7 +485,7 @@ async def stream_quotes(
|
||||||
si['asset_type'] = 'crypto'
|
si['asset_type'] = 'crypto'
|
||||||
|
|
||||||
symbol = symbols[0]
|
symbol = symbols[0]
|
||||||
|
breakpoint()
|
||||||
init_msgs = {
|
init_msgs = {
|
||||||
# pass back token, and bool, signalling if we're the writer
|
# pass back token, and bool, signalling if we're the writer
|
||||||
# and that history has been written
|
# and that history has been written
|
||||||
|
|
|
@ -167,7 +167,7 @@ class BrokerConfig(Struct, frozen=True):
|
||||||
|
|
||||||
|
|
||||||
def get_config() -> BrokerConfig | None:
|
def get_config() -> BrokerConfig | None:
|
||||||
conf, path = config.load()
|
conf, _= config.load()
|
||||||
|
|
||||||
section = conf.get('kucoin')
|
section = conf.get('kucoin')
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ class Client:
|
||||||
|
|
||||||
signature = base64.b64encode(
|
signature = base64.b64encode(
|
||||||
hmac.new(
|
hmac.new(
|
||||||
self._key_secret.encode('utf-8'),
|
self._config.key_secret.encode('utf-8'),
|
||||||
str_to_sign.encode('utf-8'),
|
str_to_sign.encode('utf-8'),
|
||||||
hashlib.sha256,
|
hashlib.sha256,
|
||||||
).digest()
|
).digest()
|
||||||
|
@ -216,7 +216,7 @@ class Client:
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'KC-API-SIGN': signature,
|
'KC-API-SIGN': signature,
|
||||||
'KC-API-TIMESTAMP': str(now),
|
'KC-API-TIMESTAMP': str(pendulum.now().int_timestamp * 1000),
|
||||||
'KC-API-KEY': self._key_id,
|
'KC-API-KEY': self._key_id,
|
||||||
'KC-API-PASSPHRASE': passphrase,
|
'KC-API-PASSPHRASE': passphrase,
|
||||||
# XXX: Even if using the v1 api - this stays the same
|
# XXX: Even if using the v1 api - this stays the same
|
||||||
|
@ -422,7 +422,7 @@ async def stream_quotes(
|
||||||
send_chan: trio.abc.SendChannel,
|
send_chan: trio.abc.SendChannel,
|
||||||
symbols: list[str],
|
symbols: list[str],
|
||||||
feed_is_live: trio.Event,
|
feed_is_live: trio.Event,
|
||||||
loglevel: str = None,
|
loglevel: str = '',
|
||||||
# startup sync
|
# startup sync
|
||||||
task_status: TaskStatus[tuple[dict, dict]] = trio.TASK_STATUS_IGNORED,
|
task_status: TaskStatus[tuple[dict, dict]] = trio.TASK_STATUS_IGNORED,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -523,7 +523,7 @@ async def stream_quotes(
|
||||||
await send_chan.send({sym: msg})
|
await send_chan.send({sym: msg})
|
||||||
|
|
||||||
|
|
||||||
def make_sub(sym, connect_id, level='l1') -> dict[str, str | bool]:
|
def make_sub(sym, connect_id, level='l1') -> dict[str, str | bool] | None:
|
||||||
match level:
|
match level:
|
||||||
case 'l1':
|
case 'l1':
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue