types: add FuturesAccountInfo

This commit is contained in:
austin362667 2021-12-21 23:56:59 +08:00
parent f5bbe29ac6
commit c507722745

View File

@ -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),