Package com.xeiam.xchange.btcchina.dto.trade.streaming

Examples of com.xeiam.xchange.btcchina.dto.trade.streaming.BTCChinaBalance


  }

  private static BTCChinaBalance internalAdaptBalance(JSONObject jsonObject) throws JSONException {

    JSONObject balanceJsonObject = jsonObject.getJSONObject("balance");
    return new BTCChinaBalance(new BigDecimal(balanceJsonObject.getString("amount_integer")), new BigDecimal(balanceJsonObject.getString("amount")), balanceJsonObject.getString("symbol"),
        balanceJsonObject.getInt("amount_decimal"), balanceJsonObject.getString("currency"));
  }
View Full Code Here


  @Test
  public void testAdaptBalanceBTC() throws JSONException, IOException {

    JSONObject jsonObject = new JSONObject(IOUtils.toString(getClass().getResource("account_info-balance-BTC.json"), Charsets.UTF_8));
    BTCChinaBalance balance = BTCChinaJSONObjectAdapters.adaptBalance(jsonObject);
    assertEquals(new BigDecimal("196441900"), balance.getAmountInteger());
    assertEquals(new BigDecimal("1.964419"), balance.getAmount());
    assertEquals("฿", balance.getSymbol());
    assertEquals(8, balance.getAmountDecimal());
    assertEquals("BTC", balance.getCurrency());
  }
View Full Code Here

  @Test
  public void testAdaptBalanceCNY() throws JSONException, IOException {

    JSONObject jsonObject = new JSONObject(IOUtils.toString(getClass().getResource("account_info-balance-CNY.json"), Charsets.UTF_8));
    BTCChinaBalance balance = BTCChinaJSONObjectAdapters.adaptBalance(jsonObject);
    assertEquals(new BigDecimal("4.2609492000000005E9"), balance.getAmountInteger());
    assertEquals(new BigDecimal("42.609492"), balance.getAmount());
    assertEquals("¥", balance.getSymbol());
    assertEquals(8, balance.getAmountDecimal());
    assertEquals("CNY", balance.getCurrency());
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.btcchina.dto.trade.streaming.BTCChinaBalance

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.