From 91f26cc501b185782450a89b42210c1f23561a7d Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 5 Dec 2021 15:24:17 +0800 Subject: [PATCH] types: add account types for futures --- pkg/types/account.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pkg/types/account.go b/pkg/types/account.go index a42d06c6b..aaccf29f6 100644 --- a/pkg/types/account.go +++ b/pkg/types/account.go @@ -41,11 +41,11 @@ func (b Balance) String() string { } type Asset struct { - Currency string `json:"currency"` - Total fixedpoint.Value `json:"total"` - InUSD fixedpoint.Value `json:"inUSD"` - InBTC fixedpoint.Value `json:"inBTC"` - Time time.Time `json:"time"` + Currency string `json:"currency"` + Total fixedpoint.Value `json:"total"` + InUSD fixedpoint.Value `json:"inUSD"` + InBTC fixedpoint.Value `json:"inBTC"` + Time time.Time `json:"time"` } type AssetMap map[string]Asset @@ -181,10 +181,17 @@ func (m BalanceMap) Print() { } } +type AccountType string + +const ( + AccountTypeFutures = AccountType("futures") + AccountTypeSpot = AccountType("spot") +) + type Account struct { sync.Mutex `json:"-"` - AccountType string `json:"accountType,omitempty"` + AccountType AccountType `json:"accountType,omitempty"` MakerFeeRate fixedpoint.Value `json:"makerFeeRate,omitempty"` TakerFeeRate fixedpoint.Value `json:"takerFeeRate,omitempty"`