-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d52dc5
commit 0628910
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from typing import Any, List, Optional | ||
from datamaxi.api import API | ||
from datamaxi.lib.constants import BASE_URL | ||
|
||
|
||
class Token(API): | ||
"""Client to fetch Token status data from DataMaxi+ API.""" | ||
|
||
def __init__(self, api_key=None, **kwargs: Any): | ||
"""Initialize the object. | ||
Args: | ||
api_key (str): The DataMaxi+ API key | ||
**kwargs: Keyword arguments used by `datamaxi.api.API`. | ||
""" | ||
if "base_url" not in kwargs: | ||
kwargs["base_url"] = BASE_URL | ||
super().__init__(api_key, **kwargs) | ||
|
||
def updates(self, type: Optional[str] = None) -> List[str]: | ||
"""Get Token Updates | ||
`GET /api/v1/token/updates` | ||
<https://docs.datamaxi.finance/api/datasets/token> | ||
Returns: | ||
List of token updates | ||
""" | ||
params = {} | ||
if type: | ||
params["type"] = type | ||
|
||
url_path = "/api/v1/token/updates" | ||
return self.query(url_path, params) |