From c507722745632ee051c8489925bcfec5994ed7fd Mon Sep 17 00:00:00 2001 From: austin362667 Date: Tue, 21 Dec 2021 23:56:59 +0800 Subject: [PATCH] types: add FuturesAccountInfo --- pkg/types/account.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkg/types/account.go b/pkg/types/account.go index 21ae4640b..31015b0cf 100644 --- a/pkg/types/account.go +++ b/pkg/types/account.go @@ -206,6 +206,7 @@ type Account struct { sync.Mutex `json:"-"` AccountType AccountType `json:"accountType,omitempty"` + FuturesInfo *FuturesAccountInfo MakerFeeRate fixedpoint.Value `json:"makerFeeRate,omitempty"` TakerFeeRate fixedpoint.Value `json:"takerFeeRate,omitempty"` @@ -216,9 +217,30 @@ type Account struct { TotalAccountValue fixedpoint.Value `json:"totalAccountValue,omitempty"` + // Futures fields + CanDeposit bool `json:"canDeposit"` + CanTrade bool `json:"canTrade"` + CanWithdraw bool `json:"canWithdraw"` + balances BalanceMap } +type FuturesAccountInfo struct { + // Futures fields + Assets []FuturesUserAsset `json:"assets"` + FeeTier int `json:"feeTier"` + MaxWithdrawAmount fixedpoint.Value `json:"maxWithdrawAmount"` + Positions PositionMap `json:"positions"` + TotalInitialMargin fixedpoint.Value `json:"totalInitialMargin"` + TotalMaintMargin fixedpoint.Value `json:"totalMaintMargin"` + TotalMarginBalance fixedpoint.Value `json:"totalMarginBalance"` + TotalOpenOrderInitialMargin fixedpoint.Value `json:"totalOpenOrderInitialMargin"` + TotalPositionInitialMargin fixedpoint.Value `json:"totalPositionInitialMargin"` + TotalUnrealizedProfit fixedpoint.Value `json:"totalUnrealizedProfit"` + TotalWalletBalance fixedpoint.Value `json:"totalWalletBalance"` + UpdateTime int64 `json:"updateTime"` +} + func NewAccount() *Account { return &Account{ balances: make(BalanceMap),