Skip to content

Commit

Permalink
Merge pull request #1750 from DrColver/filter-currencies-on-create-offer
Browse files Browse the repository at this point in the history
Allow only currencies with price feed when creating offers
  • Loading branch information
alvasw authored Mar 11, 2024
2 parents 923f617 + b671bd6 commit a8c0403
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package bisq.desktop.main.content.bisq_easy.trade_wizard.market;

import bisq.bonded_roles.market_price.MarketPriceService;
import bisq.chat.ChatMessage;
import bisq.chat.ChatService;
import bisq.chat.bisqeasy.offerbook.BisqEasyOfferbookChannel;
Expand Down Expand Up @@ -48,13 +49,15 @@ public class TradeWizardMarketController implements Controller {
private final Runnable onNextHandler;
private final BisqEasyOfferbookChannelService bisqEasyOfferbookChannelService;
private final BisqEasyOfferbookSelectionService bisqEasyOfferbookSelectionService;
private final MarketPriceService marketPriceService;
private Subscription searchTextPin;

public TradeWizardMarketController(ServiceProvider serviceProvider, Runnable onNextHandler) {
this.onNextHandler = onNextHandler;
chatService = serviceProvider.getChatService();
bisqEasyOfferbookChannelService = chatService.getBisqEasyOfferbookChannelService();
bisqEasyOfferbookSelectionService = chatService.getBisqEasyOfferbookChannelSelectionService();
marketPriceService = serviceProvider.getBondedRolesService().getMarketPriceService();
model = new TradeWizardMarketModel();
view = new TradeWizardMarketView(model, this);
}
Expand Down Expand Up @@ -88,6 +91,7 @@ public void onActivate() {
}

model.getListItems().setAll(MarketRepository.getAllFiatMarkets().stream()
.filter(market -> marketPriceService.getMarketPriceByCurrencyMap().containsKey(market))
.map(market -> {
Set<BisqEasyOfferbookMessage> allMessages = bisqEasyOfferbookChannelService.getChannels().stream()
.filter(channel -> channel.getMarket().equals(market))
Expand Down

0 comments on commit a8c0403

Please sign in to comment.