From 7d05ffa747873085ed345efded9f4dd6c3d44bdb Mon Sep 17 00:00:00 2001 From: dwd Date: Thu, 7 Mar 2024 07:09:28 +0800 Subject: [PATCH] add func: bnc.User.CloseFuturesOrder --- bnc/user.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bnc/user.go b/bnc/user.go index 3dcdfa2..19dcead 100644 --- a/bnc/user.go +++ b/bnc/user.go @@ -249,6 +249,10 @@ func (u *User) QueryFuturesOrder(symbol string, orderId int64, cltOrdId string, return cex.Request(u, FuturesQueryOrderConfig, FuturesQueryOrCancelOrderParams{Symbol: symbol, OrderId: orderId, OrigClientOrderId: cltOrdId}, opts...) } +func (u *User) CloseFuturesOrder(symbol string, opts ...cex.CltOpt) (*resty.Response, FuturesOrder, cex.RequestError) { + return cex.Request(u, FuturesNewOrderConfig, FuturesNewOrderParams{Symbol: symbol, PositionSide: u.cfg.fuPosSide, ClosePosition: true}, opts...) +} + // ------------------------------------------------------------ // Futures API // ============================================================