diff --git a/pyxt/perp.py b/pyxt/perp.py index f6d75d6..819fbcc 100644 --- a/pyxt/perp.py +++ b/pyxt/perp.py @@ -142,6 +142,7 @@ def get_agg_tiker(self, symbol): url = self.host + "/future/market" + '/v1/public/q/agg-ticker' code, success, error = self._fetch(method="GET", url=url, params=params, timeout=self.timeout) return code, success, error + def get_book_ticker(self, symbol): """ :return:book ticker diff --git a/pyxt/spot.py b/pyxt/spot.py index a4596a0..1e9dd1d 100644 --- a/pyxt/spot.py +++ b/pyxt/spot.py @@ -380,10 +380,13 @@ def order(self, symbol, side, type, biz_type='SPOT', time_in_force='GTC', client params['clientOrderId'] = client_order_id if price: params['price'] = price - if quantity: - params['quantity'] = quantity if quote_qty: params['quoteQty'] = quote_qty + if quantity: + if type == "MARKET" and side == "BUY" and quote_qty is None: + params['quote_qty'] = quantity * price + else: + params['quantity'] = quantity res = self.req_post("/v4/order", params) return res['result'] diff --git a/setup.py b/setup.py index b1d44ee..1e96687 100644 --- a/setup.py +++ b/setup.py @@ -8,12 +8,12 @@ setup( name='pyxt', - version='0.6.5', + version='0.6.6', description='Python3 XT.COM HTTP API Connector', long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/kelvinxue/pyxt", - download_url='https://github.com/kelvinxue/pyxt/archive/refs/tags/v0.6.5.tar.gz', + download_url='https://github.com/kelvinxue/pyxt/archive/refs/tags/v0.6.6.tar.gz', license="MIT License", author="xt", author_email="xt@xt.com",