Search in sources :

Example 1 with BitsoBalance

use of org.knowm.xchange.bitso.dto.account.BitsoBalance in project XChange by knowm.

the class BitsoAdapters method adaptWallet.

public static Wallet adaptWallet(BitsoBalance bitsoBalance) {
    // Adapt to XChange DTOs
    Balance mxnBalance = new Balance(Currency.MXN, bitsoBalance.getMxnBalance(), bitsoBalance.getMxnAvailable(), bitsoBalance.getMxnReserved());
    Balance btcBalance = new Balance(Currency.BTC, bitsoBalance.getBtcBalance(), bitsoBalance.getBtcAvailable(), bitsoBalance.getBtcReserved());
    return Wallet.Builder.from(Arrays.asList(mxnBalance, btcBalance)).build();
}
Also used : Balance(org.knowm.xchange.dto.account.Balance) BitsoBalance(org.knowm.xchange.bitso.dto.account.BitsoBalance)

Example 2 with BitsoBalance

use of org.knowm.xchange.bitso.dto.account.BitsoBalance in project XChange by knowm.

the class BitsoAccountDemo method raw.

private static void raw(BitsoAccountServiceRaw accountService) throws IOException {
    BitsoBalance bitsoBalance = accountService.getBitsoBalance();
    System.out.println("Bitso balance: " + bitsoBalance);
    BitsoDepositAddress depositAddress = accountService.getBitsoBitcoinDepositAddress();
    System.out.println("Bitcoin deposit address: " + depositAddress);
    String withdrawResult = accountService.withdrawBitsoFunds(new BigDecimal(1).movePointLeft(4), "XXX");
    System.out.println("Bitso withdrawal response = " + withdrawResult);
}
Also used : BitsoBalance(org.knowm.xchange.bitso.dto.account.BitsoBalance) BitsoDepositAddress(org.knowm.xchange.bitso.dto.account.BitsoDepositAddress) BigDecimal(java.math.BigDecimal)

Aggregations

BitsoBalance (org.knowm.xchange.bitso.dto.account.BitsoBalance)2 BigDecimal (java.math.BigDecimal)1 BitsoDepositAddress (org.knowm.xchange.bitso.dto.account.BitsoDepositAddress)1 Balance (org.knowm.xchange.dto.account.Balance)1