mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Merge branch '7-more-grpcproto-comments' into 8-remove-trdstats-service
This commit is contained in:
commit
a1f059ded4
@ -204,7 +204,7 @@ public class CoreApi {
|
|||||||
Consumer<Offer> resultHandler) {
|
Consumer<Offer> resultHandler) {
|
||||||
coreOffersService.createAndPlaceOffer(currencyCode,
|
coreOffersService.createAndPlaceOffer(currencyCode,
|
||||||
directionAsString,
|
directionAsString,
|
||||||
price,
|
useMarketBasedPrice ? "0" : price,
|
||||||
useMarketBasedPrice,
|
useMarketBasedPrice,
|
||||||
marketPriceMargin,
|
marketPriceMargin,
|
||||||
amountAsLong,
|
amountAsLong,
|
||||||
|
@ -259,7 +259,7 @@ class CoreOffersService {
|
|||||||
String offerId = getRandomOfferId();
|
String offerId = getRandomOfferId();
|
||||||
OfferDirection direction = OfferDirection.valueOf(directionAsString.toUpperCase());
|
OfferDirection direction = OfferDirection.valueOf(directionAsString.toUpperCase());
|
||||||
Coin amount = Coin.valueOf(amountAsLong);
|
Coin amount = Coin.valueOf(amountAsLong);
|
||||||
Coin minAmount = Coin.valueOf(minAmountAsLong);
|
Coin minAmount = minAmountAsLong == 0 ? amount : Coin.valueOf(minAmountAsLong);
|
||||||
Price price = Price.valueOf(currencyCode, priceStringToLong(priceAsString, currencyCode));
|
Price price = Price.valueOf(currencyCode, priceStringToLong(priceAsString, currencyCode));
|
||||||
openBsqSwapOfferService.requestNewOffer(offerId,
|
openBsqSwapOfferService.requestNewOffer(offerId,
|
||||||
direction,
|
direction,
|
||||||
@ -294,7 +294,7 @@ class CoreOffersService {
|
|||||||
OfferDirection direction = OfferDirection.valueOf(directionAsString.toUpperCase());
|
OfferDirection direction = OfferDirection.valueOf(directionAsString.toUpperCase());
|
||||||
Price price = Price.valueOf(upperCaseCurrencyCode, priceStringToLong(priceAsString, upperCaseCurrencyCode));
|
Price price = Price.valueOf(upperCaseCurrencyCode, priceStringToLong(priceAsString, upperCaseCurrencyCode));
|
||||||
Coin amount = Coin.valueOf(amountAsLong);
|
Coin amount = Coin.valueOf(amountAsLong);
|
||||||
Coin minAmount = Coin.valueOf(minAmountAsLong);
|
Coin minAmount = minAmountAsLong == 0 ? amount : Coin.valueOf(minAmountAsLong);
|
||||||
Coin useDefaultTxFee = Coin.ZERO;
|
Coin useDefaultTxFee = Coin.ZERO;
|
||||||
|
|
||||||
// Almost ready to call createOfferService.createAndGetOffer(), but first:
|
// Almost ready to call createOfferService.createAndGetOffer(), but first:
|
||||||
|
@ -68,7 +68,7 @@ class EditOfferValidator {
|
|||||||
int newEnable,
|
int newEnable,
|
||||||
EditOfferRequest.EditType editType) {
|
EditOfferRequest.EditType editType) {
|
||||||
this.currentlyOpenOffer = currentlyOpenOffer;
|
this.currentlyOpenOffer = currentlyOpenOffer;
|
||||||
this.newPrice = newPrice;
|
this.newPrice = newPrice.isBlank() ? "0" : newPrice;
|
||||||
// The client cannot determine what offer.isUseMarketBasedPrice should be
|
// The client cannot determine what offer.isUseMarketBasedPrice should be
|
||||||
// when editType = ACTIVATION_STATE_ONLY. Override newIsUseMarketBasedPrice
|
// when editType = ACTIVATION_STATE_ONLY. Override newIsUseMarketBasedPrice
|
||||||
// param for the ACTIVATION_STATE_ONLY case.
|
// param for the ACTIVATION_STATE_ONLY case.
|
||||||
@ -78,12 +78,12 @@ class EditOfferValidator {
|
|||||||
? currentlyOpenOffer.getOffer().isUseMarketBasedPrice()
|
? currentlyOpenOffer.getOffer().isUseMarketBasedPrice()
|
||||||
: newIsUseMarketBasedPrice;
|
: newIsUseMarketBasedPrice;
|
||||||
this.newMarketPriceMargin = newMarketPriceMargin;
|
this.newMarketPriceMargin = newMarketPriceMargin;
|
||||||
this.newTriggerPrice = newTriggerPrice;
|
this.newTriggerPrice = newTriggerPrice.isBlank() ? "0" : newTriggerPrice;
|
||||||
this.newEnable = newEnable;
|
this.newEnable = newEnable;
|
||||||
this.editType = editType;
|
this.editType = editType;
|
||||||
|
|
||||||
this.isZeroEditedFixedPriceString = new BigDecimal(newPrice).doubleValue() == 0;
|
this.isZeroEditedFixedPriceString = new BigDecimal(this.newPrice).doubleValue() == 0;
|
||||||
this.isZeroEditedTriggerPrice = new BigDecimal(newTriggerPrice).equals(ZERO);
|
this.isZeroEditedTriggerPrice = new BigDecimal(this.newTriggerPrice).equals(ZERO);
|
||||||
}
|
}
|
||||||
|
|
||||||
EditOfferValidator validate() {
|
EditOfferValidator validate() {
|
||||||
|
Loading…
Reference in New Issue
Block a user