@icgio/icg-exchanges-wrapper 1.14.4 → 1.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -413,23 +413,28 @@ module.exports = class Orders {
413
413
  return this.order_info
414
414
  }
415
415
  get_order_info_all_stats() {
416
- const info_all = this.get_order_info_all()
417
- return Object.entries(info_all).reduce((exchange_stats, [exchange, pairs]) => {
418
- exchange_stats[exchange] = Object.entries(pairs).reduce((pair_stats, [pair, types]) => {
419
- pair_stats[pair] = Object.entries(types).reduce((type_stats, [type, orders]) => {
420
- type_stats[type] = Object.entries(orders).map(([order_id, order]) => ({
421
- order_id: order_id,
422
- price: order.price,
423
- amount: order.amount,
424
- f_amount: order.f_amount,
425
- t_amount: order.t_amount,
426
- }))
427
- return type_stats
428
- }, {})
429
- return pair_stats
430
- }, {})
431
- return exchange_stats
432
- }, {})
416
+ let info_all = this.get_order_info_all()
417
+ let stats = []
418
+ for (let exchange in info_all) {
419
+ for (let pair in info_all[exchange]) {
420
+ for (let type in info_all[exchange][pair]) {
421
+ for (let order_id in info_all[exchange][pair][type]) {
422
+ let order = info_all[exchange][pair][type][order_id]
423
+ stats.push({
424
+ exchange: exchange,
425
+ pair: pair,
426
+ type: type.toUpperCase(),
427
+ order_id: order_id,
428
+ price: order.price || 'N/A',
429
+ amount: order.amount || 0,
430
+ f_amount: order.f_amount || 0,
431
+ t_amount: order.t_amount || 0,
432
+ })
433
+ }
434
+ }
435
+ }
436
+ }
437
+ return stats
433
438
  }
434
439
  get_order_info_by_order_type(order_type) {
435
440
  let order_info_temp = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.14.4",
3
+ "version": "1.14.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {