Search in sources :

Example 1 with BTCTurkAccountBalance

use of org.knowm.xchange.btcturk.dto.account.BTCTurkAccountBalance in project XChange by knowm.

the class AccountDataFetchIntegration method testBalance.

@Test
public void testBalance() throws IOException, InterruptedException {
    if (!BTCTurkDemoUtilsTest.BTCTURK_APIKEY.isEmpty()) {
        // BTCTurkAccountBalance Test
        BTCTurkAccountBalance accountBalance = btcTurkAccountService.getBTCTurkBalance();
        assertThat(accountBalance).isNotEqualTo(null);
        assertThat(accountBalance.getBtctry_maker_fee_percentage()).isEqualTo(new BigDecimal("0.0012711860000000"));
        // AccountInfo Test
        Thread.sleep(1000);
        AccountInfo accountInfo = btcTurkAccountService.getAccountInfo();
        assertThat(accountInfo).isNotEqualTo(null);
    } else
        assertThat(accountService).isNotEqualTo(null);
}
Also used : BTCTurkAccountBalance(org.knowm.xchange.btcturk.dto.account.BTCTurkAccountBalance) BigDecimal(java.math.BigDecimal) AccountInfo(org.knowm.xchange.dto.account.AccountInfo) Test(org.junit.Test) BTCTurkDemoUtilsTest(org.knowm.xchange.btcturk.service.BTCTurkDemoUtilsTest)

Example 2 with BTCTurkAccountBalance

use of org.knowm.xchange.btcturk.dto.account.BTCTurkAccountBalance in project XChange by knowm.

the class BTCTurkAdapters method adaptWallet.

public static Wallet adaptWallet(String name, BTCTurkAccountBalance btcTurkBalance) {
    List<Balance> balances = new ArrayList<>(7);
    balances.add(new Balance(Currency.TRY, null, btcTurkBalance.getTry_available(), btcTurkBalance.getTry_reserved()));
    balances.add(new Balance(Currency.BTC, null, btcTurkBalance.getBtc_available(), btcTurkBalance.getBtc_reserved()));
    balances.add(new Balance(Currency.ETH, null, btcTurkBalance.getEth_available(), btcTurkBalance.getEth_reserved()));
    balances.add(new Balance(Currency.XRP, null, btcTurkBalance.getXrp_available(), btcTurkBalance.getXrp_reserved()));
    balances.add(new Balance(Currency.LTC, null, btcTurkBalance.getLtc_available(), btcTurkBalance.getLtc_reserved()));
    balances.add(new Balance(Currency.USDT, null, btcTurkBalance.getUsdt_available(), btcTurkBalance.getUsdt_reserved()));
    balances.add(new Balance(Currency.XLM, null, btcTurkBalance.getXlm_available(), btcTurkBalance.getXlm_reserved()));
    return Wallet.Builder.from(balances).id(name).name(name).build();
}
Also used : ArrayList(java.util.ArrayList) BTCTurkAccountBalance(org.knowm.xchange.btcturk.dto.account.BTCTurkAccountBalance) Balance(org.knowm.xchange.dto.account.Balance)

Example 3 with BTCTurkAccountBalance

use of org.knowm.xchange.btcturk.dto.account.BTCTurkAccountBalance in project XChange by knowm.

the class BTCTurkAccountDemo method raw.

private static void raw(BTCTurkAccountServiceRaw accountService) throws IOException {
    BTCTurkAccountBalance responseBalances = accountService.getBTCTurkBalance();
    System.out.println(responseBalances.toString());
    System.out.println(responseBalances.getBtc_balance().toString());
}
Also used : BTCTurkAccountBalance(org.knowm.xchange.btcturk.dto.account.BTCTurkAccountBalance)

Aggregations

BTCTurkAccountBalance (org.knowm.xchange.btcturk.dto.account.BTCTurkAccountBalance)3 BigDecimal (java.math.BigDecimal)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 BTCTurkDemoUtilsTest (org.knowm.xchange.btcturk.service.BTCTurkDemoUtilsTest)1 AccountInfo (org.knowm.xchange.dto.account.AccountInfo)1 Balance (org.knowm.xchange.dto.account.Balance)1