Skip to content

Commit

Permalink
Move get_signed_prices method to auth client (#40)
Browse files Browse the repository at this point in the history
* Move method to auth client

* Use proper rate limiter

* Release
  • Loading branch information
acontry authored Feb 18, 2023
1 parent 434d42b commit f472f13
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ dev

- [change here]

0.4.1 (2023-02-18)
++++++++++++++++++

**Bugfixes**

- Fix `python_requires` in setup.py so this package can be installed by poetry.
- `get_signed_prices` should be an authenticated endpoint.

0.4.0 (2022-07-28)
++++++++++++++++++

Expand Down
15 changes: 15 additions & 0 deletions coinbasepro/auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,21 @@ def generate_crypto_address(self, account_id: str) -> Dict[str, Any]:
)
return self._convert_dict(r, field_conversions)

def get_signed_prices(self) -> Dict[str, Any]:
"""Get cryptographically signed prices.
Prices reported are ready to be posted on-chain using
Compound's Open Oracle smart contract.
Returns:
Signed price details.
Raises:
See `get_products()`.
"""
return self._send_message("get", "/oracle", rate_limiter=self.a_rate_limiter)

def withdraw(
self, amount: Union[float, Decimal], currency: str, payment_method_id: str
) -> Dict[str, Any]:
Expand Down
15 changes: 0 additions & 15 deletions coinbasepro/public_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,21 +445,6 @@ def get_currencies(self) -> List[Dict[str, Any]]:
)
return self._convert_list_of_dicts(currencies, field_conversions)

def get_signed_prices(self) -> Dict[str, Any]:
"""Get cryptographically signed prices.
Prices reported are ready to be posted on-chain using
Compound's Open Oracle smart contract.
Returns:
Signed price details.
Raises:
See `get_products()`.
"""
return self._send_message("get", "/oracle", rate_limiter=self.p_rate_limiter)

def get_time(self) -> Dict[str, Any]:
"""Get the API server time.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setuptools.setup(
name="coinbasepro",
version="0.4.0",
version="0.4.1",
description="A Python interface for the Coinbase Pro/Coinbase Exchange API.",
long_description=readme + "\n\n" + history,
long_description_content_type="text/x-rst",
Expand Down

0 comments on commit f472f13

Please sign in to comment.