Skip to content

Commit

Permalink
Merge pull request #124 from excelsia/balance-api-minor-change
Browse files Browse the repository at this point in the history
balance API change
  • Loading branch information
ncying authored Sep 17, 2018
2 parents b190e8d + 8209b26 commit 080b8de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/scala/scorex/api/http/AddressApiRoute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import play.api.libs.json._
import scorex.account.{Address, PublicKeyAccount}
import scorex.crypto.EllipticCurveImpl
import scorex.crypto.encode.Base58
import scorex.transaction.PoSCalc
import vee.spos.SPoSCalc
import vee.wallet.Wallet

import scala.util.{Failure, Success, Try}
Expand Down Expand Up @@ -254,9 +254,10 @@ case class AddressApiRoute(settings: RestAPISettings, wallet: Wallet, state: Sta
BalanceDetails(
account.address,
portfolio.balance,
PoSCalc.generatingBalance(state, functionalitySettings, account, state.height),
SPoSCalc.mintingBalance(state, functionalitySettings, account, state.height),
portfolio.balance - portfolio.leaseInfo.leaseOut,
state.effectiveBalance(account))
state.effectiveBalance(account),
state.height)
}
}

Expand Down Expand Up @@ -331,7 +332,7 @@ object AddressApiRoute {

implicit val balanceFormat: Format[Balance] = Json.format

case class BalanceDetails(address: String, regular: Long, generating: Long, available: Long, effective: Long)
case class BalanceDetails(address: String, regular: Long, mintingAverage: Long, available: Long, effective: Long, height: Int)

implicit val balanceDetailsFormat: Format[BalanceDetails] = Json.format

Expand Down
Empty file modified start_nodes.sh
100644 → 100755
Empty file.

0 comments on commit 080b8de

Please sign in to comment.