@chainstream-io/sdk 0.0.8 → 0.0.9

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.
@@ -313,306 +313,338 @@ class StreamApi {
313
313
  return this.subscribe(channel, (data) => callback(data === null || data === void 0 ? void 0 : data.map((item) => {
314
314
  const result = {};
315
315
  if (item.t) {
316
- result.tokenAddress = item.t.a;
316
+ result.metadata = {
317
+ tokenAddress: item.t.a,
318
+ };
317
319
  if (item.t.n) {
318
- result.name = item.t.n;
320
+ result.metadata.name = item.t.n;
319
321
  }
320
322
  if (item.t.s) {
321
- result.symbol = item.t.s;
323
+ result.metadata.symbol = item.t.s;
322
324
  }
323
325
  if (item.t.iu) {
324
- result.imageUrl = item.t.iu;
326
+ result.metadata.imageUrl = item.t.iu;
325
327
  }
326
328
  if (item.t.de) {
327
- result.description = item.t.de;
329
+ result.metadata.description = item.t.de;
330
+ }
331
+ if (item.t.d) {
332
+ result.metadata.decimals = item.t.dec;
333
+ }
334
+ if (item.t.cts) {
335
+ result.metadata.createdAtMs = item.t.cts;
336
+ }
337
+ if (item.t.lf) {
338
+ result.metadata.launchFrom = {};
339
+ if (item.t.lf.pa) {
340
+ result.metadata.launchFrom.programAddress = item.t.lf.pa;
341
+ }
342
+ if (item.t.lf.pf) {
343
+ result.metadata.launchFrom.protocolFamily = item.t.lf.pf;
344
+ }
345
+ if (item.t.lf.pn) {
346
+ result.metadata.launchFrom.protocolName = item.t.lf.pn;
347
+ }
348
+ }
349
+ if (item.t.mt) {
350
+ result.metadata.migratedTo = {};
351
+ if (item.t.mt.pa) {
352
+ result.metadata.migratedTo.programAddress = item.t.mt.pa;
353
+ }
354
+ if (item.t.mt.pf) {
355
+ result.metadata.migratedTo.protocolFamily = item.t.mt.pf;
356
+ }
357
+ if (item.t.mt.pn) {
358
+ result.metadata.migratedTo.protocolName = item.t.mt.pn;
359
+ }
328
360
  }
329
361
  if (item.t.sm) {
330
- result.socialMedia = {};
362
+ result.metadata.socialMedia = {};
331
363
  if (item.t.sm.tw) {
332
- result.socialMedia.twitter = item.t.sm.tw;
364
+ result.metadata.socialMedia.twitter = item.t.sm.tw;
333
365
  }
334
366
  if (item.t.sm.tg) {
335
- result.socialMedia.telegram = item.t.sm.tg;
367
+ result.metadata.socialMedia.telegram = item.t.sm.tg;
336
368
  }
337
369
  if (item.t.sm.w) {
338
- result.socialMedia.website = item.t.sm.w;
370
+ result.metadata.socialMedia.website = item.t.sm.w;
339
371
  }
340
372
  if (item.t.sm.tt) {
341
- result.socialMedia.tiktok = item.t.sm.tt;
373
+ result.metadata.socialMedia.tiktok = item.t.sm.tt;
342
374
  }
343
375
  if (item.t.sm.dc) {
344
- result.socialMedia.discord = item.t.sm.dc;
376
+ result.metadata.socialMedia.discord = item.t.sm.dc;
345
377
  }
346
378
  if (item.t.sm.fb) {
347
- result.socialMedia.facebook = item.t.sm.fb;
379
+ result.metadata.socialMedia.facebook = item.t.sm.fb;
348
380
  }
349
381
  if (item.t.sm.gh) {
350
- result.socialMedia.github = item.t.sm.gh;
382
+ result.metadata.socialMedia.github = item.t.sm.gh;
351
383
  }
352
384
  if (item.t.sm.ig) {
353
- result.socialMedia.instagram = item.t.sm.ig;
385
+ result.metadata.socialMedia.instagram = item.t.sm.ig;
354
386
  }
355
387
  if (item.t.sm.li) {
356
- result.socialMedia.linkedin = item.t.sm.li;
388
+ result.metadata.socialMedia.linkedin = item.t.sm.li;
357
389
  }
358
390
  if (item.t.sm.md) {
359
- result.socialMedia.medium = item.t.sm.md;
391
+ result.metadata.socialMedia.medium = item.t.sm.md;
360
392
  }
361
393
  if (item.t.sm.rd) {
362
- result.socialMedia.reddit = item.t.sm.rd;
394
+ result.metadata.socialMedia.reddit = item.t.sm.rd;
363
395
  }
364
396
  if (item.t.sm.yt) {
365
- result.socialMedia.youtube = item.t.sm.yt;
397
+ result.metadata.socialMedia.youtube = item.t.sm.yt;
366
398
  }
367
399
  if (item.t.sm.bb) {
368
- result.socialMedia.bitbucket = item.t.sm.bb;
400
+ result.metadata.socialMedia.bitbucket = item.t.sm.bb;
369
401
  }
370
402
  }
371
403
  if (item.t.cts) {
372
- result.createdAtMs = item.t.cts;
404
+ result.metadata.createdAtMs = item.t.cts;
373
405
  }
374
406
  }
375
- if (item.h) {
376
- if (item.h.a) {
377
- result.tokenAddress = item.h.a;
378
- }
379
- if (item.h.h !== undefined) {
380
- result.holders = item.h.h;
407
+ if (item.bc) {
408
+ result.bondingCurve = {};
409
+ if (item.bc.pr) {
410
+ result.bondingCurve.progressRatio = this.formatScientificNotation(item.bc.pr);
381
411
  }
382
- if (item.h.t100a !== undefined) {
383
- result.top100Amount = this.formatScientificNotation(item.h.t100a);
412
+ }
413
+ if (item.h) {
414
+ result.holder = {
415
+ tokenAddress: item.h.a,
416
+ timestamp: item.h.ts || 0,
417
+ };
418
+ if (item.h.h) {
419
+ result.holder.holders = item.h.h;
384
420
  }
385
- if (item.h.t10a !== undefined) {
386
- result.top10Amount = this.formatScientificNotation(item.h.t10a);
421
+ if (item.h.t100a) {
422
+ result.holder.top100Amount = this.formatScientificNotation(item.h.t100a);
387
423
  }
388
- if (item.h.t100h !== undefined) {
389
- result.top100Holders = item.h.t100h;
424
+ if (item.h.t10a) {
425
+ result.holder.top10Amount = this.formatScientificNotation(item.h.t10a);
390
426
  }
391
- if (item.h.t10h !== undefined) {
392
- result.top10Holders = item.h.t10h;
427
+ if (item.h.t100h) {
428
+ result.holder.top100Holders = item.h.t100h;
393
429
  }
394
- if (item.h.t100r !== undefined) {
395
- result.top100Ratio = this.formatScientificNotation(item.h.t100r);
430
+ if (item.h.t10h) {
431
+ result.holder.top10Holders = item.h.t10h;
396
432
  }
397
- if (item.h.t10r !== undefined) {
398
- result.top10Ratio = this.formatScientificNotation(item.h.t10r);
433
+ if (item.h.t100r) {
434
+ result.holder.top100Ratio = this.formatScientificNotation(item.h.t100r);
399
435
  }
400
- if (item.h.ts !== undefined) {
401
- result.timestamp = item.h.ts;
436
+ if (item.h.t10r) {
437
+ result.holder.top10Ratio = this.formatScientificNotation(item.h.t10r);
402
438
  }
403
439
  }
404
440
  if (item.s) {
405
- if (item.s.a) {
406
- result.tokenAddress = item.s.a;
441
+ result.supply = {
442
+ tokenAddress: item.s.a,
443
+ timestamp: item.s.ts || 0,
444
+ };
445
+ if (item.s.s) {
446
+ result.supply.supply = item.s.s;
407
447
  }
408
- if (item.s.s !== undefined) {
409
- result.supply = item.s.s;
410
- }
411
- if (item.s.mc !== undefined) {
412
- result.marketCapInUsd = item.s.mc;
413
- }
414
- if (item.s.ts !== undefined) {
415
- result.timestamp = item.s.ts;
448
+ if (item.s.mc) {
449
+ result.supply.marketCapInUsd = item.s.mc;
416
450
  }
417
451
  }
418
452
  if (item.ts) {
419
- if (item.ts.a) {
420
- result.address = item.ts.a;
421
- }
422
- if (item.ts.t !== undefined) {
423
- result.timestamp = item.ts.t;
424
- }
425
- if (item.ts.b1m !== undefined) {
426
- result.buys1m = item.ts.b1m;
453
+ result.stat = {
454
+ address: item.ts.a,
455
+ timestamp: item.ts.t || 0,
456
+ };
457
+ if (item.ts.b1m) {
458
+ result.stat.buys1m = item.ts.b1m;
427
459
  }
428
- if (item.ts.s1m !== undefined) {
429
- result.sells1m = item.ts.s1m;
460
+ if (item.ts.s1m) {
461
+ result.stat.sells1m = item.ts.s1m;
430
462
  }
431
- if (item.ts.be1m !== undefined) {
432
- result.buyers1m = item.ts.be1m;
463
+ if (item.ts.be1m) {
464
+ result.stat.buyers1m = item.ts.be1m;
433
465
  }
434
- if (item.ts.se1m !== undefined) {
435
- result.sellers1m = item.ts.se1m;
466
+ if (item.ts.se1m) {
467
+ result.stat.sellers1m = item.ts.se1m;
436
468
  }
437
- if (item.ts.bviu1m !== undefined) {
438
- result.buyVolumeInUsd1m = this.formatScientificNotation(item.ts.bviu1m);
469
+ if (item.ts.bviu1m) {
470
+ result.stat.buyVolumeInUsd1m = this.formatScientificNotation(item.ts.bviu1m);
439
471
  }
440
- if (item.ts.sviu1m !== undefined) {
441
- result.sellVolumeInUsd1m = this.formatScientificNotation(item.ts.sviu1m);
472
+ if (item.ts.sviu1m) {
473
+ result.stat.sellVolumeInUsd1m = this.formatScientificNotation(item.ts.sviu1m);
442
474
  }
443
- if (item.ts.p1m !== undefined) {
444
- result.price1m = this.formatScientificNotation(item.ts.p1m);
475
+ if (item.ts.p1m) {
476
+ result.stat.price1m = this.formatScientificNotation(item.ts.p1m);
445
477
  }
446
- if (item.ts.oiu1m !== undefined) {
447
- result.openInUsd1m = this.formatScientificNotation(item.ts.oiu1m);
478
+ if (item.ts.oiu1m) {
479
+ result.stat.openInUsd1m = this.formatScientificNotation(item.ts.oiu1m);
448
480
  }
449
- if (item.ts.ciu1m !== undefined) {
450
- result.closeInUsd1m = this.formatScientificNotation(item.ts.ciu1m);
481
+ if (item.ts.ciu1m) {
482
+ result.stat.closeInUsd1m = this.formatScientificNotation(item.ts.ciu1m);
451
483
  }
452
- if (item.ts.b5m !== undefined) {
453
- result.buys5m = item.ts.b5m;
484
+ if (item.ts.b5m) {
485
+ result.stat.buys5m = item.ts.b5m;
454
486
  }
455
- if (item.ts.s5m !== undefined) {
456
- result.sells5m = item.ts.s5m;
487
+ if (item.ts.s5m) {
488
+ result.stat.sells5m = item.ts.s5m;
457
489
  }
458
- if (item.ts.be5m !== undefined) {
459
- result.buyers5m = item.ts.be5m;
490
+ if (item.ts.be5m) {
491
+ result.stat.buyers5m = item.ts.be5m;
460
492
  }
461
- if (item.ts.se5m !== undefined) {
462
- result.sellers5m = item.ts.se5m;
493
+ if (item.ts.se5m) {
494
+ result.stat.sellers5m = item.ts.se5m;
463
495
  }
464
- if (item.ts.bviu5m !== undefined) {
465
- result.buyVolumeInUsd5m = this.formatScientificNotation(item.ts.bviu5m);
496
+ if (item.ts.bviu5m) {
497
+ result.stat.buyVolumeInUsd5m = this.formatScientificNotation(item.ts.bviu5m);
466
498
  }
467
- if (item.ts.sviu5m !== undefined) {
468
- result.sellVolumeInUsd5m = this.formatScientificNotation(item.ts.sviu5m);
499
+ if (item.ts.sviu5m) {
500
+ result.stat.sellVolumeInUsd5m = this.formatScientificNotation(item.ts.sviu5m);
469
501
  }
470
- if (item.ts.p5m !== undefined) {
471
- result.price5m = this.formatScientificNotation(item.ts.p5m);
502
+ if (item.ts.p5m) {
503
+ result.stat.price5m = this.formatScientificNotation(item.ts.p5m);
472
504
  }
473
- if (item.ts.oiu5m !== undefined) {
474
- result.openInUsd5m = this.formatScientificNotation(item.ts.oiu5m);
505
+ if (item.ts.oiu5m) {
506
+ result.stat.openInUsd5m = this.formatScientificNotation(item.ts.oiu5m);
475
507
  }
476
- if (item.ts.ciu5m !== undefined) {
477
- result.closeInUsd5m = this.formatScientificNotation(item.ts.ciu5m);
508
+ if (item.ts.ciu5m) {
509
+ result.stat.closeInUsd5m = this.formatScientificNotation(item.ts.ciu5m);
478
510
  }
479
- if (item.ts.b15m !== undefined) {
480
- result.buys15m = item.ts.b15m;
511
+ if (item.ts.b15m) {
512
+ result.stat.buys15m = item.ts.b15m;
481
513
  }
482
- if (item.ts.s15m !== undefined) {
483
- result.sells15m = item.ts.s15m;
514
+ if (item.ts.s15m) {
515
+ result.stat.sells15m = item.ts.s15m;
484
516
  }
485
- if (item.ts.be15m !== undefined) {
486
- result.buyers15m = item.ts.be15m;
517
+ if (item.ts.be15m) {
518
+ result.stat.buyers15m = item.ts.be15m;
487
519
  }
488
- if (item.ts.se15m !== undefined) {
489
- result.sellers15m = item.ts.se15m;
520
+ if (item.ts.se15m) {
521
+ result.stat.sellers15m = item.ts.se15m;
490
522
  }
491
- if (item.ts.bviu15m !== undefined) {
492
- result.buyVolumeInUsd15m = this.formatScientificNotation(item.ts.bviu15m);
523
+ if (item.ts.bviu15m) {
524
+ result.stat.buyVolumeInUsd15m = this.formatScientificNotation(item.ts.bviu15m);
493
525
  }
494
- if (item.ts.sviu15m !== undefined) {
495
- result.sellVolumeInUsd15m = this.formatScientificNotation(item.ts.sviu15m);
526
+ if (item.ts.sviu15m) {
527
+ result.stat.sellVolumeInUsd15m = this.formatScientificNotation(item.ts.sviu15m);
496
528
  }
497
- if (item.ts.p15m !== undefined) {
498
- result.price15m = this.formatScientificNotation(item.ts.p15m);
529
+ if (item.ts.p15m) {
530
+ result.stat.price15m = this.formatScientificNotation(item.ts.p15m);
499
531
  }
500
- if (item.ts.oiu15m !== undefined) {
501
- result.openInUsd15m = this.formatScientificNotation(item.ts.oiu15m);
532
+ if (item.ts.oiu15m) {
533
+ result.stat.openInUsd15m = this.formatScientificNotation(item.ts.oiu15m);
502
534
  }
503
- if (item.ts.ciu15m !== undefined) {
504
- result.closeInUsd15m = this.formatScientificNotation(item.ts.ciu15m);
535
+ if (item.ts.ciu15m) {
536
+ result.stat.closeInUsd15m = this.formatScientificNotation(item.ts.ciu15m);
505
537
  }
506
- if (item.ts.b30m !== undefined) {
507
- result.buys30m = item.ts.b30m;
538
+ if (item.ts.b30m) {
539
+ result.stat.buys30m = item.ts.b30m;
508
540
  }
509
- if (item.ts.s30m !== undefined) {
510
- result.sells30m = item.ts.s30m;
541
+ if (item.ts.s30m) {
542
+ result.stat.sells30m = item.ts.s30m;
511
543
  }
512
- if (item.ts.be30m !== undefined) {
513
- result.buyers30m = item.ts.be30m;
544
+ if (item.ts.be30m) {
545
+ result.stat.buyers30m = item.ts.be30m;
514
546
  }
515
- if (item.ts.se30m !== undefined) {
516
- result.sellers30m = item.ts.se30m;
547
+ if (item.ts.se30m) {
548
+ result.stat.sellers30m = item.ts.se30m;
517
549
  }
518
- if (item.ts.bviu30m !== undefined) {
519
- result.buyVolumeInUsd30m = this.formatScientificNotation(item.ts.bviu30m);
550
+ if (item.ts.bviu30m) {
551
+ result.stat.buyVolumeInUsd30m = this.formatScientificNotation(item.ts.bviu30m);
520
552
  }
521
- if (item.ts.sviu30m !== undefined) {
522
- result.sellVolumeInUsd30m = this.formatScientificNotation(item.ts.sviu30m);
553
+ if (item.ts.sviu30m) {
554
+ result.stat.sellVolumeInUsd30m = this.formatScientificNotation(item.ts.sviu30m);
523
555
  }
524
- if (item.ts.p30m !== undefined) {
525
- result.price30m = this.formatScientificNotation(item.ts.p30m);
556
+ if (item.ts.p30m) {
557
+ result.stat.price30m = this.formatScientificNotation(item.ts.p30m);
526
558
  }
527
- if (item.ts.oiu30m !== undefined) {
528
- result.openInUsd30m = this.formatScientificNotation(item.ts.oiu30m);
559
+ if (item.ts.oiu30m) {
560
+ result.stat.openInUsd30m = this.formatScientificNotation(item.ts.oiu30m);
529
561
  }
530
- if (item.ts.ciu30m !== undefined) {
531
- result.closeInUsd30m = this.formatScientificNotation(item.ts.ciu30m);
562
+ if (item.ts.ciu30m) {
563
+ result.stat.closeInUsd30m = this.formatScientificNotation(item.ts.ciu30m);
532
564
  }
533
- if (item.ts.b1h !== undefined) {
534
- result.buys1h = item.ts.b1h;
565
+ if (item.ts.b1h) {
566
+ result.stat.buys1h = item.ts.b1h;
535
567
  }
536
- if (item.ts.s1h !== undefined) {
537
- result.sells1h = item.ts.s1h;
568
+ if (item.ts.s1h) {
569
+ result.stat.sells1h = item.ts.s1h;
538
570
  }
539
- if (item.ts.be1h !== undefined) {
540
- result.buyers1h = item.ts.be1h;
571
+ if (item.ts.be1h) {
572
+ result.stat.buyers1h = item.ts.be1h;
541
573
  }
542
- if (item.ts.se1h !== undefined) {
543
- result.sellers1h = item.ts.se1h;
574
+ if (item.ts.se1h) {
575
+ result.stat.sellers1h = item.ts.se1h;
544
576
  }
545
- if (item.ts.bviu1h !== undefined) {
546
- result.buyVolumeInUsd1h = this.formatScientificNotation(item.ts.bviu1h);
577
+ if (item.ts.bviu1h) {
578
+ result.stat.buyVolumeInUsd1h = this.formatScientificNotation(item.ts.bviu1h);
547
579
  }
548
- if (item.ts.sviu1h !== undefined) {
549
- result.sellVolumeInUsd1h = this.formatScientificNotation(item.ts.sviu1h);
580
+ if (item.ts.sviu1h) {
581
+ result.stat.sellVolumeInUsd1h = this.formatScientificNotation(item.ts.sviu1h);
550
582
  }
551
- if (item.ts.p1h !== undefined) {
552
- result.price1h = this.formatScientificNotation(item.ts.p1h);
583
+ if (item.ts.p1h) {
584
+ result.stat.price1h = this.formatScientificNotation(item.ts.p1h);
553
585
  }
554
- if (item.ts.oiu1h !== undefined) {
555
- result.openInUsd1h = this.formatScientificNotation(item.ts.oiu1h);
586
+ if (item.ts.oiu1h) {
587
+ result.stat.openInUsd1h = this.formatScientificNotation(item.ts.oiu1h);
556
588
  }
557
- if (item.ts.ciu1h !== undefined) {
558
- result.closeInUsd1h = this.formatScientificNotation(item.ts.ciu1h);
589
+ if (item.ts.ciu1h) {
590
+ result.stat.closeInUsd1h = this.formatScientificNotation(item.ts.ciu1h);
559
591
  }
560
- if (item.ts.b4h !== undefined) {
561
- result.buys4h = item.ts.b4h;
592
+ if (item.ts.b4h) {
593
+ result.stat.buys4h = item.ts.b4h;
562
594
  }
563
- if (item.ts.s4h !== undefined) {
564
- result.sells4h = item.ts.s4h;
595
+ if (item.ts.s4h) {
596
+ result.stat.sells4h = item.ts.s4h;
565
597
  }
566
- if (item.ts.be4h !== undefined) {
567
- result.buyers4h = item.ts.be4h;
598
+ if (item.ts.be4h) {
599
+ result.stat.buyers4h = item.ts.be4h;
568
600
  }
569
- if (item.ts.se4h !== undefined) {
570
- result.sellers4h = item.ts.se4h;
601
+ if (item.ts.se4h) {
602
+ result.stat.sellers4h = item.ts.se4h;
571
603
  }
572
- if (item.ts.bviu4h !== undefined) {
573
- result.buyVolumeInUsd4h = this.formatScientificNotation(item.ts.bviu4h);
604
+ if (item.ts.bviu4h) {
605
+ result.stat.buyVolumeInUsd4h = this.formatScientificNotation(item.ts.bviu4h);
574
606
  }
575
- if (item.ts.sviu4h !== undefined) {
576
- result.sellVolumeInUsd4h = this.formatScientificNotation(item.ts.sviu4h);
607
+ if (item.ts.sviu4h) {
608
+ result.stat.sellVolumeInUsd4h = this.formatScientificNotation(item.ts.sviu4h);
577
609
  }
578
- if (item.ts.p4h !== undefined) {
579
- result.price4h = this.formatScientificNotation(item.ts.p4h);
610
+ if (item.ts.p4h) {
611
+ result.stat.price4h = this.formatScientificNotation(item.ts.p4h);
580
612
  }
581
- if (item.ts.oiu4h !== undefined) {
582
- result.openInUsd4h = this.formatScientificNotation(item.ts.oiu4h);
613
+ if (item.ts.oiu4h) {
614
+ result.stat.openInUsd4h = this.formatScientificNotation(item.ts.oiu4h);
583
615
  }
584
- if (item.ts.ciu4h !== undefined) {
585
- result.closeInUsd4h = this.formatScientificNotation(item.ts.ciu4h);
616
+ if (item.ts.ciu4h) {
617
+ result.stat.closeInUsd4h = this.formatScientificNotation(item.ts.ciu4h);
586
618
  }
587
- if (item.ts.b24h !== undefined) {
588
- result.buys24h = item.ts.b24h;
619
+ if (item.ts.b24h) {
620
+ result.stat.buys24h = item.ts.b24h;
589
621
  }
590
- if (item.ts.s24h !== undefined) {
591
- result.sells24h = item.ts.s24h;
622
+ if (item.ts.s24h) {
623
+ result.stat.sells24h = item.ts.s24h;
592
624
  }
593
- if (item.ts.be24h !== undefined) {
594
- result.buyers24h = item.ts.be24h;
625
+ if (item.ts.be24h) {
626
+ result.stat.buyers24h = item.ts.be24h;
595
627
  }
596
- if (item.ts.se24h !== undefined) {
597
- result.sellers24h = item.ts.se24h;
628
+ if (item.ts.se24h) {
629
+ result.stat.sellers24h = item.ts.se24h;
598
630
  }
599
- if (item.ts.bviu24h !== undefined) {
600
- result.buyVolumeInUsd24h = this.formatScientificNotation(item.ts.bviu24h);
631
+ if (item.ts.bviu24h) {
632
+ result.stat.buyVolumeInUsd24h = this.formatScientificNotation(item.ts.bviu24h);
601
633
  }
602
- if (item.ts.sviu24h !== undefined) {
603
- result.sellVolumeInUsd24h = this.formatScientificNotation(item.ts.sviu24h);
634
+ if (item.ts.sviu24h) {
635
+ result.stat.sellVolumeInUsd24h = this.formatScientificNotation(item.ts.sviu24h);
604
636
  }
605
- if (item.ts.p24h !== undefined) {
606
- result.price24h = this.formatScientificNotation(item.ts.p24h);
637
+ if (item.ts.p24h) {
638
+ result.stat.price24h = this.formatScientificNotation(item.ts.p24h);
607
639
  }
608
- if (item.ts.oiu24h !== undefined) {
609
- result.openInUsd24h = this.formatScientificNotation(item.ts.oiu24h);
640
+ if (item.ts.oiu24h) {
641
+ result.stat.openInUsd24h = this.formatScientificNotation(item.ts.oiu24h);
610
642
  }
611
- if (item.ts.ciu24h !== undefined) {
612
- result.closeInUsd24h = this.formatScientificNotation(item.ts.ciu24h);
643
+ if (item.ts.ciu24h) {
644
+ result.stat.closeInUsd24h = this.formatScientificNotation(item.ts.ciu24h);
613
645
  }
614
- if (item.ts.p !== undefined) {
615
- result.price = this.formatScientificNotation(item.ts.p);
646
+ if (item.ts.p) {
647
+ result.stat.price = this.formatScientificNotation(item.ts.p);
616
648
  }
617
649
  }
618
650
  return result;