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

[bitstamp] add withdrawal request txid field #4889

Merged
Merged
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 @@ -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
Loading