// First we check if offer is still available then we create the trade with the protocol public void onTakeOffer( Coin amount, Offer offer, String paymentAccountId, TradeResultHandler tradeResultHandler) { final OfferAvailabilityModel model = getOfferAvailabilityModel(offer); offer.checkOfferAvailability( model, () -> { if (offer.getState() == Offer.State.AVAILABLE) createTrade(amount, offer, paymentAccountId, model, tradeResultHandler); }); }
public void checkOfferAvailability(Offer offer, ResultHandler resultHandler) { offer.checkOfferAvailability(getOfferAvailabilityModel(offer), resultHandler); }