Package com.xeiam.xchange.coinbase.dto.marketdata

Examples of com.xeiam.xchange.coinbase.dto.marketdata.CoinbaseMoney


    // System.out.println("Bitcoin blockchain transaction hash: " + transactionHash);
  }

  public static void raw(CoinbaseAccountService accountService) throws IOException {

    CoinbaseMoney balance = accountService.getCoinbaseBalance();
    System.out.println(balance);

    demoUsers(accountService);

    demoAddresses(accountService);
View Full Code Here


    assertThat(button.getCallbackUrl()).isNull();
    assertThat(button.getSuccessUrl()).isNull();
    assertThat(button.getCancelUrl()).isNull();
    assertThat(button.getInfoUrl()).isNull();
    assertThat(button.isAutoReDirect()).isFalse();
    assertThat(button.getPrice()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal(".00100000")));
    assertThat(button.isVariablePrice()).isTrue();
    assertThat(button.isChoosePrice()).isFalse();
    assertThat(button.isIncludeAddress()).isFalse();
    assertThat(button.isIncludeEmail()).isTrue();
  }
View Full Code Here

    CoinbaseOrder order = orderList.get(0);
    assertThat(order.getId()).isEqualTo("ND4923CX");
    assertThat(order.getCreatedAt()).isEqualTo(DateUtils.fromISO8601DateString("2014-02-19T13:30:50-08:00"));
    assertThat(order.getStatus()).isEqualTo(CoinbaseOrderStatus.COMPLETED);
    assertThat(order.getTotalBTC()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal(".00157800")));
    assertThat(order.getTotalNative()).isEqualsToByComparingFields(new CoinbaseMoney("USD", new BigDecimal("1.00")));
    assertThat(order.getCustom()).isEmpty();
    assertThat(order.getReceiveAddress()).isEqualTo("1DkHhHANFeZmJL4p6HXzGDHbvxHT8DzQgW");

    CoinbaseButton button = order.getButton();
    assertThat(button.getType()).isEqualTo(CoinbaseButtonType.SUBSCRIPTION);
View Full Code Here

    assertThat(transferList.size()).isEqualTo(1);

    CoinbaseTransfer transfer = transferList.get(0);
    assertThat(transfer.getId()).isEqualTo("52f4411667c71baf9000003c");
    assertThat(transfer.getCreatedAt()).isEqualTo(DateUtils.fromISO8601DateString("2014-02-06T18:12:38-08:00"));
    assertThat(transfer.getCoinbaseFee()).isEqualsToByComparingFields(new CoinbaseMoney("USD", new BigDecimal("9.05")));
    assertThat(transfer.getBankFee()).isEqualsToByComparingFields(new CoinbaseMoney("USD", new BigDecimal(".15")));
    assertThat(transfer.getPayoutDate()).isEqualTo(DateUtils.fromISO8601DateString("2014-02-06T18:12:37-08:00"));
    assertThat(transfer.getTransactionId()).isEqualTo("52f4411767c71baf9000003f");
    assertThat(transfer.getFundingType()).isEqualTo("AchDebit");
    assertThat(transfer.getCode()).isEqualTo("52f4411667c71baf9000003c");
    assertThat(transfer.getType()).isEqualTo(CoinbaseTransferType.BUY);
    assertThat(transfer.getStatus()).isEqualTo(CoinbaseTransferStatus.COMPLETED);
    assertThat(transfer.getBtcAmount()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("1.20000000")));
    assertThat(transfer.getSubtotal()).isEqualsToByComparingFields(new CoinbaseMoney("USD", new BigDecimal("905.10")));
    assertThat(transfer.getTotal()).isEqualsToByComparingFields(new CoinbaseMoney("USD", new BigDecimal("914.30")));
    assertThat(transfer.getDescription()).isEqualTo("Bought 1.20 BTC for $914.30.  \n\nPaid for with Bank ****. Your bitcoin will arrive by the end of day on Thursday Feb  6, 2014.");

  }
View Full Code Here

    CoinbaseUser currentUser = accountChanges.getCurrentUser();
    assertThat(currentUser.getId()).isEqualTo("527d2a1ffedcb8b73b000028");
    assertThat(currentUser.getEmail()).isEqualTo("test@test.com");
    assertThat(currentUser.getName()).isEqualTo("first last");

    assertThat(accountChanges.getBalance()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("7.10000000")));

    assertThat(accountChanges.getTotalCount()).isEqualTo(2);
    assertThat(accountChanges.getNumPages()).isEqualTo(1);
    assertThat(accountChanges.getCurrentPage()).isEqualTo(1);

    List<CoinbaseAccountChange> accountChangeList = accountChanges.getAccountChanges();
    assertThat(accountChangeList.size()).isEqualTo(2);

    CoinbaseAccountChange accountChange = accountChangeList.get(0);
    assertThat(accountChange.getId()).isEqualTo("52f4411aabf9534a02000085");
    assertThat(accountChange.getCreatedAt()).isEqualTo(DateUtils.fromISO8601DateString("2014-02-06T18:12:42-08:00"));
    assertThat(accountChange.getTransactionId()).isEqualTo("52f4411aabf9534a02000081");
    assertThat(accountChange.isConfirmed()).isTrue();
    assertThat(accountChange.getAmount()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("1.20000000")));

    CoinbaseCache cache = accountChange.getCache();
    assertThat(cache.isNotesPresent()).isTrue();
    assertThat(cache.getCategory()).isEqualTo(CoinbaseAccountChangeCategory.TX);
View Full Code Here

    assertThat(user.getEmail()).isEqualTo("demo@demo.com");
    assertThat(user.getTimeZone()).isEqualTo("Pacific Time (US & Canada)");
    assertThat(user.getNativeCurrency()).isEqualTo("USD");
    assertThat(user.getBuyLevel()).isEqualTo(CoinbaseBuySellLevel.TWO);
    assertThat(user.getSellLevel()).isEqualTo(CoinbaseBuySellLevel.TWO);
    assertThat(user.getBalance()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("7.10770000")));
    assertThat(user.getBuyLimit()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("79.20000000")));
    assertThat(user.getSellLimit()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("79.20000000")));

    CoinbaseMerchant merchant = user.getMerchant();
    assertThat(merchant.getCompanyName()).isEqualTo("XChange Demo");
    assertThat(merchant.getLogo()).isNull();
  }
View Full Code Here

    // Read in the JSON from the example resources
    InputStream is = CoinbaseAccountJsonTest.class.getResourceAsStream("/account/example-balance-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    CoinbaseMoney balance = mapper.readValue(is, CoinbaseMoney.class);

    assertThat(balance).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("7.10000000")));
  }
View Full Code Here

    CoinbaseTransaction transaction = transactionList.get(0);
    assertThat(transaction.getId()).isEqualTo("52d8d8685a62c7613e000277");
    assertThat(transaction.getCreatedAt()).isEqualTo(DateUtils.fromISO8601DateString("2014-01-16T23:14:48-08:00"));
    assertThat(transaction.getTransactionHash()).isNull();
    assertThat(transaction.getAmount()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("1.00000000")));
    assertThat(transaction.isRequest()).isFalse();
    assertThat(transaction.getStatus()).isEqualTo(CoinbaseTransactionStatus.COMPLETE);

    CoinbaseUser sender = transaction.getSender();
    assertThat(sender.getId()).isEqualTo("5083a5410924750200000001");
View Full Code Here

    assertThat(recurringPayment.getRepeat()).isEqualTo(CoinbaseRepeat.MONTHLY);
    assertThat(recurringPayment.getLastRun()).isNull();
    assertThat(recurringPayment.getNextRun()).isEqualTo(DateUtils.fromISO8601DateString("2014-03-01T07:00:00-08:00"));
    assertThat(recurringPayment.getNotes()).isEqualTo("For Demo");
    assertThat(recurringPayment.getDescription()).isEqualTo("Buy 0.01 BTC");
    assertThat(recurringPayment.getAmount()).isEqualsToByComparingFields(new CoinbaseMoney("BTC", new BigDecimal("0.01000000")));
  }
View Full Code Here

  }

  public static AccountInfo adaptAccountInfo(final CoinbaseUser user) {

    final String username = user.getEmail();
    final CoinbaseMoney balance = user.getBalance();
    final Wallet wallet = new Wallet(balance.getCurrency(), balance.getAmount());
    final List<Wallet> wallets = new ArrayList<Wallet>();
    wallets.add(wallet);

    final AccountInfo accountInfo = new AccountInfo(username, wallets);
    return accountInfo;
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.coinbase.dto.marketdata.CoinbaseMoney

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.