Skip to content

Commit 079be18

Browse files
authored
feat: add copyTrading field support for GetInstrumentsInfo API (#206)
1 parent 1d7cd29 commit 079be18

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

v5_enum.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,31 @@ const (
317317
WithdrawStatusV5BlockchainConfirmed = WithdrawStatusV5("BlockchainConfirmed")
318318
)
319319

320+
// IsLowestRisk :
320321
type IsLowestRisk int
321322

322323
const (
323-
IsLowestRiskFalse = IsLowestRisk(0)
324-
IsLowestRiskTrue = IsLowestRisk(1)
324+
// IsLowestRiskNo :
325+
IsLowestRiskNo = IsLowestRisk(0)
326+
// IsLowestRiskYes :
327+
IsLowestRiskYes = IsLowestRisk(1)
325328
)
326329

330+
// CopyTradingSupport : Indicates whether the trading pair supports copy trading and for which account types
331+
type CopyTradingSupport string
332+
333+
const (
334+
// CopyTradingSupportNone : Regardless of normal account or UTA account, this trading pair does not support copy trading
335+
CopyTradingSupportNone = CopyTradingSupport("none")
336+
// CopyTradingSupportBoth : For both normal account and UTA account, this trading pair supports copy trading
337+
CopyTradingSupportBoth = CopyTradingSupport("both")
338+
// CopyTradingSupportUtaOnly : Only for UTA account, this trading pair supports copy trading
339+
CopyTradingSupportUtaOnly = CopyTradingSupport("utaOnly")
340+
// CopyTradingSupportNormalOnly : Only for normal account, this trading pair supports copy trading
341+
CopyTradingSupportNormalOnly = CopyTradingSupport("normalOnly")
342+
)
343+
344+
// CollateralSwitchV5 :
327345
type CollateralSwitchV5 string
328346

329347
const (

v5_market_service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ type V5GetInstrumentsInfoLinearInverseItem struct {
418418
LotSizeFilter LinearInverseLotSizeFilterV5 `json:"lotSizeFilter"`
419419
UnifiedMarginTrade bool `json:"unifiedMarginTrade"`
420420
FundingInterval int `json:"fundingInterval"`
421+
CopyTrading CopyTradingSupport `json:"copyTrading"`
421422
}
422423

423424
type LinearInversePriceFilterV5 struct {

v5_market_service_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ func TestV5Market_GetInstrumentsInfo(t *testing.T) {
245245
},
246246
"unifiedMarginTrade": true,
247247
"fundingInterval": 480,
248+
"copyTrading": CopyTradingSupportBoth,
248249
},
249250
},
250251
},

0 commit comments

Comments
 (0)