MCPcopy
hub / github.com/ccxt/ccxt / safeDictN

Method safeDictN

java/lib/src/main/java/io/github/ccxt/Exchange.java:4115–4134  ·  view source on GitHub ↗
(Object dictionaryOrList, Object keys, Object... optionalArgs)

Source from the content-addressed store, hash-verified

4113 }
4114
4115 public Object safeDictN(Object dictionaryOrList, Object keys, Object... optionalArgs)
4116 {
4117 /**
4118 * @ignore
4119 * @method
4120 * @description safely extract a dictionary from dictionary or list
4121 * @returns {object | undefined}
4122 */
4123 Object defaultValue = Helpers.getArg(optionalArgs, 0, null);
4124 Object value = this.safeValueN(dictionaryOrList, keys, defaultValue);
4125 if (Helpers.isTrue(Helpers.isEqual(value, null)))
4126 {
4127 return defaultValue;
4128 }
4129 if (Helpers.isTrue(this.isDictionary(value)))
4130 {
4131 return value;
4132 }
4133 return defaultValue;
4134 }
4135
4136 public Object safeDict(Object dictionaryOrList, Object key, Object... optionalArgs)
4137 {

Callers 8

testSafeMethodsMethod · 0.95
parseOrderMethod · 0.45
handleTickerMethod · 0.45
handleOrderBookMethod · 0.45
handleTradesMethod · 0.45
handleMyTradeMethod · 0.45
handleOrderMethod · 0.45
handleBalanceMethod · 0.45

Calls 5

getArgMethod · 0.95
safeValueNMethod · 0.95
isTrueMethod · 0.95
isEqualMethod · 0.95
isDictionaryMethod · 0.95

Tested by 1

testSafeMethodsMethod · 0.76