grpc offer info returns atomic units

This commit is contained in:
woodser 2022-12-23 09:30:19 +00:00
parent fb1b8f8bd8
commit a21628ad0d

View file

@ -21,6 +21,7 @@ import bisq.core.api.model.builder.OfferInfoBuilder;
import bisq.core.monetary.Price; import bisq.core.monetary.Price;
import bisq.core.offer.Offer; import bisq.core.offer.Offer;
import bisq.core.offer.OpenOffer; import bisq.core.offer.OpenOffer;
import bisq.core.trade.HavenoUtils;
import bisq.common.Payload; import bisq.common.Payload;
import bisq.common.proto.ProtoUtil; import bisq.common.proto.ProtoUtil;
import java.util.Optional; import java.util.Optional;
@ -150,15 +151,15 @@ public class OfferInfo implements Payload {
.withPrice(preciseOfferPrice) .withPrice(preciseOfferPrice)
.withUseMarketBasedPrice(offer.isUseMarketBasedPrice()) .withUseMarketBasedPrice(offer.isUseMarketBasedPrice())
.withMarketPriceMarginPct(marketPriceMarginAsPctLiteral) .withMarketPriceMarginPct(marketPriceMarginAsPctLiteral)
.withAmount(offer.getAmount().value) .withAmount(HavenoUtils.centinerosToAtomicUnits(offer.getAmount().value).longValueExact())
.withMinAmount(offer.getMinAmount().value) .withMinAmount(HavenoUtils.centinerosToAtomicUnits(offer.getMinAmount().value).longValueExact())
.withVolume(roundedVolume) .withVolume(roundedVolume)
.withMinVolume(roundedMinVolume) .withMinVolume(roundedMinVolume)
.withMakerFee(offer.getMakerFee().value) .withMakerFee(HavenoUtils.centinerosToAtomicUnits(offer.getMakerFee().value).longValueExact())
.withTxFee(offer.getTxFee().value) .withTxFee(HavenoUtils.centinerosToAtomicUnits(offer.getTxFee().value).longValueExact())
.withOfferFeePaymentTxId(offer.getOfferFeePaymentTxId()) .withOfferFeePaymentTxId(offer.getOfferFeePaymentTxId())
.withBuyerSecurityDeposit(offer.getBuyerSecurityDeposit().value) .withBuyerSecurityDeposit(HavenoUtils.centinerosToAtomicUnits(offer.getBuyerSecurityDeposit().value).longValueExact())
.withSellerSecurityDeposit(offer.getSellerSecurityDeposit().value) .withSellerSecurityDeposit(HavenoUtils.centinerosToAtomicUnits(offer.getSellerSecurityDeposit().value).longValueExact())
.withPaymentAccountId(offer.getMakerPaymentAccountId()) .withPaymentAccountId(offer.getMakerPaymentAccountId())
.withPaymentMethodId(offer.getPaymentMethod().getId()) .withPaymentMethodId(offer.getPaymentMethod().getId())
.withPaymentMethodShortName(offer.getPaymentMethod().getShortName()) .withPaymentMethodShortName(offer.getPaymentMethod().getShortName())