From 80fe1f321059cd6d207152888e0a56936750a740 Mon Sep 17 00:00:00 2001 From: Tim Ross Date: Thu, 13 Jun 2024 09:49:27 -0400 Subject: [PATCH] [Bitstamp] Return Lists instead of arrays --- .../xchange/bitstamp/BitstampAuthenticatedV2.java | 5 +++-- .../bitstamp/service/BitstampAccountServiceRaw.java | 12 ++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAuthenticatedV2.java b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAuthenticatedV2.java index d29510ca09..2a06571830 100644 --- a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAuthenticatedV2.java +++ b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAuthenticatedV2.java @@ -10,6 +10,7 @@ import jakarta.ws.rs.core.MediaType; import java.io.IOException; import java.math.BigDecimal; +import java.util.List; import org.knowm.xchange.bitstamp.dto.BitstampException; import org.knowm.xchange.bitstamp.dto.BitstampTransferBalanceResponse; import org.knowm.xchange.bitstamp.dto.account.BitstampBalance; @@ -647,7 +648,7 @@ BitstampTransferBalanceResponse transferSubAccountBalanceToMain( @POST @Path("withdrawal-requests/") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - WithdrawalRequest[] getWithdrawalRequests( + List getWithdrawalRequests( @HeaderParam("X-Auth") String apiKey, @HeaderParam("X-Auth-Signature") ParamsDigest signer, @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory nonce, @@ -658,7 +659,7 @@ WithdrawalRequest[] getWithdrawalRequests( @POST @Path("fees/withdrawal/") - WithdrawalFee[] getWithdrawalFees( + List getWithdrawalFees( @HeaderParam("X-Auth") String apiKey, @HeaderParam("X-Auth-Signature") ParamsDigest signer, @HeaderParam("X-Auth-Nonce") SynchronizedValueFactory nonce, diff --git a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/service/BitstampAccountServiceRaw.java b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/service/BitstampAccountServiceRaw.java index 979a044446..1d70f13f07 100644 --- a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/service/BitstampAccountServiceRaw.java +++ b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/service/BitstampAccountServiceRaw.java @@ -350,16 +350,13 @@ public List getUnconfirmedDeposits() throws IOException { public List getWithdrawalRequests(Long timeDelta) throws IOException { try { - final List response = - Arrays.asList( - bitstampAuthenticatedV2.getWithdrawalRequests( + return bitstampAuthenticatedV2.getWithdrawalRequests( apiKeyForV2Requests, signatureCreatorV2, uuidNonceFactory, timestampFactory, API_VERSION, - timeDelta)); - return response; + timeDelta); } catch (BitstampException e) { throw handleError(e); } @@ -368,13 +365,12 @@ public List getWithdrawalRequests(Long timeDelta) throws IOEx public List getWithdrawalFees() throws IOException { try { - return Arrays.asList( - bitstampAuthenticatedV2.getWithdrawalFees( + return bitstampAuthenticatedV2.getWithdrawalFees( apiKeyForV2Requests, signatureCreatorV2, uuidNonceFactory, timestampFactory, - API_VERSION)); + API_VERSION); } catch (BitstampException e) { throw handleError(e); }