From 3d536efec8ff0629d8917eb92ca35498ee57979f Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 5 Dec 2021 15:30:58 +0800 Subject: [PATCH] types: extend FuturesSettings fields for isolated margin --- pkg/types/margin.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/types/margin.go b/pkg/types/margin.go index 268ea6faa..82bf54a5c 100644 --- a/pkg/types/margin.go +++ b/pkg/types/margin.go @@ -8,14 +8,23 @@ type FuturesExchange interface { type FuturesSettings struct { IsFutures bool + IsIsolatedFutures bool + IsolatedFuturesSymbol string +} + +func (s FuturesSettings) GetFuturesSettings() FuturesSettings { + return s } func (s *FuturesSettings) UseFutures() { s.IsFutures = true } -func (s FuturesSettings) GetFuturesSettings() FuturesSettings { - return s +func (s *FuturesSettings) UseIsolatedFutures(symbol string) { + s.IsFutures = true + s.IsIsolatedFutures = true + s.IsolatedFuturesSymbol = symbol + }