types: remove exchange specific fields

This commit is contained in:
austin362667 2021-12-23 23:16:20 +08:00
parent 6c1642eed6
commit df62683313
2 changed files with 15 additions and 27 deletions

View File

@ -217,7 +217,6 @@ type Account struct {
TotalAccountValue fixedpoint.Value `json:"totalAccountValue,omitempty"`
// Futures fields
CanDeposit bool `json:"canDeposit"`
CanTrade bool `json:"canTrade"`
CanWithdraw bool `json:"canWithdraw"`
@ -227,18 +226,18 @@ type Account struct {
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"`
Assets map[Asset]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 {

View File

@ -39,20 +39,9 @@ type Position struct {
ExchangeFeeRates map[ExchangeName]ExchangeFee `json:"exchangeFeeRates"`
// Futures data fields
Isolated bool `json:"isolated"`
InitialMargin fixedpoint.Value `json:"initialMargin"`
MaintMargin fixedpoint.Value `json:"maintMargin"`
OpenOrderInitialMargin fixedpoint.Value `json:"openOrderInitialMargin"`
PositionInitialMargin fixedpoint.Value `json:"positionInitialMargin"`
UnrealizedProfit fixedpoint.Value `json:"unrealizedProfit"`
EntryPrice fixedpoint.Value `json:"entryPrice"`
MaxNotional fixedpoint.Value `json:"maxNotional"`
PositionSide string `json:"positionSide"`
PositionAmt fixedpoint.Value `json:"positionAmt"`
Notional fixedpoint.Value `json:"notional"`
IsolatedWallet fixedpoint.Value `json:"isolatedWallet"`
UpdateTime int64 `json:"updateTime"`
PositionRisk PositionRisk
Isolated bool `json:"isolated"`
UpdateTime int64 `json:"updateTime"`
PositionRisk *PositionRisk
sync.Mutex
}