From c1b4b7d0e9a26663ec5b243738368c2f0f9399b3 Mon Sep 17 00:00:00 2001 From: Martin Kersner Date: Thu, 31 Oct 2024 11:28:40 +0900 Subject: [PATCH] feat: update premium params --- datamaxi/__version__.py | 2 +- datamaxi/datamaxi/premium.py | 33 ++++++++++++++++++++++++--------- pyproject.toml | 4 ++-- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/datamaxi/__version__.py b/datamaxi/__version__.py index 8b301a7..770bb8d 100644 --- a/datamaxi/__version__.py +++ b/datamaxi/__version__.py @@ -1 +1 @@ -__version__ = "0.23.0" +__version__ = "0.24.0" diff --git a/datamaxi/datamaxi/premium.py b/datamaxi/datamaxi/premium.py index 186797f..f177d2c 100644 --- a/datamaxi/datamaxi/premium.py +++ b/datamaxi/datamaxi/premium.py @@ -18,11 +18,14 @@ def __init__(self, api_key=None, **kwargs: Any): def get( self, - sort: str = None, - limit: int = None, - symbol: str = None, sourceExchange: str = None, targetExchange: str = None, + asset: str = None, + sourceQuote: str = None, + targetQuote: str = None, + currency: str = None, + sort: str = None, + limit: int = None, pandas: bool = True, ) -> Union[List, pd.DataFrame]: """Fetch premium data @@ -31,11 +34,14 @@ def get( Args: - sort (str): Sort data by `asc` or `desc` - limit (int): Limit number of data to return - symbol (str): Symbol name sourceExchange (str): Source exchange name targetExchange (str): Target exchange name + asset (str): Asset name + sourceQuote (str): Source quote currency + targetQuote (str): Target quote currency + currency (str): Currency applied to cross-exchange price differences + sort (str): Sort data by `asc` or `desc` + limit (int): Limit number of data to return pandas (bool): Return data as pandas DataFrame Returns: @@ -49,15 +55,24 @@ def get( if limit is not None: params["limit"] = limit - if symbol is not None: - params["symbol"] = symbol - if sourceExchange is not None: params["sourceExchange"] = sourceExchange if targetExchange is not None: params["targetExchange"] = targetExchange + if asset is not None: + params["asset"] = asset + + if sourceQuote is not None: + params["sourceQuote"] = sourceQuote + + if targetQuote is not None: + params["targetQuote"] = targetQuote + + if currency is not None: + params["currency"] = currency + res = self.query("/api/v1/premium", params) if pandas: diff --git a/pyproject.toml b/pyproject.toml index 288c679..196a13b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [project] name = "datamaxi" -version = "0.23.0" +version = "0.24.0" authors = [ { name="Bisonai", email="business@bisonai.com" }, ] -description = "Official Python client for DataMaxi+ API" +description = "Official Python SDK for DataMaxi+ API" readme = "README.md" requires-python = ">=3.8" classifiers = [