MCPcopy
hub / github.com/ccxt/ccxt / safeDict

Method safeDict

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

Source from the content-addressed store, hash-verified

4134 }
4135
4136 public Object safeDict(Object dictionaryOrList, Object key, Object... optionalArgs)
4137 {
4138 /**
4139 * @ignore
4140 * @method
4141 * @description safely extract a dictionary from dictionary or list
4142 * @returns {object | undefined}
4143 */
4144 Object defaultValue = Helpers.getArg(optionalArgs, 0, null);
4145 Object value = this.safeValue(dictionaryOrList, key, defaultValue);
4146 if (Helpers.isTrue(Helpers.isEqual(value, null)))
4147 {
4148 return defaultValue;
4149 }
4150 if (Helpers.isTrue(this.isDictionary(value)))
4151 {
4152 return value;
4153 }
4154 return defaultValue;
4155 }
4156
4157 public Object safeDict2(Object dictionaryOrList, Object key1, Object key2, Object... optionalArgs)
4158 {

Callers 15

initializePropertiesMethod · 0.95
fetchMarginModeMethod · 0.95
fetchLeverageMethod · 0.95
fetchOpenInterestMethod · 0.95
featuresMapperMethod · 0.95
featureValueByTypeMethod · 0.95
safeLedgerEntryMethod · 0.95
safeCurrencyStructureMethod · 0.95
setMarketsMethod · 0.95
safeOrderMethod · 0.95
parsedFeeAndFeesMethod · 0.95
safeTickerMethod · 0.95

Calls 5

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

Tested by 12

testSafeMethodsMethod · 0.76
testTickerMethod · 0.36
testCurrencyMethod · 0.36
testMarketMethod · 0.36
testFetchCurrenciesMethod · 0.36
fetchBestBidAskMethod · 0.36
testOptionsNetworksMethod · 0.36
getSkipsMethod · 0.36
tcoMininumAmountMethod · 0.36
tcoMininumCostMethod · 0.36