Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added forward attribute to transactionHistory call #10

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public AccountOverviewResponse accountOverview(String currency) throws IOExcepti
}

@Override
public HasMoreResponse<TransactionHistory> transactionHistory(String type, String currency, DuringHasMoreRequest request) throws IOException {
public HasMoreResponse<TransactionHistory> transactionHistory(String type, String currency, Boolean forward, DuringHasMoreRequest request) throws IOException {
if (request == null) request = DuringHasMoreRequest.builder().build();
return super.executeSync(getAPIImpl().transactionHistory(request.getStarAt(), request.getEndAt(), type,
request.getOffset(), request.getMaxCount(), currency));
request.getOffset(), request.getMaxCount(), currency, forward));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

/**
* Account API
*
* @author chenshiwei
* @email casocroz@gmail.com
* @date 2019/7/25
Expand All @@ -21,12 +22,12 @@ public interface AccountAPI {

/**
* User's account overview
*
* <p>
* This endpoint requires the General permission.
*
* @param currency [Optional] Currecny ,including XBT,USDT,Default XBT
* @return The accounts.
* @throws IOException on socket errors.
* @throws IOException on socket errors.
* @throws KucoinFuturesApiException when errors are returned from the exchange.
*/
AccountOverviewResponse accountOverview(String currency) throws IOException;
Expand All @@ -39,12 +40,14 @@ public interface AccountAPI {
* @param type [Optional] Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw,
* Transferin-Transfer in, TransferOut-Transfer out
* @param currency [Optional] Currency of transaction history XBT or USDT
* @param forward [optional] This parameter functions to judge whether the lookup is forward or not.
* True means “yes” and False means “no”. This parameter is set as true by default
* @param request [Optional] include startAt endAt offset and maxCount optional parameters
* @return The account balance.
* @throws IOException on socket errors.
* @throws IOException on socket errors.
* @throws KucoinFuturesApiException when errors are returned from the exchange.
*/
HasMoreResponse<TransactionHistory> transactionHistory(String type, String currency, DuringHasMoreRequest request)
HasMoreResponse<TransactionHistory> transactionHistory(String type, String currency, Boolean forward, DuringHasMoreRequest request)
throws IOException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public interface AccountAPIRetrofit {

@GET("api/v1/transaction-history")
Call<KucoinFuturesResponse<HasMoreResponse<TransactionHistory>>> transactionHistory(@Query("startAt") Long startAt,
@Query("endAt") Long endAt,
@Query("type") String type,
@Query("offset") Long offset,
@Query("maxCount") Long maxCount,
@Query("currency") String currency);
@Query("endAt") Long endAt,
@Query("type") String type,
@Query("offset") Long offset,
@Query("maxCount") Long maxCount,
@Query("currency") String currency,
@Query("forward") Boolean forward);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void accountAPI() throws Exception {
assertThat(accountOverviewResponse, notNullValue());

HasMoreResponse<TransactionHistory> transactionHistoryHasMoreResponse = futuresRestClient.accountAPI()
.transactionHistory(null, null, null);
.transactionHistory(null, null, null, null);
assertThat(transactionHistoryHasMoreResponse, notNullValue());
assertThat(transactionHistoryHasMoreResponse.isHasMore(), Is.is(false));
}
Expand Down