From 8c97c61d9386bd9fb449dcc1322553390cce95eb Mon Sep 17 00:00:00 2001 From: Kwonhyukjoon Date: Tue, 27 Jun 2023 14:21:56 +0900 Subject: [PATCH] [APP-781] Update neutron vesting amount calculating --- .../io/cosmostaion/network/res/neutron/ResVestingData.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/wannabit/io/cosmostaion/network/res/neutron/ResVestingData.kt b/app/src/main/java/wannabit/io/cosmostaion/network/res/neutron/ResVestingData.kt index feef8f1e4..2cc04c15e 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/network/res/neutron/ResVestingData.kt +++ b/app/src/main/java/wannabit/io/cosmostaion/network/res/neutron/ResVestingData.kt @@ -5,8 +5,8 @@ import java.math.BigDecimal data class ResVestingData(val allocated_amount: String?, val withdrawn_amount: String?, val schedule: Schedule?) { fun getVestingAmount(): BigDecimal? { - return if (allocated_amount != null) { - BigDecimal(allocated_amount) + return if (allocated_amount != null && withdrawn_amount != null) { + BigDecimal(allocated_amount).subtract(BigDecimal(withdrawn_amount)) } else { BigDecimal.ZERO }