Code Duplication    Length = 12-13 lines in 4 locations

tradehub/demex_client.py 4 locations

@@ 254-266 (lines=13) @@
251
        else:
252
            raise ValueError("Stop Price target {} is required to be higher than the current market price {} to trigger a stop order.".format(stop_price, current_price))
253
254
    def stop_limit_sell(self, pair: str, price: str, quantity: str, stop_price: str):
255
        """
256
        Function to place a stop limit sell order on Demex.
257
258
        Execution of this function is as follows::
259
260
            stop_limit_sell(pair='swth_eth1', quantity=1000, price='0.0002', stop_price='0.00015')
261
262
        The expected return result for this function is as follows::
263
264
            {
265
                'height': str,
266
                'txhash': str,
267
                `'raw_log': str,
268
                'logs': [{
269
                    'msg_index': int,
@@ 207-219 (lines=13) @@
204
                                                    type="market")
205
        return self.tradehub.create_order(message=create_order_msg)
206
207
    def stop_limit_buy(self, pair: str, price: str, quantity: str, stop_price: str):
208
        """
209
        Function to place a stop limit buy order on Demex.
210
211
        Execution of this function is as follows::
212
213
            stop_limit_buy(pair='swth_eth1', quantity=1000, price='0.0001', stop_price='0.00015')
214
215
        The expected return result for this function is as follows::
216
217
            {
218
                'height': str,
219
                'txhash': str,
220
                `'raw_log': str,
221
                'logs': [{
222
                    'msg_index': int,
@@ 347-358 (lines=12) @@
344
        else:
345
            raise ValueError("Stop Price target {} is required to be higher than the current market price {} to trigger a stop order.".format(stop_price, current_price))
346
347
    def stop_market_sell(self, pair: str, quantity: str, stop_price: str):
348
        """
349
        Function to place a stop market sell order on Demex.
350
351
        Execution of this function is as follows::
352
353
            stop_market_sell(pair='swth_eth1', quantity=1000, stop_price='0.00015')
354
355
        The expected return result for this function is as follows::
356
357
            {
358
                'height': str,
359
                'txhash': str,
360
                `'raw_log': str,
361
                'logs': [{
@@ 301-312 (lines=12) @@
298
        else:
299
            raise ValueError("Stop Price target {} is required to be below the current market price {} to trigger a stop order.".format(stop_price, current_price))
300
301
    def stop_market_buy(self, pair: str, quantity: str, stop_price: str):
302
        """
303
        Function to place a stop market buy order on Demex.
304
305
        Execution of this function is as follows::
306
307
            stop_market_buy(pair='swth_eth1', quantity=1000, stop_price='0.00015')
308
309
        The expected return result for this function is as follows::
310
311
            {
312
                'height': str,
313
                'txhash': str,
314
                `'raw_log': str,
315
                'logs': [{