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

Assinatura Invalida(Invalid Signature) #2803

Open EmerF opened 6 years ago

EmerF commented 6 years ago

Getting this error when i call the method getAccountInfo()

Error: Exception in thread "main" org.knowm.xchange.exceptions.ExchangeException: Error getting account info: Assinatura invalida. at org.knowm.xchange.mercadobitcoin.service.MercadoBitcoinAccountServiceRaw.getMercadoBitcoinAccountInfo(MercadoBitcoinAccountServiceRaw.java:52) at org.knowm.xchange.mercadobitcoin.service.MercadoBitcoinAccountService.getAccountInfo(MercadoBitcoinAccountService.java:32) at net.emerson.entity.MercadoObject.createExchange(MercadoObject.java:45) at net.mercadobitcoin.main.TradeMainNova.criarObjetosBuscadorPreco(TradeMainNova.java:205) at net.mercadobitcoin.main.TradeMainNova.transferirParaPoloniex(TradeMainNova.java:153) at net.mercadobitcoin.main.TradeMainNova.main(TradeMainNova.java:46)

`` ExchangeSpecification exSpec = new ExchangeSpecification(MercadoBitcoinExchange.class); exSpec.setApiKey(key); exSpec.setSecretKey(secret);

    exchange = ExchangeFactory.INSTANCE.createExchange(exSpec);
    tradeService = exchange.getTradeService();
    accountService = (MercadoBitcoinAccountService) exchange.getAccountService();
    AccountInfo accountInfo = accountService.getAccountInfo();
    System.out.println(accountInfo.toString());
    ``
walec51 commented 5 years ago

is your systems clock synchronized using NTP?

EmerF commented 5 years ago

No, i guess. I'll fix this and test.

Em qui, 27 de set de 2018 às 15:57, Adam Walczak notifications@github.com escreveu:

is your systems clock synchronized using NTP?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/knowm/XChange/issues/2803#issuecomment-425205341, or mute the thread https://github.com/notifications/unsubscribe-auth/ALRxY89DeyXgpqB2LitUgLi2wUDHUTyCks5ufR-qgaJpZM4WrH37 .

-- Emerson Fonseca

EmerF commented 5 years ago

full Log:

7/09/2018 18:31:08 INFO  TradeMainNova:30 - Usuario: emerson
27/09/2018 18:31:08 INFO  TradeMainNova:45 - Iniciando a Execucao...
18:31:09.144 [main] DEBUG org.knowm.xchange.ExchangeFactory - Creating exchange from specification
18:31:09.163 [main] DEBUG org.knowm.xchange.ExchangeFactory - Creating default exchange from class name
18:31:09.176 [main] DEBUG org.knowm.xchange.ExchangeFactory - Creating default exchange from class name
18:31:09.670 [main] DEBUG org.knowm.xchange.mercadobitcoin.MercadoBitcoinExchange - ExchangeMetaData [currencyPairs={BTC/BRL=CurrencyPairMetaData [tradingFee=null, minimumAmount=null, maximumAmount=null, priceScale=8], LTC/BRL=CurrencyPairMetaData [tradingFee=null, minimumAmount=null, maximumAmount=null, priceScale=8]}, currencies={}, publicRateLimits=[RateLimit [calls=1, timeSpan=0, timeUnit=MINUTES]], privateRateLimits=[RateLimit [calls=60, timeSpan=0, timeUnit=MINUTES]], shareRateLimits=false]
18:31:09.687 [main] DEBUG si.mazi.rescu.Config - Configuration from rescu.properties:
18:31:09.687 [main] DEBUG si.mazi.rescu.Config - httpConnTimeout = 30000
18:31:09.689 [main] DEBUG si.mazi.rescu.Config - httpReadTimeout = 30000
18:31:09.690 [main] DEBUG si.mazi.rescu.Config - proxyHost = null
18:31:09.690 [main] DEBUG si.mazi.rescu.Config - proxyPort = null
18:31:09.690 [main] DEBUG si.mazi.rescu.Config - ignoreHttpErrorCodes = false
18:31:09.715 [main] INFO org.knowm.xchange.mercadobitcoin.MercadoBitcoinExchange - Calling Remote Init...
18:31:09.715 [main] INFO org.knowm.xchange.mercadobitcoin.MercadoBitcoinExchange - No remote initialization implemented for Mercado Bitcoin. The exchange meta data for this exchange is loaded from a json file containing hard-coded exchange meta-data. This may or may not be OK for you, and you should understand exactly how this works. Each exchange can either 1) rely on the hard-coded json file that comes packaged with XChange's jar, 2) provide your own override json file, 3) properly implement the `remoteInit()` method for the exchange (please submit a pull request so the whole community can benefit) or 4) a combination of hard-coded JSON and remote API calls. For more info see: https://github.com/timmolter/XChange/wiki/Design-Notes#exchange-metadata
18:31:34.095 [main] DEBUG si.mazi.rescu.HttpTemplate - Executing POST request at https://www.mercadobitcoin.net/tapi/
18:31:38.369 [main] DEBUG si.mazi.rescu.HttpTemplate - Request http status = 200
Exception in thread "main" org.knowm.xchange.exceptions.ExchangeException: Error getting account info: Assinatura invalida.
    at org.knowm.xchange.mercadobitcoin.service.MercadoBitcoinAccountServiceRaw.getMercadoBitcoinAccountInfo(MercadoBitcoinAccountServiceRaw.java:52)
    at org.knowm.xchange.mercadobitcoin.service.MercadoBitcoinAccountService.getAccountInfo(MercadoBitcoinAccountService.java:32)
    at net.emerson.entity.MercadoObject.createExchange(MercadoObject.java:44)
    at net.mercadobitcoin.main.TradeMainNova.main(TradeMainNova.java:47)
EmerF commented 5 years ago

Error persist

EmerF commented 5 years ago

Does anybody knows?

jakubkalicki commented 5 years ago

I would like to help, but exchange has no english translation...

EmerF commented 5 years ago

I had to develop my own API because it has many problems