@method @name okx#fetchTicker @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-ticker @param {string} symbol unified symbol of the market
(Object symbol, Object... optionalArgs)
| 2323 | * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure} |
| 2324 | */ |
| 2325 | public java.util.concurrent.CompletableFuture<Object> fetchTicker(Object symbol, Object... optionalArgs) |
| 2326 | { |
| 2327 | |
| 2328 | return java.util.concurrent.CompletableFuture.supplyAsync(() -> { |
| 2329 | |
| 2330 | Object parameters = Helpers.getArg(optionalArgs, 0, new java.util.HashMap<String, Object>() {{}}); |
| 2331 | (this.loadMarkets()).join(); |
| 2332 | Object market = this.market(symbol); |
| 2333 | Object request = new java.util.HashMap<String, Object>() {{ |
| 2334 | put( "instId", Helpers.GetValue(market, "id") ); |
| 2335 | }}; |
| 2336 | Object response = (this.publicGetMarketTicker(this.extend(request, parameters))).join(); |
| 2337 | // |
| 2338 | // { |
| 2339 | // "code": "0", |
| 2340 | // "msg": "", |
| 2341 | // "data": [ |
| 2342 | // { |
| 2343 | // "instType": "SPOT", |
| 2344 | // "instId": "ETH-BTC", |
| 2345 | // "last": "0.07319", |
| 2346 | // "lastSz": "0.044378", |
| 2347 | // "askPx": "0.07322", |
| 2348 | // "askSz": "4.2", |
| 2349 | // "bidPx": "0.0732", |
| 2350 | // "bidSz": "6.050058", |
| 2351 | // "open24h": "0.07801", |
| 2352 | // "high24h": "0.07975", |
| 2353 | // "low24h": "0.06019", |
| 2354 | // "volCcy24h": "11788.887619", |
| 2355 | // "vol24h": "167493.829229", |
| 2356 | // "ts": "1621440583784", |
| 2357 | // "sodUtc0": "0.07872", |
| 2358 | // "sodUtc8": "0.07345" |
| 2359 | // } |
| 2360 | // ] |
| 2361 | // } |
| 2362 | // |
| 2363 | Object data = this.safeList(response, "data", new java.util.ArrayList<Object>(java.util.Arrays.asList())); |
| 2364 | Object first = this.safeDict(data, 0, new java.util.HashMap<String, Object>() {{}}); |
| 2365 | return this.parseTicker(first, market); |
| 2366 | }); |
| 2367 | |
| 2368 | } |
| 2369 | |
| 2370 | /** |
| 2371 | * @method |
nothing calls this directly
no test coverage detected