Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions bitstamp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ def account_balance(self, base="btc", quote="usd"):
url = self._construct_url("balance/", base, quote)
return self._post(url, return_json=True, version=2)

def user_transactions(self, offset=0, limit=100, descending=True,
base=None, quote=None):
def user_transactions(self, offset=0, limit=1000, descending=True,
base=None, quote=None, since_timestamp=None, since_id=None):
"""
Returns descending list of transactions. Every transaction (dictionary)
contains::
Expand All @@ -273,9 +273,32 @@ def user_transactions(self, offset=0, limit=100, descending=True,
'limit': limit,
'sort': 'desc' if descending else 'asc',
}
if since_timestamp is not None:
data.update({'since_timestamp': since_timestamp})
if since_id is not None:
data.update({'since_id': since_id})
url = self._construct_url("user_transactions/", base, quote)
return self._post(url, data=data, return_json=True, version=2)

def crypto_transactions(self, offset=0, limit=1000):
"""
Returns list of crypto transactions. Every transaction (dictionary)
contains::
{u'currency' : u'LTC'
u'destinationAddress': u'Destination Address'
u'txid': u'Transaction Hash'
u'amount' u'1.0'
u'datetime': int(timestamp)}

Instead of the keys btc and usd, it can contain other currency codes
"""
data = {
'offset': offset,
'limit': limit,
}
url = "crypto-transactions/"
return self._post(url, data=data, return_json=True, version=2)

def open_orders(self, base="btc", quote="usd"):
"""
Returns JSON list of open orders. Each order is represented as a
Expand Down