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

309 error and takes from 1 to 2 positional arguments but 3 were given #31

Open
Julicher opened this issue Jan 5, 2022 · 5 comments
Open

Comments

@Julicher
Copy link

Julicher commented Jan 5, 2022

When accessing the account: via this example https://docs.bitvavo.com/?_ga=2.52320942.665698512.1641382004-1137001316.1615803719#tag/Account

it gives me the "takes from 1 to 2 positional arguments but 3 were given" error when entering the API and secret API key
any solutions?

when accessing it using the dictionary example: https://github.com/bitvavo/python-bitvavo-api (getting started section) it gives me an error that the signature is invalid.

it all worked a few weeks ago but it suddenly stopped working. how?
created also a new API and uninstalled the package still nothing

thanks!

@rroumenov
Copy link

Could you please append an image/code/example of how are you using it or what are you trying to do?

Checking the last API version, Bitvavo object can be created without parameters, and account method does not expected any, so I cannot understand why are you getting that error.

Regards.

@Julicher
Copy link
Author

Sorry for the confusion, I just can't seem to access the api at all: for instance when I use this,

# API setup
bitvavo = Bitvavo({
  'APIKEY': key,
  'APISECRET': secretkey,
  'RESTURL': 'https://api.bitvavo.com/v2',
  'WSURL': 'wss://ws.bitvavo.com/v2/',
  'ACCESSWINDOW': 10000,
  'DEBUGGING': True
})
balance = bitvavo.balance({})
print(balance)

i get:

16:01:19 DEBUG: REQUEST: https://api.bitvavo.com/v2/balance
{'errorCode': 309, 'error': 'The signature is invalid.'}

previously this was just working fine

Thanks

@Julicher Julicher changed the title error: "takes from 1 to 2 positional arguments but 3 were given" and 309 error 309 error Jan 10, 2022
@Julicher
Copy link
Author

Julicher commented Jan 10, 2022

and this method according to the docs, gives another error: see below

from python_bitvavo_api.bitvavo import Bitvavo

bitvavo = Bitvavo('<APIKEY>', '<APISECRET>')
response = bitvavo.account({})
print(response)
__init__() takes from 1 to 2 positional arguments but 3 were given

@Julicher Julicher changed the title 309 error 309 error and takes from 1 to 2 positional arguments but 3 were given Jan 10, 2022
@NostraDavid
Copy link

Your first block of code works perfectly fine for me; perhaps your key and/or secret aren't quite up to snuff? Or perhaps you haven't installed the latest version of the Bitvavo API? Though they haven't changed much as of late.

About your second block of code: Bitvavo('<APIKEY>', '<APISECRET>') would never work, because the Bitvavo object only accepts a dict object (like your first block), and dicts need both a key and a value combination to work :)

@Peccer
Copy link

Peccer commented Apr 9, 2022

I am encountering kind of the same problem.
In my google cloud function, the below code results in the 309 error.
But when I run the code in deepnote (notebook cloud platform) it all works fine....

bitvavo = Bitvavo({
'APIKEY': key,
'APISECRET': secretkey,
'RESTURL': 'https://api.bitvavo.com/v2',
'WSURL': 'wss://ws.bitvavo.com/v2/',
'ACCESSWINDOW': 10000,
'DEBUGGING': False
})
response_asset = bitvavo.assets({'symbol': symbol})
print("respones_asset",response_asset)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants