From 65f9c7fa9d6b5854c4dd063db51bfd11fa802174 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sat, 13 Jan 2024 18:37:13 -0300 Subject: [PATCH] Added withdrawMargin(params) So we can simulate cross margin by rebalancing. --- lib/trade.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/trade.js b/lib/trade.js index 44f7f5e..61c0108 100644 --- a/lib/trade.js +++ b/lib/trade.js @@ -256,6 +256,13 @@ Trade.addMargin = async function (params) { return result.data } +Trade.withdrawMargin = async function (params) { + let endpoint = '/api/v1/margin/withdrawMargin' + let url = this.baseURL + endpoint + let result = await axios.post(url, params, this.sign(endpoint, 'POST', params)) + return result.data +} + /* Get V1 Historical Orders List GET /api/v1/funding-history