@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.
- package/dist/common/auth.helper.js +16 -37
- package/dist/common/awsKms.js +9 -19
- package/dist/common/big-number.helper.d.ts +0 -3
- package/dist/common/big-number.helper.js +7 -26
- package/dist/common/index.js +65 -107
- package/dist/common/indexer.helper.js +9 -19
- package/dist/common/logger.js +6 -16
- package/dist/common/mappers/codexAsset.mapper.js +3 -14
- package/dist/common/mappers/codexBalance.mapper.js +3 -14
- package/dist/common/mappers/index.js +15 -35
- package/dist/common/mappers/trade.mapper.js +15 -35
- package/dist/common/migration.helpers.js +3 -14
- package/dist/common/redis.helper.js +20 -40
- package/dist/common/secret.helper.js +11 -26
- package/dist/common/timestamp.helper.js +3 -14
- package/dist/common/utils/assert.js +3 -14
- package/dist/common/utils/decode.js +6 -17
- package/dist/common/utils/index.js +4 -15
- package/dist/common/utils/social.js +3 -14
- package/dist/common/utils/stat.js +7 -26
- package/dist/constants/index.js +3 -14
- package/dist/enums/index.js +3 -14
- package/dist/helpers/Encoding.js +10 -31
- package/dist/helpers/algo.helper.js +44 -82
- package/dist/helpers/assert.helper.js +13 -34
- package/dist/helpers/atomic.helper.d.ts +0 -17
- package/dist/helpers/atomic.helper.js +7 -43
- package/dist/helpers/balance.helper.js +71 -166
- package/dist/helpers/codex/common.helper.js +71 -149
- package/dist/helpers/codex/index.js +71 -149
- package/dist/helpers/codex/mbr.helper.js +71 -149
- package/dist/helpers/codex/mna.helper.js +71 -149
- package/dist/helpers/codex/order.helper.js +71 -149
- package/dist/helpers/codex/setGlobal.helper.js +73 -151
- package/dist/helpers/codex/transfer.helper.js +71 -149
- package/dist/helpers/codex/txn.helper.js +71 -149
- package/dist/helpers/codex.helper.js +71 -149
- package/dist/helpers/email.helper.js +6 -17
- package/dist/helpers/eth.helper.js +71 -149
- package/dist/helpers/hummingbots.helper.js +11 -22
- package/dist/helpers/index.js +31 -58
- package/dist/helpers/interval.helpers.js +10 -21
- package/dist/helpers/liquidity.helper.js +6 -17
- package/dist/helpers/order.helper.js +3 -14
- package/dist/helpers/pair.helper.js +3 -14
- package/dist/helpers/pointSystem.helper.js +15 -33
- package/dist/helpers/ticker.helpers.js +7 -27
- package/dist/helpers/vaa.helper.js +97 -175
- package/dist/helpers/withdraw.helper.js +97 -167
- package/dist/interfaces/db/market/index.d.ts +34 -6
- package/dist/interfaces/db/white_label/index.d.ts +3 -3
- package/dist/interfaces/index.js +11 -14
- package/dist/types/index.js +15 -33
- package/package.json +15 -7
- package/dist/baseModel/base.model.d.ts +0 -26
- package/dist/baseModel/index.d.ts +0 -2
- package/dist/helpers/api.helper.d.ts +0 -16
- package/dist/helpers/api.helper.js +0 -1652
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("algosdk"));
|
|
4
|
-
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["algosdk"], factory);
|
|
6
|
-
else {
|
|
7
|
-
var a = typeof exports === 'object' ? factory(require("algosdk")) : factory(root["algosdk"]);
|
|
8
|
-
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
-
}
|
|
10
|
-
})(global, (__WEBPACK_EXTERNAL_MODULE__9709__) => {
|
|
11
|
-
return /******/ (() => { // webpackBootstrap
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
12
2
|
/******/ "use strict";
|
|
13
3
|
/******/ var __webpack_modules__ = ({
|
|
14
4
|
|
|
@@ -20,8 +10,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
20
10
|
exports.Logger = void 0;
|
|
21
11
|
const node_process_1 = __webpack_require__(1708);
|
|
22
12
|
class Logger {
|
|
13
|
+
_timeLabels = new Map();
|
|
14
|
+
_prefix;
|
|
15
|
+
disabled;
|
|
23
16
|
constructor(prefix, disabled) {
|
|
24
|
-
this._timeLabels = new Map();
|
|
25
17
|
this._prefix = prefix;
|
|
26
18
|
this.disabled = disabled;
|
|
27
19
|
}
|
|
@@ -65,7 +57,6 @@ class Logger {
|
|
|
65
57
|
const color = process.env.LOGGING_OBJECT_INLINE !== "false"
|
|
66
58
|
? this.noColor
|
|
67
59
|
: (diff > 100 ? this.toRed : this.toYellow);
|
|
68
|
-
// console.log(' ');
|
|
69
60
|
if (diff > 100 || (label.includes('update24hStat') && diff > 25)) {
|
|
70
61
|
this.log(`Benchmark took ${color(diff)} milliseconds for ${color(label)}`);
|
|
71
62
|
}
|
|
@@ -196,7 +187,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
196
187
|
exports.printUnpackedLocalData = exports.getAccounInfoFormLocalStorage = void 0;
|
|
197
188
|
exports.unpackData = unpackData;
|
|
198
189
|
exports.decodeString = decodeString;
|
|
199
|
-
const algosdk_1 = __importStar(__webpack_require__(
|
|
190
|
+
const algosdk_1 = __importStar(__webpack_require__(8115));
|
|
200
191
|
const orderByteSize = 28;
|
|
201
192
|
const getAccounInfoFormLocalStorage = (localState) => {
|
|
202
193
|
const uintArray = Buffer.from(localState, 'base64');
|
|
@@ -341,10 +332,10 @@ function extractAppOrders(account, appId) {
|
|
|
341
332
|
|
|
342
333
|
/***/ }),
|
|
343
334
|
|
|
344
|
-
/***/
|
|
335
|
+
/***/ 8115:
|
|
345
336
|
/***/ ((module) => {
|
|
346
337
|
|
|
347
|
-
module.exports =
|
|
338
|
+
module.exports = require("algosdk");
|
|
348
339
|
|
|
349
340
|
/***/ })
|
|
350
341
|
|
|
@@ -380,8 +371,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__9709__;
|
|
|
380
371
|
/******/ // Load entry module and return exports
|
|
381
372
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
382
373
|
/******/ var __webpack_exports__ = __webpack_require__(7413);
|
|
374
|
+
/******/ module.exports = __webpack_exports__;
|
|
383
375
|
/******/
|
|
384
|
-
/******/ return __webpack_exports__;
|
|
385
376
|
/******/ })()
|
|
386
|
-
;
|
|
387
|
-
});
|
|
377
|
+
;
|
package/dist/common/logger.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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
|
|
|
@@ -55,8 +45,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
55
45
|
exports.Logger = void 0;
|
|
56
46
|
const node_process_1 = __webpack_require__(1708);
|
|
57
47
|
class Logger {
|
|
48
|
+
_timeLabels = new Map();
|
|
49
|
+
_prefix;
|
|
50
|
+
disabled;
|
|
58
51
|
constructor(prefix, disabled) {
|
|
59
|
-
this._timeLabels = new Map();
|
|
60
52
|
this._prefix = prefix;
|
|
61
53
|
this.disabled = disabled;
|
|
62
54
|
}
|
|
@@ -100,7 +92,6 @@ class Logger {
|
|
|
100
92
|
const color = process.env.LOGGING_OBJECT_INLINE !== "false"
|
|
101
93
|
? this.noColor
|
|
102
94
|
: (diff > 100 ? this.toRed : this.toYellow);
|
|
103
|
-
// console.log(' ');
|
|
104
95
|
if (diff > 100 || (label.includes('update24hStat') && diff > 25)) {
|
|
105
96
|
this.log(`Benchmark took ${color(diff)} milliseconds for ${color(label)}`);
|
|
106
97
|
}
|
|
@@ -182,7 +173,6 @@ exports["default"] = new Logger();
|
|
|
182
173
|
|
|
183
174
|
})();
|
|
184
175
|
|
|
185
|
-
|
|
176
|
+
module.exports = __webpack_exports__;
|
|
186
177
|
/******/ })()
|
|
187
|
-
;
|
|
188
|
-
});
|
|
178
|
+
;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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).
|
|
@@ -34,7 +24,6 @@ function mapToCodexAssetDto(o, isArchived) {
|
|
|
34
24
|
|
|
35
25
|
})();
|
|
36
26
|
|
|
37
|
-
|
|
27
|
+
module.exports = __webpack_exports__;
|
|
38
28
|
/******/ })()
|
|
39
|
-
;
|
|
40
|
-
});
|
|
29
|
+
;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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).
|
|
@@ -32,7 +22,6 @@ function mapToCodexBalanceDto(o) {
|
|
|
32
22
|
|
|
33
23
|
})();
|
|
34
24
|
|
|
35
|
-
|
|
25
|
+
module.exports = __webpack_exports__;
|
|
36
26
|
/******/ })()
|
|
37
|
-
;
|
|
38
|
-
});
|
|
27
|
+
;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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
|
|
|
@@ -187,7 +177,7 @@ exports.bn_operation = bn_operation;
|
|
|
187
177
|
exports.roundNumber = roundNumber;
|
|
188
178
|
exports.convertFromBaseUnits = convertFromBaseUnits;
|
|
189
179
|
exports.convertToBaseUnits = convertToBaseUnits;
|
|
190
|
-
const bignumber_js_1 = __importDefault(__webpack_require__(
|
|
180
|
+
const bignumber_js_1 = __importDefault(__webpack_require__(4978));
|
|
191
181
|
bignumber_js_1.default.config({ DECIMAL_PLACES: 40, EXPONENTIAL_AT: 45 });
|
|
192
182
|
var Operations;
|
|
193
183
|
(function (Operations) {
|
|
@@ -205,7 +195,6 @@ var Operations;
|
|
|
205
195
|
function absolute(value) {
|
|
206
196
|
let x = new bignumber_js_1.default(value);
|
|
207
197
|
const res = x.abs().toString();
|
|
208
|
-
// console.log('Absolute value', { value, res })
|
|
209
198
|
return res;
|
|
210
199
|
}
|
|
211
200
|
function ceil(value) {
|
|
@@ -345,17 +334,10 @@ function roundNumber({ decimalPlaces = 0 }, x) {
|
|
|
345
334
|
}
|
|
346
335
|
function convertFromBaseUnits(assetDecimals, quantity) {
|
|
347
336
|
const decimals = Number(assetDecimals);
|
|
348
|
-
return roundNumber({ decimalPlaces: decimals },
|
|
349
|
-
// eslint-disable-next-line no-magic-numbers
|
|
350
|
-
Math.pow(10, -decimals) * Number(quantity));
|
|
337
|
+
return roundNumber({ decimalPlaces: decimals }, Math.pow(10, -decimals) * Number(quantity));
|
|
351
338
|
}
|
|
352
|
-
/**
|
|
353
|
-
* Computs quantity * 10^(assetDecimals) and rounds the result
|
|
354
|
-
*/
|
|
355
339
|
function convertToBaseUnits(assetDecimals, quantity) {
|
|
356
|
-
// eslint-disable-next-line no-magic-numbers
|
|
357
340
|
const baseAmount = Math.pow(10, Number(assetDecimals)) * Number(quantity);
|
|
358
|
-
// 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
|
|
359
341
|
return roundNumber({ decimalPlaces: 0 }, baseAmount);
|
|
360
342
|
}
|
|
361
343
|
|
|
@@ -989,6 +971,13 @@ var ScheduledNotificationStatusEnum;
|
|
|
989
971
|
})(ScheduledNotificationStatusEnum || (exports.ScheduledNotificationStatusEnum = ScheduledNotificationStatusEnum = {}));
|
|
990
972
|
|
|
991
973
|
|
|
974
|
+
/***/ }),
|
|
975
|
+
|
|
976
|
+
/***/ 4978:
|
|
977
|
+
/***/ ((module) => {
|
|
978
|
+
|
|
979
|
+
module.exports = require("bignumber.js");
|
|
980
|
+
|
|
992
981
|
/***/ }),
|
|
993
982
|
|
|
994
983
|
/***/ 5237:
|
|
@@ -1021,8 +1010,8 @@ const big_number_helper_1 = __webpack_require__(1174);
|
|
|
1021
1010
|
const _enums_1 = __webpack_require__(9965);
|
|
1022
1011
|
function mapToUserTradeDto(t, baseAsset, priceAsset) {
|
|
1023
1012
|
const o = t.buyOrder && t.sellOrder
|
|
1024
|
-
? (t.buyOrderId > t.sellOrderId ? t.buyOrder : t.sellOrder)
|
|
1025
|
-
: (t.buyOrder || t.sellOrder);
|
|
1013
|
+
? (t.buyOrderId > t.sellOrderId ? t.buyOrder : t.sellOrder)
|
|
1014
|
+
: (t.buyOrder || t.sellOrder);
|
|
1026
1015
|
return {
|
|
1027
1016
|
pairId: t.pairId,
|
|
1028
1017
|
orderId: o?.id,
|
|
@@ -1035,7 +1024,6 @@ function mapToOrderTradeDto(order, trades, pairKey, baseAsset, priceAsset) {
|
|
|
1035
1024
|
return {
|
|
1036
1025
|
id: order.id,
|
|
1037
1026
|
pairId: order.pairId,
|
|
1038
|
-
// @ts-ignore
|
|
1039
1027
|
pair: pairKey || order.pair?.pairKey,
|
|
1040
1028
|
...mapAssets(baseAsset, priceAsset),
|
|
1041
1029
|
amount: order.amount,
|
|
@@ -1105,13 +1093,6 @@ var TwitterAccessScopeEnum;
|
|
|
1105
1093
|
})(TwitterAccessScopeEnum || (exports.TwitterAccessScopeEnum = TwitterAccessScopeEnum = {}));
|
|
1106
1094
|
|
|
1107
1095
|
|
|
1108
|
-
/***/ }),
|
|
1109
|
-
|
|
1110
|
-
/***/ 6168:
|
|
1111
|
-
/***/ ((module) => {
|
|
1112
|
-
|
|
1113
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__6168__;
|
|
1114
|
-
|
|
1115
1096
|
/***/ }),
|
|
1116
1097
|
|
|
1117
1098
|
/***/ 6828:
|
|
@@ -1319,7 +1300,7 @@ function removeField(obj, fieldToRemove) {
|
|
|
1319
1300
|
.filter(([key]) => key !== fieldToRemove)
|
|
1320
1301
|
.map(([key, value]) => [key, removeField(value, fieldToRemove)]));
|
|
1321
1302
|
}
|
|
1322
|
-
return obj;
|
|
1303
|
+
return obj;
|
|
1323
1304
|
}
|
|
1324
1305
|
function removeUndefined(obj) {
|
|
1325
1306
|
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
|
|
@@ -1414,8 +1395,7 @@ __exportStar(__webpack_require__(3004), exports);
|
|
|
1414
1395
|
/******/ // Load entry module and return exports
|
|
1415
1396
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
1416
1397
|
/******/ var __webpack_exports__ = __webpack_require__(9321);
|
|
1398
|
+
/******/ module.exports = __webpack_exports__;
|
|
1417
1399
|
/******/
|
|
1418
|
-
/******/ return __webpack_exports__;
|
|
1419
1400
|
/******/ })()
|
|
1420
|
-
;
|
|
1421
|
-
});
|
|
1401
|
+
;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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
|
|
|
@@ -163,7 +153,7 @@ exports.bn_operation = bn_operation;
|
|
|
163
153
|
exports.roundNumber = roundNumber;
|
|
164
154
|
exports.convertFromBaseUnits = convertFromBaseUnits;
|
|
165
155
|
exports.convertToBaseUnits = convertToBaseUnits;
|
|
166
|
-
const bignumber_js_1 = __importDefault(__webpack_require__(
|
|
156
|
+
const bignumber_js_1 = __importDefault(__webpack_require__(4978));
|
|
167
157
|
bignumber_js_1.default.config({ DECIMAL_PLACES: 40, EXPONENTIAL_AT: 45 });
|
|
168
158
|
var Operations;
|
|
169
159
|
(function (Operations) {
|
|
@@ -181,7 +171,6 @@ var Operations;
|
|
|
181
171
|
function absolute(value) {
|
|
182
172
|
let x = new bignumber_js_1.default(value);
|
|
183
173
|
const res = x.abs().toString();
|
|
184
|
-
// console.log('Absolute value', { value, res })
|
|
185
174
|
return res;
|
|
186
175
|
}
|
|
187
176
|
function ceil(value) {
|
|
@@ -321,17 +310,10 @@ function roundNumber({ decimalPlaces = 0 }, x) {
|
|
|
321
310
|
}
|
|
322
311
|
function convertFromBaseUnits(assetDecimals, quantity) {
|
|
323
312
|
const decimals = Number(assetDecimals);
|
|
324
|
-
return roundNumber({ decimalPlaces: decimals },
|
|
325
|
-
// eslint-disable-next-line no-magic-numbers
|
|
326
|
-
Math.pow(10, -decimals) * Number(quantity));
|
|
313
|
+
return roundNumber({ decimalPlaces: decimals }, Math.pow(10, -decimals) * Number(quantity));
|
|
327
314
|
}
|
|
328
|
-
/**
|
|
329
|
-
* Computs quantity * 10^(assetDecimals) and rounds the result
|
|
330
|
-
*/
|
|
331
315
|
function convertToBaseUnits(assetDecimals, quantity) {
|
|
332
|
-
// eslint-disable-next-line no-magic-numbers
|
|
333
316
|
const baseAmount = Math.pow(10, Number(assetDecimals)) * Number(quantity);
|
|
334
|
-
// 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
|
|
335
317
|
return roundNumber({ decimalPlaces: 0 }, baseAmount);
|
|
336
318
|
}
|
|
337
319
|
|
|
@@ -943,6 +925,13 @@ var ScheduledNotificationStatusEnum;
|
|
|
943
925
|
})(ScheduledNotificationStatusEnum || (exports.ScheduledNotificationStatusEnum = ScheduledNotificationStatusEnum = {}));
|
|
944
926
|
|
|
945
927
|
|
|
928
|
+
/***/ }),
|
|
929
|
+
|
|
930
|
+
/***/ 4978:
|
|
931
|
+
/***/ ((module) => {
|
|
932
|
+
|
|
933
|
+
module.exports = require("bignumber.js");
|
|
934
|
+
|
|
946
935
|
/***/ }),
|
|
947
936
|
|
|
948
937
|
/***/ 5237:
|
|
@@ -980,13 +969,6 @@ var TwitterAccessScopeEnum;
|
|
|
980
969
|
})(TwitterAccessScopeEnum || (exports.TwitterAccessScopeEnum = TwitterAccessScopeEnum = {}));
|
|
981
970
|
|
|
982
971
|
|
|
983
|
-
/***/ }),
|
|
984
|
-
|
|
985
|
-
/***/ 6168:
|
|
986
|
-
/***/ ((module) => {
|
|
987
|
-
|
|
988
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__6168__;
|
|
989
|
-
|
|
990
972
|
/***/ }),
|
|
991
973
|
|
|
992
974
|
/***/ 6828:
|
|
@@ -1194,7 +1176,7 @@ function removeField(obj, fieldToRemove) {
|
|
|
1194
1176
|
.filter(([key]) => key !== fieldToRemove)
|
|
1195
1177
|
.map(([key, value]) => [key, removeField(value, fieldToRemove)]));
|
|
1196
1178
|
}
|
|
1197
|
-
return obj;
|
|
1179
|
+
return obj;
|
|
1198
1180
|
}
|
|
1199
1181
|
function removeUndefined(obj) {
|
|
1200
1182
|
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
|
|
@@ -1273,8 +1255,8 @@ const big_number_helper_1 = __webpack_require__(1174);
|
|
|
1273
1255
|
const _enums_1 = __webpack_require__(9965);
|
|
1274
1256
|
function mapToUserTradeDto(t, baseAsset, priceAsset) {
|
|
1275
1257
|
const o = t.buyOrder && t.sellOrder
|
|
1276
|
-
? (t.buyOrderId > t.sellOrderId ? t.buyOrder : t.sellOrder)
|
|
1277
|
-
: (t.buyOrder || t.sellOrder);
|
|
1258
|
+
? (t.buyOrderId > t.sellOrderId ? t.buyOrder : t.sellOrder)
|
|
1259
|
+
: (t.buyOrder || t.sellOrder);
|
|
1278
1260
|
return {
|
|
1279
1261
|
pairId: t.pairId,
|
|
1280
1262
|
orderId: o?.id,
|
|
@@ -1287,7 +1269,6 @@ function mapToOrderTradeDto(order, trades, pairKey, baseAsset, priceAsset) {
|
|
|
1287
1269
|
return {
|
|
1288
1270
|
id: order.id,
|
|
1289
1271
|
pairId: order.pairId,
|
|
1290
|
-
// @ts-ignore
|
|
1291
1272
|
pair: pairKey || order.pair?.pairKey,
|
|
1292
1273
|
...mapAssets(baseAsset, priceAsset),
|
|
1293
1274
|
amount: order.amount,
|
|
@@ -1337,7 +1318,6 @@ function isMaker(oSide, tSide) {
|
|
|
1337
1318
|
|
|
1338
1319
|
})();
|
|
1339
1320
|
|
|
1340
|
-
|
|
1321
|
+
module.exports = __webpack_exports__;
|
|
1341
1322
|
/******/ })()
|
|
1342
|
-
;
|
|
1343
|
-
});
|
|
1323
|
+
;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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).
|
|
@@ -38,7 +28,6 @@ async function checkIfExists(queryRunner, tableName, indexName) {
|
|
|
38
28
|
|
|
39
29
|
})();
|
|
40
30
|
|
|
41
|
-
|
|
31
|
+
module.exports = __webpack_exports__;
|
|
42
32
|
/******/ })()
|
|
43
|
-
;
|
|
44
|
-
});
|
|
33
|
+
;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("ioredis"));
|
|
4
|
-
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["ioredis"], factory);
|
|
6
|
-
else {
|
|
7
|
-
var a = typeof exports === 'object' ? factory(require("ioredis")) : factory(root["ioredis"]);
|
|
8
|
-
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
-
}
|
|
10
|
-
})(global, (__WEBPACK_EXTERNAL_MODULE__6615__) => {
|
|
11
|
-
return /******/ (() => { // webpackBootstrap
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
12
2
|
/******/ "use strict";
|
|
13
3
|
/******/ var __webpack_modules__ = ({
|
|
14
4
|
|
|
5
|
+
/***/ 657:
|
|
6
|
+
/***/ ((module) => {
|
|
7
|
+
|
|
8
|
+
module.exports = require("ioredis");
|
|
9
|
+
|
|
10
|
+
/***/ }),
|
|
11
|
+
|
|
15
12
|
/***/ 5281:
|
|
16
13
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
17
14
|
|
|
@@ -20,23 +17,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
18
|
};
|
|
22
19
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
23
|
-
const ioredis_1 = __importDefault(__webpack_require__(
|
|
20
|
+
const ioredis_1 = __importDefault(__webpack_require__(657));
|
|
24
21
|
class RedisHelper {
|
|
22
|
+
host = process.env.REDIS_HOSTNAME;
|
|
23
|
+
port = process.env.REDIS_PORT;
|
|
24
|
+
client = new ioredis_1.default({
|
|
25
|
+
host: this.host,
|
|
26
|
+
port: Number(this.port),
|
|
27
|
+
lazyConnect: true,
|
|
28
|
+
});
|
|
29
|
+
operationQueue = [];
|
|
30
|
+
runningOperations = false;
|
|
25
31
|
constructor() {
|
|
26
|
-
this.host = process.env.REDIS_HOSTNAME;
|
|
27
|
-
this.port = process.env.REDIS_PORT;
|
|
28
|
-
this.client = new ioredis_1.default({
|
|
29
|
-
host: this.host,
|
|
30
|
-
port: Number(this.port),
|
|
31
|
-
lazyConnect: true,
|
|
32
|
-
});
|
|
33
|
-
this.operationQueue = [];
|
|
34
|
-
this.runningOperations = false;
|
|
35
32
|
this.client.on('connect', () => {
|
|
36
|
-
// console.log('Redis Connected');
|
|
37
33
|
});
|
|
38
34
|
this.client.on('ready', () => {
|
|
39
|
-
// console.log('Redis Ready');
|
|
40
35
|
this.performPendingOperations();
|
|
41
36
|
});
|
|
42
37
|
this.client.on('error', (err) => {
|
|
@@ -175,14 +170,11 @@ class RedisHelper {
|
|
|
175
170
|
}
|
|
176
171
|
}
|
|
177
172
|
async createStream(key) {
|
|
178
|
-
// console.log(`[Stream '${key}'] Creating...`);
|
|
179
173
|
await this.client.xgroup('CREATE', key, 'group', '$', 'MKSTREAM');
|
|
180
174
|
}
|
|
181
175
|
async writeToStream(key, message) {
|
|
182
176
|
try {
|
|
183
|
-
// console.log(`[Stream '${key}']`, `Try write to stream`);
|
|
184
177
|
if (await this.streamExists(key)) {
|
|
185
|
-
// console.log(`[Stream '${key}']`, `Writing the message`, JSON.stringify(message));
|
|
186
178
|
await this.client.xadd(key, '*', 'message', JSON.stringify(message));
|
|
187
179
|
}
|
|
188
180
|
}
|
|
@@ -191,7 +183,6 @@ class RedisHelper {
|
|
|
191
183
|
}
|
|
192
184
|
}
|
|
193
185
|
async readStream(key, timeout) {
|
|
194
|
-
// console.log(`[Stream '${key}'] Reading with timeout ${timeout}s...`);
|
|
195
186
|
const results = await this.client.xreadgroup('GROUP', 'group', 'consumer', 'COUNT', 1, 'BLOCK', timeout * 1000, 'STREAMS', key, '>');
|
|
196
187
|
if (results && results.length > 0) {
|
|
197
188
|
const [, entries] = results[0];
|
|
@@ -203,9 +194,7 @@ class RedisHelper {
|
|
|
203
194
|
return null;
|
|
204
195
|
}
|
|
205
196
|
async deleteStream(key) {
|
|
206
|
-
// console.log(`[Stream '${key}']`, `Try delete stream`);
|
|
207
197
|
if (await this.streamExists(key)) {
|
|
208
|
-
// console.log(`[Stream '${key}']`, `Deleting...`);
|
|
209
198
|
await this.client.del(key);
|
|
210
199
|
}
|
|
211
200
|
}
|
|
@@ -214,20 +203,12 @@ class RedisHelper {
|
|
|
214
203
|
}
|
|
215
204
|
async streamExists(key) {
|
|
216
205
|
const exists = await this.client.exists(key);
|
|
217
|
-
// console.log(`Key '${key}' in redis exists: ${exists}`);
|
|
218
206
|
return exists === 1;
|
|
219
207
|
}
|
|
220
208
|
}
|
|
221
209
|
exports["default"] = new RedisHelper();
|
|
222
210
|
|
|
223
211
|
|
|
224
|
-
/***/ }),
|
|
225
|
-
|
|
226
|
-
/***/ 6615:
|
|
227
|
-
/***/ ((module) => {
|
|
228
|
-
|
|
229
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__6615__;
|
|
230
|
-
|
|
231
212
|
/***/ })
|
|
232
213
|
|
|
233
214
|
/******/ });
|
|
@@ -262,8 +243,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__6615__;
|
|
|
262
243
|
/******/ // Load entry module and return exports
|
|
263
244
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
264
245
|
/******/ var __webpack_exports__ = __webpack_require__(5281);
|
|
246
|
+
/******/ module.exports = __webpack_exports__;
|
|
265
247
|
/******/
|
|
266
|
-
/******/ return __webpack_exports__;
|
|
267
248
|
/******/ })()
|
|
268
|
-
;
|
|
269
|
-
});
|
|
249
|
+
;
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("@aws-sdk/client-secrets-manager"));
|
|
4
|
-
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["@aws-sdk/client-secrets-manager"], factory);
|
|
6
|
-
else {
|
|
7
|
-
var a = typeof exports === 'object' ? factory(require("@aws-sdk/client-secrets-manager")) : factory(root["@aws-sdk/client-secrets-manager"]);
|
|
8
|
-
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
-
}
|
|
10
|
-
})(global, (__WEBPACK_EXTERNAL_MODULE__2216__) => {
|
|
11
|
-
return /******/ (() => { // webpackBootstrap
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
12
2
|
/******/ "use strict";
|
|
13
3
|
/******/ var __webpack_modules__ = ({
|
|
14
4
|
|
|
15
|
-
/***/
|
|
5
|
+
/***/ 862:
|
|
16
6
|
/***/ ((module) => {
|
|
17
7
|
|
|
18
|
-
module.exports =
|
|
8
|
+
module.exports = require("@aws-sdk/client-secrets-manager");
|
|
19
9
|
|
|
20
10
|
/***/ })
|
|
21
11
|
|
|
@@ -52,15 +42,13 @@ var __webpack_exports__ = {};
|
|
|
52
42
|
var exports = __webpack_exports__;
|
|
53
43
|
|
|
54
44
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55
|
-
const client_secrets_manager_1 = __webpack_require__(
|
|
45
|
+
const client_secrets_manager_1 = __webpack_require__(862);
|
|
56
46
|
class SecretHelper {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.ondatoCredentialsSecretName = process.env.OndatoSecret;
|
|
63
|
-
}
|
|
47
|
+
creatorMnemonicSecretName = process.env.CreatorSecret;
|
|
48
|
+
dispenserMnemonicSecretName = process.env.DispenserSecret;
|
|
49
|
+
transactionMnemonicSecretName = process.env.TransactionSecret;
|
|
50
|
+
relayerMnemonicSecretName = process.env.RelayerSecret;
|
|
51
|
+
ondatoCredentialsSecretName = process.env.OndatoSecret;
|
|
64
52
|
async getCreatorMnemonic() {
|
|
65
53
|
const creatorMnemonic = await this.getSecrets(this.creatorMnemonicSecretName);
|
|
66
54
|
return JSON.parse(creatorMnemonic).creator;
|
|
@@ -85,7 +73,6 @@ class SecretHelper {
|
|
|
85
73
|
return new client_secrets_manager_1.SecretsManager({ region: 'us-east-1' });
|
|
86
74
|
}
|
|
87
75
|
getSecrets(secretName) {
|
|
88
|
-
// console.log(`Getting secrets by name: ${secretName}`);
|
|
89
76
|
return new Promise((resolve, reject) => {
|
|
90
77
|
try {
|
|
91
78
|
const command = new client_secrets_manager_1.GetSecretValueCommand({ SecretId: secretName });
|
|
@@ -96,7 +83,6 @@ class SecretHelper {
|
|
|
96
83
|
reject(err);
|
|
97
84
|
}
|
|
98
85
|
else {
|
|
99
|
-
// console.log('secrets successfully received');
|
|
100
86
|
resolve(data.SecretString);
|
|
101
87
|
}
|
|
102
88
|
});
|
|
@@ -138,7 +124,6 @@ exports["default"] = new SecretHelper();
|
|
|
138
124
|
|
|
139
125
|
})();
|
|
140
126
|
|
|
141
|
-
|
|
127
|
+
module.exports = __webpack_exports__;
|
|
142
128
|
/******/ })()
|
|
143
|
-
;
|
|
144
|
-
});
|
|
129
|
+
;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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).
|
|
@@ -35,7 +25,6 @@ function timestamp(accuracy = 'micro') {
|
|
|
35
25
|
|
|
36
26
|
})();
|
|
37
27
|
|
|
38
|
-
|
|
28
|
+
module.exports = __webpack_exports__;
|
|
39
29
|
/******/ })()
|
|
40
|
-
;
|
|
41
|
-
});
|
|
30
|
+
;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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).
|
|
@@ -26,7 +16,6 @@ exports.assert = assert;
|
|
|
26
16
|
|
|
27
17
|
})();
|
|
28
18
|
|
|
29
|
-
|
|
19
|
+
module.exports = __webpack_exports__;
|
|
30
20
|
/******/ })()
|
|
31
|
-
;
|
|
32
|
-
});
|
|
21
|
+
;
|