All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.knowm.xchange.examples.coindirect.account.CoindirectAccountDemo Maven / Gradle / Ivy

Go to download

Provides a set of examples that demonstrate how to use XChange in client applications

The newest version!
package org.knowm.xchange.examples.coindirect.account;

import java.io.IOException;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.coindirect.CoindirectExchange;
import org.knowm.xchange.coindirect.service.CoindirectAccountService;
import org.knowm.xchange.dto.account.AccountInfo;
import org.knowm.xchange.examples.coindirect.CoindirectDemoUtils;
import org.knowm.xchange.service.account.AccountService;

public class CoindirectAccountDemo {
  public static void main(String[] args) throws IOException {
    Exchange exchange = CoindirectDemoUtils.createExchange();

    /* create a data service from the exchange */
    AccountService accountService = exchange.getAccountService();

    generic(exchange, accountService);
    raw((CoindirectExchange) exchange, (CoindirectAccountService) accountService);
  }

  private static void generic(Exchange exchange, AccountService accountService) throws IOException {

    AccountInfo accountInfo = accountService.getAccountInfo();
    System.out.println("Account Info: " + accountInfo);

    //        String depositAddress = accountService.requestDepositAddress(Currency.BTC);
    //        System.out.println("Deposit Address: " + depositAddress);

    // String transactionHash = accountService.withdrawFunds(new BigDecimal(".01"), "XXX");
    // System.out.println("Bitcoin blockchain transaction hash: " + transactionHash);
  }

  public static void raw(CoindirectExchange exchange, CoindirectAccountService accountService)
      throws IOException {}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy