Skip to content

Commit

Permalink
feat: token
Browse files Browse the repository at this point in the history
  • Loading branch information
hayotbisonai committed Aug 12, 2024
1 parent 9d52dc5 commit 0628910
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions datamaxi/token/__init__.py
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)

0 comments on commit 0628910

Please sign in to comment.