MCPcopy
hub / github.com/ccxt/ccxt / safeList2

Method safeList2

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

Source from the content-addressed store, hash-verified

4203 }
4204
4205 public Object safeList2(Object dictionaryOrList, Object key1, Object key2, Object... optionalArgs)
4206 {
4207 /**
4208 * @ignore
4209 * @method
4210 * @description safely extract an Array from dictionary or list
4211 * @returns {Array | undefined}
4212 */
4213 Object defaultValue = Helpers.getArg(optionalArgs, 0, null);
4214 Object value = this.safeValue(dictionaryOrList, key1);
4215 if (Helpers.isTrue(Helpers.isTrue((!Helpers.isEqual(value, null))) && Helpers.isTrue(Helpers.isArray(value))))
4216 {
4217 return value;
4218 }
4219 Object value2 = this.safeValue(dictionaryOrList, key2);
4220 if (Helpers.isTrue(Helpers.isTrue((!Helpers.isEqual(value2, null))) && Helpers.isTrue(Helpers.isArray(value2))))
4221 {
4222 return value2;
4223 }
4224 return defaultValue;
4225 }
4226
4227 public Object safeList(Object dictionaryOrList, Object key, Object... optionalArgs)
4228 {

Callers 15

testSafeMethodsMethod · 0.95
parseCustomBalanceMethod · 0.45
cancelAllOrdersMethod · 0.45
fetchFundingHistoryMethod · 0.45
parseOpenInterestMethod · 0.45
closePositionMethod · 0.45
closeAllPositionsMethod · 0.45
fetchTickersMethod · 0.45
parseCancelOrdersMethod · 0.45
cancelOrdersMethod · 0.45
fetchPositionMethod · 0.45
parseBalanceMethod · 0.45

Calls 5

getArgMethod · 0.95
safeValueMethod · 0.95
isTrueMethod · 0.95
isEqualMethod · 0.95
isArrayMethod · 0.95

Tested by 1

testSafeMethodsMethod · 0.76