wallet sync added
This commit is contained in:
parent
606e41d574
commit
7cb8b28f58
@ -19,6 +19,7 @@ class Wallets(object):
|
|||||||
def __init__(self, exchange: Exchange) -> None:
|
def __init__(self, exchange: Exchange) -> None:
|
||||||
self.exchange = exchange
|
self.exchange = exchange
|
||||||
self.wallets: Dict[str, self.wallet] = {}
|
self.wallets: Dict[str, self.wallet] = {}
|
||||||
|
self._update_wallets()
|
||||||
|
|
||||||
def _update_wallets(self) -> None:
|
def _update_wallets(self) -> None:
|
||||||
balances = self.exchange.get_balances()
|
balances = self.exchange.get_balances()
|
||||||
@ -27,10 +28,11 @@ class Wallets(object):
|
|||||||
info = {
|
info = {
|
||||||
'exchange': self.exchange.id,
|
'exchange': self.exchange.id,
|
||||||
'currency': currency,
|
'currency': currency,
|
||||||
'free': balances[currency['free']],
|
'free': balances[currency]['free'],
|
||||||
'used': balances[currency['used']],
|
'used': balances[currency]['used'],
|
||||||
'total': balances[currency['total']]
|
'total': balances[currency]['total']
|
||||||
}
|
}
|
||||||
|
|
||||||
self.wallets[currency] = self.wallet(**info)
|
self.wallets[currency] = self.wallet(**info)
|
||||||
|
|
||||||
logger.info('Wallets synced ...')
|
logger.info('Wallets synced ...')
|
||||||
|
Loading…
Reference in New Issue
Block a user