max: fix balance field for api

This commit is contained in:
c9s 2022-07-08 17:28:07 +08:00
parent 59fcef0b6d
commit e9faf34b5e
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 5 additions and 3 deletions

View File

@ -608,7 +608,7 @@ func (e *Exchange) QueryAccountBalances(ctx context.Context) (types.BalanceMap,
Available: b.Balance,
Locked: b.Locked,
NetAsset: b.Balance.Add(b.Locked).Sub(b.Debt),
Borrowed: b.Debt, // TODO: Replace this with borrow in the newer version
Borrowed: b.Borrowed,
Interest: b.Interest,
}
}

View File

@ -22,8 +22,10 @@ type Account struct {
Locked fixedpoint.Value `json:"locked"`
// v3 fields for M wallet
Debt fixedpoint.Value `json:"debt"`
Interest fixedpoint.Value `json:"interest"`
Debt fixedpoint.Value `json:"debt"`
Principal fixedpoint.Value `json:"principal"`
Borrowed fixedpoint.Value `json:"borrowed"`
Interest fixedpoint.Value `json:"interest"`
// v2 fields
FiatCurrency string `json:"fiat_currency"`