Package com.xeiam.xchange.cryptotrade.dto

Examples of com.xeiam.xchange.cryptotrade.dto.CryptoTradePair


  public void testDeserializePair() throws IOException {

    InputStream is = CryptoTradeMarketDataJsonTest.class.getResourceAsStream("/marketdata/example-pair-data.json");

    ObjectMapper mapper = new ObjectMapper();
    CryptoTradePair pair = mapper.readValue(is, CryptoTradePair.class);

    assertThat(pair.getLabel()).isEqualTo("esl_ltc");
    assertThat(pair.getType()).isEqualTo(CryptoTradePairType.security_pair);
    assertThat(pair.getMinOrderAmount()).isEqualTo("0.1");
    assertThat(pair.getDecimals()).isEqualTo(8);

    assertThat(pair.getStatus()).isEqualTo("success");
    assertThat(pair.getError()).isNullOrEmpty();
  }
View Full Code Here


    assertThat(pairMap).containsKey(CurrencyPair.BTC_USD);
    assertThat(pairMap).containsKey(CurrencyPair.LTC_BTC);
    assertThat(pairMap).containsKey(new CurrencyPair("AMC", "BTC"));
    assertThat(pairMap).containsKey(new CurrencyPair("BMI", "BTC"));

    CryptoTradePair pair = pairMap.get(CurrencyPair.BTC_USD);
    assertThat(pair.getLabel()).isEqualTo("btc_usd");
    assertThat(pair.getType()).isEqualTo(CryptoTradePairType.normal_pair);
    assertThat(pair.getMinOrderAmount()).isEqualTo("0.001");
    assertThat(pair.getDecimals()).isEqualTo(8);

    pair = pairMap.get(new CurrencyPair("AMC", "BTC"));
    assertThat(pair.getLabel()).isEqualTo("amc_btc");
    assertThat(pair.getType()).isEqualTo(CryptoTradePairType.security_pair);
    /*
     * XXX: Exchange doesn't return minOrderAmount or Decimals for security_pairs
     */
    assertThat(pair.getMinOrderAmount()).isNull();
    assertThat(pair.getDecimals()).isEqualTo(0);

    assertThat(pairs.getStatus()).isEqualTo("success");
    assertThat(pairs.getError()).isNullOrEmpty();
  }
View Full Code Here

    return handleResponse(cryptoTradeDepth).getPublicTrades();
  }

  public CryptoTradePair getCryptoTradePairInfo(CurrencyPair currencyPair) throws CryptoTradeException, IOException {

    CryptoTradePair cryptoTradePair = cryptoTradeProxy.getPair(currencyPair.baseSymbol.toLowerCase(), currencyPair.counterSymbol.toLowerCase());

    return handleResponse(cryptoTradePair);
  }
View Full Code Here

  private static void raw(CryptoTradeMarketDataServiceRaw marketDataService) throws IOException {

    Map<CurrencyPair, CryptoTradePair> currencyPairs = marketDataService.getCryptoTradePairs();
    System.out.println(currencyPairs);

    CryptoTradePair currencyPair = marketDataService.getCryptoTradePairInfo(CurrencyPair.BTC_USD);
    System.out.println(currencyPair);

    CryptoTradeTicker ticker = marketDataService.getCryptoTradeTicker(CurrencyPair.BTC_USD);
    System.out.println(ticker);
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.cryptotrade.dto.CryptoTradePair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.