From c41f228143af7fe21bb239a4356b50f12c9c2395 Mon Sep 17 00:00:00 2001 From: rizer1980 <4340180@gmail.com> Date: Wed, 5 Jun 2024 03:28:00 +0300 Subject: [PATCH] [bitstamp] add withdrawal request txid field --- .../dto/account/WithdrawalRequest.java | 35 ++----------------- .../dto/account/WithdrawalsJSONTest.java | 1 + .../bitstamp/dto/account/withdrawals.json | 3 +- 3 files changed, 6 insertions(+), 33 deletions(-) diff --git a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalRequest.java b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalRequest.java index 70a1da8f896..8d639ff5e15 100644 --- a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalRequest.java +++ b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalRequest.java @@ -4,9 +4,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.util.Date; +import lombok.Getter; import org.knowm.xchange.bitstamp.BitstampUtils; import org.knowm.xchange.currency.Currency; +@Getter public class WithdrawalRequest { private final Date datetime; @@ -24,28 +26,13 @@ public class WithdrawalRequest { @JsonProperty("transaction_id") private String transactionId; // Transaction id (bitcoin withdrawals only). + private String txid; public WithdrawalRequest(@JsonProperty("datetime") String datetime) { super(); this.datetime = BitstampUtils.parseDate(datetime); } - public Long getId() { - return id; - } - - public Date getDatetime() { - return datetime; - } - - public Type getType() { - return type; - } - - public BigDecimal getAmount() { - return amount; - } - public Status getStatus() { return Status.fromString(statusOriginal); } @@ -55,22 +42,6 @@ public String getStatusOriginal() { return statusOriginal; } - public String getData() { - return data; - } - - public String getAddress() { - return address; - } - - public String getTransactionId() { - return transactionId; - } - - public Currency getCurrency() { - return currency; - } - @Override public String toString() { return "WithdrawalRequest [id=" diff --git a/xchange-bitstamp/src/test/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalsJSONTest.java b/xchange-bitstamp/src/test/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalsJSONTest.java index 665ffd14c1d..51ea89ac5fd 100644 --- a/xchange-bitstamp/src/test/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalsJSONTest.java +++ b/xchange-bitstamp/src/test/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalsJSONTest.java @@ -34,6 +34,7 @@ public void testUnmarshal() throws IOException { assertThat(withdrawals.get(1).getType()).isEqualTo(Type.litecoin); assertThat(withdrawals.get(1).getStatus()).isEqualTo(Status.finished); + assertThat(withdrawals.get(1).getTxid()).isEqualTo("1"); assertThat(withdrawals.get(2).getType()).isEqualTo(Type.XRP); assertThat(withdrawals.get(2).getStatus()).isEqualTo(Status.unknown); diff --git a/xchange-bitstamp/src/test/resources/org/knowm/xchange/bitstamp/dto/account/withdrawals.json b/xchange-bitstamp/src/test/resources/org/knowm/xchange/bitstamp/dto/account/withdrawals.json index 2dc47a49dba..2e57eae94cf 100644 --- a/xchange-bitstamp/src/test/resources/org/knowm/xchange/bitstamp/dto/account/withdrawals.json +++ b/xchange-bitstamp/src/test/resources/org/knowm/xchange/bitstamp/dto/account/withdrawals.json @@ -15,7 +15,8 @@ "datetime": "2017-08-21 20:23:12", "amount": "33.10000000", "data": "", - "id": 1928123 + "id": 1928123, + "txid": 1 }, { "status": "10",