Search in sources :

Example 1 with OfferAvailabilityProtocol

use of bisq.core.offer.availability.OfferAvailabilityProtocol in project bisq-core by bisq-network.

the class Offer method checkOfferAvailability.

// /////////////////////////////////////////////////////////////////////////////////////////
// Availability
// /////////////////////////////////////////////////////////////////////////////////////////
public void checkOfferAvailability(OfferAvailabilityModel model, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {
    availabilityProtocol = new OfferAvailabilityProtocol(model, () -> {
        cancelAvailabilityRequest();
        resultHandler.handleResult();
    }, (errorMessage) -> {
        if (availabilityProtocol != null)
            availabilityProtocol.cancel();
        log.error(errorMessage);
        errorMessageHandler.handleErrorMessage(errorMessage);
    });
    availabilityProtocol.sendOfferAvailabilityRequest();
}
Also used : Altcoin(bisq.core.monetary.Altcoin) PubKeyRing(bisq.common.crypto.PubKeyRing) Setter(lombok.Setter) OfferAvailabilityModel(bisq.core.offer.availability.OfferAvailabilityModel) Getter(lombok.Getter) Utilities(bisq.common.util.Utilities) Coin(org.bitcoinj.core.Coin) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) Date(java.util.Date) Volume(bisq.core.monetary.Volume) PersistablePayload(bisq.common.proto.persistable.PersistablePayload) PB(io.bisq.generated.protobuffer.PB) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) TradePriceOutOfToleranceException(bisq.core.exceptions.TradePriceOutOfToleranceException) ReadOnlyStringProperty(javafx.beans.property.ReadOnlyStringProperty) Map(java.util.Map) CurrencyUtil(bisq.core.locale.CurrencyUtil) ErrorMessageHandler(bisq.common.handlers.ErrorMessageHandler) NetworkPayload(bisq.common.proto.network.NetworkPayload) OfferAvailabilityProtocol(bisq.core.offer.availability.OfferAvailabilityProtocol) Nullable(javax.annotation.Nullable) ObjectProperty(javafx.beans.property.ObjectProperty) ResultHandler(bisq.common.handlers.ResultHandler) JsonExclude(bisq.common.util.JsonExclude) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) Fiat(org.bitcoinj.utils.Fiat) PublicKey(java.security.PublicKey) MathUtils(bisq.common.util.MathUtils) PaymentMethod(bisq.core.payment.payload.PaymentMethod) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) PriceFeedService(bisq.core.provider.price.PriceFeedService) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) NodeAddress(bisq.network.p2p.NodeAddress) Price(bisq.core.monetary.Price) Optional(java.util.Optional) KeyRing(bisq.common.crypto.KeyRing) StringProperty(javafx.beans.property.StringProperty) MarketPrice(bisq.core.provider.price.MarketPrice) OfferAvailabilityProtocol(bisq.core.offer.availability.OfferAvailabilityProtocol)

Aggregations

KeyRing (bisq.common.crypto.KeyRing)1 PubKeyRing (bisq.common.crypto.PubKeyRing)1 ErrorMessageHandler (bisq.common.handlers.ErrorMessageHandler)1 ResultHandler (bisq.common.handlers.ResultHandler)1 NetworkPayload (bisq.common.proto.network.NetworkPayload)1 PersistablePayload (bisq.common.proto.persistable.PersistablePayload)1 JsonExclude (bisq.common.util.JsonExclude)1 MathUtils (bisq.common.util.MathUtils)1 Utilities (bisq.common.util.Utilities)1 TradePriceOutOfToleranceException (bisq.core.exceptions.TradePriceOutOfToleranceException)1 CurrencyUtil (bisq.core.locale.CurrencyUtil)1 Altcoin (bisq.core.monetary.Altcoin)1 Price (bisq.core.monetary.Price)1 Volume (bisq.core.monetary.Volume)1 OfferAvailabilityModel (bisq.core.offer.availability.OfferAvailabilityModel)1 OfferAvailabilityProtocol (bisq.core.offer.availability.OfferAvailabilityProtocol)1 PaymentMethod (bisq.core.payment.payload.PaymentMethod)1 MarketPrice (bisq.core.provider.price.MarketPrice)1 PriceFeedService (bisq.core.provider.price.PriceFeedService)1 NodeAddress (bisq.network.p2p.NodeAddress)1