[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request hummingbot#6573 from hummingbot/fix/update-bitmart…
Browse files Browse the repository at this point in the history
…-order-detail
  • Loading branch information
cardosofede committed Sep 24, 2023
2 parents 2aa845c + 95e03b0 commit 8b41156
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion hummingbot/connector/exchange/bitmart/bitmart_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
CREATE_ORDER_PATH_URL = "spot/v1/submit_order"
CANCEL_ORDER_PATH_URL = "spot/v2/cancel_order"
GET_ACCOUNT_SUMMARY_PATH_URL = "spot/v1/wallet"
GET_ORDER_DETAIL_PATH_URL = "spot/v1/order_detail"
GET_ORDER_DETAIL_PATH_URL = "spot/v2/order_detail"
GET_TRADE_DETAIL_PATH_URL = "spot/v1/trades"
SERVER_TIME_PATH = "system/time"

Expand Down
4 changes: 1 addition & 3 deletions hummingbot/connector/exchange/bitmart/bitmart_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ async def _format_trading_rules(self, symbols_details: Dict[str, Any]) -> List[T
"quote_currency":"BTC",
"quote_increment":"1.00000000",
"base_min_size":"1.00000000",
"base_max_size":"10000000.00000000",
"price_min_precision":6,
"price_max_precision":8,
"expiration":"NA",
Expand All @@ -254,7 +253,6 @@ async def _format_trading_rules(self, symbols_details: Dict[str, Any]) -> List[T
price_step = Decimal("1") / Decimal(str(math.pow(10, price_decimals)))
result.append(TradingRule(trading_pair=trading_pair,
min_order_size=Decimal(str(rule["base_min_size"])),
max_order_size=Decimal(str(rule["base_max_size"])),
min_order_value=Decimal(str(rule["min_buy_amount"])),
min_base_amount_increment=Decimal(str(rule["base_min_size"])),
min_price_increment=price_step))
Expand Down Expand Up @@ -291,7 +289,7 @@ async def _update_balances(self):
async def _request_order_update(self, order: InFlightOrder) -> Dict[str, Any]:
return await self._api_get(
path_url=CONSTANTS.GET_ORDER_DETAIL_PATH_URL,
params={"clientOrderId": order.client_order_id},
params={"order_id": order.exchange_order_id},
is_auth_required=True)

async def _request_order_fills(self, order: InFlightOrder) -> Dict[str, Any]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def all_symbols_request_mock_response(self):
"quote_currency": self.quote_asset,
"quote_increment": "1.00000000",
"base_min_size": "1.00000000",
"base_max_size": "10000000.00000000",
"price_min_precision": 6,
"price_max_precision": 8,
"expiration": "NA",
Expand Down Expand Up @@ -120,7 +119,6 @@ def all_symbols_including_invalid_pair_mock_response(self) -> Tuple[str, Any]:
"quote_currency": self.quote_asset,
"quote_increment": "1.00000000",
"base_min_size": "1.00000000",
"base_max_size": "10000000.00000000",
"price_min_precision": 6,
"price_max_precision": 8,
"expiration": "NA",
Expand All @@ -135,7 +133,6 @@ def all_symbols_including_invalid_pair_mock_response(self) -> Tuple[str, Any]:
"quote_currency": "PAIR",
"quote_increment": "1.00000000",
"base_min_size": "1.00000000",
"base_max_size": "10000000.00000000",
"price_min_precision": 6,
"price_max_precision": 8,
"expiration": "NA",
Expand Down Expand Up @@ -190,7 +187,6 @@ def trading_rules_request_mock_response(self):
"quote_currency": self.quote_asset,
"quote_increment": "1.00000000",
"base_min_size": "5.00000000",
"base_max_size": "10000000.00000000",
"price_min_precision": 6,
"price_max_precision": 8,
"expiration": "NA",
Expand Down Expand Up @@ -296,7 +292,6 @@ def expected_trading_rule(self):
return TradingRule(
trading_pair=self.trading_pair,
min_order_size=Decimal(self.trading_rules_request_mock_response["data"]["symbols"][0]["base_min_size"]),
max_order_size=Decimal(self.trading_rules_request_mock_response["data"]["symbols"][0]["base_max_size"]),
min_order_value=Decimal(self.trading_rules_request_mock_response["data"]["symbols"][0]["min_buy_amount"]),
min_base_amount_increment=Decimal(str(
self.trading_rules_request_mock_response["data"]["symbols"][0]["base_min_size"])),
Expand Down Expand Up @@ -375,7 +370,7 @@ def validate_order_cancelation_request(self, order: InFlightOrder, request_call:

def validate_order_status_request(self, order: InFlightOrder, request_call: RequestCall):
request_params = request_call.kwargs["params"]
self.assertEqual(order.client_order_id, request_params["clientOrderId"])
self.assertEqual(order.exchange_order_id, request_params["order_id"])

def validate_trades_request(self, order: InFlightOrder, request_call: RequestCall):
request_params = request_call.kwargs["params"]
Expand Down

0 comments on commit 8b41156

Please sign in to comment.