Skip to content

Commit

Permalink
Merge pull request #208 from matthewli1409/master
Browse files Browse the repository at this point in the history
ledger missing id fix
  • Loading branch information
vigan-abd authored Oct 19, 2022
2 parents 1c289d7 + eb33c06 commit fd5484c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.0.4
-) Added missing ID to ledgers.py

2.0.3
-) Implemented Liquidations endpoint (REST)

Expand Down
10 changes: 6 additions & 4 deletions bfxapi/models/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class Ledger:
DESCRIPTION
"""

def __init__(self, currency, mts, amount, balance, description):
def __init__(self, lid, currency, mts, amount, balance, description):
self.id = lid
self.currency = currency
self.mts = mts
self.amount = amount
Expand All @@ -40,15 +41,16 @@ def from_raw_ledger(raw_ledger):
@return Ledger
"""
lid = raw_ledger[LedgerModel.ID]
currency = raw_ledger[LedgerModel.CURRENCY]
mts = raw_ledger[LedgerModel.MTS]
amount = raw_ledger[LedgerModel.AMOUNT]
balance = raw_ledger[LedgerModel.BALANCE]
description = raw_ledger[LedgerModel.DESCRIPTION]
return Ledger(currency, mts, amount, balance, description)
return Ledger(lid, currency, mts, amount, balance, description)

def __str__(self):
''' Allow us to print the Ledger object in a pretty format '''
text = "Ledger <{} {} balance:{} '{}' mts={}>"
return text.format(self.amount, self.currency, self.balance,
text = "Ledger <{} {} {} balance:{} '{}' mts={}>"
return text.format(self.id, self.amount, self.currency, self.balance,
self.description, self.mts)
2 changes: 1 addition & 1 deletion bfxapi/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
This module contains the current version of the bfxapi lib
"""

__version__ = '2.0.3'
__version__ = '2.0.4'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
here = path.abspath(path.dirname(__file__))
setup(
name='bitfinex-api-py',
version='2.0.3',
version='2.0.4',
description='Official Bitfinex Python API',
long_description='A Python reference implementation of the Bitfinex API for both REST and websocket interaction',
long_description_content_type='text/markdown',
Expand Down

0 comments on commit fd5484c

Please sign in to comment.