-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added restClient.UnifiedApi.Account.PresetAccountModeSwitchAsync and …
…PrecheckAccountModeSwitchAsync
- Loading branch information
Showing
11 changed files
with
764 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
OKX.Net.UnitTests/Endpoints/UnifiedApi/Account/PrecheckAccountModeSwitchAsync.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,45 @@ | ||
GET | ||
/api/v5/account/set-account-switch-precheck | ||
true | ||
{ | ||
"code": "0", | ||
"data": [ | ||
{ | ||
"acctLv": "3", | ||
"curAcctLv": "4", | ||
"mgnAft": { | ||
"acctAvailEq": "106002.2061970689", | ||
"details": [], | ||
"mgnRatio": "148.1652396878421" | ||
}, | ||
"mgnBf": { | ||
"acctAvailEq": "77308.89735228613", | ||
"details": [], | ||
"mgnRatio": "4.460069474634038" | ||
}, | ||
"posList": [ | ||
{ | ||
"lever": "50", | ||
"posId": "2005456500916518912" | ||
}, | ||
{ | ||
"lever": "50", | ||
"posId": "2005456108363218944" | ||
}, | ||
{ | ||
"lever": "50", | ||
"posId": "2005456332909477888" | ||
}, | ||
{ | ||
"lever": "50", | ||
"posId": "2005456415990251520" | ||
} | ||
], | ||
"posTierCheck": [], | ||
"riskOffsetType": "", | ||
"sCode": "0", | ||
"unmatchedInfoCheck": [] | ||
} | ||
], | ||
"msg": "" | ||
} |
13 changes: 13 additions & 0 deletions
13
OKX.Net.UnitTests/Endpoints/UnifiedApi/Account/PresetAccountModeSwitch.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,13 @@ | ||
POST | ||
/api/v5/account/account-level-switch-preset | ||
true | ||
{ | ||
"code": "0", | ||
"msg": "", | ||
"data": [{ | ||
"acctLv": "3", | ||
"curAcctLv": "2", | ||
"lever": "", | ||
"riskOffsetType": "" | ||
}] | ||
} |
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,33 @@ | ||
using CryptoExchange.Net.Attributes; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OKX.Net.Enums; | ||
|
||
/// <summary> | ||
/// Check result | ||
/// </summary> | ||
public enum AccountSwitchCheckResult | ||
{ | ||
/// <summary> | ||
/// Passed all checks | ||
/// </summary> | ||
[Map("0")] | ||
Passed, | ||
/// <summary> | ||
/// Unmatched information | ||
/// </summary> | ||
[Map("1")] | ||
UmatchedInfo, | ||
/// <summary> | ||
/// Leverage setting is not finished | ||
/// </summary> | ||
[Map("3")] | ||
LeverageSettingNotFinished, | ||
/// <summary> | ||
/// Position tier or margin check is not passed | ||
/// </summary> | ||
[Map("4")] | ||
PositionTierOrMarginNotPassed | ||
} |
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,19 @@ | ||
using CryptoExchange.Net.Attributes; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OKX.Net.Enums; | ||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member | ||
|
||
public enum RiskOffsetType | ||
{ | ||
[Map("1")] | ||
SpotDerivativesUsdtOffset, | ||
[Map("2")] | ||
SpotDerivativesCryptoOffset, | ||
[Map("4")] | ||
SpotDerivativesUsdcOffset, | ||
[Map("3")] | ||
DerivativesOnlyMode | ||
} |
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,113 @@ | ||
using CryptoExchange.Net.Attributes; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OKX.Net.Enums; | ||
/// <summary> | ||
/// Unmatched info type | ||
/// </summary> | ||
public enum UnmatchedInfoType | ||
{ | ||
/// <summary> | ||
/// Asset validation | ||
/// </summary> | ||
[Map("asset_validation")] | ||
AssetValidation, | ||
/// <summary> | ||
/// Order book pending orders | ||
/// </summary> | ||
[Map("pending_orders")] | ||
PendingOrders, | ||
/// <summary> | ||
/// Pending algo orders and trading bots, such as iceberg, recurring buy and twap | ||
/// </summary> | ||
[Map("pending_algos")] | ||
PendingAlgos, | ||
/// <summary> | ||
/// Isolated margin (quick margin and manual transfers | ||
/// </summary> | ||
[Map("isolated_margin")] | ||
IsolatedMargin, | ||
/// <summary> | ||
/// Isolated contract (manual transfers | ||
/// </summary> | ||
[Map("isolated_contract")] | ||
IsolatedContract, | ||
/// <summary> | ||
/// Contract positions in hedge mode | ||
/// </summary> | ||
[Map("contract_long_short")] | ||
ContractLongShort, | ||
/// <summary> | ||
/// Cross margin positions | ||
/// </summary> | ||
[Map("cross_margin")] | ||
CrossMargin, | ||
/// <summary> | ||
/// Cross options buyer | ||
/// </summary> | ||
[Map("cross_option_buyer")] | ||
CrossOptionBuyer, | ||
/// <summary> | ||
/// Isolated options (only applicable to spot mode | ||
/// </summary> | ||
[Map("isolated_option")] | ||
IsolatedOption, | ||
/// <summary> | ||
/// Positions with trial funds | ||
/// </summary> | ||
[Map("growth_fund")] | ||
GrowthFund, | ||
/// <summary> | ||
/// All positions | ||
/// </summary> | ||
[Map("all_positions")] | ||
AllPositions, | ||
/// <summary> | ||
/// Copy trader and customize lead trader can only use spot mode or spot and futures mode | ||
/// </summary> | ||
[Map("spot_lead_copy_only_simple_single")] | ||
SpotLeadCopyOnlySimpleSingle, | ||
/// <summary> | ||
/// Spot customize copy trading | ||
/// </summary> | ||
[Map("stop_spot_custom")] | ||
StopSpotCustom, | ||
/// <summary> | ||
/// Contract customize copy trading | ||
/// </summary> | ||
[Map("stop_futures_custom")] | ||
StopFuturesCustom, | ||
/// <summary> | ||
/// Lead trader can not switch to portfolio margin mode | ||
/// </summary> | ||
[Map("lead_portfolio")] | ||
LeadPortfolio, | ||
/// <summary> | ||
/// You can not switch to spot mode when having smart contract sync | ||
/// </summary> | ||
[Map("futures_smart_sync")] | ||
FuturesSmartSync, | ||
/// <summary> | ||
/// Vip loan | ||
/// </summary> | ||
[Map("vip_fixed_loan")] | ||
VipFixedLoan, | ||
/// <summary> | ||
/// Borrowings | ||
/// </summary> | ||
[Map("repay_borrowings")] | ||
RepayBorrowings, | ||
/// <summary> | ||
/// Due to compliance restrictions, margin trading services are unavailable | ||
/// </summary> | ||
[Map("compliance_restriction")] | ||
ComplianceRestriction, | ||
/// <summary> | ||
/// Due to compliance restrictions, margin trading services are unavailable. if you are not a resident of this region, please complete kyc2 identity verification. | ||
/// </summary> | ||
[Map("compliance_kyc2")] | ||
ComplianceKyc2, | ||
} | ||
|
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.