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

Method safe_list_2

python/ccxt/base/exchange.py:3024–3036  ·  view source on GitHub ↗

@ignore safely extract an Array from dictionary or list :returns Array | None:

(self, dictionaryOrList, key1: IndexType, key2: str, defaultValue: List[Any] = None)

Source from the content-addressed store, hash-verified

3022 return(value is not None) and isinstance(value, dict)
3023
3024 def safe_list_2(self, dictionaryOrList, key1: IndexType, key2: str, defaultValue: List[Any] = None):
3025 """
3026 @ignore
3027 safely extract an Array from dictionary or list
3028 :returns Array | None:
3029 """
3030 value = self.safe_value(dictionaryOrList, key1)
3031 if (value is not None) and isinstance(value, list):
3032 return value
3033 value2 = self.safe_value(dictionaryOrList, key2)
3034 if (value2 is not None) and isinstance(value2, list):
3035 return value2
3036 return defaultValue
3037
3038 def safe_list(self, dictionaryOrList, key: IndexType, defaultValue: List[Any] = None):
3039 """

Callers 15

test_safe_methodsFunction · 0.95
cancel_ordersMethod · 0.80
fetch_positionMethod · 0.80
fetch_marketsMethod · 0.80
parse_balance_customMethod · 0.80
cancel_ordersMethod · 0.80
fetch_transfersMethod · 0.80
signMethod · 0.80
parse_currencyMethod · 0.80
fetch_tickersMethod · 0.80
fetch_ledgerMethod · 0.80
cancel_ordersMethod · 0.80

Calls 1

safe_valueMethod · 0.95

Tested by 1

test_safe_methodsFunction · 0.76