MCPcopy Create free account
hub / github.com/ccxt/ccxt / cancel_orders

Method cancel_orders

python/ccxt/hyperliquid.py:2272–2317  ·  view source on GitHub ↗

cancel multiple orders https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid :param str[] ids: order ids

(self, ids: List[str], symbol: Str = None, params={})

Source from the content-addressed store, hash-verified

2270 return self.safe_dict(orders, 0)
2271
2272 def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
2273 """
2274 cancel multiple orders
2275
2276 https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
2277 https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
2278
2279 :param str[] ids: order ids
2280 :param str [symbol]: unified market symbol
2281 :param dict [params]: extra parameters specific to the exchange API endpoint
2282 :param string|str[] [params.clientOrderId]: client order ids,(optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
2283 :param str [params.vaultAddress]: the vault address
2284 :param str [params.subAccountAddress]: sub account user address
2285 :returns dict: an list of `order structures <https://docs.ccxt.com/?id=order-structure>`
2286 """
2287 self.check_required_credentials()
2288 if symbol is None:
2289 raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
2290 self.load_markets()
2291 self.initialize_client()
2292 request = self.cancel_orders_request(ids, symbol, params)
2293 response = self.privatePostExchange(request)
2294 #
2295 # {
2296 # "status":"ok",
2297 # "response":{
2298 # "type":"cancel",
2299 # "data":{
2300 # "statuses":[
2301 # "success"
2302 # ]
2303 # }
2304 # }
2305 # }
2306 #
2307 innerResponse = self.safe_dict(response, 'response')
2308 data = self.safe_dict(innerResponse, 'data')
2309 statuses = self.safe_list(data, 'statuses', [])
2310 orders = []
2311 for i in range(0, len(statuses)):
2312 status = statuses[i]
2313 orders.append(self.safe_order({
2314 'info': status,
2315 'status': status,
2316 }))
2317 return orders
2318
2319 def cancel_twap_order(self, id: str, symbol: Str = None, params={}):
2320 """

Callers 1

cancel_orderMethod · 0.95

Calls 11

initialize_clientMethod · 0.95
cancel_orders_requestMethod · 0.95
ArgumentsRequiredClass · 0.90
safe_dictMethod · 0.80
safe_listMethod · 0.80
safe_orderMethod · 0.80
privatePostExchangeMethod · 0.65
rangeFunction · 0.50
load_marketsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected