Compare commits

..

No commits in common. "5304a36b8758da20c790043c5501626d305bb6c6" and "d848050b5293498b79bd5fe2c2c260f3dfe44da5" have entirely different histories.

1 changed files with 18 additions and 12 deletions

View File

@ -65,7 +65,6 @@ from .venues import (
)
from piker.accounting import (
Asset,
digits_to_dec,
MktPair,
)
from piker.data import (
@ -309,16 +308,18 @@ class Client:
"""
assets = {}
resp = await self.json_rpc(
'public/get_currencies',
params={}
'private/get_account_summaries',
params={
'extended' : True
}
)
currencies = resp.result
for currency in currencies:
name = currency['currency']
tx_tick = digits_to_dec(currency['fee_precision'])
summaries = resp.result['summaries']
for summary in summaries:
currency = summary['currency']
tx_tick = Decimal('1e-08')
atype='crypto_currency'
assets[name] = Asset(
name=name,
assets[currency] = Asset(
name=currency,
atype=atype,
tx_tick=tx_tick)
return assets
@ -451,15 +452,20 @@ class Client:
Fuzzy search symbology set for pairs matching `pattern`.
'''
pairs: dict[str, Pair] = await self.exch_info()
return match_from_pairs(
pairs: dict[str, Pair] = await self.symbol_info()
matches: dict[str, Pair] = match_from_pairs(
pairs=pairs,
query=pattern.upper(),
score_cutoff=35,
limit=limit
)
# repack in name-keyed table
return {
pair.instrument_name.lower(): pair
for pair in matches.values()
}
async def bars(
self,
mkt: MktPair,