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.89k stars 1.94k forks source link

[BITSTAMP] Invalid signature 403 #3441

Open EVRUSIN opened 4 years ago

EVRUSIN commented 4 years ago

Hi! Does XChange-bitstamp work correctly?

I'm trying to get transactions

    ExchangeSpecification exSpec = new BitstampExchange().getDefaultExchangeSpecification();
    exSpec.setUserName("Bitstamp");
    exSpec.setApiKey("apiKey");
    exSpec.setSecretKey("secretKey");
    Exchange bitstamp = ExchangeFactory.INSTANCE.createExchange(exSpec);
    AccountService accountService = bitstamp.getAccountService();
    List<FundingRecord> fundingRecords = accountService
                                      .getFundingHistory(new BitstampTradeHistoryParams(new CurrencyPair("BTC", "USD"), 1));

But I get 403 error (Invalid signature)

I tried this apiKey+secretKey pair with Bitstamp's native java example (https://www.bitstamp.net/api/) and they work fine.

Am I somewhere wrong? Regards

mdvx commented 4 years ago

I am able to get regular holdings, but i have not tried funding history, maybe check the URL matches the docs

EVRUSIN commented 4 years ago

Double checked it( POST for https://www.bitstamp.net/api/v2/user_transactions/ endpoint in bitstamp docs. And funding history uses getUserTransactions method, which uses the same https://www.bitstamp.net/api/v2/user_transactions/ endpoint