BitShares Forum

Main => General Discussion => Topic started by: botfund on October 17, 2015, 03:16:33 am

Title: [API] Is there a direct way to get order book in wallet_api?
Post by: botfund 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:{}}].
Title: Re: [API] Is there a direct way to get order book in wallet_api?
Post by: svk 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.