Adding balance_available to the wallet (#132)

* Adding balance_available to the wallet
* Refactoring bfx_rest.py/get_wallets to use the updated Wallet class, which has available_balance i it

Co-authored-by: jon <fcmisc@gmail.com>
This commit is contained in:
Jon
2021-04-14 11:53:05 +01:00
committed by GitHub
parent 4b4a17ebd8
commit e1f5254372
5 changed files with 11 additions and 7 deletions

View File

@@ -9,10 +9,11 @@ class Wallet:
currency
"""
def __init__(self, wType, currency, balance, unsettled_interest):
def __init__(self, wType, currency, balance, unsettled_interest, balance_available):
self.type = wType
self.currency = currency
self.balance = balance
self.balance_available = balance_available
self.unsettled_interest = unsettled_interest
self.key = "{}_{}".format(wType, currency)
@@ -29,5 +30,5 @@ class Wallet:
self.unsettled_interest = data
def __str__(self):
return "Wallet <'{}_{}' balance='{}' unsettled='{}'>".format(
self.type, self.currency, self.balance, self.unsettled_interest)
return "Wallet <'{}_{}' balance='{}' balance_available='{}' unsettled='{}'>".format(
self.type, self.currency, self.balance, self.balance_available, self.unsettled_interest)