Skip to content

Commit

Permalink
Merge pull request #4889 from rizer1980/PR/bitstamp-withdrawal-reques…
Browse files Browse the repository at this point in the history
…ts-fix

[bitstamp] add withdrawal request txid field
  • Loading branch information
timmolter authored Jun 5, 2024
2 parents b4a957b + c41f228 commit 7c1c160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand All @@ -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="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"datetime": "2017-08-21 20:23:12",
"amount": "33.10000000",
"data": "",
"id": 1928123
"id": 1928123,
"txid": 1
},
{
"status": "10",
Expand Down

0 comments on commit 7c1c160

Please sign in to comment.