cancel all open orders :param str [symbol]: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None :param dict [params]: extra parameters specific to the exchange API endpoint :param str [params.accountIndex]: account in
(self, symbol: Str = None, params={})
| 2930 | return self.parse_order(response, market) |
| 2931 | |
| 2932 | def cancel_all_orders(self, symbol: Str = None, params={}): |
| 2933 | """ |
| 2934 | cancel all open orders |
| 2935 | :param str [symbol]: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None |
| 2936 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 2937 | :param str [params.accountIndex]: account index |
| 2938 | :param str [params.apiKeyIndex]: api key index |
| 2939 | :returns dict[]: a list of `order structures <https://docs.ccxt.com/?id=order-structure>` |
| 2940 | """ |
| 2941 | self.load_markets() |
| 2942 | apiKeyIndex = None |
| 2943 | apiKeyIndex, params = self.handle_api_key_index(params, 'cancelAllOrders', 'apiKeyIndex', 'api_key_index') |
| 2944 | accountIndex = None |
| 2945 | accountIndex, params = self.handle_account_index(params, 'cancelAllOrders', 'accountIndex', 'account_index') |
| 2946 | strAccountIndex = self.number_to_string(accountIndex) |
| 2947 | strApiKeyIndex = self.number_to_string(apiKeyIndex) |
| 2948 | signer = self.load_account(self.options['chainId'], self.get_lighter_private_key(strAccountIndex, strApiKeyIndex), strApiKeyIndex, strAccountIndex, params) |
| 2949 | nonce = self.fetch_nonce(accountIndex, apiKeyIndex, params) |
| 2950 | signRaw = { |
| 2951 | 'time_in_force': 0, # 0: IMMEDIATE 1: SCHEDULED 2: ABORT |
| 2952 | 'time': 0, # if time_in_force is not IMMEDIATE, set the timestamp_ms here |
| 2953 | 'nonce': nonce, |
| 2954 | 'api_key_index': apiKeyIndex, |
| 2955 | 'account_index': accountIndex, |
| 2956 | } |
| 2957 | txType, txInfo = self.lighter_sign_cancel_all_orders(signer, self.extend(signRaw, params)) |
| 2958 | request = { |
| 2959 | 'tx_type': txType, |
| 2960 | 'tx_info': txInfo, |
| 2961 | } |
| 2962 | response = self.publicPostSendTx(request) |
| 2963 | return self.parse_orders([response]) |
| 2964 | |
| 2965 | def cancel_all_orders_after(self, timeout: Int, params={}): |
| 2966 | """ |
nothing calls this directly
no test coverage detected