private static FundingRecord adaptFundingRecord(Map item) { FundingRecord.Type type = item.get("type").toString().equalsIgnoreCase("WITHDRAWAL_SUBTRACT_FUNDS") ? FundingRecord.Type.WITHDRAWAL : FundingRecord.Type.DEPOSIT; return new FundingRecord.Builder() .setType(type) .setBlockchainTransactionHash(null) // not available in the API yet .setAddress(null) // not available in the API yet .setAmount(new BigDecimal(item.get("value").toString()).abs()) .setCurrency(Currency.getInstance(((Map) item.get("balance")).get("currency").toString())) .setDate(DateUtils.fromMillisUtc(Long.valueOf(item.get("time").toString()))) .setInternalId(item.get("historyId").toString()) // could be detailId maybe? .setFee(null) // not available in the API yet .setStatus(FundingRecord.Status.COMPLETE) .setBalance(new BigDecimal(((Map) item.get("fundsAfter")).get("total").toString())) .build(); } }
public static List<FundingRecord> adaptUserTransactionsToFundingRecords( Bl3pUserTransactions.Bl3pUserTransaction[] transactions) { List<FundingRecord> list = new ArrayList<>(transactions.length); for (Bl3pUserTransactions.Bl3pUserTransaction tx : transactions) { list.add( new FundingRecord.Builder() .setAmount(tx.amount.value) .setBalance(tx.balance.value) .setCurrency(Currency.getInstance(tx.amount.currency)) .setDate(tx.date) .setFee(tx.fee == null ? null : tx.fee.value) .setType( tx.type == "deposit" ? FundingRecord.Type.DEPOSIT : FundingRecord.Type.WITHDRAWAL) .build()); } return list; } }
public static FundingRecord adaptTransaction(BTCTurkUserTransactions transaction) { String description = transaction.getOperation().toString(); if (transaction.getId() != null) { description += ", index: " + transaction.getId(); } return new FundingRecord.Builder() .setInternalId(transaction.getId().toString()) .setDate(transaction.getDate()) .setType(transaction.getOperation().getType()) .setCurrency(transaction.getCurrency()) .setAmount(transaction.getAmount()) .setFee(transaction.getFee()) .setBalance(transaction.getFunds()) .setDescription(description) .build(); }
public static FundingRecord adaptFundingRecord( BitflyerCoinHistory history, FundingRecord.Type type) { return new FundingRecord.Builder() .setDate(BitflyerUtils.parseDate(history.getEventDate())) .setCurrency(new Currency(history.getCurrencyCode())) .setAmount(history.getAmount()) .setAddress(history.getAddress()) .setInternalId(history.getID()) .setType(type) .setStatus(adaptStatus(history.getStatus())) .setBalance(history.getAmount()) .setFee(add(history.getFee(), history.getAdditionalFee())) .build(); }
public static Builder from(FundingRecord record) { return new Builder() .setAddress(record.address) .setDate(record.date) .setCurrency(record.currency) .setAmount(record.amount) .setInternalId(record.internalId) .setDescription(record.description) .setType(record.type) .setStatus(record.status) .setBalance(record.balance) .setFee(record.fee); }
public static FundingRecord adaptFundingRecord( BitflyerDepositOrWithdrawal history, FundingRecord.Type type) { return new FundingRecord.Builder() .setDate(BitflyerUtils.parseDate(history.getEventDate())) .setCurrency(new Currency(history.getCurrencyCode())) .setAmount(history.getAmount()) .setInternalId(history.getID()) .setType(type) .setStatus(adaptStatus(history.getStatus())) .setBalance(history.getAmount()) .build(); }
public static FundingRecord adaptFundingRecord( BitflyerDepositOrWithdrawal history, FundingRecord.Type type) { return new FundingRecord.Builder() .setDate(BitflyerUtils.parseDate(history.getEventDate())) .setCurrency(new Currency(history.getCurrencyCode())) .setAmount(history.getAmount()) .setInternalId(history.getID()) .setType(type) .setStatus(adaptStatus(history.getStatus())) .setBalance(history.getAmount()) .build(); }
public static FundingRecord adaptFundingRecord( BitflyerCoinHistory history, FundingRecord.Type type) { return new FundingRecord.Builder() .setDate(BitflyerUtils.parseDate(history.getEventDate())) .setCurrency(new Currency(history.getCurrencyCode())) .setAmount(history.getAmount()) .setAddress(history.getAddress()) .setInternalId(history.getID()) .setType(type) .setStatus(adaptStatus(history.getStatus())) .setBalance(history.getAmount()) .setFee(add(history.getFee(), history.getAdditionalFee())) .build(); }
public static Builder from(FundingRecord record) { return new Builder() .setAddress(record.address) .setDate(record.date) .setCurrency(record.currency) .setAmount(record.amount) .setInternalId(record.internalId) .setDescription(record.description) .setType(record.type) .setStatus(record.status) .setBalance(record.balance) .setFee(record.fee); }