Skip to content

Commit ac46502

Browse files
committed
added restUrl and wsUrl, updated logo
1 parent 66d6f7b commit ac46502

File tree

3 files changed

+38
-5
lines changed

3 files changed

+38
-5
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<p align="center">
2-
<a href="https://bitvavo.com"><img src="https://bitvavo.com/media/images/logo/bitvavoGeneral.svg" width="600" title="Bitvavo Logo"></a>
2+
<br>
3+
<a href="https://bitvavo.com"><img src="https://bitvavo.com/assets/static/ext/logo-shape.svg" width="100" title="Bitvavo Logo">
34
</p>
45

56
# Python Bitvavo Api
@@ -176,6 +177,9 @@ print(response)
176177
"withdrawalFee": "0.2",
177178
"withdrawalMinAmount": "0.2",
178179
"withdrawalStatus": "OK",
180+
"networks": [
181+
"Mainnet"
182+
],
179183
"message": ""
180184
},
181185
{
@@ -188,6 +192,9 @@ print(response)
188192
"withdrawalFee": "2",
189193
"withdrawalMinAmount": "2",
190194
"withdrawalStatus": "OK",
195+
"networks": [
196+
"Mainnet"
197+
],
191198
"message": ""
192199
},
193200
{
@@ -200,6 +207,9 @@ print(response)
200207
"withdrawalFee": "3",
201208
"withdrawalMinAmount": "3",
202209
"withdrawalStatus": "",
210+
"networks": [
211+
"Mainnet"
212+
],
203213
"message": ""
204214
},
205215
{
@@ -212,6 +222,9 @@ print(response)
212222
"withdrawalFee": "2",
213223
"withdrawalMinAmount": "2",
214224
"withdrawalStatus": "OK",
225+
"networks": [
226+
"Mainnet"
227+
],
215228
"message": ""
216229
},
217230
...
@@ -1193,6 +1206,9 @@ websocket.assets({}, ownCallback)
11931206
"withdrawalFee": "0.2",
11941207
"withdrawalMinAmount": "0.2",
11951208
"withdrawalStatus": "OK",
1209+
"networks": [
1210+
"Mainnet"
1211+
],
11961212
"message": ""
11971213
},
11981214
{
@@ -1205,6 +1221,9 @@ websocket.assets({}, ownCallback)
12051221
"withdrawalFee": "2",
12061222
"withdrawalMinAmount": "2",
12071223
"withdrawalStatus": "OK",
1224+
"networks": [
1225+
"Mainnet"
1226+
],
12081227
"message": ""
12091228
},
12101229
{
@@ -1217,6 +1236,9 @@ websocket.assets({}, ownCallback)
12171236
"withdrawalFee": "3",
12181237
"withdrawalMinAmount": "3",
12191238
"withdrawalStatus": "",
1239+
"networks": [
1240+
"Mainnet"
1241+
],
12201242
"message": ""
12211243
},
12221244
{
@@ -1229,6 +1251,9 @@ websocket.assets({}, ownCallback)
12291251
"withdrawalFee": "2",
12301252
"withdrawalMinAmount": "2",
12311253
"withdrawalStatus": "OK",
1254+
"networks": [
1255+
"Mainnet"
1256+
],
12321257
"message": ""
12331258
},
12341259
...

python_bitvavo_api/bitvavo.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def run(self):
130130

131131
class Bitvavo:
132132
def __init__(self, options = {}):
133+
self.base = "https://api.bitvavo.com/v2"
134+
self.wsUrl = "wss://ws.bitvavo.com/v2/"
133135
self.ACCESSWINDOW = None
134136
self.APIKEY = ''
135137
self.APISECRET = ''
@@ -146,9 +148,12 @@ def __init__(self, options = {}):
146148
self.ACCESSWINDOW = options[key]
147149
elif key.lower() == "debugging":
148150
debugging = options[key]
151+
elif key.lower() == "resturl":
152+
self.base = options[key]
153+
elif key.lower() == "wsurl":
154+
self.wsUrl = options[key]
149155
if(self.ACCESSWINDOW == None):
150156
self.ACCESSWINDOW = 10000
151-
self.base = 'https://api.bitvavo.com/v2'
152157

153158
def getRemainingLimit(self):
154159
return self.rateLimitRemaining
@@ -335,13 +340,14 @@ def withdrawalHistory(self, options):
335340
return self.privateRequest('/withdrawalHistory', postfix, {}, 'GET')
336341

337342
def newWebsocket(self):
338-
return Bitvavo.websocket(self.APIKEY, self.APISECRET, self.ACCESSWINDOW, self)
343+
return Bitvavo.websocket(self.APIKEY, self.APISECRET, self.ACCESSWINDOW, self.wsUrl, self)
339344

340345
class websocket:
341-
def __init__(self, APIKEY, APISECRET, ACCESSWINDOW, bitvavo):
346+
def __init__(self, APIKEY, APISECRET, ACCESSWINDOW, WSURL, bitvavo):
342347
self.APIKEY = APIKEY
343348
self.APISECRET = APISECRET
344349
self.ACCESSWINDOW = ACCESSWINDOW
350+
self.wsUrl = WSURL
345351
self.open = False
346352
self.callbacks = {}
347353
self.keepAlive = True
@@ -353,7 +359,7 @@ def __init__(self, APIKEY, APISECRET, ACCESSWINDOW, bitvavo):
353359

354360
def subscribe(self):
355361
websocket.enableTrace(False)
356-
ws = websocket.WebSocketApp("wss://ws.bitvavo.com/v2/",
362+
ws = websocket.WebSocketApp(self.wsUrl,
357363
on_message = self.on_message,
358364
on_error = self.on_error,
359365
on_close = self.on_close)

python_bitvavo_api/testApi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def main():
1717
bitvavo = Bitvavo({
1818
'APIKEY': '<APIKEY>',
1919
'APISECRET': '<APISECRET>',
20+
'RESTURL': 'https://api.bitvavo.com/v2',
21+
'WSURL': 'wss://ws.bitvavo.com/v2/',
2022
'ACCESSWINDOW': 10000,
2123
'DEBUGGING': False
2224
})

0 commit comments

Comments
 (0)