use of org.knowm.xchange.dsx.dto.DsxTransaction in project XChange by knowm.
the class DsxAccountService method getFundingHistory.
@Override
public List<FundingRecord> getFundingHistory(TradeHistoryParams params) throws IOException {
List<DsxTransaction> transactions;
String currencyCode = null;
Integer limit = 1000;
int offset = 0;
if (params instanceof TradeHistoryParamCurrency) {
Currency currency = ((TradeHistoryParamCurrency) params).getCurrency();
currencyCode = currency != null ? currency.getCurrencyCode() : null;
}
if (params instanceof TradeHistoryParamLimit) {
limit = ((TradeHistoryParamLimit) params).getLimit();
}
if (params instanceof TradeHistoryParamOffset) {
offset = ((TradeHistoryParamOffset) params).getOffset().intValue();
}
transactions = getTransactions(currencyCode, limit, offset);
List<FundingRecord> records = new ArrayList<>();
for (DsxTransaction transaction : transactions) {
records.add(DsxAdapters.adapt(transaction));
}
return records;
}
Aggregations