peshay / btcde

A Python Module for Bitcoin.de Trading API
MIT License
38 stars 24 forks source link

showMyTrades returns nothing #31

Closed js931 closed 5 years ago

js931 commented 6 years ago

Hi,

if i try to retrieve the trades i made, the function "showMyTrades" just returns an empty response. There are many trades in my account and all other functions work fine. So it is not a problem with my account or API keys.

My code:

import btcde
api_key_BTCDE = '[my key]'
api_secret_BTCDE = '[my secret]'
conn = btcde.Connection(api_key_BTCDE, api_secret_BTCDE)
trades = conn.showMyTrades() 
print(trades)

The response:

{'trades': [], 'page': {'current': 0, 'last': 0}, 'errors': [], 'credits': 57}

Any help will be greatly appreciated, thanks!

Best regards Jan

js931 commented 6 years ago

Additional note: If i try to pass an argument to the function, an error occurs. trades = conn.showMyTrades(type='buy')

Error message:

WARNING:btcde:API Error Code: 1 WARNING:btcde:API Error Message: Wrong format for header: X-API-KEY {} WARNING:btcde:API Error URL: https://api.bitcoin.de/v2/trades?type=buy

js931 commented 6 years ago

I found a way to make it work, you have to pass the "state" argument: state=1 It is described as "optional" in the API docs, but if you actually want to receive some data, you have to pass it to the function!