MCPcopy Create free account
hub / github.com/ccxt/node-binance-api / fMarkPriceConvertData

Method fMarkPriceConvertData

src/node-binance-api.ts:2368–2397  ·  view source on GitHub ↗

* Converts the futures markPrice stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type

(data: any)

Source from the content-addressed store, hash-verified

2366 * @return {object} - user friendly data type
2367 */
2368 fMarkPriceConvertData(data: any) {
2369 const friendlyData = (data: any) => {
2370 const {
2371 e: eventType,
2372 E: eventTime,
2373 s: symbol,
2374 p: markPrice,
2375 i: indexPrice,
2376 r: fundingRate,
2377 T: fundingTime
2378 } = data;
2379 return {
2380 eventType,
2381 eventTime,
2382 symbol,
2383 markPrice,
2384 indexPrice,
2385 fundingRate,
2386 fundingTime
2387 };
2388 };
2389 if (Array.isArray(data)) {
2390 const result = [];
2391 for (const obj of data) {
2392 result.push(friendlyData(obj));
2393 }
2394 return result;
2395 }
2396 return friendlyData(data);
2397 }
2398
2399 /**
2400 * Converts the futures aggTrade stream data into a friendly object

Callers 1

Calls 1

friendlyDataFunction · 0.85

Tested by

no test coverage detected