Skip to content

Commit

Permalink
Update address balance at a certain time
Browse files Browse the repository at this point in the history
  • Loading branch information
leej1012 committed Dec 19, 2023
1 parent 7b8439c commit e5e6d91
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public Integer queryAddressTxCountInPeriod(String address, Integer startTime, In

@Override
public String queryAddressCertainTimeBalance(String address, Integer timestamp) {
BigDecimal ontBalance = new BigDecimal((String) sdk.getNativeAssetBalance(address).get(ConstantParam.ONT));
BigDecimal ontBalance = new BigDecimal((String) sdk.getNativeAssetBalance(address).get(ConstantParam.ONT)).divide(ConstantParam.NEW_ONT_DECIMAL, 9, RoundingMode.DOWN);
BigDecimal fromAmount = txDetailMapper.selectAssetTransferAmountByAddress(ConstantParam.ONT, address, null, timestamp);
BigDecimal toAmount = txDetailMapper.selectAssetTransferAmountByAddress(ConstantParam.ONT, null, address, timestamp);
BigDecimal certainTimeBalance = ontBalance.add(fromAmount).subtract(toAmount);
Expand Down

0 comments on commit e5e6d91

Please sign in to comment.