Skip to content

Commit cd76320

Browse files
authored
Merge pull request #1 from bas20150622/master
Added newer api functionality
2 parents c0f31b7 + caa5017 commit cd76320

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

bitstamp/client.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ def account_balance(self, base="btc", quote="usd"):
268268
url = self._construct_url("balance/", base, quote)
269269
return self._post(url, return_json=True, version=2)
270270

271-
def user_transactions(self, offset=0, limit=100, descending=True,
272-
base=None, quote=None):
271+
def user_transactions(self, offset=0, limit=1000, descending=True,
272+
base=None, quote=None, since_timestamp=None, since_id=None):
273273
"""
274274
Returns descending list of transactions. Every transaction (dictionary)
275275
contains::
@@ -288,9 +288,32 @@ def user_transactions(self, offset=0, limit=100, descending=True,
288288
'limit': limit,
289289
'sort': 'desc' if descending else 'asc',
290290
}
291+
if since_timestamp is not None:
292+
data.update({'since_timestamp': since_timestamp})
293+
if since_id is not None:
294+
data.update({'since_id': since_id})
291295
url = self._construct_url("user_transactions/", base, quote)
292296
return self._post(url, data=data, return_json=True, version=2)
293297

298+
def crypto_transactions(self, offset=0, limit=1000):
299+
"""
300+
Returns list of crypto transactions. Every transaction (dictionary)
301+
contains::
302+
{u'currency' : u'LTC'
303+
u'destinationAddress': u'Destination Address'
304+
u'txid': u'Transaction Hash'
305+
u'amount' u'1.0'
306+
u'datetime': int(timestamp)}
307+
308+
Instead of the keys btc and usd, it can contain other currency codes
309+
"""
310+
data = {
311+
'offset': offset,
312+
'limit': limit,
313+
}
314+
url = "crypto-transactions/"
315+
return self._post(url, data=data, return_json=True, version=2)
316+
294317
def open_orders(self, base="btc", quote="usd"):
295318
"""
296319
Returns JSON list of open orders. Each order is represented as a

0 commit comments

Comments
 (0)