@Override
  public Trades getTrades(CurrencyPair currencyPair, Object... args) throws IOException {

    // According to API docs, default is 50
    int limitTrades = 50;
    if (args != null && args.length > 1) {
      if (args[1] instanceof Integer) {
        limitTrades = ((Integer) args[1]).intValue();
      } else {
        throw new ExchangeException("Argument 1 must be an Integer!");
      }
    }

    long lastTradeTime = 0;
    if (args != null && args.length > 0) {
      // parameter 0, if present, is the last trade timestamp
      if (args[0] instanceof Number) {
        Number arg = (Number) args[0];
        lastTradeTime =
            arg.longValue() / 1000; // divide by 1000 to convert to unix timestamp (seconds)
      } else if (args[0] instanceof Date) {
        Date arg = (Date) args[0];
        lastTradeTime =
            arg.getTime() / 1000; // divide by 1000 to convert to unix timestamp (seconds)
      } else {
        throw new IllegalArgumentException(
            "Argument 0, the last trade time, must be a Date or Long (millisecond timestamp) (was "
                + args[0].getClass()
                + ")");
      }
    }
    GeminiTrade[] trades =
        getGeminiTrades(GeminiUtils.toPairString(currencyPair), lastTradeTime, limitTrades);

    return GeminiAdapters.adaptTrades(trades, currencyPair);
  }
@ Override public Trades getTrades ( CurrencyPair currencyPair , Object ... args ) throws IOException { int limitTrades = 50 ; if ( args != null && args . length > 1 ) { if ( args [ 1 ] instanceof Integer ) { limitTrades = ( ( Integer ) args [ 1 ] ) . intValue ( ) ; } else { throw new ExchangeException ( "Argument 1 must be an Integer!" ) ; } } long lastTradeTime = 0 ; if ( args != null && args . length > 0 ) { if ( args [ 0 ] instanceof Number ) { Number arg = ( Number ) args [ 0 ] ; lastTradeTime = arg . longValue ( ) / 1000 ; } else if ( args [ 0 ] instanceof Date ) { Date arg = ( Date ) args [ 0 ] ; lastTradeTime = arg . getTime ( ) / 1000 ; } else { throw new IllegalArgumentException ( "Argument 0, the last trade time, must be a Date or Long (millisecond timestamp) (was " + args [ 0 ] . getClass ( ) + ")" ) ; } } GeminiTrade [ ] trades = getGeminiTrades ( GeminiUtils . toPairString ( currencyPair ) , lastTradeTime , limitTrades ) ; return GeminiAdapters . adaptTrades ( trades , currencyPair ) ; }
@param currencyPair The CurrencyPair for which to query trades.
@param args One argument may be supplied which is the timestamp after which trades should be
collected. Trades before this time are not reported. The argument may be of type
java.util.Date or Number (milliseconds since Jan 1, 1970)