MCPcopy Index your code
hub / github.com/ccxt/ccxt / safeDict2

Method safeDict2

java/lib/src/main/java/io/github/ccxt/Exchange.java:4157–4177  ·  view source on GitHub ↗
(Object dictionaryOrList, Object key1, Object key2, Object... optionalArgs)

Source from the content-addressed store, hash-verified

4155 }
4156
4157 public Object safeDict2(Object dictionaryOrList, Object key1, Object key2, Object... optionalArgs)
4158 {
4159 /**
4160 * @ignore
4161 * @method
4162 * @description safely extract a dictionary from dictionary or list
4163 * @returns {object | undefined}
4164 */
4165 Object defaultValue = Helpers.getArg(optionalArgs, 0, null);
4166 Object value = this.safeValue(dictionaryOrList, key1);
4167 if (Helpers.isTrue(this.isDictionary(value)))
4168 {
4169 return value;
4170 }
4171 Object value2 = this.safeValue(dictionaryOrList, key2);
4172 if (Helpers.isTrue(this.isDictionary(value2)))
4173 {
4174 return value2;
4175 }
4176 return defaultValue;
4177 }
4178
4179 public Object safeListN(Object dictionaryOrList, Object keys, Object... optionalArgs)
4180 {

Callers 15

testSafeMethodsMethod · 0.95
parseMarketMethod · 0.45
parseMarketMethod · 0.45
parseMarketMethod · 0.45
depositMethod · 0.45
fetchDepositMethod · 0.45
parseOrderMethod · 0.45
createOrderMethod · 0.45
cancelOrderMethod · 0.45
parseMarketMethod · 0.45
fetchClosedOrdersMethod · 0.45
fetchCanceledOrdersMethod · 0.45

Calls 4

getArgMethod · 0.95
safeValueMethod · 0.95
isTrueMethod · 0.95
isDictionaryMethod · 0.95

Tested by 1

testSafeMethodsMethod · 0.76