diff --git a/src/node-binance-api.ts b/src/node-binance-api.ts index 59deef0c..79859b78 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