Skip to content

Commit fd5484c

Browse files
authored
Merge pull request #208 from matthewli1409/master
ledger missing id fix
2 parents 1c289d7 + eb33c06 commit fd5484c

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.0.4
2+
-) Added missing ID to ledgers.py
3+
14
2.0.3
25
-) Implemented Liquidations endpoint (REST)
36

bfxapi/models/ledger.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class Ledger:
2626
DESCRIPTION
2727
"""
2828

29-
def __init__(self, currency, mts, amount, balance, description):
29+
def __init__(self, lid, currency, mts, amount, balance, description):
30+
self.id = lid
3031
self.currency = currency
3132
self.mts = mts
3233
self.amount = amount
@@ -40,15 +41,16 @@ def from_raw_ledger(raw_ledger):
4041
4142
@return Ledger
4243
"""
44+
lid = raw_ledger[LedgerModel.ID]
4345
currency = raw_ledger[LedgerModel.CURRENCY]
4446
mts = raw_ledger[LedgerModel.MTS]
4547
amount = raw_ledger[LedgerModel.AMOUNT]
4648
balance = raw_ledger[LedgerModel.BALANCE]
4749
description = raw_ledger[LedgerModel.DESCRIPTION]
48-
return Ledger(currency, mts, amount, balance, description)
50+
return Ledger(lid, currency, mts, amount, balance, description)
4951

5052
def __str__(self):
5153
''' Allow us to print the Ledger object in a pretty format '''
52-
text = "Ledger <{} {} balance:{} '{}' mts={}>"
53-
return text.format(self.amount, self.currency, self.balance,
54+
text = "Ledger <{} {} {} balance:{} '{}' mts={}>"
55+
return text.format(self.id, self.amount, self.currency, self.balance,
5456
self.description, self.mts)

bfxapi/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
This module contains the current version of the bfxapi lib
33
"""
44

5-
__version__ = '2.0.3'
5+
__version__ = '2.0.4'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
here = path.abspath(path.dirname(__file__))
1212
setup(
1313
name='bitfinex-api-py',
14-
version='2.0.3',
14+
version='2.0.4',
1515
description='Official Bitfinex Python API',
1616
long_description='A Python reference implementation of the Bitfinex API for both REST and websocket interaction',
1717
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)