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

Method safe_string_2

python/ccxt/base/exchange.py:839–852  ·  view source on GitHub ↗
(dictionary, key1, key2, default_value=None)

Source from the content-addressed store, hash-verified

837
838 @staticmethod
839 def safe_string_2(dictionary, key1, key2, default_value=None):
840 try:
841 value = dictionary[key1]
842 if value is not None and value != '':
843 return str(value)
844 except Exception:
845 pass
846 try:
847 value = dictionary[key2]
848 if value is not None and value != '':
849 return str(value)
850 except Exception:
851 pass
852 return default_value
853
854 @staticmethod
855 def safe_string_lower_2(dictionary, key1, key2, default_value=None):

Callers 15

test_safe_methodsFunction · 0.95
set_marketsMethod · 0.95
safe_orderMethod · 0.95
safe_tickerMethod · 0.95
network_code_to_idMethod · 0.95
safe_number_2Method · 0.95
handle_param_string_2Method · 0.95
marketMethod · 0.95

Calls

no outgoing calls

Tested by 2

test_safe_methodsFunction · 0.76