coinfloor / API

All you need to know about the APIs for Coinfloor's Trade Engine
Apache License 2.0
34 stars 20 forks source link

why does the balance query take two currencies in the url? #21

Closed npomfret closed 6 years ago

npomfret commented 6 years ago

The example url in the account balance documentation is this: https://webapi.coinfloor.co.uk:8090/bist/XBT/GBP/balance/

Why are there two currencies? Can I add more? Can I specify only one?

Also, the docs states that I need these 3 parameters:

User ID - user ID
API key - api key
Passphrase - passphrase

That's not correct, is it?

whitslack commented 6 years ago

Why are there two currencies? Can I add more? Can I specify only one?

It's because BIST is an emulation of Bitstamp's v1 API. Bitstamp traded only a single currency pair at that time, so their API did not support arbitrary numbers of currencies. When we implemented BIST, we had to replicate Bitstamp's API at multiple base URIs, one for each currency pair traded on Coinfloor. We don't recommend using BIST, as it's inefficient compared to our native WebSocket-based API.

Also, the docs states that I need these 3 parameters: […] That's not correct, is it?

The docs are correct. What is your doubt?

npomfret commented 6 years ago

Thanks for the quick response. And ignore the comment about 3 params!

Is there a convenient way using the API to get every currency pair that would ensure I can get all by balances?

whitslack commented 6 years ago

The GetBalances method in the WebSocket API returns all of your balances across all assets. With the JavaScript client library you would call this method like Coinfloor.getBalances(console.log), replacing console.log with your own callback function to receive the balances. There is no plain HTTP API method to get all balances at once.