Authentication

coinbase.jwt_generator.build_rest_jwt(uri, key_var, secret_var) str[source]

Build REST JWT

Description:

Builds and returns a JWT token for connecting to the REST API.


Parameters:

  • uri (str) - Formatted URI for the endpoint (e.g. “GET api.coinbase.com/api/v3/brokerage/accounts”) Can be generated using format_jwt_uri

  • key_var (str) - The API key

  • secret_var (str) - The API key secret

coinbase.jwt_generator.build_ws_jwt(key_var, secret_var) str[source]

Build WebSocket JWT

Description:

Builds and returns a JWT token for connecting to the WebSocket API.


Parameters:

  • key_var (str) - The API key

  • secret_var (str) - The API key secret

coinbase.jwt_generator.format_jwt_uri(method, path) str[source]

Format JWT URI

Description:

Formats method and path into valid URI for JWT generation.


Parameters:

  • method (str) - The REST request method. E.g. GET, POST, PUT, DELETE

  • path (str) - The path of the endpoint. E.g. “/api/v3/brokerage/accounts”