getMyOffers() does not require asset code

This commit is contained in:
woodser 2023-02-23 09:21:03 -05:00
parent ce579b78ca
commit 1d46818732

View File

@ -288,9 +288,11 @@ public class CoreOffersService {
private boolean offerMatchesDirectionAndCurrency(Offer offer, private boolean offerMatchesDirectionAndCurrency(Offer offer,
String direction, String direction,
String currencyCode) { String currencyCode) {
var offerOfWantedDirection = offer.getDirection().name().equalsIgnoreCase(direction); if ("".equals(direction)) direction = null;
if ("".equals(currencyCode)) currencyCode = null;
var offerOfWantedDirection = direction == null || offer.getDirection().name().equalsIgnoreCase(direction);
var counterAssetCode = isCryptoCurrency(currencyCode) ? offer.getOfferPayload().getBaseCurrencyCode() : offer.getOfferPayload().getCounterCurrencyCode(); // TODO: crypto pairs invert base and counter currencies var counterAssetCode = isCryptoCurrency(currencyCode) ? offer.getOfferPayload().getBaseCurrencyCode() : offer.getOfferPayload().getCounterCurrencyCode(); // TODO: crypto pairs invert base and counter currencies
var offerInWantedCurrency = counterAssetCode.equalsIgnoreCase(currencyCode); var offerInWantedCurrency = currencyCode == null || counterAssetCode.equalsIgnoreCase(currencyCode);
return offerOfWantedDirection && offerInWantedCurrency; return offerOfWantedDirection && offerInWantedCurrency;
} }