@@ -269,7 +269,10 @@ def ticker24h(self, options):
269269 postfix = createPostfix (options )
270270 return self .publicRequest ((self .base + '/ticker/24h' + postfix ))
271271
272- # optional body parameters: limit:(amount, price, postOnly), market:(amount, amountQuote, disableMarketProtection), both: timeInForce, selfTradePrevention, responseRequired
272+ # optional body parameters: limit:(amount, price, postOnly), market:(amount, amountQuote, disableMarketProtection)
273+ # stopLoss/takeProfit:(amount, amountQuote, disableMarketProtection, triggerType, triggerReference, triggerAmount)
274+ # stopLossLimit/takeProfitLimit:(amount, price, postOnly, triggerType, triggerReference, triggerAmount)
275+ # all orderTypes: timeInForce, selfTradePrevention, responseRequired
273276 def placeOrder (self , market , side , orderType , body ):
274277 body ['market' ] = market
275278 body ['side' ] = side
@@ -280,8 +283,9 @@ def getOrder(self, market, orderId):
280283 postfix = createPostfix ({ 'market' : market , 'orderId' : orderId })
281284 return self .privateRequest ('/order' , postfix , {}, 'GET' )
282285
283- # Optional body parameters: limit:(amount, amountRemaining, price, timeInForce, selfTradePrevention, postOnly)
284- # (set at least 1) (responseRequired can be set as well, but does not update anything)
286+ # Optional parameters: limit:(amount, amountRemaining, price, timeInForce, selfTradePrevention, postOnly)
287+ # untriggered stopLoss/takeProfit:(amount, amountQuote, disableMarketProtection, triggerType, triggerReference, triggerAmount)
288+ # stopLossLimit/takeProfitLimit: (amount, price, postOnly, triggerType, triggerReference, triggerAmount)
285289 def updateOrder (self , market , orderId , body ):
286290 body ['market' ] = market
287291 body ['orderId' ] = orderId
@@ -313,6 +317,9 @@ def trades(self, market, options):
313317 postfix = createPostfix (options )
314318 return self .privateRequest ('/trades' , postfix , {}, 'GET' )
315319
320+ def account (self ):
321+ return self .privateRequest ('/account' , '' , {}, 'GET' )
322+
316323 # options: symbol
317324 def balance (self , options ):
318325 postfix = createPostfix (options )
@@ -438,6 +445,8 @@ def on_message(ws, msg):
438445 callbacks ['ordersOpen' ](msg ['response' ])
439446 elif (msg ['action' ] == 'privateGetTrades' ):
440447 callbacks ['trades' ](msg ['response' ])
448+ elif (msg ['action' ] == 'privateGetAccount' ):
449+ callbacks ['account' ](msg ['response' ])
441450 elif (msg ['action' ] == 'privateGetBalance' ):
442451 callbacks ['balance' ](msg ['response' ])
443452 elif (msg ['action' ] == 'privateDepositAssets' ):
@@ -594,7 +603,10 @@ def tickerBook(self, options, callback):
594603 options ['action' ] = 'getTickerBook'
595604 self .doSend (self .ws , json .dumps (options ))
596605
597- # optional body parameters: limit:(amount, price, postOnly), market:(amount, amountQuote, disableMarketProtection), both: timeInForce, selfTradePrevention, responseRequired
606+ # optional body parameters: limit:(amount, price, postOnly), market:(amount, amountQuote, disableMarketProtection)
607+ # stopLoss/takeProfit:(amount, amountQuote, disableMarketProtection, triggerType, triggerReference, triggerAmount)
608+ # stopLossLimit/takeProfitLimit:(amount, price, postOnly, triggerType, triggerReference, triggerAmount)
609+ # all orderTypes: timeInForce, selfTradePrevention, responseRequired
598610 def placeOrder (self , market , side , orderType , body , callback ):
599611 self .callbacks ['placeOrder' ] = callback
600612 body ['market' ] = market
@@ -608,8 +620,9 @@ def getOrder(self, market, orderId, callback):
608620 options = { 'action' : 'privateGetOrder' , 'market' : market , 'orderId' : orderId }
609621 self .doSend (self .ws , json .dumps (options ), True )
610622
611- # Optional body parameters: limit:(amount, amountRemaining, price, timeInForce, selfTradePrevention, postOnly)
612- # (set at least 1) (responseRequired can be set as well, but does not update anything)
623+ # Optional parameters: limit:(amount, amountRemaining, price, timeInForce, selfTradePrevention, postOnly)
624+ # untriggered stopLoss/takeProfit:(amount, amountQuote, disableMarketProtection, triggerType, triggerReference, triggerAmount)
625+ # stopLossLimit/takeProfitLimit: (amount, price, postOnly, triggerType, triggerReference, triggerAmount)
613626 def updateOrder (self , market , orderId , body , callback ):
614627 self .callbacks ['updateOrder' ] = callback
615628 body ['market' ] = market
@@ -648,6 +661,10 @@ def trades(self, market, options, callback):
648661 options ['market' ] = market
649662 self .doSend (self .ws , json .dumps (options ), True )
650663
664+ def account (self , callback ):
665+ self .callbacks ['account' ] = callback
666+ self .doSend (self .ws , json .dumps ({ 'action' : 'privateGetAccount' }), True )
667+
651668 # options: symbol
652669 def balance (self , options , callback ):
653670 options ['action' ] = 'privateGetBalance'
0 commit comments