Files
bitfinex-api-py/bfxapi/models/wallet.py
Jon e1f5254372 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>
2021-04-14 12:53:05 +02:00

35 lines
1006 B
Python

"""
Module used to describe all of the different data types
"""
class Wallet:
"""
Stores data relevant to a users wallet such as balance and
currency
"""
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)
def set_balance(self, data):
"""
Set the balance of the wallet
"""
self.balance = data
def set_unsettled_interest(self, data):
"""
Set the unsettled interest of the wallet
"""
self.unsettled_interest = data
def __str__(self):
return "Wallet <'{}_{}' balance='{}' balance_available='{}' unsettled='{}'>".format(
self.type, self.currency, self.balance, self.balance_available, self.unsettled_interest)