knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.81k stars 1.93k forks source link

[Bitstamp] WithdrawalRequest object does not support txid field #4888

Closed tross-nydig closed 4 weeks ago

tross-nydig commented 1 month ago

The Bitstamp V2 API has an endpoint that gets withdrawal requests.

The response object looks like this:

{
    "address": "aMDHooGmAkyrsaQiKhAORhSNTmoRzxqWIO",
    "amount": "0.00006000",
    "currency": "BTC",
    "datetime": "2022-01-31 16:07:32",
    "id": 1,
    "network": "bitcoin",
    "status": 2,
    "transaction_id": "NsOeFbQhRnpGzNIThWGBTkQwRJqTNOGPVhYavrVyMfkAyMUmIlUpFIwGTzSvpeOP",
    "txid": 1,
    "type": 0
}

The transaction_id field is the transaction hash but the response also contains a field called txid that represents Bitstamp's internal transaction ID. This field is very useful for anyone who might also call the endpoint that brings back all Bitstamp user transactions.

The xchange-bitstamp module doesn't support this field at present but it's a pretty easy thing to add by simply adding txid to xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalRequest.java

rizer1980 commented 1 month ago

Hello, tross-nydig check #4889

tross-nydig commented 1 month ago

Awesome, quick work! I had my own pull request in the works but am just happy to have this field in the code now. I might create a small followup PR to add txId to the toString method if that's OK?

        + ", txid="
        + txid
tross-nydig commented 1 month ago

Added a tiny PR here: https://github.com/knowm/XChange/pull/4896

timmolter commented 4 weeks ago

merged #4896