bitvavo-api-upgraded 1.16.0__tar.gz → 1.17.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/.gitignore +7 -5
- bitvavo_api_upgraded-1.17.1/.python-version +5 -0
- bitvavo_api_upgraded-1.17.1/.vscode/settings.json +2 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/CHANGELOG.md +90 -2
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/LICENSE.txt +2 -2
- bitvavo_api_upgraded-1.17.1/PKG-INFO +320 -0
- bitvavo_api_upgraded-1.17.1/README.md +284 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/README.pypi.md +9 -3
- bitvavo_api_upgraded-1.17.1/docs/assets/bitvavo-mark-square-blue.svg +5 -0
- bitvavo_api_upgraded-1.17.1/docs/rest.md +72 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/pyproject.toml +50 -41
- bitvavo_api_upgraded-1.17.1/src/bitvavo_api_upgraded/__init__.py +8 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/src/bitvavo_api_upgraded/bitvavo.py +86 -40
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/src/bitvavo_api_upgraded/helper_funcs.py +1 -1
- bitvavo_api_upgraded-1.17.1/src/bitvavo_api_upgraded/settings.py +70 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/src/bitvavo_api_upgraded/type_aliases.py +3 -1
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/tests/conftest.py +9 -24
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/tests/test_bitvavo.py +135 -57
- bitvavo_api_upgraded-1.17.1/tests/test_settings.py +36 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/tox.ini +6 -2
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/uv.lock +309 -281
- bitvavo_api_upgraded-1.16.0/.python-version +0 -5
- bitvavo_api_upgraded-1.16.0/PKG-INFO +0 -2429
- bitvavo_api_upgraded-1.16.0/README.md +0 -2394
- bitvavo_api_upgraded-1.16.0/src/bitvavo_api_upgraded/settings.py +0 -47
- bitvavo_api_upgraded-1.16.0/tests/__init__.py +0 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/.github/README.md +0 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/.github/workflows/release.yml +0 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/.pre-commit-config.yaml +0 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/scripts/bootstrap.sh +0 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/src/bitvavo_api_upgraded/py.typed +0 -0
- {bitvavo_api_upgraded-1.16.0/src/bitvavo_api_upgraded → bitvavo_api_upgraded-1.17.1/tests}/__init__.py +0 -0
- {bitvavo_api_upgraded-1.16.0 → bitvavo_api_upgraded-1.17.1}/tests/test_helper_funcs.py +0 -0
@@ -1,9 +1,97 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
v1.17.1 - 2024-12-24
|
4
|
+
|
5
|
+
Turns out the settings weren't working as expected, so I switched
|
6
|
+
`python-decouple` out from `pydantic-settings`, which (once setup) works a lot
|
7
|
+
smoother. Keywords being "once setup", because holy smokes is it a paint to do
|
8
|
+
the initial setup - figure out how the hell you need to validate values before
|
9
|
+
or after, etc.
|
10
|
+
|
11
|
+
Just don't forget to create a local `.env` with `BITVAVO_APIKEY` and
|
12
|
+
`BITVAVO_APISECRET` keys.
|
13
|
+
|
14
|
+
### Added
|
15
|
+
|
16
|
+
- `pydantic-settings`: a powerful and modern way of loading your settings.
|
17
|
+
- we're using `.env` here, but it can be setup for `.json` or `.yaml` -
|
18
|
+
whatever you fancy.
|
19
|
+
- because of `pydantic-settings` you can now also do
|
20
|
+
`Bitvavo(bitvavo_settings.model_dump())`, and import bitvavo_settings from
|
21
|
+
`settings.py`
|
22
|
+
- add pydantic plugin for mypy, so mypy stops complaining about pydantic.
|
23
|
+
- vscode settings to disable `pytest-cov` during debugging. If you do not
|
24
|
+
disable `pytest-cov` during debugging, it still silently break your debugging
|
25
|
+
system...
|
26
|
+
- you can now import BitvavoApiUpgradedSettings and BitvavoSettings directly
|
27
|
+
from `bitvavo_api_upgraded`
|
28
|
+
|
29
|
+
### Changed
|
30
|
+
|
31
|
+
- `python-decouple` replaced by `pydantic-settings` - see Added and Removed
|
32
|
+
- `pytest-cov` relegated to enable coverage via vscode - friendship with
|
33
|
+
`pytest-cov` ended. `coverage.py` is my best friend.
|
34
|
+
- reason for this is because `pytest-cov` fucked with the ability to debug
|
35
|
+
within vscode.
|
36
|
+
- bump minor Python versions
|
37
|
+
|
38
|
+
### Removed
|
39
|
+
|
40
|
+
- `python-decouple` - this lacked type hinting since forever, not to mention it
|
41
|
+
didn't throw errors if missing...
|
42
|
+
|
43
|
+
### Fixed
|
44
|
+
|
45
|
+
- a bunch of tests that have VERY flaky output from the API >:(
|
46
|
+
|
47
|
+
## v1.17.0 - 2024-11-24
|
48
|
+
|
49
|
+
Integrate all changes from Bitvavo's `v1.1.1` to `v1.4.2` lib versions,
|
50
|
+
basically catching up their changes with our code. The reason for choosing
|
51
|
+
`v1.1.1` as starting point, is because I'm not sure if I missed anything,
|
52
|
+
because if I follow the timeline on PyPI is that I should pick `v1.2.2`, but if
|
53
|
+
I look at my commit history, I should choose an older point. Oh well, it's only
|
54
|
+
a little bit more work.
|
55
|
+
|
56
|
+
I used [this Github
|
57
|
+
link](https://github.com/bitvavo/python-bitvavo-api/compare/v1.1.1...v1.4.2) to
|
58
|
+
compare their versions.
|
59
|
+
|
60
|
+
### Added
|
61
|
+
|
62
|
+
- `fees()` call. This was added to the Python SDK in early 2024.
|
63
|
+
- `_default(value, fallback)` function, which ensures a `fallback` is returned,
|
64
|
+
if `value` is `None`. This ensures sane values will always be available.
|
65
|
+
- `strintdict` type, as I had a bunch of `dict` types copied.
|
66
|
+
|
67
|
+
### Changed
|
68
|
+
|
69
|
+
- you can now do `from bitvavo_api_upgraded import Bitvavo`, instead of `from
|
70
|
+
bitvavo_api_upgraded.bitvavo import Bitvavo`, which always felt annoying. You
|
71
|
+
can still use the old way; no worries.
|
72
|
+
- lowercased the http headers like `Bitvavo-Ratelimit-Remaining`, because
|
73
|
+
Bitvavo updated the API, which broke this code. This should probably fix the
|
74
|
+
issues of older versions of this lib going over the rate limit. 😅
|
75
|
+
- `LICENSE.txt`'s year got updated
|
76
|
+
- in `README.md`, below my text, I've replaced their old README with their
|
77
|
+
current one.
|
78
|
+
- fixed coverage report; I switched to `pytest-cov`, from `coverage.py`
|
79
|
+
eventhough `pytest-cov` still uses `coverage.py`, but the output was messed up
|
80
|
+
(it also covered `tests/`, wich was unintentional)
|
81
|
+
|
82
|
+
### Unchanged
|
83
|
+
|
84
|
+
Normally I don't add this chapter, but I'm moving changes from Bitvavo's repo to
|
85
|
+
here, so it's good I'll track this stuff for later.
|
86
|
+
|
87
|
+
- I did NOT add the `name` var to `__init__.py`, because I'm pretty sure they
|
88
|
+
added it for their build process, but since I'm using `uv` I don't need that.
|
89
|
+
- Did not add `self.timeout`, as I use `self.ACCESSWINDOW / 1000` instead.
|
90
|
+
|
3
91
|
## v1.16.0 - 2024-11-18
|
4
92
|
|
5
|
-
Quite a few changes, most aimed at the maintenance of this project, but all
|
6
|
-
code has not changed.
|
93
|
+
Quite a few changes, most aimed at the maintenance of this project, but all
|
94
|
+
changes are superficial - the functional code has not changed.
|
7
95
|
|
8
96
|
### Added
|
9
97
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
ISC License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2024, Bitvavo B.V.
|
4
4
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|
6
6
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -12,4 +12,4 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
12
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
13
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
14
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
@@ -0,0 +1,320 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: bitvavo-api-upgraded
|
3
|
+
Version: 1.17.1
|
4
|
+
Summary: A unit-tested fork of the Bitvavo API
|
5
|
+
Project-URL: homepage, https://github.com/Thaumatorium/bitvavo-api-upgraded
|
6
|
+
Project-URL: repository, https://github.com/Thaumatorium/bitvavo-api-upgraded
|
7
|
+
Project-URL: changelog, https://github.com/Thaumatorium/bitvavo-api-upgraded/blob/master/CHANGELOG.md
|
8
|
+
Author: Bitvavo BV (original code)
|
9
|
+
Author-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
|
10
|
+
Maintainer-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
|
11
|
+
License: ISC License
|
12
|
+
License-File: LICENSE.txt
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
14
|
+
Classifier: Environment :: Console
|
15
|
+
Classifier: Framework :: Pytest
|
16
|
+
Classifier: Framework :: tox
|
17
|
+
Classifier: Intended Audience :: Developers
|
18
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
19
|
+
Classifier: License :: OSI Approved :: ISC License (ISCL)
|
20
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
21
|
+
Classifier: Operating System :: Microsoft :: Windows
|
22
|
+
Classifier: Operating System :: POSIX
|
23
|
+
Classifier: Programming Language :: Python
|
24
|
+
Classifier: Programming Language :: Python :: 3.9
|
25
|
+
Classifier: Programming Language :: Python :: 3.10
|
26
|
+
Classifier: Programming Language :: Python :: 3.11
|
27
|
+
Classifier: Programming Language :: Python :: 3.12
|
28
|
+
Classifier: Programming Language :: Python :: 3.13
|
29
|
+
Classifier: Typing :: Typed
|
30
|
+
Requires-Python: >=3.9
|
31
|
+
Requires-Dist: pydantic-settings==2.*,>=2.6
|
32
|
+
Requires-Dist: requests==2.*,>=2.26
|
33
|
+
Requires-Dist: structlog==24.*,>=21.5
|
34
|
+
Requires-Dist: websocket-client==1.*,>=1.2
|
35
|
+
Description-Content-Type: text/markdown
|
36
|
+
|
37
|
+
# Bitvavo API (upgraded)
|
38
|
+
|
39
|
+
## Userguide
|
40
|
+
|
41
|
+
`pip install bitvavo_api_upgraded`
|
42
|
+
|
43
|
+
Works the same as the official API lib, but I have:
|
44
|
+
|
45
|
+
- typing for _all_ functions and classes
|
46
|
+
- unit tests (I already found three bugs that I fixed, because the original code
|
47
|
+
wasn't tested, at all)
|
48
|
+
- a changelog, so you can track of the changes that I make
|
49
|
+
- compatible with Python 3.7 and newer ([3.6 isn't supported as of
|
50
|
+
2021-12-23](https://endoflife.date/python))
|
51
|
+
|
52
|
+
## Devguide
|
53
|
+
|
54
|
+
```shell
|
55
|
+
echo "install development requirements"
|
56
|
+
uv sync
|
57
|
+
echo "run tox, a program that creates separate environments for different python versions, for testing purposes (among other things)"
|
58
|
+
uv run tox
|
59
|
+
```
|
60
|
+
|
61
|
+
### Semantic Versioning (SemVer)
|
62
|
+
|
63
|
+
I'm using semantic versioning, which means that changes mean this:
|
64
|
+
|
65
|
+
1. MAJOR version when you make incompatible API changes,
|
66
|
+
1. MINOR version when you add functionality in a backwards compatible manner,
|
67
|
+
and
|
68
|
+
1. PATCH version when you make backwards compatible bug fixes.
|
69
|
+
|
70
|
+
### Versioning
|
71
|
+
|
72
|
+
Copy the following block to CHANGELOG.md and add all information since last
|
73
|
+
version bump
|
74
|
+
|
75
|
+
```markdown
|
76
|
+
## $UNRELEASED
|
77
|
+
|
78
|
+
### Added
|
79
|
+
|
80
|
+
...
|
81
|
+
|
82
|
+
### Changed
|
83
|
+
|
84
|
+
...
|
85
|
+
|
86
|
+
### Removed
|
87
|
+
|
88
|
+
...
|
89
|
+
```
|
90
|
+
|
91
|
+
Commit those changes.
|
92
|
+
|
93
|
+
After that, run `bump-my-version bump (major|minor|patch)` to automatically
|
94
|
+
replace `$UNRELEASED` with the new version number, and also automatically tag
|
95
|
+
and commit (with tag) to release a new version via the Github workflow.
|
96
|
+
|
97
|
+
## py.typed
|
98
|
+
|
99
|
+
Perhaps a curious file, but it simply exists to let `mypy` know that the code is
|
100
|
+
typed: [Don't forget `py.typed` for your typed Python package
|
101
|
+
](https://blog.whtsky.me/tech/2021/dont-forget-py.typed-for-your-typed-python-package/)
|
102
|
+
|
103
|
+
## Last note
|
104
|
+
|
105
|
+
_below this line is the old README.md_
|
106
|
+
|
107
|
+
---
|
108
|
+
|
109
|
+
# Bitvavo SDK for Python
|
110
|
+
|
111
|
+
Crypto starts with Bitvavo. You use Bitvavo SDK for Python to buy, sell, and
|
112
|
+
store over 200 digital assets on Bitvavo from inside your app.
|
113
|
+
|
114
|
+
To trade and execute your advanced trading strategies, Bitvavo SDK for Python is
|
115
|
+
a wrapper that enables you to easily call every endpoint in [Bitvavo
|
116
|
+
API](https://docs.bitvavo.com/).
|
117
|
+
|
118
|
+
- [Prerequisites](#prerequisites) - what you need to start developing with
|
119
|
+
Bitvavo SDK for Python
|
120
|
+
- [Get started](#get-started) - rapidly create an app and start trading with
|
121
|
+
Bitvavo
|
122
|
+
- [About the SDK](#about-the-sdk) - general information about Bitvavo SDK for
|
123
|
+
Python
|
124
|
+
- [API reference](https://docs.bitvavo.com/) - information on the specifics of
|
125
|
+
every parameter
|
126
|
+
|
127
|
+
This page shows you how to use Bitvavo SDK for Python with WebSockets. For REST,
|
128
|
+
see the [REST readme](docs/rest.md).
|
129
|
+
|
130
|
+
## Prerequisites
|
131
|
+
|
132
|
+
To start programming with Bitvavo SDK for Python you need:
|
133
|
+
|
134
|
+
- [Python3](https://www.python.org/downloads/) installed on your development
|
135
|
+
environment
|
136
|
+
|
137
|
+
If you are working on macOS, ensure that you have installed SSH certificates:
|
138
|
+
|
139
|
+
```terminal
|
140
|
+
open /Applications/Python\ 3.12/Install\ Certificates.command
|
141
|
+
open /Applications/Python\ 3.12/Update\ Shell\ Profile.command
|
142
|
+
```
|
143
|
+
|
144
|
+
- A Python app. Use your favorite IDE, or run from the command line
|
145
|
+
- An [API key and
|
146
|
+
secret](https://support.bitvavo.com/hc/en-us/articles/4405059841809)
|
147
|
+
associated with your Bitvavo account
|
148
|
+
|
149
|
+
You control the actions your app can do using the rights you assign to the API
|
150
|
+
key. Possible rights are:
|
151
|
+
|
152
|
+
- **View**: retrieve information about your balance, account, deposit and
|
153
|
+
withdrawals
|
154
|
+
- **Trade**: place, update, view and cancel orders
|
155
|
+
- **Withdraw**: withdraw funds
|
156
|
+
|
157
|
+
Best practice is to not grant this privilege, withdrawals using the API do
|
158
|
+
not require 2FA and e-mail confirmation.
|
159
|
+
|
160
|
+
## Get started
|
161
|
+
|
162
|
+
Want to quickly make a trading app? Here you go:
|
163
|
+
|
164
|
+
1. **Install Bitvavo SDK for Python**
|
165
|
+
|
166
|
+
In your Python app, add [Bitvavo SDK for
|
167
|
+
Python](https://github.com/bitvavo/python-bitvavo-api) from
|
168
|
+
[pypi.org](https://pypi.org/project/python-bitvavo-api/):
|
169
|
+
|
170
|
+
```shell
|
171
|
+
python -m pip install python_bitvavo_api
|
172
|
+
```
|
173
|
+
|
174
|
+
If you installed from `test.pypi.com`, update the requests library: `pip
|
175
|
+
install --upgrade requests`.
|
176
|
+
|
177
|
+
1. **Create a simple Bitvavo implementation**
|
178
|
+
|
179
|
+
Add the following code to a new file in your app:
|
180
|
+
|
181
|
+
```python
|
182
|
+
from python_bitvavo_api.bitvavo import Bitvavo
|
183
|
+
import json
|
184
|
+
import time
|
185
|
+
|
186
|
+
# Use this class to connect to Bitvavo and make your first calls.
|
187
|
+
# Add trading strategies to implement your business logic.
|
188
|
+
class BitvavoImplementation:
|
189
|
+
api_key = "<Replace with your your API key from Bitvavo Dashboard>"
|
190
|
+
api_secret = "<Replace with your API secret from Bitvavo Dashboard>"
|
191
|
+
bitvavo_engine = None
|
192
|
+
bitvavo_socket = None
|
193
|
+
|
194
|
+
# Connect securely to Bitvavo, create the WebSocket and error callbacks.
|
195
|
+
def __init__(self):
|
196
|
+
self.bitvavo_engine = Bitvavo({
|
197
|
+
'APIKEY': self.api_key,
|
198
|
+
'APISECRET': self.api_secret
|
199
|
+
})
|
200
|
+
self.bitvavo_socket = self.bitvavo_engine.newWebsocket()
|
201
|
+
self.bitvavo_socket.setErrorCallback(self.error_callback)
|
202
|
+
|
203
|
+
# Handle errors.
|
204
|
+
def error_callback(self, error):
|
205
|
+
print("Add your error message.")
|
206
|
+
#print("Errors:", json.dumps(error, indent=2))
|
207
|
+
|
208
|
+
# Retrieve the data you need from Bitvavo in order to implement your
|
209
|
+
# trading logic. Use multiple workflows to return data to your
|
210
|
+
# callbacks.
|
211
|
+
def a_trading_strategy(self):
|
212
|
+
self.bitvavo_socket.ticker24h({}, self.a_trading_strategy_callback)
|
213
|
+
|
214
|
+
# In your app you analyse data returned by the trading strategy, then make
|
215
|
+
# calls to Bitvavo to respond to market conditions.
|
216
|
+
def a_trading_strategy_callback(self, response):
|
217
|
+
# Iterate through the markets
|
218
|
+
for market in response:
|
219
|
+
|
220
|
+
match market["market"]:
|
221
|
+
case "ZRX-EUR":
|
222
|
+
print("Eureka, the latest bid for ZRX-EUR is: ", market["bid"] )
|
223
|
+
# Implement calculations for your trading logic.
|
224
|
+
# If they are positive, place an order: For example:
|
225
|
+
# self.bitvavo_socket.placeOrder("ZRX-EUR",
|
226
|
+
# 'buy',
|
227
|
+
# 'limit',
|
228
|
+
# { 'amount': '1', 'price': '00001' },
|
229
|
+
# self.order_placed_callback)
|
230
|
+
case "a different market":
|
231
|
+
print("do something else")
|
232
|
+
case _:
|
233
|
+
print("Not this one: ", market["market"])
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
def order_placed_callback(self, response):
|
238
|
+
# The order return parameters explain the quote and the fees for this trade.
|
239
|
+
print("Order placed:", json.dumps(response, indent=2))
|
240
|
+
# Add your business logic.
|
241
|
+
|
242
|
+
|
243
|
+
# Sockets are fast, but asynchronous. Keep the socket open while you are
|
244
|
+
# trading.
|
245
|
+
def wait_and_close(self):
|
246
|
+
# Bitvavo uses a weight based rate limiting system. Your app is limited to 1000 weight points per IP or
|
247
|
+
# API key per minute. The rate weighting for each endpoint is supplied in Bitvavo API documentation.
|
248
|
+
# This call returns the amount of points left. If you make more requests than permitted by the weight limit,
|
249
|
+
# your IP or API key is banned.
|
250
|
+
limit = self.bitvavo_engine.getRemainingLimit()
|
251
|
+
try:
|
252
|
+
while (limit > 0):
|
253
|
+
time.sleep(0.5)
|
254
|
+
limit = self.bitvavo_engine.getRemainingLimit()
|
255
|
+
except KeyboardInterrupt:
|
256
|
+
self.bitvavo_socket.closeSocket()
|
257
|
+
|
258
|
+
|
259
|
+
# Shall I re-explain main? Naaaaaaaaaa.
|
260
|
+
if __name__ == '__main__':
|
261
|
+
bvavo = BitvavoImplementation()
|
262
|
+
bvavo.a_trading_strategy()
|
263
|
+
bvavo.wait_and_close()
|
264
|
+
```
|
265
|
+
|
266
|
+
1. **Add security information**
|
267
|
+
|
268
|
+
You must supply your security information to trade on Bitvavo and see your
|
269
|
+
account information using the authenticate methods. Replace the values of
|
270
|
+
`api_key` and `api_secret` with your credentials from [Bitvavo
|
271
|
+
Dashboard](https://account.bitvavo.com/user/api).
|
272
|
+
|
273
|
+
You can retrieve public information such as available markets, assets and
|
274
|
+
current market without supplying your key and secret. However,
|
275
|
+
unauthenticated calls have lower rate limits based on your IP address, and
|
276
|
+
your account is blocked for longer if you exceed your limit.
|
277
|
+
|
278
|
+
1. **Run your app**
|
279
|
+
|
280
|
+
- Command line warriors: `python3 <filename>`.
|
281
|
+
- IDE heroes: press the big green button.
|
282
|
+
|
283
|
+
Your app connects to Bitvavo and returns a list the latest trade price for each
|
284
|
+
market. You use this data to implement your trading logic.
|
285
|
+
|
286
|
+
## About the SDK
|
287
|
+
|
288
|
+
This section explains global concepts about Bitvavo SDK for Python.
|
289
|
+
|
290
|
+
### Rate limit
|
291
|
+
|
292
|
+
Bitvavo uses a weight based rate limiting system. Your app is limited to 1000
|
293
|
+
weight points per IP or API key per minute. When you make a call to Bitvavo API,
|
294
|
+
your remaining weight points are returned in the header of each REST request.
|
295
|
+
|
296
|
+
Websocket methods do not return your returning weight points, you track your
|
297
|
+
remaining weight points with a call to:
|
298
|
+
|
299
|
+
```python
|
300
|
+
limit = bitvavo.getRemainingLimit()
|
301
|
+
```
|
302
|
+
|
303
|
+
If you make more requests than permitted by the weight limit, your IP or API key
|
304
|
+
is banned.
|
305
|
+
|
306
|
+
The rate weighting for each endpoint is supplied in the [Bitvavo API
|
307
|
+
documentation](https://docs.bitvavo.com/).
|
308
|
+
|
309
|
+
### Requests
|
310
|
+
|
311
|
+
For all methods, required parameters are passed as separate values, optional
|
312
|
+
parameters are passed as a dictionary. Return parameters are in dictionary
|
313
|
+
format: `response['<key>'] = '<value>'`. However, as a limit order requires more
|
314
|
+
information than a market order, some optional parameters are required when you
|
315
|
+
place an order.
|
316
|
+
|
317
|
+
### Security
|
318
|
+
|
319
|
+
You must set your API key and secret for authenticated endpoints, public
|
320
|
+
endpoints do not require authentication.
|