viabtc / viabtc_exchange_server

A trading engine with high-speed performance and real-time notification
MIT License
2.68k stars 1.49k forks source link

order.book method arguments #123

Open ohld opened 6 years ago

ohld commented 6 years ago

Hi there!

In Wiki pages there is a documentation for order.book method:

Order list method: order.book params: market: side: side,1:sell,2:buy offset: limit: result:

But if I send this params I get the error:

{'result': None, 'error': {'code': 1, 'message': 'invalid argument'}, 'id': 0}

What are the proper arguments for that method? Thanks

ohld commented 6 years ago

BTW I'm developing my Python wrapper for ViaBTC Exchange server. It is early-stage but star button can be smashed already! https://github.com/testnet-exchange/python-viabtc-api

niyas commented 6 years ago

I am also facing the same issue, can anyone help?

niyas commented 6 years ago

@ohld Please try this payload {"method": "order.book", "params": ['BTCUSDT', 2, 1, 5], "id": 0 } use the market, side, offset and limit that suits for you Works for me!!

objectt commented 6 years ago

@ohld

{"method": "order.book", "params": ["BTCBCH", 2, 0, 101], "id": 1516681174} make sure your market exists and limit is less than 102

niyas commented 6 years ago

@objectt One doubt what is id refers to and why we use it

objectt commented 6 years ago

@niyas Every request and response includes request id therefore client can use it to match corresponding request and response. It must be an integer but doesn't have to be unique.