From 1c5df803a2e9f7338819640f90e190158e3d5d72 Mon Sep 17 00:00:00 2001 From: liqinghu Date: Sat, 11 Oct 2025 19:47:56 +0800 Subject: [PATCH 1/2] cancelAll --- src/node-binance-api.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/node-binance-api.ts b/src/node-binance-api.ts index 59deef0c..c345501f 100644 --- a/src/node-binance-api.ts +++ b/src/node-binance-api.ts @@ -1020,6 +1020,16 @@ export default class Binance { return await this.privateSpotRequest('v3/order', this.extend({ symbol: symbol, orderId: orderid }, params), 'DELETE'); } + /** + * Cancels all orders + * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade + * @param {string} symbol - the symbol to cancel + * @return {promise or undefined} - omitting the callback returns a promise + */ + async cancelAll(symbol: string, params: Dict = {}): Promise { + return await this.privateSpotRequest('v3/openOrders', this.extend({ symbol: symbol}, params), 'DELETE'); + } + /** * Gets the status of an order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data From 82717823bfb68ec662e353e4d87a54fc8d55f038 Mon Sep 17 00:00:00 2001 From: carlosmiei <43336371+carlosmiei@users.noreply.github.com> Date: Sat, 18 Oct 2025 15:17:08 +0100 Subject: [PATCH 2/2] Fix formatting in cancelAll method --- src/node-binance-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node-binance-api.ts b/src/node-binance-api.ts index c345501f..79859b78 100644 --- a/src/node-binance-api.ts +++ b/src/node-binance-api.ts @@ -1027,7 +1027,7 @@ export default class Binance { * @return {promise or undefined} - omitting the callback returns a promise */ async cancelAll(symbol: string, params: Dict = {}): Promise { - return await this.privateSpotRequest('v3/openOrders', this.extend({ symbol: symbol}, params), 'DELETE'); + return await this.privateSpotRequest('v3/openOrders', this.extend({ symbol: symbol }, params), 'DELETE'); } /**