coinbase / coinbase-python

DEPRECATED — Coinbase Python API
Apache License 2.0
528 stars 217 forks source link

Can't get notifications #18

Closed franciscolourenco closed 8 years ago

franciscolourenco commented 8 years ago

Code:

import os
from coinbase.wallet.client import Client

client = Client(os.environ['COINBASE_API_KEY'], os.environ['COINBASE_API_SECRET'])
notifications = client.get_notifications()

Error:

Traceback (most recent call last):
  File "coinbase.get_notifications.py", line 6, in <module>
    notifications = client.get_notifications()
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/client.py", line 264, in get_notifications
    return self._make_api_object(response, Notification)
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/client.py", line 161, in _make_api_object
    obj.data = new_api_object(self, data, model_type)
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/model.py", line 28, in new_api_object
    return [new_api_object(client, v, cls) for v in obj]
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/model.py", line 25, in new_api_object
    result[k] = new_api_object(client, v)
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/model.py", line 15, in new_api_object
    cls = _resource_to_model.get(resource, None)
TypeError: unhashable type: 'dict'
ERROR: exit status 1

Got read notification read permissions, any idea what is wrong?

MalteJ commented 8 years ago

same here. Python 2.7 on OS X and on Linux.

jorilallo commented 8 years ago

@aristidesfl @MalteJ sorry for the delayed response, it seems we were missing some includes from MANIFEST.in. I updated the lib and callback/notification validation should work on 2.0.4.

franciscolourenco commented 8 years ago

@jorilallo do you know how to fix this one too? https://github.com/coinbase/coinbase-node/issues/52

jorilallo commented 8 years ago

@aristidesfl not from the top of my mind, we need to look that separately. Probably not too hard so if you end up fixing for yourself, feel free to shoot a PR

franciscolourenco commented 8 years ago

I've updated to 2.0.4 but I still have the same error. Something else I need to do?

jorilallo commented 8 years ago

@aristidesfl Please double check you're on 2.0.4, the files should be there. It will also give you the path on the error, check the folder content

franciscolourenco commented 8 years ago

I re-installed the library multiple times

$ heroku local:run python coinbase.get_notifications.py
Traceback (most recent call last):
  File "coinbase.get_notifications.py", line 6, in <module>
    notifications = client.get_notifications()
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/client.py", line 264, in get_notifications
    return self._make_api_object(response, Notification)
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/client.py", line 161, in _make_api_object
    obj.data = new_api_object(self, data, model_type)
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/model.py", line 28, in new_api_object
    return [new_api_object(client, v, cls) for v in obj]
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/model.py", line 25, in new_api_object
    result[k] = new_api_object(client, v)
  File "/Users/user/Work/smoothkeyscroll-server/.virtualenv/lib/python2.7/site-packages/coinbase/wallet/model.py", line 15, in new_api_object
    cls = _resource_to_model.get(resource, None)
TypeError: unhashable type: 'dict'
ERROR: exit status 1
$ pip list
blinker (1.4)
braintree (3.19.0)
cffi (1.2.1)
coinbase (2.0.4)
cryptography (1.0)
enum34 (1.0.4)
Flask (0.10.1)
Flask-SQLAlchemy (2.0)
gunicorn (19.3.0)
idna (2.0)
ipaddress (1.0.14)
itsdangerous (0.24)
Jinja2 (2.8)
MarkupSafe (0.23)
mixpanel (4.2.0)
ndg-httpsclient (0.4.0)
pip (8.0.2)
psycopg2 (2.6.1)
pudb (2015.3)
pyasn1 (0.1.8)
pycparser (2.14)
pycrypto (2.6.1)
Pygments (2.0.2)
pyOpenSSL (0.15.1)
requests (2.9.1)
rollbar (0.11.1)
setuptools (18.2)
simplejson (3.8.0)
six (1.10.0)
SQLAlchemy (1.0.8)
urwid (1.3.0)
Werkzeug (0.11.3)
wheel (0.24.0)
WTForms (2.1)
jorilallo commented 8 years ago

Oh, accidentally confused this by another issue. I'll need to take another look

maksim-s commented 8 years ago

this is now fixed in 2.0.5

franciscolourenco commented 8 years ago

Has this been uploaded to pypi? Still showing 2.0.4

maksim-s commented 8 years ago

@aristidesfl: Pushed another fix in 2.0.6. It's now on PyPI

franciscolourenco commented 8 years ago

Seems to be working now, thanks!

On Thursday 18 February 2016 at 21:03, Maksim Stepanenko wrote:

@aristidesfl (https://github.com/aristidesfl): Pushed another fix in 2.0.6. It's now on PyPI

— Reply to this email directly or view it on GitHub (https://github.com/coinbase/coinbase-python/issues/18#issuecomment-185892778).