coinbase/coinbase-python

No resource_path returned in API calls to resource collections.

achampion opened this issue · 1 comments

The response to /v2/accounts does not include a resource_path so the example in the documentation accounts.refresh() fails, e.g.:

In []:
from coinbase.wallet.client import Client
client = Client(<api-key>, <api-secret>, api_version='2017-08-07')
accounts = client.get_accounts()
accounts

Out[]:
<APIObject @ 0x1076bd888> {
  "data": [
    ...
  ]
} 

In []:
accounts.refresh()

Out[]:
...
ValueError: Unable to refresh: missing 'resource_path' attribute.

You can manually add a resource_path which allows the call to work:

In []:
accounts['resource_path'] = '/v2/accounts'
accounts.refresh()

Out[]:
<APIObject @ 0x1076cec50> {
  "data": [
    ...
  ]
} 

This seems to be true for other resource collections, e.g. account[0].get_transactions() has the same issue.

sds commented

Possible resolution in #85. Feel free to reopen if you're still having issues!