MCPcopy Create free account
hub / github.com/ccxt/ccxt / custom_handle_margin_mode_and_params

Method custom_handle_margin_mode_and_params

python/ccxt/cryptocom.py:2487–2505  ·  view source on GitHub ↗

@ignore marginMode specified by params["marginMode"], self.options["marginMode"], self.options["defaultMarginMode"], params["margin"] = True or self.options["defaultType"] = 'margin' :param dict [params]: extra parameters specific to the exchange API endpoint :returns Array

(self, methodName, params={})

Source from the content-addressed store, hash-verified

2485 }
2486
2487 def custom_handle_margin_mode_and_params(self, methodName, params={}) -> list:
2488 """
2489 @ignore
2490 marginMode specified by params["marginMode"], self.options["marginMode"], self.options["defaultMarginMode"], params["margin"] = True or self.options["defaultType"] = 'margin'
2491 :param dict [params]: extra parameters specific to the exchange API endpoint
2492 :returns Array: the marginMode in lowercase
2493 """
2494 defaultType = self.safe_string(self.options, 'defaultType')
2495 isMargin = self.safe_bool(params, 'margin', False)
2496 params = self.omit(params, 'margin')
2497 marginMode = None
2498 marginMode, params = self.handle_margin_mode_and_params(methodName, params)
2499 if marginMode is not None:
2500 if marginMode != 'cross':
2501 raise NotSupported(self.id + ' only cross margin is supported')
2502 else:
2503 if (defaultType == 'margin') or (isMargin is True):
2504 marginMode = 'cross'
2505 return [marginMode, params]
2506
2507 def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
2508 #

Callers 1

create_order_requestMethod · 0.95

Calls 5

NotSupportedClass · 0.90
safe_stringMethod · 0.80
safe_boolMethod · 0.80
omitMethod · 0.45

Tested by

no test coverage detected