Author Topic: [API] Is there a direct way to get order book in wallet_api?  (Read 539 times)

0 Members and 1 Guest are viewing this topic.

Offline botfund

  • Full Member
  • ***
  • Posts: 174
    • View Profile
  • BitShares: botfund
[API] Is there a direct way to get order book in wallet_api?
« on: October 17, 2015, 03:16:33 am »
What I've found in wallet_api to get order book:
get_call_orders
get_limit_orders

It's really difficult for api caller to calculate an order book from the raw information and it will  be affected by market rule changes a lot. And we need to implement the same logic in all the program languages we want to use. Can we provide an api to get order book directly? Something like {asks:[{price:{}, amount:xxxx, optional order:{}}], bids:[{price:{}, amount:xxxx, optional order:{}}].

Offline svk

Re: [API] Is there a direct way to get order book in wallet_api?
« Reply #1 on: October 17, 2015, 04:57:01 pm »
Welcome to my world :(

There's a subscribe_to_market call also that will notify you of changes in a market.

I recommend looking at MarketsActions.js in graphene-ui/dl/src/actions where you can see the api calls being used, and MarketsStore.js for processing methods.
Worker: dev.bitsharesblocks