all: add AccountTypeIsolatedMargin

This commit is contained in:
c9s 2022-04-22 14:45:45 +08:00
parent 98a696a7d0
commit a1c9bd7ec8
2 changed files with 7 additions and 6 deletions

View File

@ -326,7 +326,7 @@ func (e *Exchange) queryIsolatedMarginAccount(ctx context.Context) (*types.Accou
}
a := &types.Account{
AccountType: types.AccountTypeMargin,
AccountType: types.AccountTypeIsolatedMargin,
IsolatedMarginInfo: toGlobalIsolatedMarginAccountInfo(marginAccount), // In binance GO api, Account define marginAccount info which mantain []*AccountAsset and []*AccountPosition.
}

View File

@ -230,9 +230,10 @@ func (m BalanceMap) Print() {
type AccountType string
const (
AccountTypeFutures = AccountType("futures")
AccountTypeMargin = AccountType("margin")
AccountTypeSpot = AccountType("spot")
AccountTypeFutures = AccountType("futures")
AccountTypeMargin = AccountType("margin")
AccountTypeIsolatedMargin = AccountType("isolated_margin")
AccountTypeSpot = AccountType("spot")
)
type Account struct {
@ -251,8 +252,8 @@ type Account struct {
MarginLevel fixedpoint.Value `json:"marginLevel,omitempty"`
MarginTolerance fixedpoint.Value `json:"marginTolerance,omitempty"`
BorrowEnabled bool `json:"borrowEnabled,omitempty"`
TransferEnabled bool `json:"transferEnabled,omitempty"`
BorrowEnabled bool `json:"borrowEnabled,omitempty"`
TransferEnabled bool `json:"transferEnabled,omitempty"`
// isolated margin related fields
// LiquidationPrice is only used when account is in the isolated margin mode