-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added FuturesApi.Account.GetMarginModeAsync endpoint Added FuturesApi.Account.SetMarginModeAsync endpoint Added FuturesApi.Account.GetCrossMarginLeverageAsync endpoint Added FuturesApi.Account.SetCrossMarginLeverageAsync endpoint Added marginMode parameter to FuturesApi.Trading.PlaceOrderAsync and PlaceMultipleOrdersAsync endpoints Added onWalletUpdate update handler to FuturesApi.SubscribeToBalanceUpdatesAsync stream Added FuturesApi.SubscribeToMarginModeUpdatesAsync stream Added FuturesApi.SubscribeToCrossMarginLeverageUpdatesAsync stream Updated various order and trade response/update models with margin mode properties Update position models with MarginMode, PositionSide, Leverage and PositionFunding properties
- Loading branch information
Showing
30 changed files
with
779 additions
and
15 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
Kucoin.Net.UnitTests/Endpoints/Futures/Account/GetCrossMarginLeverage.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
GET | ||
/api/v2/getCrossUserLeverage | ||
true | ||
{"code":"200000","data":{ | ||
"symbol":"XBTUSDTM", | ||
"leverage":"3.00" | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
Kucoin.Net.UnitTests/Endpoints/Futures/Account/GetMarginMode.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
GET | ||
/api/v2/position/getMarginMode | ||
true | ||
{"code":"200000","data":{"symbol":"XBTUSDTM","marginMode":"ISOLATED"}} |
8 changes: 8 additions & 0 deletions
8
Kucoin.Net.UnitTests/Endpoints/Futures/Account/SetCrossMarginLeverage.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
POST | ||
/api/v2/changeCrossUserLeverage | ||
true | ||
{"code":"200000","data":{ | ||
"symbol":"XBTUSDTM", | ||
"leverage":"3.00" | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
Kucoin.Net.UnitTests/Endpoints/Futures/Account/SetMarginMode.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
POST | ||
/api/v2/position/changeMarginMode | ||
true | ||
{"code":"200000","data":{"symbol":"XBTUSDTM","marginMode":"ISOLATED"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Kucoin.Net.UnitTests/Subscriptions/Futures/CrossMarginLeverage.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
> {"id":"|1|","type":"subscribe","topic":"/contract/crossLeverage","privateChannel":true,"response":true} | ||
< { "id": "|1|", "type": "ack" } | ||
= | ||
{ | ||
"topic": "/contract/crossLeverage", | ||
"type": "message", | ||
"subject": "user.config", | ||
"userId": "6687a53f5bda600001284bf", | ||
"channelType": "private", | ||
"data": { | ||
"ANTUSDTM": { | ||
"leverage": 5 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
> {"id":"|1|","type":"subscribe","topic":"/contract/marginMode","privateChannel":true,"response":true} | ||
< { "id": "|1|", "type": "ack" } | ||
= | ||
{ | ||
"topic": "/contract/marginMode", | ||
"type": "message", | ||
"subject": "user.config", | ||
"userId": "6687a53f5bda600012b84bf", | ||
"channelType": "private", | ||
"data": { | ||
"ANTUSDTM": "CROSS" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
> {"id":"|1|","type":"subscribe","topic":"/contractAccount/wallet","privateChannel":true,"response":true} | ||
< { "id": "|1|", "type": "ack" } | ||
= | ||
{ | ||
"userId": "xbc453tg732eba53a88ggyt8c", | ||
"topic": "/contractAccount/wallet", | ||
"subject": "walletBalance.change", | ||
"data": { | ||
"currency": "XBT", // Currency Symbol | ||
"walletBalance": "2.002", // Wallet Balance | ||
"availableBalance": "2.002", // Available Balance | ||
"holdBalance": "0", // Frozen Balance | ||
"isolatedOrderMargin": "0", // Margin of the isolated margin order | ||
"isolatedPosMargin": "0", // Margin of the isolated margin position, including isolated margin funding fees | ||
"isolatedUnPnl": "0", // Unrealized P&L in isolated margin mode | ||
"isolatedFundingFeeMargin":"0", // Isolated margin funding fee | ||
"crossOrderMargin": "0", // Margin of the cross margin order | ||
"crossPosMargin": "0", // Margin of the cross margin position | ||
"crossUnPnl": "0", // Unrealized P&L in cross margin mode | ||
"equity": "2.002", // Equity | ||
"totalCrossMargin": "2.002", // Total margin under cross margin mode | ||
"version": "9", // Version. When holding a cross margin position, the available balance may change with fluctuations in the mark price, leading to discrepancies in the available balance for the same version number. | ||
"timestamp": "1714632069838" // Last modified time | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using CryptoExchange.Net.Attributes; | ||
|
||
namespace Kucoin.Net.Enums | ||
{ | ||
/// <summary> | ||
/// Margin mode | ||
/// </summary> | ||
public enum FuturesMarginMode | ||
{ | ||
/// <summary> | ||
/// Cross margin | ||
/// </summary> | ||
[Map("CROSS")] | ||
Cross, | ||
/// <summary> | ||
/// Isolated margin | ||
/// </summary> | ||
[Map("ISOLATED")] | ||
Isolated, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using CryptoExchange.Net.Attributes; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Kucoin.Net.Enums | ||
{ | ||
/// <summary> | ||
/// Position side | ||
/// </summary> | ||
public enum PositionSide | ||
{ | ||
/// <summary> | ||
/// Both (One way position mode) | ||
/// </summary> | ||
[Map("BOTH")] | ||
Both, | ||
/// <summary> | ||
/// Long | ||
/// </summary> | ||
[Map("LONG")] | ||
Long, | ||
/// <summary> | ||
/// Short | ||
/// </summary> | ||
[Map("SHORT")] | ||
Short | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.