Skip to content

Commit 5730152

Browse files
authored
Merge pull request #965 from tsinghoo/master
feat(client): add cancelAll method
2 parents b4e01b7 + 8271782 commit 5730152

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/node-binance-api.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,16 @@ export default class Binance {
10201020
return await this.privateSpotRequest('v3/order', this.extend({ symbol: symbol, orderId: orderid }, params), 'DELETE');
10211021
}
10221022

1023+
/**
1024+
* Cancels all orders
1025+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade
1026+
* @param {string} symbol - the symbol to cancel
1027+
* @return {promise or undefined} - omitting the callback returns a promise
1028+
*/
1029+
async cancelAll(symbol: string, params: Dict = {}): Promise<CancelOrder> {
1030+
return await this.privateSpotRequest('v3/openOrders', this.extend({ symbol: symbol }, params), 'DELETE');
1031+
}
1032+
10231033
/**
10241034
* Gets the status of an order
10251035
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data

0 commit comments

Comments
 (0)