package org.knowm.xchange.independentreserve.dto.trade;

import org.knowm.xchange.independentreserve.dto.auth.AuthAggregate;

/**
 * Author: Kamil Zbikowski Date: 4/14/15
 */
public class IndependentReserveOpenOrderRequest extends AuthAggregate {

  public IndependentReserveOpenOrderRequest(String apiKey, Long nonce, String primaryCurrencyCode, String secondaryCurrencyCode, String pageIndex,
      String pageSize) {
    super(apiKey, nonce);

    if (primaryCurrencyCode != null) {
      if (primaryCurrencyCode.equals("BTC")) {
        primaryCurrencyCode = "Xbt";
      } else if (primaryCurrencyCode.equals("ETH")) {
        primaryCurrencyCode = "Eth";
      } else {
        throw new IllegalArgumentException("IndependentReserveOpenOrderRequest - unknown value of base currency code");
      }
      this.parameters.put("primaryCurrencyCode", primaryCurrencyCode);
    }

    if (secondaryCurrencyCode != null) {
      if (secondaryCurrencyCode.equals("USD")) {
        secondaryCurrencyCode = "Usd";
      } else if (secondaryCurrencyCode.equals("AUD")) {
        secondaryCurrencyCode = "Aud";
      } else {
        throw new IllegalArgumentException("IndependentReserveOpenOrderRequest - unknown value of counter currency code");
      }
      this.parameters.put("secondaryCurrencyCode", secondaryCurrencyCode);
    }

    this.parameters.put("pageIndex", pageIndex);
    this.parameters.put("pageSize", pageSize);

  }
}

@@ -1095,24 +1095,119 @@
 de = %22Aud%22;%0A
+      %7D else if (secondaryCurrencyCode.equals(%22NZD%22)) %7B%0A        secondaryCurrencyCode = %22Nzd%22;%0A
       %7D else

support NZD