delta-exchange / python-rest-client

https://pypi.org/project/delta-rest-client/
13 stars 19 forks source link

wallet balance #15

Closed benjiqq closed 5 years ago

benjiqq commented 5 years ago

client or docs out of date?

delta request error: 401 Client Error: Unauthorized for url: https://api.delta.exchange/wallet/balances

https://docs.delta.exchange/#delta-exchange-api-wallet

marif4444 commented 5 years ago

You need to pass the authentication header for private endpoints. You are using api or python client?

benjiqq commented 5 years ago

using client as in this line but with following modification https://github.com/delta-exchange/python-rest-client/blob/master/delta_rest_client/delta_rest_client.py#L117


 def get_wallet(self):
        response = self._request("GET", "wallet/balances",
                                query={}, auth=True)
        return response.json()
benjiqq commented 5 years ago

also not sure how to retrieve asset id for given asset. would nice to add in client get_assets (?)

benjiqq commented 5 years ago

i.e. see #16

bbc4468 commented 5 years ago

The following api returns the list of assets https://api.delta.exchange/assets

Will add get_assets in the rest client. In the meanwhile, you can directly use the following function

response = client.request("GET", "assets") assets = response.json()

bbc4468 commented 5 years ago

We made intentionally made "request" function public for such cases.

benjiqq commented 5 years ago

ok, it makes sense to cover all available calls? a more fully developed client makes it easier for those using it.

bbc4468 commented 5 years ago

Done. closing the issue now.