@ultrade/shared 1.0.0 → 1.0.1

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.
Files changed (58) hide show
  1. package/dist/common/auth.helper.js +16 -37
  2. package/dist/common/awsKms.js +9 -19
  3. package/dist/common/big-number.helper.d.ts +0 -3
  4. package/dist/common/big-number.helper.js +7 -26
  5. package/dist/common/index.js +65 -107
  6. package/dist/common/indexer.helper.js +9 -19
  7. package/dist/common/logger.js +6 -16
  8. package/dist/common/mappers/codexAsset.mapper.js +3 -14
  9. package/dist/common/mappers/codexBalance.mapper.js +3 -14
  10. package/dist/common/mappers/index.js +15 -35
  11. package/dist/common/mappers/trade.mapper.js +15 -35
  12. package/dist/common/migration.helpers.js +3 -14
  13. package/dist/common/redis.helper.js +20 -40
  14. package/dist/common/secret.helper.js +11 -26
  15. package/dist/common/timestamp.helper.js +3 -14
  16. package/dist/common/utils/assert.js +3 -14
  17. package/dist/common/utils/decode.js +6 -17
  18. package/dist/common/utils/index.js +4 -15
  19. package/dist/common/utils/social.js +3 -14
  20. package/dist/common/utils/stat.js +7 -26
  21. package/dist/constants/index.js +3 -14
  22. package/dist/enums/index.js +3 -14
  23. package/dist/helpers/Encoding.js +10 -31
  24. package/dist/helpers/algo.helper.js +44 -82
  25. package/dist/helpers/assert.helper.js +13 -34
  26. package/dist/helpers/atomic.helper.d.ts +0 -17
  27. package/dist/helpers/atomic.helper.js +7 -43
  28. package/dist/helpers/balance.helper.js +71 -166
  29. package/dist/helpers/codex/common.helper.js +71 -149
  30. package/dist/helpers/codex/index.js +71 -149
  31. package/dist/helpers/codex/mbr.helper.js +71 -149
  32. package/dist/helpers/codex/mna.helper.js +71 -149
  33. package/dist/helpers/codex/order.helper.js +71 -149
  34. package/dist/helpers/codex/setGlobal.helper.js +73 -151
  35. package/dist/helpers/codex/transfer.helper.js +71 -149
  36. package/dist/helpers/codex/txn.helper.js +71 -149
  37. package/dist/helpers/codex.helper.js +71 -149
  38. package/dist/helpers/email.helper.js +6 -17
  39. package/dist/helpers/eth.helper.js +71 -149
  40. package/dist/helpers/hummingbots.helper.js +11 -22
  41. package/dist/helpers/index.js +31 -58
  42. package/dist/helpers/interval.helpers.js +10 -21
  43. package/dist/helpers/liquidity.helper.js +6 -17
  44. package/dist/helpers/order.helper.js +3 -14
  45. package/dist/helpers/pair.helper.js +3 -14
  46. package/dist/helpers/pointSystem.helper.js +15 -33
  47. package/dist/helpers/ticker.helpers.js +7 -27
  48. package/dist/helpers/vaa.helper.js +97 -175
  49. package/dist/helpers/withdraw.helper.js +97 -167
  50. package/dist/interfaces/db/market/index.d.ts +34 -6
  51. package/dist/interfaces/db/white_label/index.d.ts +3 -3
  52. package/dist/interfaces/index.js +11 -14
  53. package/dist/types/index.js +15 -33
  54. package/package.json +15 -7
  55. package/dist/baseModel/base.model.d.ts +0 -26
  56. package/dist/baseModel/index.d.ts +0 -2
  57. package/dist/helpers/api.helper.d.ts +0 -16
  58. package/dist/helpers/api.helper.js +0 -1652
@@ -1,21 +1,11 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("ethereumjs-util"), require("yaml"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["ethereumjs-util", "yaml"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("ethereumjs-util"), require("yaml")) : factory(root["ethereumjs-util"], root["yaml"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(global, (__WEBPACK_EXTERNAL_MODULE__1297__, __WEBPACK_EXTERNAL_MODULE__5343__) => {
11
- return /******/ (() => { // webpackBootstrap
1
+ /******/ (() => { // webpackBootstrap
12
2
  /******/ "use strict";
13
3
  /******/ var __webpack_modules__ = ({
14
4
 
15
- /***/ 1297:
5
+ /***/ 913:
16
6
  /***/ ((module) => {
17
7
 
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__1297__;
8
+ module.exports = require("yaml");
19
9
 
20
10
  /***/ }),
21
11
 
@@ -63,8 +53,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
63
53
  exports.encryptSecretValue = encryptSecretValue;
64
54
  exports.createStrategyHash = createStrategyHash;
65
55
  const crypto_1 = __importDefault(__webpack_require__(6982));
66
- const ethUtil = __importStar(__webpack_require__(1297));
67
- const yaml_1 = __webpack_require__(5343);
56
+ const ethUtil = __importStar(__webpack_require__(7835));
57
+ const yaml_1 = __webpack_require__(913);
68
58
  function encryptSecretValue(password, value) {
69
59
  const passwordBytes = Buffer.from(password, 'utf-8');
70
60
  const kdf = 'pbkdf2';
@@ -110,17 +100,17 @@ function createStrategyHash(partnerId, yamlString) {
110
100
 
111
101
  /***/ }),
112
102
 
113
- /***/ 5343:
103
+ /***/ 6982:
114
104
  /***/ ((module) => {
115
105
 
116
- module.exports = __WEBPACK_EXTERNAL_MODULE__5343__;
106
+ module.exports = require("crypto");
117
107
 
118
108
  /***/ }),
119
109
 
120
- /***/ 6982:
110
+ /***/ 7835:
121
111
  /***/ ((module) => {
122
112
 
123
- module.exports = require("crypto");
113
+ module.exports = require("ethereumjs-util");
124
114
 
125
115
  /***/ })
126
116
 
@@ -156,8 +146,7 @@ module.exports = require("crypto");
156
146
  /******/ // Load entry module and return exports
157
147
  /******/ // This entry module is referenced by other modules so it can't be inlined
158
148
  /******/ var __webpack_exports__ = __webpack_require__(3089);
149
+ /******/ module.exports = __webpack_exports__;
159
150
  /******/
160
- /******/ return __webpack_exports__;
161
151
  /******/ })()
162
- ;
163
- });
152
+ ;
@@ -1,14 +1,4 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("bignumber.js"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["bignumber.js"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("bignumber.js")) : factory(root["bignumber.js"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(global, (__WEBPACK_EXTERNAL_MODULE__6168__) => {
11
- return /******/ (() => { // webpackBootstrap
1
+ /******/ (() => { // webpackBootstrap
12
2
  /******/ "use strict";
13
3
  /******/ var __webpack_modules__ = ({
14
4
 
@@ -74,7 +64,6 @@ function groupTickersByInterval(tickers, newIntervalInSec, endTimeInSec) {
74
64
  const newGroupedTickers = [];
75
65
  let timestamp = endTimeInSec - newIntervalInSec;
76
66
  let slot = null;
77
- // desc direction by timestamp
78
67
  const sortedTickers = tickers.sort((a, b) => b.t - a.t);
79
68
  for (let i = 0; i < sortedTickers.length; i++) {
80
69
  const element = sortedTickers[i];
@@ -188,7 +177,7 @@ exports.bn_operation = bn_operation;
188
177
  exports.roundNumber = roundNumber;
189
178
  exports.convertFromBaseUnits = convertFromBaseUnits;
190
179
  exports.convertToBaseUnits = convertToBaseUnits;
191
- const bignumber_js_1 = __importDefault(__webpack_require__(6168));
180
+ const bignumber_js_1 = __importDefault(__webpack_require__(4978));
192
181
  bignumber_js_1.default.config({ DECIMAL_PLACES: 40, EXPONENTIAL_AT: 45 });
193
182
  var Operations;
194
183
  (function (Operations) {
@@ -206,7 +195,6 @@ var Operations;
206
195
  function absolute(value) {
207
196
  let x = new bignumber_js_1.default(value);
208
197
  const res = x.abs().toString();
209
- // console.log('Absolute value', { value, res })
210
198
  return res;
211
199
  }
212
200
  function ceil(value) {
@@ -346,17 +334,10 @@ function roundNumber({ decimalPlaces = 0 }, x) {
346
334
  }
347
335
  function convertFromBaseUnits(assetDecimals, quantity) {
348
336
  const decimals = Number(assetDecimals);
349
- return roundNumber({ decimalPlaces: decimals },
350
- // eslint-disable-next-line no-magic-numbers
351
- Math.pow(10, -decimals) * Number(quantity));
337
+ return roundNumber({ decimalPlaces: decimals }, Math.pow(10, -decimals) * Number(quantity));
352
338
  }
353
- /**
354
- * Computs quantity * 10^(assetDecimals) and rounds the result
355
- */
356
339
  function convertToBaseUnits(assetDecimals, quantity) {
357
- // eslint-disable-next-line no-magic-numbers
358
340
  const baseAmount = Math.pow(10, Number(assetDecimals)) * Number(quantity);
359
- // make sure the final value is an integer. This prevents this kind of computation errors: 0.0012 * 100000 = 119.99999999999999 and rounds this result into 120
360
341
  return roundNumber({ decimalPlaces: 0 }, baseAmount);
361
342
  }
362
343
 
@@ -409,6 +390,13 @@ var HummingbotInstanceStatus;
409
390
  })(HummingbotInstanceStatus || (exports.HummingbotInstanceStatus = HummingbotInstanceStatus = {}));
410
391
 
411
392
 
393
+ /***/ }),
394
+
395
+ /***/ 4978:
396
+ /***/ ((module) => {
397
+
398
+ module.exports = require("bignumber.js");
399
+
412
400
  /***/ }),
413
401
 
414
402
  /***/ 5386:
@@ -445,25 +433,25 @@ function getDatepartValue(value) {
445
433
  if (!units) {
446
434
  return mapWithTimeframe(datepart, 1);
447
435
  }
448
- if (datepart === 'minute' && units % (7 * 24 * 60) === 0) { // week
436
+ if (datepart === 'minute' && units % (7 * 24 * 60) === 0) {
449
437
  return mapWithTimeframe('week', units / (7 * 24 * 60));
450
438
  }
451
- if (datepart === 'minute' && units % (24 * 60) === 0) { // day
439
+ if (datepart === 'minute' && units % (24 * 60) === 0) {
452
440
  return mapWithTimeframe('day', units / (24 * 60));
453
441
  }
454
- if (datepart === 'minute' && units % 60 === 0) { // hour
442
+ if (datepart === 'minute' && units % 60 === 0) {
455
443
  return mapWithTimeframe('hour', units / 60);
456
444
  }
457
- if (datepart === 'hour' && units % (7 * 24) === 0) { // week
445
+ if (datepart === 'hour' && units % (7 * 24) === 0) {
458
446
  return mapWithTimeframe('week', units / (7 * 24));
459
447
  }
460
- if (datepart === 'hour' && units % 24 === 0) { // day
448
+ if (datepart === 'hour' && units % 24 === 0) {
461
449
  return mapWithTimeframe(units === 24 ? 'hour' : 'day', units === 24 ? 24 : units / 24);
462
450
  }
463
- if (datepart === 'day' && units % 7 === 0) { // week
451
+ if (datepart === 'day' && units % 7 === 0) {
464
452
  return mapWithTimeframe('week', units / 7);
465
453
  }
466
- if (datepart === 'month' && units % 12 === 0) { // year
454
+ if (datepart === 'month' && units % 12 === 0) {
467
455
  return mapWithTimeframe('year', units / 12);
468
456
  }
469
457
  return mapWithTimeframe(datepart, units);
@@ -512,13 +500,6 @@ function mapDatepartToTimeframe(datepart, value) {
512
500
  }
513
501
 
514
502
 
515
- /***/ }),
516
-
517
- /***/ 6168:
518
- /***/ ((module) => {
519
-
520
- module.exports = __WEBPACK_EXTERNAL_MODULE__6168__;
521
-
522
503
  /***/ }),
523
504
 
524
505
  /***/ 7114:
@@ -667,23 +648,19 @@ var SmallTimeframeEnum;
667
648
  SmallTimeframeEnum["last_year"] = "last_year";
668
649
  })(SmallTimeframeEnum || (exports.SmallTimeframeEnum = SmallTimeframeEnum = {}));
669
650
  class PairsQueryDto {
670
- constructor() {
671
- this.timeRange = SmallTimeframeEnum.last_30_days;
672
- this.sortBy = 'volume_usd';
673
- this.order = 'desc';
674
- this.limit = 20;
675
- this.page = 1;
676
- }
651
+ timeRange = SmallTimeframeEnum.last_30_days;
652
+ sortBy = 'volume_usd';
653
+ order = 'desc';
654
+ limit = 20;
655
+ page = 1;
677
656
  }
678
657
  exports.PairsQueryDto = PairsQueryDto;
679
658
  class UsersQueryDto {
680
- constructor() {
681
- this.timeRange = SmallTimeframeEnum.last_30_days;
682
- this.sortBy = 'volume_usd';
683
- this.order = 'desc';
684
- this.limit = 20;
685
- this.page = 1;
686
- }
659
+ timeRange = SmallTimeframeEnum.last_30_days;
660
+ sortBy = 'volume_usd';
661
+ order = 'desc';
662
+ limit = 20;
663
+ page = 1;
687
664
  }
688
665
  exports.UsersQueryDto = UsersQueryDto;
689
666
  var StatisticTypeQuery;
@@ -694,10 +671,8 @@ var StatisticTypeQuery;
694
671
  StatisticTypeQuery["dau"] = "dau";
695
672
  })(StatisticTypeQuery || (exports.StatisticTypeQuery = StatisticTypeQuery = {}));
696
673
  class ChartQueryDto {
697
- constructor() {
698
- this.type = StatisticTypeQuery.volume;
699
- this.timeRange = SmallTimeframeEnum.last_7_days;
700
- }
674
+ type = StatisticTypeQuery.volume;
675
+ timeRange = SmallTimeframeEnum.last_7_days;
701
676
  }
702
677
  exports.ChartQueryDto = ChartQueryDto;
703
678
 
@@ -708,7 +683,6 @@ exports.ChartQueryDto = ChartQueryDto;
708
683
  /***/ ((__unused_webpack_module, exports) => {
709
684
 
710
685
 
711
- //--import { Asset } from "@ultrade/shared/db/entities/market/asset.entity";
712
686
  Object.defineProperty(exports, "__esModule", ({ value: true }));
713
687
  exports.AmmBucketKeys = exports.VALIDATOR_APP_ID = exports.CONTRACT_VERSION = exports.AmmForeignResources = exports.AmmChars = exports.AmmIds = exports.PoolType = void 0;
714
688
  var PoolType;
@@ -830,8 +804,7 @@ function round2(val) { return Math.round(val * 100) / 100; }
830
804
  /******/ // Load entry module and return exports
831
805
  /******/ // This entry module is referenced by other modules so it can't be inlined
832
806
  /******/ var __webpack_exports__ = __webpack_require__(9730);
807
+ /******/ module.exports = __webpack_exports__;
833
808
  /******/
834
- /******/ return __webpack_exports__;
835
809
  /******/ })()
836
- ;
837
- });
810
+ ;
@@ -1,14 +1,4 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else {
7
- var a = factory();
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(global, () => {
11
- return /******/ (() => { // webpackBootstrap
1
+ /******/ (() => { // webpackBootstrap
12
2
  /******/ "use strict";
13
3
  var __webpack_exports__ = {};
14
4
  // This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
@@ -36,25 +26,25 @@ function getDatepartValue(value) {
36
26
  if (!units) {
37
27
  return mapWithTimeframe(datepart, 1);
38
28
  }
39
- if (datepart === 'minute' && units % (7 * 24 * 60) === 0) { // week
29
+ if (datepart === 'minute' && units % (7 * 24 * 60) === 0) {
40
30
  return mapWithTimeframe('week', units / (7 * 24 * 60));
41
31
  }
42
- if (datepart === 'minute' && units % (24 * 60) === 0) { // day
32
+ if (datepart === 'minute' && units % (24 * 60) === 0) {
43
33
  return mapWithTimeframe('day', units / (24 * 60));
44
34
  }
45
- if (datepart === 'minute' && units % 60 === 0) { // hour
35
+ if (datepart === 'minute' && units % 60 === 0) {
46
36
  return mapWithTimeframe('hour', units / 60);
47
37
  }
48
- if (datepart === 'hour' && units % (7 * 24) === 0) { // week
38
+ if (datepart === 'hour' && units % (7 * 24) === 0) {
49
39
  return mapWithTimeframe('week', units / (7 * 24));
50
40
  }
51
- if (datepart === 'hour' && units % 24 === 0) { // day
41
+ if (datepart === 'hour' && units % 24 === 0) {
52
42
  return mapWithTimeframe(units === 24 ? 'hour' : 'day', units === 24 ? 24 : units / 24);
53
43
  }
54
- if (datepart === 'day' && units % 7 === 0) { // week
44
+ if (datepart === 'day' && units % 7 === 0) {
55
45
  return mapWithTimeframe('week', units / 7);
56
46
  }
57
- if (datepart === 'month' && units % 12 === 0) { // year
47
+ if (datepart === 'month' && units % 12 === 0) {
58
48
  return mapWithTimeframe('year', units / 12);
59
49
  }
60
50
  return mapWithTimeframe(datepart, units);
@@ -104,7 +94,6 @@ function mapDatepartToTimeframe(datepart, value) {
104
94
 
105
95
  })();
106
96
 
107
- /******/ return __webpack_exports__;
97
+ module.exports = __webpack_exports__;
108
98
  /******/ })()
109
- ;
110
- });
99
+ ;
@@ -1,21 +1,11 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("bignumber.js"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["bignumber.js"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("bignumber.js")) : factory(root["bignumber.js"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(global, (__WEBPACK_EXTERNAL_MODULE__6168__) => {
11
- return /******/ (() => { // webpackBootstrap
1
+ /******/ (() => { // webpackBootstrap
12
2
  /******/ "use strict";
13
3
  /******/ var __webpack_modules__ = ({
14
4
 
15
- /***/ 6168:
5
+ /***/ 4978:
16
6
  /***/ ((module) => {
17
7
 
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__6168__;
8
+ module.exports = require("bignumber.js");
19
9
 
20
10
  /***/ }),
21
11
 
@@ -28,7 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
18
  };
29
19
  Object.defineProperty(exports, "__esModule", ({ value: true }));
30
20
  exports.computeLiquidityUsd = computeLiquidityUsd;
31
- const bignumber_js_1 = __importDefault(__webpack_require__(6168));
21
+ const bignumber_js_1 = __importDefault(__webpack_require__(4978));
32
22
  function computeLiquidityUsd(opts) {
33
23
  const { buy, sell, baseDec, baseUsd } = opts;
34
24
  const sumQuoteRaw = buy.reduce((acc, [_, amount]) => acc.plus(new bignumber_js_1.default(amount)), new bignumber_js_1.default(0));
@@ -74,8 +64,7 @@ function computeLiquidityUsd(opts) {
74
64
  /******/ // Load entry module and return exports
75
65
  /******/ // This entry module is referenced by other modules so it can't be inlined
76
66
  /******/ var __webpack_exports__ = __webpack_require__(6810);
67
+ /******/ module.exports = __webpack_exports__;
77
68
  /******/
78
- /******/ return __webpack_exports__;
79
69
  /******/ })()
80
- ;
81
- });
70
+ ;
@@ -1,14 +1,4 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else {
7
- var a = factory();
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(global, () => {
11
- return /******/ (() => { // webpackBootstrap
1
+ /******/ (() => { // webpackBootstrap
12
2
  /******/ "use strict";
13
3
  /******/ var __webpack_modules__ = ({
14
4
 
@@ -940,7 +930,6 @@ function mapOrderTypeShortToLong(value) {
940
930
 
941
931
  })();
942
932
 
943
- /******/ return __webpack_exports__;
933
+ module.exports = __webpack_exports__;
944
934
  /******/ })()
945
- ;
946
- });
935
+ ;
@@ -1,14 +1,4 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else {
7
- var a = factory();
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(global, () => {
11
- return /******/ (() => { // webpackBootstrap
1
+ /******/ (() => { // webpackBootstrap
12
2
  /******/ "use strict";
13
3
  /******/ var __webpack_modules__ = ({
14
4
 
@@ -931,8 +921,7 @@ __exportStar(__webpack_require__(3004), exports);
931
921
  /******/ // Load entry module and return exports
932
922
  /******/ // This entry module is referenced by other modules so it can't be inlined
933
923
  /******/ var __webpack_exports__ = __webpack_require__(3084);
924
+ /******/ module.exports = __webpack_exports__;
934
925
  /******/
935
- /******/ return __webpack_exports__;
936
926
  /******/ })()
937
- ;
938
- });
927
+ ;
@@ -1,14 +1,4 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else {
7
- var a = factory();
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(global, () => {
11
- return /******/ (() => { // webpackBootstrap
1
+ /******/ (() => { // webpackBootstrap
12
2
  /******/ "use strict";
13
3
  /******/ var __webpack_modules__ = ({
14
4
 
@@ -224,23 +214,19 @@ var SmallTimeframeEnum;
224
214
  SmallTimeframeEnum["last_year"] = "last_year";
225
215
  })(SmallTimeframeEnum || (exports.SmallTimeframeEnum = SmallTimeframeEnum = {}));
226
216
  class PairsQueryDto {
227
- constructor() {
228
- this.timeRange = SmallTimeframeEnum.last_30_days;
229
- this.sortBy = 'volume_usd';
230
- this.order = 'desc';
231
- this.limit = 20;
232
- this.page = 1;
233
- }
217
+ timeRange = SmallTimeframeEnum.last_30_days;
218
+ sortBy = 'volume_usd';
219
+ order = 'desc';
220
+ limit = 20;
221
+ page = 1;
234
222
  }
235
223
  exports.PairsQueryDto = PairsQueryDto;
236
224
  class UsersQueryDto {
237
- constructor() {
238
- this.timeRange = SmallTimeframeEnum.last_30_days;
239
- this.sortBy = 'volume_usd';
240
- this.order = 'desc';
241
- this.limit = 20;
242
- this.page = 1;
243
- }
225
+ timeRange = SmallTimeframeEnum.last_30_days;
226
+ sortBy = 'volume_usd';
227
+ order = 'desc';
228
+ limit = 20;
229
+ page = 1;
244
230
  }
245
231
  exports.UsersQueryDto = UsersQueryDto;
246
232
  var StatisticTypeQuery;
@@ -251,10 +237,8 @@ var StatisticTypeQuery;
251
237
  StatisticTypeQuery["dau"] = "dau";
252
238
  })(StatisticTypeQuery || (exports.StatisticTypeQuery = StatisticTypeQuery = {}));
253
239
  class ChartQueryDto {
254
- constructor() {
255
- this.type = StatisticTypeQuery.volume;
256
- this.timeRange = SmallTimeframeEnum.last_7_days;
257
- }
240
+ type = StatisticTypeQuery.volume;
241
+ timeRange = SmallTimeframeEnum.last_7_days;
258
242
  }
259
243
  exports.ChartQueryDto = ChartQueryDto;
260
244
 
@@ -265,7 +249,6 @@ exports.ChartQueryDto = ChartQueryDto;
265
249
  /***/ ((__unused_webpack_module, exports) => {
266
250
 
267
251
 
268
- //--import { Asset } from "@ultrade/shared/db/entities/market/asset.entity";
269
252
  Object.defineProperty(exports, "__esModule", ({ value: true }));
270
253
  exports.AmmBucketKeys = exports.VALIDATOR_APP_ID = exports.CONTRACT_VERSION = exports.AmmForeignResources = exports.AmmChars = exports.AmmIds = exports.PoolType = void 0;
271
254
  var PoolType;
@@ -386,7 +369,6 @@ exports.transformPointSystemSettings = transformPointSystemSettings;
386
369
 
387
370
  })();
388
371
 
389
- /******/ return __webpack_exports__;
372
+ module.exports = __webpack_exports__;
390
373
  /******/ })()
391
- ;
392
- });
374
+ ;
@@ -1,14 +1,4 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("bignumber.js"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["bignumber.js"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("bignumber.js")) : factory(root["bignumber.js"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(global, (__WEBPACK_EXTERNAL_MODULE__6168__) => {
11
- return /******/ (() => { // webpackBootstrap
1
+ /******/ (() => { // webpackBootstrap
12
2
  /******/ "use strict";
13
3
  /******/ var __webpack_modules__ = ({
14
4
 
@@ -42,7 +32,7 @@ exports.bn_operation = bn_operation;
42
32
  exports.roundNumber = roundNumber;
43
33
  exports.convertFromBaseUnits = convertFromBaseUnits;
44
34
  exports.convertToBaseUnits = convertToBaseUnits;
45
- const bignumber_js_1 = __importDefault(__webpack_require__(6168));
35
+ const bignumber_js_1 = __importDefault(__webpack_require__(4978));
46
36
  bignumber_js_1.default.config({ DECIMAL_PLACES: 40, EXPONENTIAL_AT: 45 });
47
37
  var Operations;
48
38
  (function (Operations) {
@@ -60,7 +50,6 @@ var Operations;
60
50
  function absolute(value) {
61
51
  let x = new bignumber_js_1.default(value);
62
52
  const res = x.abs().toString();
63
- // console.log('Absolute value', { value, res })
64
53
  return res;
65
54
  }
66
55
  function ceil(value) {
@@ -200,27 +189,20 @@ function roundNumber({ decimalPlaces = 0 }, x) {
200
189
  }
201
190
  function convertFromBaseUnits(assetDecimals, quantity) {
202
191
  const decimals = Number(assetDecimals);
203
- return roundNumber({ decimalPlaces: decimals },
204
- // eslint-disable-next-line no-magic-numbers
205
- Math.pow(10, -decimals) * Number(quantity));
192
+ return roundNumber({ decimalPlaces: decimals }, Math.pow(10, -decimals) * Number(quantity));
206
193
  }
207
- /**
208
- * Computs quantity * 10^(assetDecimals) and rounds the result
209
- */
210
194
  function convertToBaseUnits(assetDecimals, quantity) {
211
- // eslint-disable-next-line no-magic-numbers
212
195
  const baseAmount = Math.pow(10, Number(assetDecimals)) * Number(quantity);
213
- // make sure the final value is an integer. This prevents this kind of computation errors: 0.0012 * 100000 = 119.99999999999999 and rounds this result into 120
214
196
  return roundNumber({ decimalPlaces: 0 }, baseAmount);
215
197
  }
216
198
 
217
199
 
218
200
  /***/ }),
219
201
 
220
- /***/ 6168:
202
+ /***/ 4978:
221
203
  /***/ ((module) => {
222
204
 
223
- module.exports = __WEBPACK_EXTERNAL_MODULE__6168__;
205
+ module.exports = require("bignumber.js");
224
206
 
225
207
  /***/ })
226
208
 
@@ -269,7 +251,6 @@ function groupTickersByInterval(tickers, newIntervalInSec, endTimeInSec) {
269
251
  const newGroupedTickers = [];
270
252
  let timestamp = endTimeInSec - newIntervalInSec;
271
253
  let slot = null;
272
- // desc direction by timestamp
273
254
  const sortedTickers = tickers.sort((a, b) => b.t - a.t);
274
255
  for (let i = 0; i < sortedTickers.length; i++) {
275
256
  const element = sortedTickers[i];
@@ -352,7 +333,6 @@ function roundUpHoursInTimestamp(timeInSec) {
352
333
 
353
334
  })();
354
335
 
355
- /******/ return __webpack_exports__;
336
+ module.exports = __webpack_exports__;
356
337
  /******/ })()
357
- ;
358
- });
338
+ ;