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 FundingRecord adapt(GeminiTransfer transfer) { FundingRecord.Status status = FundingRecord.Status.PROCESSING; if (transfer.status.equals("Complete")) status = FundingRecord.Status.COMPLETE; if (transfer.status.equals("Advanced")) status = FundingRecord.Status.COMPLETE; String description = ""; if (transfer.purpose != null) description = transfer.purpose; if (transfer.method != null) description += " " + transfer.method; description = description.trim(); FundingRecord.Type type = transfer.type.equals("Withdrawal") ? FundingRecord.Type.WITHDRAWAL : FundingRecord.Type.DEPOSIT; return new FundingRecord.Builder() .setStatus(status) .setType(type) .setInternalId(transfer.eid) .setAddress(transfer.destination) .setCurrency(Currency.getInstance(transfer.currency)) .setDate(DateUtils.fromMillisUtc(transfer.timestamp)) .setAmount(transfer.amount) .setBlockchainTransactionHash(transfer.txnHash) .setDescription(description) .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 adapt(GeminiTransfer transfer) { FundingRecord.Status status = FundingRecord.Status.PROCESSING; if (transfer.status.equals("Complete")) status = FundingRecord.Status.COMPLETE; if (transfer.status.equals("Advanced")) status = FundingRecord.Status.COMPLETE; String description = ""; if (transfer.purpose != null) description = transfer.purpose; if (transfer.method != null) description += " " + transfer.method; description = description.trim(); FundingRecord.Type type = transfer.type.equals("Withdrawal") ? FundingRecord.Type.WITHDRAWAL : FundingRecord.Type.DEPOSIT; return new FundingRecord.Builder() .setStatus(status) .setType(type) .setInternalId(transfer.eid) .setAddress(transfer.destination) .setCurrency(Currency.getInstance(transfer.currency)) .setDate(DateUtils.fromMillisUtc(transfer.timestamp)) .setAmount(transfer.amount) .setBlockchainTransactionHash(transfer.txnHash) .setDescription(description) .build(); }
public static FundingRecord adapt(HitbtcTransaction transaction) { String description = transaction.getType() + " " + transaction.getStatus(); if (transaction.getIndex() != null) { description += ", index: " + transaction.getIndex(); } if (transaction.getPaymentId() != null) { description += ", paymentId: " + transaction.getPaymentId(); } return new FundingRecord.Builder() .setAddress(transaction.getAddress()) .setCurrency(Currency.getInstance(transaction.getCurrency())) .setAmount(transaction.getAmount()) .setType(convertType(transaction.getType())) .setFee(transaction.getFee()) .setDescription(description) .setStatus(convertStatus(transaction.getStatus())) .setInternalId(transaction.getId()) .setBlockchainTransactionHash(transaction.getHash()) .setDate(transaction.getCreatedAt()) .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( 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 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 adapt(HitbtcTransaction transaction) { String description = transaction.getType() + " " + transaction.getStatus(); if (transaction.getIndex() != null) { description += ", index: " + transaction.getIndex(); } if (transaction.getPaymentId() != null) { description += ", paymentId: " + transaction.getPaymentId(); } return new FundingRecord.Builder() .setAddress(transaction.getAddress()) .setCurrency(Currency.getInstance(transaction.getCurrency())) .setAmount(transaction.getAmount()) .setType(convertType(transaction.getType())) .setFee(transaction.getFee()) .setDescription(description) .setStatus(convertStatus(transaction.getStatus())) .setInternalId(transaction.getId()) .setBlockchainTransactionHash(transaction.getHash()) .setDate(transaction.getCreatedAt()) .build(); }
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(); }
private static FundingRecord adaptFundingRecord(KucoinWalletRecord record) { return new FundingRecord.Builder() .setAmount(record.getAmount()) .setAddress(record.getAddress()) .setCurrency(Currency.getInstance(record.getCoinType())) .setDate(new Date(record.getCreatedAt())) .setFee(record.getFee()) .setStatus(record.getStatus().getFundingRecordStatus()) .setBlockchainTransactionHash(record.getOuterWalletTxid()) .setInternalId(record.getOid()) .setDescription(record.getRemark()) .setType(record.getType().getFundingRecordType()) .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(); }
static FundingRecord.Builder fundingRecordBuilder(AbucoinsHistory history) { return new FundingRecord.Builder() .setDescription(history.getUrl()) .setAmount(history.getAmount()) .setCurrency(Currency.getInstance(history.getCurrency())) .setDate(parseDate(history.getDate())) .setFee(history.getFee()) .setStatus(adaptFundingStatus(history.getStatus())); }
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); }