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

Method fetchStatus

java/lib/src/main/java/io/github/ccxt/exchanges/HtxCore.java:1233–1473  ·  view source on GitHub ↗

@method @name htx#fetchStatus @description the latest known information on the availability of the exchange API @see https://huobiapi.github.io/docs/spot/v1/en/#get-system-status @see https://huobiapi.github.io/docs/dm/v1/en/#get-system-status @see https://huobiapi.github.io/docs/coin_margined_swap/

(Object... optionalArgs)

Source from the content-addressed store, hash-verified

1231 * @returns {object} a [status structure]{@link https://docs.ccxt.com/?id=exchange-status-structure}
1232 */
1233 public java.util.concurrent.CompletableFuture<Object> fetchStatus(Object... optionalArgs)
1234 {
1235
1236 return java.util.concurrent.CompletableFuture.supplyAsync(() -> {
1237
1238 Object parameters = Helpers.getArg(optionalArgs, 0, new java.util.HashMap<String, Object>() {{}});
1239 (this.loadMarkets()).join();
1240 Object marketType = null;
1241 var marketTypeparametersVariable = this.handleMarketTypeAndParams("fetchStatus", null, parameters);
1242 marketType = ((java.util.List<Object>) marketTypeparametersVariable).get(0);
1243 parameters = ((java.util.List<Object>) marketTypeparametersVariable).get(1);
1244 Object enabledForContracts = this.handleOption("fetchStatus", "enableForContracts", false); // temp fix for: https://status-linear-swap.huobigroup.com/api/v2/summary.json
1245 Object response = null;
1246 if (Helpers.isTrue(Helpers.isTrue(!Helpers.isEqual(marketType, "spot")) && Helpers.isTrue(enabledForContracts)))
1247 {
1248 Object subType = this.safeString(parameters, "subType", Helpers.GetValue(this.options, "defaultSubType"));
1249 if (Helpers.isTrue(Helpers.isEqual(marketType, "swap")))
1250 {
1251 if (Helpers.isTrue(Helpers.isEqual(subType, "linear")))
1252 {
1253 response = (this.statusPublicSwapLinearGetApiV2SummaryJson()).join();
1254 } else if (Helpers.isTrue(Helpers.isEqual(subType, "inverse")))
1255 {
1256 response = (this.statusPublicSwapInverseGetApiV2SummaryJson()).join();
1257 }
1258 } else if (Helpers.isTrue(Helpers.isEqual(marketType, "future")))
1259 {
1260 if (Helpers.isTrue(Helpers.isEqual(subType, "linear")))
1261 {
1262 response = (this.statusPublicFutureLinearGetApiV2SummaryJson()).join();
1263 } else if (Helpers.isTrue(Helpers.isEqual(subType, "inverse")))
1264 {
1265 response = (this.statusPublicFutureInverseGetApiV2SummaryJson()).join();
1266 }
1267 } else if (Helpers.isTrue(Helpers.isEqual(marketType, "contract")))
1268 {
1269 response = (this.contractPublicGetHeartbeat()).join();
1270 }
1271 } else if (Helpers.isTrue(Helpers.isEqual(marketType, "spot")))
1272 {
1273 response = (this.statusPublicSpotGetApiV2SummaryJson()).join();
1274 }
1275 //
1276 // statusPublicSpotGetApiV2SummaryJson, statusPublicSwapInverseGetApiV2SummaryJson, statusPublicFutureLinearGetApiV2SummaryJson, statusPublicFutureInverseGetApiV2SummaryJson
1277 //
1278 // {
1279 // "page": {
1280 // "id":"mn7l2lw8pz4p",
1281 // "name":"Huobi Futures-USDT-margined Swaps",
1282 // "url":"https://status-linear-swap.huobigroup.com",
1283 // "time_zone":"Asia/Singapore",
1284 // "updated_at":"2022-04-29T12:47:21.319+08:00"},
1285 // "components": [
1286 // {
1287 // "id":"lrv093qk3yp5",
1288 // "name":"market data",
1289 // "status":"operational",
1290 // "created_at":"2020-10-29T14:08:59.427+08:00",

Callers

nothing calls this directly

Tested by

no test coverage detected