@@ -328,6 +328,13 @@ def trades(self, market, options=None):
328328 def account (self ):
329329 return self .privateRequest ('/account' , '' , {}, 'GET' )
330330
331+ def fees (self , market = None ):
332+ options = {}
333+ if market is not None :
334+ options ['market' ] = market
335+ postfix = createPostfix (options )
336+ return self .privateRequest ('/account/fees' , postfix , {}, 'GET' )
337+
331338 # options: symbol
332339 def balance (self , options = None ):
333340 postfix = createPostfix (options )
@@ -416,7 +423,7 @@ def on_message(self, ws, msg):
416423
417424 if 'error' in msg :
418425 if msg ['errorCode' ] == 105 :
419- ws .bitvavo .updateRateLimit (msg )
426+ self .bitvavo .updateRateLimit (msg )
420427 if 'error' in callbacks :
421428 callbacks ['error' ](msg )
422429 else :
@@ -455,6 +462,8 @@ def on_message(self, ws, msg):
455462 callbacks ['trades' ](msg ['response' ])
456463 elif (msg ['action' ] == 'privateGetAccount' ):
457464 callbacks ['account' ](msg ['response' ])
465+ elif (msg ['action' ] == 'privateGetFees' ):
466+ callbacks ['fees' ](msg ['response' ])
458467 elif (msg ['action' ] == 'privateGetBalance' ):
459468 callbacks ['balance' ](msg ['response' ])
460469 elif (msg ['action' ] == 'privateDepositAssets' ):
@@ -471,13 +480,14 @@ def on_message(self, ws, msg):
471480 market = msg ['response' ]['market' ]
472481 if ('book' in callbacks ):
473482 callbacks ['book' ](msg ['response' ])
474- if (ws .keepBookCopy ):
483+ if (self .keepBookCopy ):
475484 if (market in callbacks ['subscriptionBook' ]):
476485 callbacks ['subscriptionBook' ][market ](ws , msg )
477486
478487 elif ('event' in msg ):
479488 if (msg ['event' ] == 'authenticate' ):
480- ws .authenticated = True
489+ self .authenticated = True
490+ debugToConsole ('Authenticated Websocket.' )
481491 elif (msg ['event' ] == 'fill' ):
482492 market = msg ['market' ]
483493 callbacks ['subscriptionAccount' ][market ](msg )
@@ -499,7 +509,7 @@ def on_message(self, ws, msg):
499509 if ('subscriptionBookUpdate' in callbacks ):
500510 if (market in callbacks ['subscriptionBookUpdate' ]):
501511 callbacks ['subscriptionBookUpdate' ][market ](msg )
502- if (ws .keepBookCopy ):
512+ if (self .keepBookCopy ):
503513 if (market in callbacks ['subscriptionBook' ]):
504514 callbacks ['subscriptionBook' ][market ](ws , msg )
505515 elif (msg ['event' ] == 'trade' ):
@@ -673,6 +683,13 @@ def account(self, callback):
673683 self .callbacks ['account' ] = callback
674684 self .doSend (self .ws , json .dumps ({ 'action' : 'privateGetAccount' }), True )
675685
686+ def fees (self , market , callback = None ):
687+ if callable (market ):
688+ callback = market
689+ market = None
690+ self .callbacks ['fees' ] = callback
691+ self .doSend (self .ws , json .dumps ({ 'action' : 'privateGetFees' , 'market' : market }), True )
692+
676693 # options: symbol
677694 def balance (self , options , callback ):
678695 options ['action' ] = 'privateGetBalance'
0 commit comments