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