coinbase / coinbase-advanced-py

The Advanced API Python SDK is a Python package that makes it easy to interact with the Coinbase Advanced API. The SDK handles authentication, HTTP connections, and provides helpful methods for interacting with the API.
https://docs.cdp.coinbase.com/advanced-trade/docs/welcome/
Apache License 2.0
101 stars 27 forks source link

Documentation Issue #32

Closed bamsutler closed 6 months ago

bamsutler commented 6 months ago

It's not an issue with the repo, but I don't see another place to report it.

The official documentation has the on message function structured like this in a number of places on the linked page:

from coinbase.rest import WSClient

api_key = "organizations/{org_id}/apiKeys/{key_id}"
api_secret = "-----BEGIN EC PRIVATE KEY-----\nYOUR PRIVATE KEY\n-----END EC PRIVATE KEY-----\n"

def on_message(ws, message):
    print(message)

ws_client = WSClient(api_key=api_key, api_secret=api_secret, on_message=on_message, verbose=True)

The readme in this repo has the following correct code:

from coinbase.websocket import WSClient

api_key = "organizations/{org_id}/apiKeys/{key_id}"
api_secret = "-----BEGIN EC PRIVATE KEY-----\nYOUR PRIVATE KEY\n-----END EC PRIVATE KEY-----\n"

def on_message(msg):
    print(msg)

client = WSClient(api_key=api_key, api_secret=api_secret, on_message=on_message)
github-actions[bot] commented 6 months ago

Thank you for reporting! If this is an SDK specific issue, we will look into it and get back to you soon. If this is an API related request, report it in our Advanced API forum instead.

justinsogoni-cb commented 6 months ago

Thanks! We noted this and will make it consistent in the near future

urischwartz-cb commented 6 months ago

@bamsutler this is fixed now. Thanks again for reporting!

bamsutler commented 6 months ago

Thank you ! Appreciate the hard work on these tools 👍