BitMEX / api-connectors

Libraries for connecting to the BitMEX API.
https://www.bitmex.com/app/restAPI
910 stars 795 forks source link

Query margin in XBT #86

Closed diegotrazzi closed 6 years ago

diegotrazzi commented 6 years ago

>>> bitmex.User.User_getMargin(currency='XBt').result() (This is a valid call)

Is it possible to add to the possible queries for the margin XBT and other options available form the interface rather than Sathosi only ?

>>> bitmex.User.User_getMargin(currency='XBT').result() (This call errors)

Traceback (most recent call last): File "C:\Users\diego\AppData\Local\Programs\Python\Python36\lib\site-packages\bravado\http_future.py", line 156, in unmarshal_response op=operation, File "C:\Users\diego\AppData\Local\Programs\Python\Python36\lib\site-packages\bravado\http_future.py", line 185, in unmarshal_response_inner response_spec = get_response_spec(status_code=response.status_code, op=op) File "C:\Users\diego\AppData\Local\Programs\Python\Python36\lib\site-packages\bravado_core\response.py", line 158, in get_response_spec "status_code or use a default response.".format(status_code, op)) bravado_core.exception.MatchingResponseNotFound: Response specification matching http status_code 204 not found for operation Operation(User_getMargin). Either add a response specification for the status_code or use a default response.

bendelo commented 6 years ago

Just divide by 1e8

diegotrazzi commented 6 years ago

Of course, I have a method for that, but why did you design the query with a flag to specify the currency if only works with XBt ?

Could you please tell me which other currency strings I can pass into the currency arg ?

Thanks !

STRML commented 6 years ago

This is for futureproofing, in case BitMEX supports other base currencies. Right now the only valid base currency is XBt (Satoshi).