package org.knowm.xchange.bitbay.v3.service;

import java.io.IOException;
import java.util.UUID;
import java.util.regex.Pattern;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.bitbay.v3.dto.trade.BitbayUserTrades;
import org.knowm.xchange.bitbay.v3.dto.trade.BitbayUserTradesQuery;
import org.knowm.xchange.exceptions.ExchangeException;
import org.knowm.xchange.utils.ObjectMapperHelper;

/** @author walec51 */
public class BitbayTradeServiceRaw extends BitbayBaseService {

  private static final Pattern WHITESPACES = Pattern.compile("\\s\\s");

  BitbayTradeServiceRaw(Exchange exchange) {
    super(exchange);
  }

  public BitbayUserTrades getBitbayTransactions(BitbayUserTradesQuery query)
      throws IOException, ExchangeException {
    String jsonQuery = ObjectMapperHelper.toJSON(query);
    jsonQuery = WHITESPACES.matcher(jsonQuery).replaceAll("");
    BitbayUserTrades response =
        bitbayAuthenticated.getTransactionHistory(
            apiKey, sign, exchange.getNonceFactory(), UUID.randomUUID(), jsonQuery);
    checkError(response);
    return response;
  }
}

@@ -94,40 +94,8 @@
 ID;%0A
-import java.util.regex.Pattern;%0A
 impo
@@ -125,16 +125,16 @@
 change;%0A
+
 import o
@@ -454,81 +454,8 @@
  %7B%0A%0A
-  private static final Pattern WHITESPACES = Pattern.compile(%22%5C%5Cs%5C%5Cs%22);%0A%0A
   Bi
@@ -648,16 +648,22 @@
 n %7B%0A    
+final 
 String j
@@ -694,16 +694,23 @@
 elper.to
+Compact
 JSON(que
@@ -722,70 +722,13 @@
     
-jsonQuery = WHITESPACES.matcher(jsonQuery).replaceAll(%22%22);%0A   
+final
  Bit

Use compact JSON instead of replacing whitespaces in String