diff --git a/cli/src/main/java/bisq/cli/CliMain.java b/cli/src/main/java/bisq/cli/CliMain.java index bd57db2e9c..7a52f9a4cc 100644 --- a/cli/src/main/java/bisq/cli/CliMain.java +++ b/cli/src/main/java/bisq/cli/CliMain.java @@ -781,7 +781,7 @@ public class CliMain { stream.println(); stream.format(rowFormat, editoffer.name(), "--offer-id= \\", "Edit offer with id"); stream.format(rowFormat, "", "[--fixed-price=] \\", ""); - stream.format(rowFormat, "", "[--market-price=margin=] \\", ""); + stream.format(rowFormat, "", "[--market-price-margin=] \\", ""); stream.format(rowFormat, "", "[--trigger-price=] \\", ""); stream.format(rowFormat, "", "[--enabled=]", ""); stream.println(); diff --git a/cli/src/main/java/bisq/cli/TradeFormat.java b/cli/src/main/java/bisq/cli/TradeFormat.java index dbf8dbf4b8..57248f4da0 100644 --- a/cli/src/main/java/bisq/cli/TradeFormat.java +++ b/cli/src/main/java/bisq/cli/TradeFormat.java @@ -159,12 +159,12 @@ public class TradeFormat { private static final Function priceFormat = (t) -> t.getOffer().getBaseCurrencyCode().equals("BTC") ? formatPrice(t.getTradePrice()) - : formatCryptoCurrencyPrice(t.getOffer().getPrice()); + : formatCryptoCurrencyPrice(t.getTradePrice()); private static final Function amountFormat = (t) -> t.getOffer().getBaseCurrencyCode().equals("BTC") ? formatSatoshis(t.getTradeAmountAsLong()) - : formatCryptoCurrencyOfferVolume(t.getOffer().getVolume()); + : formatCryptoCurrencyOfferVolume(t.getTradeVolume()); private static final BiFunction makerTakerMinerTxFeeFormat = (t, isTaker) -> { if (isTaker) { @@ -188,7 +188,7 @@ public class TradeFormat { private static final Function tradeCostFormat = (t) -> t.getOffer().getBaseCurrencyCode().equals("BTC") - ? formatOfferVolume(t.getOffer().getVolume()) + ? formatOfferVolume(t.getTradeVolume()) : formatSatoshis(t.getTradeAmountAsLong()); private static final BiFunction bsqReceiveAddress = (t, showBsqBuyerAddress) -> { diff --git a/core/src/main/java/bisq/core/api/model/TradeInfo.java b/core/src/main/java/bisq/core/api/model/TradeInfo.java index 5779baf348..38bf15256d 100644 --- a/core/src/main/java/bisq/core/api/model/TradeInfo.java +++ b/core/src/main/java/bisq/core/api/model/TradeInfo.java @@ -51,6 +51,7 @@ public class TradeInfo implements Payload { private final String payoutTxId; private final long tradeAmountAsLong; private final long tradePrice; + private final long tradeVolume; private final String tradingPeerNodeAddress; private final String state; private final String phase; @@ -78,6 +79,7 @@ public class TradeInfo implements Payload { this.payoutTxId = builder.payoutTxId; this.tradeAmountAsLong = builder.tradeAmountAsLong; this.tradePrice = builder.tradePrice; + this.tradeVolume = builder.tradeVolume; this.tradingPeerNodeAddress = builder.tradingPeerNodeAddress; this.state = builder.state; this.phase = builder.phase; @@ -133,6 +135,7 @@ public class TradeInfo implements Payload { .withPayoutTxId(trade.getPayoutTxId()) .withTradeAmountAsLong(trade.getTradeAmountAsLong()) .withTradePrice(trade.getTradePrice().getValue()) + .withTradeVolume(trade.getTradeVolume() == null ? 0 : trade.getTradeVolume().getValue()) .withTradingPeerNodeAddress(Objects.requireNonNull( trade.getTradingPeerNodeAddress()).getHostNameWithoutPostFix()) .withState(trade.getState().name()) @@ -169,6 +172,7 @@ public class TradeInfo implements Payload { .setPayoutTxId(payoutTxId == null ? "" : payoutTxId) .setTradeAmountAsLong(tradeAmountAsLong) .setTradePrice(tradePrice) + .setTradeVolume(tradeVolume) .setTradingPeerNodeAddress(tradingPeerNodeAddress) .setState(state) .setPhase(phase) @@ -199,6 +203,7 @@ public class TradeInfo implements Payload { .withPayoutTxId(proto.getPayoutTxId()) .withTradeAmountAsLong(proto.getTradeAmountAsLong()) .withTradePrice(proto.getTradePrice()) + .withTradeVolume(proto.getTradeVolume()) .withTradePeriodState(proto.getTradePeriodState()) .withState(proto.getState()) .withPhase(proto.getPhase()) @@ -234,6 +239,7 @@ public class TradeInfo implements Payload { private String payoutTxId; private long tradeAmountAsLong; private long tradePrice; + private long tradeVolume; private String tradingPeerNodeAddress; private String state; private String phase; @@ -312,6 +318,11 @@ public class TradeInfo implements Payload { return this; } + public TradeInfoBuilder withTradeVolume(long tradeVolume) { + this.tradeVolume = tradeVolume; + return this; + } + public TradeInfoBuilder withTradePeriodState(String tradePeriodState) { this.tradePeriodState = tradePeriodState; return this; @@ -392,6 +403,7 @@ public class TradeInfo implements Payload { ", payoutTxId='" + payoutTxId + '\'' + "\n" + ", tradeAmountAsLong='" + tradeAmountAsLong + '\'' + "\n" + ", tradePrice='" + tradePrice + '\'' + "\n" + + ", tradeVolume='" + tradeVolume + '\'' + "\n" + ", tradingPeerNodeAddress='" + tradingPeerNodeAddress + '\'' + "\n" + ", state='" + state + '\'' + "\n" + ", phase='" + phase + '\'' + "\n" + diff --git a/proto/src/main/proto/grpc.proto b/proto/src/main/proto/grpc.proto index 21221eda45..84e6ee18ad 100644 --- a/proto/src/main/proto/grpc.proto +++ b/proto/src/main/proto/grpc.proto @@ -409,6 +409,7 @@ message TradeInfo { bool isWithdrawn = 23; string contractAsJson = 24; ContractInfo contract = 25; + uint64 tradeVolume = 26; } message ContractInfo {