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

bitvavo.Markets(map[string]string{"market": "BTC-EUR"}) fails to decode json response #4

Open
pavelsmolensky opened this issue May 3, 2021 · 1 comment

Comments

@pavelsmolensky
Copy link

Version: github.com/bitvavo/go-bitvavo-api v1.2.0

b = bitvavo.Bitvavo{
		ApiKey:       "***",
		ApiSecret:    "***",
		RestUrl:      "https://api.bitvavo.com/v2",
		WsUrl:        "wss://ws.bitvavo.com/v2/",
		AccessWindow: 10000,
		Debugging:    false,
	}

_, err := b.Markets(map[string]string{"market": "BTC-EUR"})
if err != nil {
	log.Fatal(err)
}

Results in

Error returned by API: errorCode:0, Message:

The root cause is that response for /markets?market=BTC-EUR contains json object, instead of json array expected by the lib:
https://github.com/bitvavo/go-bitvavo-api/blob/master/bitvavo.go#L716

Underlying error is
json: cannot unmarshal object into Go value of type []bitvavo.Markets

@PsySolix
Copy link

Have the same issue..

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

2 participants