@@ -234,6 +234,9 @@ def orderbook(self, limit=25):
234
234
``base``, ``quote`` and ``price``. From those you can
235
235
obtain the actual amounts for sale
236
236
237
+ .. note:: This method does order consolidation and hides some
238
+ details of individual orders!
239
+
237
240
"""
238
241
orders = self .blockchain .rpc .get_order_book (
239
242
self ["base" ]["id" ], self ["quote" ]["id" ], limit
@@ -271,6 +274,42 @@ def orderbook(self, limit=25):
271
274
data = {"asks" : asks , "bids" : bids }
272
275
return data
273
276
277
+ def get_limit_orders (self , limit = 25 ):
278
+ """ Returns the list of limit orders for a given market.
279
+
280
+ :param int limit: Limit the amount of orders (default: 25)
281
+
282
+ Sample output:
283
+
284
+ .. code-block:: js
285
+
286
+ {'bids': [0.003679 USD/BTS (1.9103 USD|519.29602 BTS),
287
+ 0.003676 USD/BTS (299.9997 USD|81606.16394 BTS),
288
+ 0.003665 USD/BTS (288.4618 USD|78706.21881 BTS),
289
+ 0.003665 USD/BTS (3.5285 USD|962.74409 BTS),
290
+ 0.003665 USD/BTS (72.5474 USD|19794.41299 BTS)],
291
+ 'asks': [0.003738 USD/BTS (36.4715 USD|9756.17339 BTS),
292
+ 0.003738 USD/BTS (18.6915 USD|5000.00000 BTS),
293
+ 0.003742 USD/BTS (182.6881 USD|48820.22081 BTS),
294
+ 0.003772 USD/BTS (4.5200 USD|1198.14798 BTS),
295
+ 0.003799 USD/BTS (148.4975 USD|39086.59741 BTS)]}
296
+
297
+
298
+ .. note:: Each bid is an instance of
299
+ class:`bitshares.price.Order` and thus carries the keys
300
+ ``base``, ``quote`` and ``price``. From those you can
301
+ obtain the actual amounts for sale
302
+
303
+ """
304
+ return list (
305
+ map (
306
+ lambda x : Order (x , blockchain_instance = self .blockchain ),
307
+ self .blockchain .rpc .get_limit_orders (
308
+ self ["base" ]["id" ], self ["quote" ]["id" ], limit
309
+ ),
310
+ )
311
+ )
312
+
274
313
def trades (self , limit = 25 , start = None , stop = None ):
275
314
""" Returns your trade history for a given market.
276
315
0 commit comments