@ultrade/shared 1.0.0
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/baseModel/base.model.d.ts +26 -0
- package/dist/baseModel/index.d.ts +2 -0
- package/dist/common/auth.helper.d.ts +4 -0
- package/dist/common/auth.helper.js +367 -0
- package/dist/common/awsKms.d.ts +2 -0
- package/dist/common/awsKms.js +265 -0
- package/dist/common/big-number.helper.d.ts +38 -0
- package/dist/common/big-number.helper.js +263 -0
- package/dist/common/index.d.ts +11 -0
- package/dist/common/index.js +2541 -0
- package/dist/common/indexer.helper.d.ts +2 -0
- package/dist/common/indexer.helper.js +387 -0
- package/dist/common/logger.d.ts +32 -0
- package/dist/common/logger.js +188 -0
- package/dist/common/mappers/codexAsset.mapper.d.ts +2 -0
- package/dist/common/mappers/codexAsset.mapper.js +40 -0
- package/dist/common/mappers/codexBalance.mapper.d.ts +2 -0
- package/dist/common/mappers/codexBalance.mapper.js +38 -0
- package/dist/common/mappers/index.d.ts +3 -0
- package/dist/common/mappers/index.js +1421 -0
- package/dist/common/mappers/trade.mapper.d.ts +6 -0
- package/dist/common/mappers/trade.mapper.js +1343 -0
- package/dist/common/migration.helpers.d.ts +4 -0
- package/dist/common/migration.helpers.js +44 -0
- package/dist/common/redis.helper.d.ts +27 -0
- package/dist/common/redis.helper.js +269 -0
- package/dist/common/secret.helper.d.ts +28 -0
- package/dist/common/secret.helper.js +144 -0
- package/dist/common/timestamp.helper.d.ts +1 -0
- package/dist/common/timestamp.helper.js +41 -0
- package/dist/common/utils/assert.d.ts +1 -0
- package/dist/common/utils/assert.js +32 -0
- package/dist/common/utils/decode.d.ts +5 -0
- package/dist/common/utils/decode.js +206 -0
- package/dist/common/utils/index.d.ts +9 -0
- package/dist/common/utils/index.js +122 -0
- package/dist/common/utils/social.d.ts +1 -0
- package/dist/common/utils/social.js +30 -0
- package/dist/common/utils/stat.d.ts +1 -0
- package/dist/common/utils/stat.js +274 -0
- package/dist/constants/allowedUrls.d.ts +1 -0
- package/dist/constants/auth.d.ts +2 -0
- package/dist/constants/cctp.d.ts +3 -0
- package/dist/constants/codex.d.ts +11 -0
- package/dist/constants/env.d.ts +6 -0
- package/dist/constants/index.d.ts +7 -0
- package/dist/constants/index.js +455 -0
- package/dist/constants/queue.d.ts +39 -0
- package/dist/constants/response.d.ts +82 -0
- package/dist/constants/settings.d.ts +2 -0
- package/dist/constants/social.d.ts +3 -0
- package/dist/constants/withdrawalWalletsMessage.d.ts +1 -0
- package/dist/enums/chains.enum.d.ts +50 -0
- package/dist/enums/db/account/index.d.ts +19 -0
- package/dist/enums/db/affiliate.enum.d.ts +7 -0
- package/dist/enums/db/available-pair-settings.enum.d.ts +12 -0
- package/dist/enums/db/chains.d.ts +30 -0
- package/dist/enums/db/common.enum.d.ts +4 -0
- package/dist/enums/db/component/index.d.ts +22 -0
- package/dist/enums/db/index.d.ts +21 -0
- package/dist/enums/db/market-maker.enum.d.ts +15 -0
- package/dist/enums/db/notification-center/userNotification.enum.d.ts +36 -0
- package/dist/enums/db/order-side.enum.d.ts +5 -0
- package/dist/enums/db/order-status.enum.d.ts +8 -0
- package/dist/enums/db/order-type.enum.d.ts +7 -0
- package/dist/enums/db/pending-actions.enum.d.ts +6 -0
- package/dist/enums/db/relayer.enum.d.ts +23 -0
- package/dist/enums/db/setting-type.enum.d.ts +8 -0
- package/dist/enums/db/social-action.enum.d.ts +24 -0
- package/dist/enums/db/social-prompt.enum.d.ts +8 -0
- package/dist/enums/db/social.enum.d.ts +10 -0
- package/dist/enums/db/state-type.enum.d.ts +9 -0
- package/dist/enums/db/trade.enums.d.ts +10 -0
- package/dist/enums/db/tradingKeyType.enum.d.ts +4 -0
- package/dist/enums/db/upgrade.enum.d.ts +5 -0
- package/dist/enums/db/withdrawal-wallet.enum.d.ts +5 -0
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/index.js +893 -0
- package/dist/enums/maintenanceMode.enum.d.ts +10 -0
- package/dist/enums/notification.enum.d.ts +7 -0
- package/dist/enums/social.enum.d.ts +10 -0
- package/dist/helpers/Encoding.d.ts +33 -0
- package/dist/helpers/Encoding.js +318 -0
- package/dist/helpers/algo.helper.d.ts +14 -0
- package/dist/helpers/algo.helper.js +1211 -0
- package/dist/helpers/api.helper.d.ts +16 -0
- package/dist/helpers/api.helper.js +1652 -0
- package/dist/helpers/assert.helper.d.ts +10 -0
- package/dist/helpers/assert.helper.js +1677 -0
- package/dist/helpers/atomic.helper.d.ts +21 -0
- package/dist/helpers/atomic.helper.js +712 -0
- package/dist/helpers/balance.helper.d.ts +13 -0
- package/dist/helpers/balance.helper.js +4330 -0
- package/dist/helpers/codex/common.helper.d.ts +24 -0
- package/dist/helpers/codex/common.helper.js +4246 -0
- package/dist/helpers/codex/index.d.ts +6 -0
- package/dist/helpers/codex/index.js +4246 -0
- package/dist/helpers/codex/mbr.helper.d.ts +6 -0
- package/dist/helpers/codex/mbr.helper.js +4246 -0
- package/dist/helpers/codex/mna.helper.d.ts +2 -0
- package/dist/helpers/codex/mna.helper.js +4246 -0
- package/dist/helpers/codex/order.helper.d.ts +6 -0
- package/dist/helpers/codex/order.helper.js +4246 -0
- package/dist/helpers/codex/setGlobal.helper.d.ts +27 -0
- package/dist/helpers/codex/setGlobal.helper.js +4312 -0
- package/dist/helpers/codex/transfer.helper.d.ts +21 -0
- package/dist/helpers/codex/transfer.helper.js +4246 -0
- package/dist/helpers/codex/txn.helper.d.ts +13 -0
- package/dist/helpers/codex/txn.helper.js +4246 -0
- package/dist/helpers/codex.helper.d.ts +106 -0
- package/dist/helpers/codex.helper.js +4246 -0
- package/dist/helpers/email.helper.d.ts +5 -0
- package/dist/helpers/email.helper.js +112 -0
- package/dist/helpers/eth.helper.d.ts +12 -0
- package/dist/helpers/eth.helper.js +4246 -0
- package/dist/helpers/hummingbots.helper.d.ts +2 -0
- package/dist/helpers/hummingbots.helper.js +163 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/index.js +837 -0
- package/dist/helpers/interval.helpers.d.ts +9 -0
- package/dist/helpers/interval.helpers.js +110 -0
- package/dist/helpers/liquidity.helper.d.ts +6 -0
- package/dist/helpers/liquidity.helper.js +81 -0
- package/dist/helpers/order.helper.d.ts +7 -0
- package/dist/helpers/order.helper.js +946 -0
- package/dist/helpers/pair.helper.d.ts +9 -0
- package/dist/helpers/pair.helper.js +938 -0
- package/dist/helpers/pointSystem.helper.d.ts +14 -0
- package/dist/helpers/pointSystem.helper.js +392 -0
- package/dist/helpers/ticker.helpers.d.ts +8 -0
- package/dist/helpers/ticker.helpers.js +358 -0
- package/dist/helpers/vaa.helper.d.ts +2 -0
- package/dist/helpers/vaa.helper.js +4350 -0
- package/dist/helpers/withdraw.helper.d.ts +14 -0
- package/dist/helpers/withdraw.helper.js +4784 -0
- package/dist/interfaces/accountInfo.interface.d.ts +15 -0
- package/dist/interfaces/algostreamer/index.d.ts +49 -0
- package/dist/interfaces/api/affiliate.interface.d.ts +71 -0
- package/dist/interfaces/cache.interface.d.ts +25 -0
- package/dist/interfaces/confirmed-txn.interface.d.ts +46 -0
- package/dist/interfaces/controller.interface.d.ts +6 -0
- package/dist/interfaces/db/baseModel.interface.d.ts +5 -0
- package/dist/interfaces/db/hummingbot/index.d.ts +18 -0
- package/dist/interfaces/db/index.d.ts +10 -0
- package/dist/interfaces/db/market/index.d.ts +313 -0
- package/dist/interfaces/db/marketing/index.d.ts +48 -0
- package/dist/interfaces/db/notification_center/index.d.ts +33 -0
- package/dist/interfaces/db/relayer/index.d.ts +56 -0
- package/dist/interfaces/db/social/index.d.ts +188 -0
- package/dist/interfaces/db/softDeleteModel.interface.d.ts +4 -0
- package/dist/interfaces/db/white_label/index.d.ts +161 -0
- package/dist/interfaces/db/withdrawal_wallets/index.d.ts +12 -0
- package/dist/interfaces/dto/index.d.ts +62 -0
- package/dist/interfaces/emailService.interface.d.ts +4 -0
- package/dist/interfaces/index.d.ts +17 -0
- package/dist/interfaces/index.js +1319 -0
- package/dist/interfaces/kmsService.interface.d.ts +4 -0
- package/dist/interfaces/last-look-trade.interface.d.ts +10 -0
- package/dist/interfaces/market.interface.d.ts +17 -0
- package/dist/interfaces/order.interface.d.ts +162 -0
- package/dist/interfaces/pair.interface.d.ts +10 -0
- package/dist/interfaces/query.interface.d.ts +6 -0
- package/dist/interfaces/services/accountCache.interface.d.ts +15 -0
- package/dist/interfaces/services/algod.interface.d.ts +5 -0
- package/dist/interfaces/services/balances.interface.d.ts +11 -0
- package/dist/interfaces/services/coin-market-cap.interface.d.ts +124 -0
- package/dist/interfaces/services/index.d.ts +8 -0
- package/dist/interfaces/services/price-model.interface.d.ts +4 -0
- package/dist/interfaces/services/price-service.interface.d.ts +8 -0
- package/dist/interfaces/services/socialActivity.interface.d.ts +48 -0
- package/dist/interfaces/services/tmc.interface.d.ts +9 -0
- package/dist/interfaces/streaming.interface.d.ts +95 -0
- package/dist/interfaces/timestream.interface.d.ts +29 -0
- package/dist/interfaces/trading.interface.d.ts +235 -0
- package/dist/interfaces/tradingKey.interface.d.ts +26 -0
- package/dist/interfaces/transfer.interface.d.ts +12 -0
- package/dist/interfaces/wallet.interface.d.ts +89 -0
- package/dist/interfaces/withdrawalWallets.interface.d.ts +14 -0
- package/dist/types/algo-order.type.d.ts +10 -0
- package/dist/types/amm/amm.d.ts +163 -0
- package/dist/types/api/request.types.d.ts +99 -0
- package/dist/types/codex.types.d.ts +28 -0
- package/dist/types/hummingbots.types.d.ts +23 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +362 -0
- package/dist/types/notification.type.d.ts +10 -0
- package/dist/types/settings.type.d.ts +162 -0
- package/dist/types/state.type.d.ts +4 -0
- package/package.json +78 -0
|
@@ -0,0 +1,1652 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("buffer"), require("@aws-sdk/client-secrets-manager"), require("axios"), require("bignumber.js"), require("algosdk"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["buffer", "@aws-sdk/client-secrets-manager", "axios", "bignumber.js", "algosdk"], factory);
|
|
6
|
+
else {
|
|
7
|
+
var a = typeof exports === 'object' ? factory(require("buffer"), require("@aws-sdk/client-secrets-manager"), require("axios"), require("bignumber.js"), require("algosdk")) : factory(root["buffer"], root["@aws-sdk/client-secrets-manager"], root["axios"], root["bignumber.js"], root["algosdk"]);
|
|
8
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
+
}
|
|
10
|
+
})(global, (__WEBPACK_EXTERNAL_MODULE__18__, __WEBPACK_EXTERNAL_MODULE__2216__, __WEBPACK_EXTERNAL_MODULE__2742__, __WEBPACK_EXTERNAL_MODULE__6168__, __WEBPACK_EXTERNAL_MODULE__9709__) => {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
13
|
+
/******/ var __webpack_modules__ = ({
|
|
14
|
+
|
|
15
|
+
/***/ 18:
|
|
16
|
+
/***/ ((module) => {
|
|
17
|
+
|
|
18
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__18__;
|
|
19
|
+
|
|
20
|
+
/***/ }),
|
|
21
|
+
|
|
22
|
+
/***/ 573:
|
|
23
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/***/ }),
|
|
30
|
+
|
|
31
|
+
/***/ 623:
|
|
32
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36
|
+
class BaseModel {
|
|
37
|
+
constructor(value, dataSource) {
|
|
38
|
+
this.dataSource = dataSource;
|
|
39
|
+
this.selectWhere = '';
|
|
40
|
+
this.offsets = 0;
|
|
41
|
+
this.limits = 10;
|
|
42
|
+
this.orderBy = '';
|
|
43
|
+
this.orderIs = '';
|
|
44
|
+
this.updateWhere = '';
|
|
45
|
+
this.deleteWhere = '';
|
|
46
|
+
this.userId = '';
|
|
47
|
+
this.tableName = value;
|
|
48
|
+
}
|
|
49
|
+
async SelectAssetData() {
|
|
50
|
+
const query = 'call SelectAssets("' + this.selectCols + '","' + this.tableName + '","' + this.selectWhere + '",' + this.offsets + ',' + this.limits + ',"' + this.orderBy + '","' + this.orderIs + '","' + this.userId + '");';
|
|
51
|
+
console.log(query);
|
|
52
|
+
const result = await this.dataSource.query(`call SelectAssets(?, ?, ?, ?, ?, "?", "?", ?);`, [this.selectCols, this.tableName, this.selectWhere, this.offsets, this.limits, this.orderBy, this.orderIs, this.userId]).then(res => res[0]);
|
|
53
|
+
this.resetSelectSettings();
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
callQuery(query, args) {
|
|
57
|
+
const result = this.dataSource.query(query, args);
|
|
58
|
+
this.resetSelectSettings();
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
deleteFavRecord() {
|
|
62
|
+
const query = 'call deleteFavData(' + this.deleteWhere + ');';
|
|
63
|
+
console.log(query);
|
|
64
|
+
return this.dataSource.query(`call deleteFavData(?);`, [this.deleteWhere]).then(res => res[0]);
|
|
65
|
+
}
|
|
66
|
+
deleteAssetRecord(pairId, address) {
|
|
67
|
+
const where = ` pair_id=${pairId} AND user_address='${address}'`;
|
|
68
|
+
const query = 'call deleteAssetRecord("' + where + '");';
|
|
69
|
+
console.log(query);
|
|
70
|
+
return this.dataSource.query(`call deleteAssetRecord("?");`, [where]).then(res => res[0]);
|
|
71
|
+
}
|
|
72
|
+
resetSelectSettings() {
|
|
73
|
+
this.selectWhere = '';
|
|
74
|
+
this.orderBy = '';
|
|
75
|
+
this.orderIs = '';
|
|
76
|
+
this.selectCols = '';
|
|
77
|
+
this.tableName = '';
|
|
78
|
+
this.offsets = 0;
|
|
79
|
+
this.limits = 10;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports["default"] = BaseModel;
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/***/ }),
|
|
86
|
+
|
|
87
|
+
/***/ 839:
|
|
88
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
92
|
+
exports.transformPointSystemSettings = void 0;
|
|
93
|
+
const _types_1 = __webpack_require__(3574);
|
|
94
|
+
const transformPointSystemSettings = (pointSystemSettings) => {
|
|
95
|
+
const settingsObj = {};
|
|
96
|
+
pointSystemSettings.forEach(({ settingId, value, setting }) => {
|
|
97
|
+
if (setting.type === 'boolean') {
|
|
98
|
+
settingsObj[settingId] = value === 'true';
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
settingsObj[settingId] = value;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
discordEnabled: settingsObj[_types_1.SettingIds.POINT_SYSTEM_DISCORD_ENABLED],
|
|
106
|
+
telegramBotName: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TELEGRAM_BOT_NAME],
|
|
107
|
+
telegramBotId: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TELEGRAM_BOT_ID],
|
|
108
|
+
telegramEnabled: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TELEGRAM_ENABLED],
|
|
109
|
+
telegramGroupId: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TELEGRAM_GROUP_ID],
|
|
110
|
+
telegramGroupName: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TELEGRAM_GROUP_NAME],
|
|
111
|
+
twitterAccountId: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TWITTER_ACCOUNT_ID],
|
|
112
|
+
twitterAccountName: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TWITTER_ACCOUNT_NAME],
|
|
113
|
+
twitterEnabled: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TWITTER_ENABLED],
|
|
114
|
+
twitterJobEnabled: settingsObj[_types_1.SettingIds.POINT_SYSTEM_TWITTER_JOB_ENABLED],
|
|
115
|
+
guideLink: settingsObj[_types_1.SettingIds.POINT_SYSTEM_GUIDE_LINK],
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
exports.transformPointSystemSettings = transformPointSystemSettings;
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
/***/ }),
|
|
122
|
+
|
|
123
|
+
/***/ 865:
|
|
124
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
128
|
+
exports.groupTickersByInterval = groupTickersByInterval;
|
|
129
|
+
exports.groupTickersByMonthInterval = groupTickersByMonthInterval;
|
|
130
|
+
exports.groupTickersByYearInterval = groupTickersByYearInterval;
|
|
131
|
+
exports.mapCandleToTicker = mapCandleToTicker;
|
|
132
|
+
exports.roundUpSecondsInTimestamp = roundUpSecondsInTimestamp;
|
|
133
|
+
exports.roundUpMinutesInTimestamp = roundUpMinutesInTimestamp;
|
|
134
|
+
exports.roundUpHoursInTimestamp = roundUpHoursInTimestamp;
|
|
135
|
+
const big_number_helper_1 = __webpack_require__(1174);
|
|
136
|
+
function groupTickersByInterval(tickers, newIntervalInSec, endTimeInSec) {
|
|
137
|
+
const newGroupedTickers = [];
|
|
138
|
+
let timestamp = endTimeInSec - newIntervalInSec;
|
|
139
|
+
let slot = null;
|
|
140
|
+
// desc direction by timestamp
|
|
141
|
+
const sortedTickers = tickers.sort((a, b) => b.t - a.t);
|
|
142
|
+
for (let i = 0; i < sortedTickers.length; i++) {
|
|
143
|
+
const element = sortedTickers[i];
|
|
144
|
+
if (element.t < timestamp) {
|
|
145
|
+
if (slot) {
|
|
146
|
+
newGroupedTickers.push({ ...slot });
|
|
147
|
+
slot = null;
|
|
148
|
+
}
|
|
149
|
+
timestamp = timestamp - newIntervalInSec * Math.ceil((timestamp - element.t) / newIntervalInSec);
|
|
150
|
+
}
|
|
151
|
+
if (!slot) {
|
|
152
|
+
slot = { ...element, t: timestamp };
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
if ((0, big_number_helper_1.lessThan)(slot.h, element.h))
|
|
156
|
+
slot.h = element.h;
|
|
157
|
+
if ((0, big_number_helper_1.greaterThan)(slot.l, element.l))
|
|
158
|
+
slot.l = element.l;
|
|
159
|
+
slot.o = element.o;
|
|
160
|
+
slot.v = Number((0, big_number_helper_1.plus)(slot.v, element.v));
|
|
161
|
+
}
|
|
162
|
+
if (i + 1 === sortedTickers.length) {
|
|
163
|
+
newGroupedTickers.push({ ...slot });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return newGroupedTickers;
|
|
167
|
+
}
|
|
168
|
+
function groupTickersByMonthInterval(tickers, months, endTimeInSec) {
|
|
169
|
+
const sortedTickers = tickers.sort((a, b) => b.t - a.t);
|
|
170
|
+
const yearlyTickers = [];
|
|
171
|
+
const tickersByYear = new Map();
|
|
172
|
+
for (const ticker of sortedTickers) {
|
|
173
|
+
const date = new Date(ticker.t * 1000);
|
|
174
|
+
const year = date.getFullYear();
|
|
175
|
+
if (!tickersByYear.has(year)) {
|
|
176
|
+
tickersByYear.set(year, []);
|
|
177
|
+
}
|
|
178
|
+
tickersByYear.get(year).push(ticker);
|
|
179
|
+
}
|
|
180
|
+
for (const [year, yearTickers] of tickersByYear) {
|
|
181
|
+
if (yearTickers.length === 0)
|
|
182
|
+
continue;
|
|
183
|
+
const sortedYearTickers = yearTickers.sort((a, b) => a.t - b.t);
|
|
184
|
+
const yearlyTicker = {
|
|
185
|
+
t: new Date(year, 0, 1).getTime() / 1000,
|
|
186
|
+
o: sortedYearTickers[0].o,
|
|
187
|
+
h: Math.max(...sortedYearTickers.map(t => t.h)),
|
|
188
|
+
l: Math.min(...sortedYearTickers.map(t => t.l)),
|
|
189
|
+
c: sortedYearTickers[sortedYearTickers.length - 1].c,
|
|
190
|
+
v: sortedYearTickers.reduce((sum, t) => sum + t.v, 0),
|
|
191
|
+
q: sortedYearTickers.reduce((sum, t) => sum + t.q, 0),
|
|
192
|
+
};
|
|
193
|
+
yearlyTickers.push(yearlyTicker);
|
|
194
|
+
}
|
|
195
|
+
return yearlyTickers.sort((a, b) => b.t - a.t);
|
|
196
|
+
}
|
|
197
|
+
function groupTickersByYearInterval(tickers, years, endTimeInSec) {
|
|
198
|
+
throw new Error("groupTickersByYearInterval has not implemented yet");
|
|
199
|
+
}
|
|
200
|
+
function mapCandleToTicker(candle) {
|
|
201
|
+
return {
|
|
202
|
+
t: +(0, big_number_helper_1.divide)(candle.timestamp, 1000),
|
|
203
|
+
o: candle.open,
|
|
204
|
+
h: candle.high,
|
|
205
|
+
l: candle.low,
|
|
206
|
+
c: candle.close,
|
|
207
|
+
v: candle.volume,
|
|
208
|
+
q: candle.quote
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function roundUpSecondsInTimestamp(timeInSec) {
|
|
212
|
+
return (new Date(timeInSec * 1000).setSeconds(60, 0)) / 1000;
|
|
213
|
+
}
|
|
214
|
+
function roundUpMinutesInTimestamp(timeInSec) {
|
|
215
|
+
return (new Date(timeInSec * 1000).setMinutes(60, 0, 0)) / 1000;
|
|
216
|
+
}
|
|
217
|
+
function roundUpHoursInTimestamp(timeInSec) {
|
|
218
|
+
return (new Date(timeInSec * 1000).setHours(24, 0, 0, 0)) / 1000;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
/***/ }),
|
|
223
|
+
|
|
224
|
+
/***/ 935:
|
|
225
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
229
|
+
exports.SERVER = exports.CALCULATIONS = exports.BIGNUMBER = exports.RES_MSG = exports.RESPONSES = void 0;
|
|
230
|
+
exports.RESPONSES = {
|
|
231
|
+
SUCCESS: 200,
|
|
232
|
+
CREATED: 201,
|
|
233
|
+
ACCEPTED: 202,
|
|
234
|
+
NOCONTENT: 204,
|
|
235
|
+
BADREQUEST: 400,
|
|
236
|
+
FORBIDDEN: 403,
|
|
237
|
+
NOTFOUND: 404,
|
|
238
|
+
TIMEOUT: 408,
|
|
239
|
+
TOOMANYREQ: 429,
|
|
240
|
+
INTERNALSERVER: 500,
|
|
241
|
+
BADGATEWAYS: 502,
|
|
242
|
+
SERVICEUNAVILABLE: 503,
|
|
243
|
+
GATEWAYTIMEOUT: 504,
|
|
244
|
+
};
|
|
245
|
+
exports.RES_MSG = {
|
|
246
|
+
INSERT: 'Data has been saved successfully.',
|
|
247
|
+
ERROR: 'Some error has been occured. Please try again.',
|
|
248
|
+
SUCCESS: 'Your request is executed successfully!',
|
|
249
|
+
REQUIRED: 'coin_type or price param is required',
|
|
250
|
+
CAPTCHATEXTNOTFOUND: 'Captcha text not found.',
|
|
251
|
+
CAPTCHA_VERIFICATION_FAILED: 'Captcha is not verified.',
|
|
252
|
+
NOTEMPTY: 'coin_type or price should not be empty',
|
|
253
|
+
PAIR_LIST: 'Pair list',
|
|
254
|
+
PAIR_STATUS: 'Pair status has been changed',
|
|
255
|
+
ACTIVE_USERS: 'Active Users',
|
|
256
|
+
SETTINGS_NOT_FOUND: 'No settings found in DB.',
|
|
257
|
+
TRADE_IS_HALT: 'Trading is disabled.',
|
|
258
|
+
KYC_REQUIRED: 'KYC is required for this action.',
|
|
259
|
+
EMAIL_NOT_VERIFIED: 'Your email is not verified.Please verify first.',
|
|
260
|
+
NOT_BETA_USER: 'Trade only works for beta user.',
|
|
261
|
+
WRONG_PAIR_KEY: 'Pair key not found.',
|
|
262
|
+
PAIRDISABLED: 'Temporarily order placement has been disabled for this pair. Please try again later.',
|
|
263
|
+
BALANCE_NOT_SUFFICIENT: 'You have insufficient balance.',
|
|
264
|
+
MIN_TRADE_NOT_MATCHED: 'Minimum trade limit does not matched.',
|
|
265
|
+
ORDER_PLACED_SUCCESSFULLY: 'Order has been placed successfully.',
|
|
266
|
+
ORDER_NOT_FOUND: 'Sorry this order id does not found.',
|
|
267
|
+
ORDER_ALREADY_MATCHED: 'Order already matched.',
|
|
268
|
+
ORDER_ALREADY_CANCELED: 'Order already cancelled.',
|
|
269
|
+
ORDER_CANCELED_SUCCESSFULLY: 'order successfully cancelled',
|
|
270
|
+
ORDER_LIST: 'Order list fetched successfully.',
|
|
271
|
+
ORDER_EXIT: 'Successfully exited from the position.',
|
|
272
|
+
PAIRERR: 'please provide pair param',
|
|
273
|
+
ORDERSIDE: 'side param is required',
|
|
274
|
+
ORDERTYPE: 'type param is required',
|
|
275
|
+
ORDERIDREQ: 'order_id param is required',
|
|
276
|
+
ORDERDETAIL: 'order detail',
|
|
277
|
+
COMMODITYORICE: 'commodity price',
|
|
278
|
+
COMMODITYSPOT: 'commodity spot updated',
|
|
279
|
+
TOKEN_INSERTED: 'ERC token has been added',
|
|
280
|
+
PARAMREQ: 'Parameter missing',
|
|
281
|
+
EXIST: 'Token Already Exist',
|
|
282
|
+
BREACHEDTOKENS: 'List of breached tokens',
|
|
283
|
+
API_EXPOSE: {
|
|
284
|
+
TOKEN_NOT_FOUND: 'Token not found, Please get token and set to header.',
|
|
285
|
+
ERROR: "Something went wrong, Please try again later"
|
|
286
|
+
},
|
|
287
|
+
LIMITED_UNITS: 'ONLY {{units}} units are available. You can place your order with this amount',
|
|
288
|
+
UNITS_UNAVAIL: 'Amount unavailable',
|
|
289
|
+
ORDER: {
|
|
290
|
+
ERROR: 'An error has been occured',
|
|
291
|
+
UNITS_UNAVAIL: 'Amount unavailable',
|
|
292
|
+
LIMITED_UNITS: 'ONLY {{units}} units are available. You can place your order with this amount',
|
|
293
|
+
PLACED: 'Order has been placed',
|
|
294
|
+
NOPARAMS: 'empty body params',
|
|
295
|
+
ORDER_NOT_FOUND: 'Sorry this order id not found.',
|
|
296
|
+
ORDER_ALREADY_MATCHED: 'Order already matched.',
|
|
297
|
+
ORDER_ALREADY_CANCELED: 'Order already cancelled.',
|
|
298
|
+
ORDER_CANCELED_SUCCESSFULLY: 'Order cancelled successfully',
|
|
299
|
+
},
|
|
300
|
+
DOMAIN_NOT_FOUND: 'domain not found',
|
|
301
|
+
};
|
|
302
|
+
exports.BIGNUMBER = {
|
|
303
|
+
SMALLESTUNIT: process.env.SMALLEST_UNIT,
|
|
304
|
+
};
|
|
305
|
+
exports.CALCULATIONS = {
|
|
306
|
+
SMALLEST_UNITS: process.env.SMALLEST_UNIT,
|
|
307
|
+
};
|
|
308
|
+
exports.SERVER = {
|
|
309
|
+
AVAILABLE_ASSETS_PER_USER: 1,
|
|
310
|
+
AVAILABLE_ASSETS_PER_IP: 3,
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
/***/ }),
|
|
315
|
+
|
|
316
|
+
/***/ 1174:
|
|
317
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
321
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
322
|
+
};
|
|
323
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
324
|
+
exports.Operations = void 0;
|
|
325
|
+
exports.absolute = absolute;
|
|
326
|
+
exports.ceil = ceil;
|
|
327
|
+
exports.toFixed = toFixed;
|
|
328
|
+
exports.floor = floor;
|
|
329
|
+
exports.round = round;
|
|
330
|
+
exports.plus = plus;
|
|
331
|
+
exports.minus = minus;
|
|
332
|
+
exports.multiply = multiply;
|
|
333
|
+
exports.toUsd = toUsd;
|
|
334
|
+
exports.divide = divide;
|
|
335
|
+
exports.greaterThanOrEqual = greaterThanOrEqual;
|
|
336
|
+
exports.greaterThan = greaterThan;
|
|
337
|
+
exports.lessThanOrEqual = lessThanOrEqual;
|
|
338
|
+
exports.lessThan = lessThan;
|
|
339
|
+
exports.equal = equal;
|
|
340
|
+
exports.mod = mod;
|
|
341
|
+
exports.modZero = modZero;
|
|
342
|
+
exports.bn_operation = bn_operation;
|
|
343
|
+
exports.roundNumber = roundNumber;
|
|
344
|
+
exports.convertFromBaseUnits = convertFromBaseUnits;
|
|
345
|
+
exports.convertToBaseUnits = convertToBaseUnits;
|
|
346
|
+
const bignumber_js_1 = __importDefault(__webpack_require__(6168));
|
|
347
|
+
bignumber_js_1.default.config({ DECIMAL_PLACES: 40, EXPONENTIAL_AT: 45 });
|
|
348
|
+
var Operations;
|
|
349
|
+
(function (Operations) {
|
|
350
|
+
Operations["MINUS"] = "-";
|
|
351
|
+
Operations["PLUS"] = "+";
|
|
352
|
+
Operations["MULTIPLY"] = "*";
|
|
353
|
+
Operations["DIVIDE"] = "/";
|
|
354
|
+
Operations["GREATER_THAN_OR_EQUAL"] = ">=";
|
|
355
|
+
Operations["GREATER_THAN"] = ">";
|
|
356
|
+
Operations["LESS_THAN_OR_EQUAL"] = "<=";
|
|
357
|
+
Operations["LESS_THAN"] = "<";
|
|
358
|
+
Operations["EQUAL"] = "==";
|
|
359
|
+
Operations["MOD"] = "mod";
|
|
360
|
+
})(Operations || (exports.Operations = Operations = {}));
|
|
361
|
+
function absolute(value) {
|
|
362
|
+
let x = new bignumber_js_1.default(value);
|
|
363
|
+
const res = x.abs().toString();
|
|
364
|
+
// console.log('Absolute value', { value, res })
|
|
365
|
+
return res;
|
|
366
|
+
}
|
|
367
|
+
function ceil(value) {
|
|
368
|
+
let x = new bignumber_js_1.default(String(value));
|
|
369
|
+
const res = x.integerValue(bignumber_js_1.default.ROUND_CEIL).toString();
|
|
370
|
+
if (!equal(value, res)) {
|
|
371
|
+
console.log('Ceil value', { value, res });
|
|
372
|
+
}
|
|
373
|
+
return res;
|
|
374
|
+
}
|
|
375
|
+
function toFixed(value, decimalPlaces, roundUpToFirstSignificant = false) {
|
|
376
|
+
const x = new bignumber_js_1.default(String(value));
|
|
377
|
+
let res;
|
|
378
|
+
if (roundUpToFirstSignificant) {
|
|
379
|
+
const valueStr = x.toFixed();
|
|
380
|
+
const decimalIndex = valueStr.indexOf('.');
|
|
381
|
+
if (decimalIndex >= 0) {
|
|
382
|
+
const fractionalPart = valueStr.slice(decimalIndex + 1);
|
|
383
|
+
let leadingZeros = 0;
|
|
384
|
+
for (let char of fractionalPart) {
|
|
385
|
+
if (char === '0') {
|
|
386
|
+
leadingZeros++;
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
const totalDecimalPlaces = leadingZeros + 1;
|
|
393
|
+
res = x.toFixed(totalDecimalPlaces, bignumber_js_1.default.ROUND_UP);
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
res = x.toFixed(0);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
res = x.toFixed(decimalPlaces);
|
|
401
|
+
}
|
|
402
|
+
console.log('Fixed value', { value, res });
|
|
403
|
+
return res;
|
|
404
|
+
}
|
|
405
|
+
function floor(value) {
|
|
406
|
+
let x = new bignumber_js_1.default(String(value));
|
|
407
|
+
const res = x.integerValue(bignumber_js_1.default.ROUND_FLOOR).toString();
|
|
408
|
+
console.log('Floor value', { value, res });
|
|
409
|
+
return res;
|
|
410
|
+
}
|
|
411
|
+
function round(value) {
|
|
412
|
+
let x = new bignumber_js_1.default(String(value));
|
|
413
|
+
const res = x.integerValue(bignumber_js_1.default.ROUND_HALF_UP).toString();
|
|
414
|
+
console.log('Round value', { value, res });
|
|
415
|
+
return res;
|
|
416
|
+
}
|
|
417
|
+
function plus(value1, value2) {
|
|
418
|
+
return bn_operation(value1, value2, Operations.PLUS);
|
|
419
|
+
}
|
|
420
|
+
function minus(value1, value2) {
|
|
421
|
+
return bn_operation(value1, value2, Operations.MINUS);
|
|
422
|
+
}
|
|
423
|
+
function multiply(value1, value2) {
|
|
424
|
+
return bn_operation(value1, value2, Operations.MULTIPLY);
|
|
425
|
+
}
|
|
426
|
+
function toUsd(amount, price) {
|
|
427
|
+
return multiply(amount, price || 0);
|
|
428
|
+
}
|
|
429
|
+
;
|
|
430
|
+
function divide(value1, value2) {
|
|
431
|
+
return bn_operation(value1, value2, Operations.DIVIDE);
|
|
432
|
+
}
|
|
433
|
+
function greaterThanOrEqual(value1, value2) {
|
|
434
|
+
return Boolean(bn_operation(value1, value2, Operations.GREATER_THAN_OR_EQUAL));
|
|
435
|
+
}
|
|
436
|
+
function greaterThan(value1, value2) {
|
|
437
|
+
return Boolean(bn_operation(value1, value2, Operations.GREATER_THAN));
|
|
438
|
+
}
|
|
439
|
+
function lessThanOrEqual(value1, value2) {
|
|
440
|
+
return Boolean(bn_operation(value1, value2, Operations.LESS_THAN_OR_EQUAL));
|
|
441
|
+
}
|
|
442
|
+
function lessThan(value1, value2) {
|
|
443
|
+
return Boolean(bn_operation(value1, value2, Operations.LESS_THAN));
|
|
444
|
+
}
|
|
445
|
+
function equal(value1, value2) {
|
|
446
|
+
return Boolean(bn_operation(value1, value2, Operations.EQUAL));
|
|
447
|
+
}
|
|
448
|
+
function mod(value1, value2) {
|
|
449
|
+
return bn_operation(value1, value2, Operations.MOD);
|
|
450
|
+
}
|
|
451
|
+
function modZero(value1, value2) {
|
|
452
|
+
return equal(mod(value1, value2), 0);
|
|
453
|
+
}
|
|
454
|
+
function bn_operation(a, b, operation) {
|
|
455
|
+
a = new bignumber_js_1.default(String(a));
|
|
456
|
+
b = new bignumber_js_1.default(String(b));
|
|
457
|
+
switch (operation.toLowerCase()) {
|
|
458
|
+
case '-':
|
|
459
|
+
return a.minus(b).toString();
|
|
460
|
+
case '+':
|
|
461
|
+
return a.plus(b).toString();
|
|
462
|
+
case '*':
|
|
463
|
+
case 'x':
|
|
464
|
+
return a.multipliedBy(b).toString();
|
|
465
|
+
case '÷':
|
|
466
|
+
case '/':
|
|
467
|
+
return a.dividedBy(b).toString();
|
|
468
|
+
case '>=':
|
|
469
|
+
return a.isGreaterThanOrEqualTo(b);
|
|
470
|
+
case '>':
|
|
471
|
+
return a.isGreaterThan(b);
|
|
472
|
+
case '<=':
|
|
473
|
+
return a.isLessThanOrEqualTo(b);
|
|
474
|
+
case '<':
|
|
475
|
+
return a.isLessThan(b);
|
|
476
|
+
case '==':
|
|
477
|
+
return a.isEqualTo(b);
|
|
478
|
+
case 'mod':
|
|
479
|
+
return a.modulo(b);
|
|
480
|
+
default:
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function getExponentialNumberComponents(x) {
|
|
485
|
+
if (x.toString().includes('e')) {
|
|
486
|
+
const parts = x.toString().split('e');
|
|
487
|
+
return [parseFloat(parts[0]), parseFloat(parts[1])];
|
|
488
|
+
}
|
|
489
|
+
return [x, 0];
|
|
490
|
+
}
|
|
491
|
+
function generateExponentialNumberFromComponents(decimalPart, exponent) {
|
|
492
|
+
return decimalPart + (exponent < 0 ? `e${exponent}` : `e+${exponent}`);
|
|
493
|
+
}
|
|
494
|
+
function roundNumber({ decimalPlaces = 0 }, x) {
|
|
495
|
+
if (decimalPlaces > 0) {
|
|
496
|
+
const [decimal, decimalExponentialPart] = getExponentialNumberComponents(x);
|
|
497
|
+
const [rounded, roundedExponentialPart] = getExponentialNumberComponents(Math.round(Number(generateExponentialNumberFromComponents(decimal, decimalExponentialPart + decimalPlaces))));
|
|
498
|
+
return Number(generateExponentialNumberFromComponents(rounded, roundedExponentialPart - decimalPlaces));
|
|
499
|
+
}
|
|
500
|
+
return Math.round(x);
|
|
501
|
+
}
|
|
502
|
+
function convertFromBaseUnits(assetDecimals, quantity) {
|
|
503
|
+
const decimals = Number(assetDecimals);
|
|
504
|
+
return roundNumber({ decimalPlaces: decimals },
|
|
505
|
+
// eslint-disable-next-line no-magic-numbers
|
|
506
|
+
Math.pow(10, -decimals) * Number(quantity));
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Computs quantity * 10^(assetDecimals) and rounds the result
|
|
510
|
+
*/
|
|
511
|
+
function convertToBaseUnits(assetDecimals, quantity) {
|
|
512
|
+
// eslint-disable-next-line no-magic-numbers
|
|
513
|
+
const baseAmount = Math.pow(10, Number(assetDecimals)) * Number(quantity);
|
|
514
|
+
// 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
|
|
515
|
+
return roundNumber({ decimalPlaces: 0 }, baseAmount);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
/***/ }),
|
|
520
|
+
|
|
521
|
+
/***/ 2216:
|
|
522
|
+
/***/ ((module) => {
|
|
523
|
+
|
|
524
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__2216__;
|
|
525
|
+
|
|
526
|
+
/***/ }),
|
|
527
|
+
|
|
528
|
+
/***/ 2602:
|
|
529
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
533
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
534
|
+
};
|
|
535
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
536
|
+
const base_model_1 = __importDefault(__webpack_require__(623));
|
|
537
|
+
exports["default"] = base_model_1.default;
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
/***/ }),
|
|
541
|
+
|
|
542
|
+
/***/ 2742:
|
|
543
|
+
/***/ ((module) => {
|
|
544
|
+
|
|
545
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__2742__;
|
|
546
|
+
|
|
547
|
+
/***/ }),
|
|
548
|
+
|
|
549
|
+
/***/ 3298:
|
|
550
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
554
|
+
const client_secrets_manager_1 = __webpack_require__(2216);
|
|
555
|
+
class SecretHelper {
|
|
556
|
+
constructor() {
|
|
557
|
+
this.creatorMnemonicSecretName = process.env.CreatorSecret;
|
|
558
|
+
this.dispenserMnemonicSecretName = process.env.DispenserSecret;
|
|
559
|
+
this.transactionMnemonicSecretName = process.env.TransactionSecret;
|
|
560
|
+
this.relayerMnemonicSecretName = process.env.RelayerSecret;
|
|
561
|
+
this.ondatoCredentialsSecretName = process.env.OndatoSecret;
|
|
562
|
+
}
|
|
563
|
+
async getCreatorMnemonic() {
|
|
564
|
+
const creatorMnemonic = await this.getSecrets(this.creatorMnemonicSecretName);
|
|
565
|
+
return JSON.parse(creatorMnemonic).creator;
|
|
566
|
+
}
|
|
567
|
+
async getDispenserMnemonic() {
|
|
568
|
+
const dispenserMnemonic = await this.getSecrets(this.dispenserMnemonicSecretName);
|
|
569
|
+
return JSON.parse(dispenserMnemonic).dispenser;
|
|
570
|
+
}
|
|
571
|
+
async getTransactionMnemonic() {
|
|
572
|
+
const transactionMnemonic = await this.getSecrets(this.transactionMnemonicSecretName);
|
|
573
|
+
return JSON.parse(transactionMnemonic).txs;
|
|
574
|
+
}
|
|
575
|
+
async getRelayerMnemonics() {
|
|
576
|
+
const relayerMnemonic = await this.getSecrets(this.relayerMnemonicSecretName);
|
|
577
|
+
return JSON.parse(relayerMnemonic);
|
|
578
|
+
}
|
|
579
|
+
async getOndatoSecrets() {
|
|
580
|
+
const ondatoSecrets = await this.getSecrets(this.ondatoCredentialsSecretName);
|
|
581
|
+
return JSON.parse(ondatoSecrets);
|
|
582
|
+
}
|
|
583
|
+
getClient() {
|
|
584
|
+
return new client_secrets_manager_1.SecretsManager({ region: 'us-east-1' });
|
|
585
|
+
}
|
|
586
|
+
getSecrets(secretName) {
|
|
587
|
+
// console.log(`Getting secrets by name: ${secretName}`);
|
|
588
|
+
return new Promise((resolve, reject) => {
|
|
589
|
+
try {
|
|
590
|
+
const command = new client_secrets_manager_1.GetSecretValueCommand({ SecretId: secretName });
|
|
591
|
+
const client = this.getClient();
|
|
592
|
+
client.send(command, (err, data) => {
|
|
593
|
+
if (err) {
|
|
594
|
+
console.log('-----error in secrets---------', err);
|
|
595
|
+
reject(err);
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
// console.log('secrets successfully received');
|
|
599
|
+
resolve(data.SecretString);
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
catch (error) {
|
|
604
|
+
console.log('error curl', error);
|
|
605
|
+
reject(error);
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
saveSecret(secretName, secretValue) {
|
|
610
|
+
console.log(`Saving secret with name: ${secretName}`);
|
|
611
|
+
return new Promise((resolve, reject) => {
|
|
612
|
+
try {
|
|
613
|
+
const command = new client_secrets_manager_1.PutSecretValueCommand({
|
|
614
|
+
SecretId: secretName,
|
|
615
|
+
SecretString: secretValue,
|
|
616
|
+
});
|
|
617
|
+
const client = this.getClient();
|
|
618
|
+
client.send(command, (err, data) => {
|
|
619
|
+
if (err) {
|
|
620
|
+
console.log('-----error in saving secret---------', err);
|
|
621
|
+
reject(err);
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
console.log('secret successfully saved');
|
|
625
|
+
resolve();
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
catch (error) {
|
|
630
|
+
console.log('error curl', error);
|
|
631
|
+
reject(error);
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
exports["default"] = new SecretHelper();
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
/***/ }),
|
|
640
|
+
|
|
641
|
+
/***/ 3574:
|
|
642
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
646
|
+
if (k2 === undefined) k2 = k;
|
|
647
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
648
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
649
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
650
|
+
}
|
|
651
|
+
Object.defineProperty(o, k2, desc);
|
|
652
|
+
}) : (function(o, m, k, k2) {
|
|
653
|
+
if (k2 === undefined) k2 = k;
|
|
654
|
+
o[k2] = m[k];
|
|
655
|
+
}));
|
|
656
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
657
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
658
|
+
};
|
|
659
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
660
|
+
__exportStar(__webpack_require__(7114), exports);
|
|
661
|
+
__exportStar(__webpack_require__(5386), exports);
|
|
662
|
+
__exportStar(__webpack_require__(7159), exports);
|
|
663
|
+
__exportStar(__webpack_require__(9181), exports);
|
|
664
|
+
__exportStar(__webpack_require__(7359), exports);
|
|
665
|
+
__exportStar(__webpack_require__(3620), exports);
|
|
666
|
+
__exportStar(__webpack_require__(573), exports);
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
/***/ }),
|
|
670
|
+
|
|
671
|
+
/***/ 3620:
|
|
672
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
676
|
+
exports.HummingbotInstanceStatus = void 0;
|
|
677
|
+
var HummingbotInstanceStatus;
|
|
678
|
+
(function (HummingbotInstanceStatus) {
|
|
679
|
+
HummingbotInstanceStatus["PREPARING"] = "provisioning";
|
|
680
|
+
HummingbotInstanceStatus["STOPPING"] = "stopping";
|
|
681
|
+
HummingbotInstanceStatus["RUNNING"] = "running";
|
|
682
|
+
HummingbotInstanceStatus["STOPPED"] = "stopped";
|
|
683
|
+
HummingbotInstanceStatus["FAILED"] = "failed";
|
|
684
|
+
})(HummingbotInstanceStatus || (exports.HummingbotInstanceStatus = HummingbotInstanceStatus = {}));
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
/***/ }),
|
|
688
|
+
|
|
689
|
+
/***/ 5386:
|
|
690
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
/***/ }),
|
|
697
|
+
|
|
698
|
+
/***/ 5910:
|
|
699
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
703
|
+
exports.getDatepartValue = getDatepartValue;
|
|
704
|
+
exports.identityDatepart = identityDatepart;
|
|
705
|
+
exports.inMinCandles = inMinCandles;
|
|
706
|
+
exports.inHourCandles = inHourCandles;
|
|
707
|
+
const intervalRegex = {
|
|
708
|
+
hour: /(\d+)[H]/i,
|
|
709
|
+
day: /(\d+)[D]/i,
|
|
710
|
+
week: /(\d+)[W]/i,
|
|
711
|
+
month: /(\d+)[M]/i,
|
|
712
|
+
year: /(\d+)[Y]/i,
|
|
713
|
+
};
|
|
714
|
+
function getDatepartValue(value) {
|
|
715
|
+
const datepart = identityDatepart(value);
|
|
716
|
+
if (datepart === null) {
|
|
717
|
+
throw new Error(`Cannot fetch datepart from interval: ${value}`);
|
|
718
|
+
}
|
|
719
|
+
const units = datepart === 'minute' ? Number(value) : Number(value.slice(0, -1));
|
|
720
|
+
if (!units) {
|
|
721
|
+
return mapWithTimeframe(datepart, 1);
|
|
722
|
+
}
|
|
723
|
+
if (datepart === 'minute' && units % (7 * 24 * 60) === 0) { // week
|
|
724
|
+
return mapWithTimeframe('week', units / (7 * 24 * 60));
|
|
725
|
+
}
|
|
726
|
+
if (datepart === 'minute' && units % (24 * 60) === 0) { // day
|
|
727
|
+
return mapWithTimeframe('day', units / (24 * 60));
|
|
728
|
+
}
|
|
729
|
+
if (datepart === 'minute' && units % 60 === 0) { // hour
|
|
730
|
+
return mapWithTimeframe('hour', units / 60);
|
|
731
|
+
}
|
|
732
|
+
if (datepart === 'hour' && units % (7 * 24) === 0) { // week
|
|
733
|
+
return mapWithTimeframe('week', units / (7 * 24));
|
|
734
|
+
}
|
|
735
|
+
if (datepart === 'hour' && units % 24 === 0) { // day
|
|
736
|
+
return mapWithTimeframe(units === 24 ? 'hour' : 'day', units === 24 ? 24 : units / 24);
|
|
737
|
+
}
|
|
738
|
+
if (datepart === 'day' && units % 7 === 0) { // week
|
|
739
|
+
return mapWithTimeframe('week', units / 7);
|
|
740
|
+
}
|
|
741
|
+
if (datepart === 'month' && units % 12 === 0) { // year
|
|
742
|
+
return mapWithTimeframe('year', units / 12);
|
|
743
|
+
}
|
|
744
|
+
return mapWithTimeframe(datepart, units);
|
|
745
|
+
}
|
|
746
|
+
function identityDatepart(interval) {
|
|
747
|
+
if (!isNaN(Number(interval))) {
|
|
748
|
+
return 'minute';
|
|
749
|
+
}
|
|
750
|
+
const lastLetter = interval.slice(-1);
|
|
751
|
+
const value = `1${lastLetter}`;
|
|
752
|
+
switch (true) {
|
|
753
|
+
case intervalRegex.hour.test(value): return 'hour';
|
|
754
|
+
case intervalRegex.day.test(value): return 'day';
|
|
755
|
+
case intervalRegex.week.test(value): return 'week';
|
|
756
|
+
case intervalRegex.month.test(value): return 'month';
|
|
757
|
+
case intervalRegex.year.test(value): return 'year';
|
|
758
|
+
default: return null;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
function mapWithTimeframe(datepart, value) {
|
|
762
|
+
return { datepart, value, timeframe: mapDatepartToTimeframe(datepart, value) };
|
|
763
|
+
}
|
|
764
|
+
function inMinCandles(value) {
|
|
765
|
+
return [1, 3, 5, 15, 30].includes(value);
|
|
766
|
+
}
|
|
767
|
+
function inHourCandles(value) {
|
|
768
|
+
return [1, 2, 3, 4, 12].includes(value);
|
|
769
|
+
}
|
|
770
|
+
function mapDatepartToTimeframe(datepart, value) {
|
|
771
|
+
switch (datepart) {
|
|
772
|
+
case 'minute':
|
|
773
|
+
return inMinCandles(value) ? `${value}m` : '1m';
|
|
774
|
+
case 'hour':
|
|
775
|
+
return inHourCandles(value) ? `${value}h` : '1h';
|
|
776
|
+
case 'day':
|
|
777
|
+
return `1d`;
|
|
778
|
+
case 'week':
|
|
779
|
+
return `1w`;
|
|
780
|
+
case 'month':
|
|
781
|
+
return `1M`;
|
|
782
|
+
case 'year':
|
|
783
|
+
return `1Y`;
|
|
784
|
+
default:
|
|
785
|
+
throw new Error(`Unsupported datepart: ${datepart}`);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
/***/ }),
|
|
791
|
+
|
|
792
|
+
/***/ 6168:
|
|
793
|
+
/***/ ((module) => {
|
|
794
|
+
|
|
795
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__6168__;
|
|
796
|
+
|
|
797
|
+
/***/ }),
|
|
798
|
+
|
|
799
|
+
/***/ 6897:
|
|
800
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
804
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
805
|
+
};
|
|
806
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
807
|
+
exports.verifySignature = exports.decodeAndNormalizeAddress = exports.isAssetOptedIn = exports.getTxnParams = exports.getBoxByName = exports.getAppBoxes = exports.getAppGlobalState = exports.getAccountAssetBalances = exports.createBoxes = void 0;
|
|
808
|
+
exports.decodeStateArray = decodeStateArray;
|
|
809
|
+
const algosdk_1 = __importDefault(__webpack_require__(9709));
|
|
810
|
+
const Encoding_1 = __webpack_require__(8593);
|
|
811
|
+
const helpers_1 = __webpack_require__(9730);
|
|
812
|
+
const createBoxes = (appIndex, foreignApps) => {
|
|
813
|
+
const boxes = foreignApps.map((wlpIndex) => ({
|
|
814
|
+
appIndex,
|
|
815
|
+
name: (0, Encoding_1.concatArrays)((0, Encoding_1.encodeArgArray)(["WLP_", wlpIndex]))
|
|
816
|
+
}));
|
|
817
|
+
return boxes;
|
|
818
|
+
};
|
|
819
|
+
exports.createBoxes = createBoxes;
|
|
820
|
+
function decodeStateArray(stateArray) {
|
|
821
|
+
const state = {};
|
|
822
|
+
stateArray.forEach((row) => {
|
|
823
|
+
const key = (0, Encoding_1.decodeBase64)(row['key']).toString();
|
|
824
|
+
let value = row['value'];
|
|
825
|
+
const valueType = value['type'];
|
|
826
|
+
if (valueType == 2)
|
|
827
|
+
value = value['uint'];
|
|
828
|
+
if (valueType == 1)
|
|
829
|
+
value = (0, Encoding_1.decodeBase64)(value['bytes']);
|
|
830
|
+
if (key == 'gov') {
|
|
831
|
+
state['gov'] = (0, Encoding_1.encodeAddress)(value);
|
|
832
|
+
}
|
|
833
|
+
else {
|
|
834
|
+
state[key] = value;
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
return (0, helpers_1.sortKeysInObject)(state);
|
|
838
|
+
}
|
|
839
|
+
const getAccountAssetBalances = (accountInfo) => {
|
|
840
|
+
const balances = {
|
|
841
|
+
'0': accountInfo['amount']
|
|
842
|
+
};
|
|
843
|
+
const assets = accountInfo['assets'];
|
|
844
|
+
for (let i = 0; i < assets.length; i++) {
|
|
845
|
+
const assetId = assets[i]['asset-id'];
|
|
846
|
+
const assetAmt = assets[i]['amount'];
|
|
847
|
+
balances[assetId] = assetAmt;
|
|
848
|
+
}
|
|
849
|
+
console.log(`Account ${accountInfo.address} balances`, JSON.stringify(balances));
|
|
850
|
+
return balances;
|
|
851
|
+
};
|
|
852
|
+
exports.getAccountAssetBalances = getAccountAssetBalances;
|
|
853
|
+
const getAppGlobalState = async (algodClient, appId) => {
|
|
854
|
+
const app = await algodClient.getApplicationByID(appId).do();
|
|
855
|
+
const globalState = decodeStateArray(app['params']['global-state']);
|
|
856
|
+
return globalState;
|
|
857
|
+
};
|
|
858
|
+
exports.getAppGlobalState = getAppGlobalState;
|
|
859
|
+
const getAppBoxes = async (algodClient, appId) => {
|
|
860
|
+
const { boxes } = await algodClient.getApplicationBoxes(appId).do();
|
|
861
|
+
console.log('boxes', appId, boxes
|
|
862
|
+
.map(o => o.name)
|
|
863
|
+
.filter(o => o.length === 32)
|
|
864
|
+
.map(o => Buffer.from(o).toString('base64')));
|
|
865
|
+
};
|
|
866
|
+
exports.getAppBoxes = getAppBoxes;
|
|
867
|
+
const getBoxByName = async (algoClient, appId, boxName) => {
|
|
868
|
+
try {
|
|
869
|
+
// console.log('Get box by name', boxName);
|
|
870
|
+
const { value } = await algoClient.getApplicationBoxByName(appId, boxName).do();
|
|
871
|
+
const box = value;
|
|
872
|
+
return box;
|
|
873
|
+
}
|
|
874
|
+
catch (error) {
|
|
875
|
+
if (error.message.includes('box not found')) {
|
|
876
|
+
console.log(`Box not found '${Buffer.from(boxName).toString('hex')}'`);
|
|
877
|
+
return null;
|
|
878
|
+
}
|
|
879
|
+
throw error;
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
exports.getBoxByName = getBoxByName;
|
|
883
|
+
const getTxnParams = async (algoClient, txnsCount = 1) => {
|
|
884
|
+
const params = await algoClient.getTransactionParams().do();
|
|
885
|
+
if (txnsCount > 1) {
|
|
886
|
+
params.fee = algosdk_1.default.ALGORAND_MIN_TX_FEE * txnsCount;
|
|
887
|
+
params.flatFee = true;
|
|
888
|
+
}
|
|
889
|
+
return { ...params };
|
|
890
|
+
};
|
|
891
|
+
exports.getTxnParams = getTxnParams;
|
|
892
|
+
const isAssetOptedIn = (balances, assetId) => {
|
|
893
|
+
return Object.keys(balances).includes(assetId.toString());
|
|
894
|
+
};
|
|
895
|
+
exports.isAssetOptedIn = isAssetOptedIn;
|
|
896
|
+
const decodeAndNormalizeAddress = (address) => algosdk_1.default.decodeAddress(address.toUpperCase()).publicKey;
|
|
897
|
+
exports.decodeAndNormalizeAddress = decodeAndNormalizeAddress;
|
|
898
|
+
const verifySignature = (signature, address, message, encoding) => {
|
|
899
|
+
return algosdk_1.default.verifyBytes(new Uint8Array(Buffer.from(message, encoding)), (0, Encoding_1.decodeBase64)(signature), address);
|
|
900
|
+
};
|
|
901
|
+
exports.verifySignature = verifySignature;
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
/***/ }),
|
|
905
|
+
|
|
906
|
+
/***/ 7114:
|
|
907
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
/***/ }),
|
|
914
|
+
|
|
915
|
+
/***/ 7159:
|
|
916
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
920
|
+
exports.defaultThemesValue = exports.defaultThemeSettingValue = exports.defaultLogoSettingValue = exports.requiredColors = exports.settingIdToSecretType = exports.CredentialNameEnum = exports.AffDashboardVisibilitySettingEnum = exports.SettingIds = void 0;
|
|
921
|
+
var SettingIds;
|
|
922
|
+
(function (SettingIds) {
|
|
923
|
+
SettingIds["ENABLED"] = "company.enabled";
|
|
924
|
+
SettingIds["APP_TITLE"] = "company.appTitle";
|
|
925
|
+
SettingIds["DOMAIN"] = "company.domain";
|
|
926
|
+
SettingIds["LOGO"] = "appearance.logo";
|
|
927
|
+
SettingIds["AMM"] = "product.amm";
|
|
928
|
+
SettingIds["OBDEX"] = "product.obdex";
|
|
929
|
+
SettingIds["THEMES"] = "appearance.themes";
|
|
930
|
+
SettingIds["DIRECT_SETTLE"] = "company.directSettlement";
|
|
931
|
+
SettingIds["AMM_FEE"] = "company.ammFee";
|
|
932
|
+
SettingIds["FEE_SHARE"] = "company.feeShare";
|
|
933
|
+
SettingIds["MIN_FEE"] = "company.minFee";
|
|
934
|
+
SettingIds["MAKER_FEE"] = "company.makerFee";
|
|
935
|
+
SettingIds["TAKER_FEE"] = "company.takerFee";
|
|
936
|
+
SettingIds["GEOBLOCK"] = "company.geoblock";
|
|
937
|
+
SettingIds["EMBEDDED_APP_URL"] = "company.embeddedAppUrl";
|
|
938
|
+
SettingIds["PRODUCT_OBDEX"] = "product.obdex";
|
|
939
|
+
SettingIds["PRODUCT_AMM"] = "product.amm";
|
|
940
|
+
SettingIds["NEW_TAB"] = "appearance.newTab";
|
|
941
|
+
SettingIds["APPEARANCE_TARGET"] = "appearance.target";
|
|
942
|
+
SettingIds["CUSTOM_MENU_ITEMS"] = "appearance.customMenuItems";
|
|
943
|
+
SettingIds["REPORT_BUTTONS"] = "appearance.reportButtons";
|
|
944
|
+
SettingIds["APPEARANCE_CHART_TYPE"] = "appearance.chartType";
|
|
945
|
+
SettingIds["APPEARANCE_CHART_INT"] = "appearance.chartInt";
|
|
946
|
+
SettingIds["PINNED_PAIRS"] = "markets.pinnedPairs";
|
|
947
|
+
SettingIds["KYC_TRADE_REQUIREMENT_ENABLED"] = "markets.kycTradeRequirementEnabled";
|
|
948
|
+
SettingIds["AFFILIATE_DASHBOARD_VISIBILITY"] = "product.affiliateDashboardVisibility";
|
|
949
|
+
SettingIds["AFFILIATE_DASHBOARD_THRESHOLD"] = "product.affiliateDashboardThreshold";
|
|
950
|
+
SettingIds["AFFILIATE_DEFAULT_FEE_SHARE"] = "product.affiliateDefaultFeeShare";
|
|
951
|
+
SettingIds["AFFILIATE_POINTS_REWARD"] = "product.affiliatePointsReward";
|
|
952
|
+
SettingIds["POINT_SYSTEM_MODE"] = "product.pointSystem";
|
|
953
|
+
SettingIds["POINT_SYSTEM_TELEGRAM_API_TOKEN"] = "point-system.telegramApiToken";
|
|
954
|
+
SettingIds["POINT_SYSTEM_TELEGRAM_ENABLED"] = "point-system.telegramEnabled";
|
|
955
|
+
SettingIds["POINT_SYSTEM_TELEGRAM_GROUP_ID"] = "point-system.telegramGroupId";
|
|
956
|
+
SettingIds["POINT_SYSTEM_TELEGRAM_BOT_NAME"] = "point-system.telegramBotName";
|
|
957
|
+
SettingIds["POINT_SYSTEM_TELEGRAM_BOT_ID"] = "point-system.telegramBotId";
|
|
958
|
+
SettingIds["POINT_SYSTEM_TELEGRAM_GROUP_NAME"] = "point-system.telegramGroupName";
|
|
959
|
+
SettingIds["POINT_SYSTEM_TELEGRAM_WEBHOOK_TOKEN"] = "point-system.telegramWebhookToken";
|
|
960
|
+
SettingIds["POINT_SYSTEM_DISCORD_CLIENT_ID"] = "point-system.discordClientId";
|
|
961
|
+
SettingIds["POINT_SYSTEM_DISCORD_CLIENT_SECRET"] = "point-system.discordClientSecret";
|
|
962
|
+
SettingIds["POINT_SYSTEM_DISCORD_SERVER_ID"] = "point-system.discordServerId";
|
|
963
|
+
SettingIds["POINT_SYSTEM_DISCORD_ENABLED"] = "point-system.discordEnabled";
|
|
964
|
+
SettingIds["POINT_SYSTEM_TWITTER_CLIENT_ID"] = "point-system.twitterClientId";
|
|
965
|
+
SettingIds["POINT_SYSTEM_TWITTER_CLIENT_SECRET"] = "point-system.twitterClientSecret";
|
|
966
|
+
SettingIds["POINT_SYSTEM_TWITTER_BEARER_TOKEN"] = "point-system.twitterBearerToken";
|
|
967
|
+
SettingIds["POINT_SYSTEM_TWITTER_REFRESH_TOKEN"] = "point-system.twitterRefreshToken";
|
|
968
|
+
SettingIds["POINT_SYSTEM_TWITTER_ENABLED"] = "point-system.twitterEnabled";
|
|
969
|
+
SettingIds["POINT_SYSTEM_TWITTER_JOB_ENABLED"] = "point-system.twitterJobEnabled";
|
|
970
|
+
SettingIds["POINT_SYSTEM_TWITTER_HASHTAGS"] = "point-system.twitterHashtags";
|
|
971
|
+
SettingIds["POINT_SYSTEM_TWITTER_TWEET_EXP_TIME"] = "point-system.twitterPostDefaultExpirationTime";
|
|
972
|
+
SettingIds["POINT_SYSTEM_TWITTER_ACCOUNT_NAME"] = "point-system.twitterAccountName";
|
|
973
|
+
SettingIds["POINT_SYSTEM_TWITTER_ACCOUNT_ID"] = "point-system.twitterAccountId";
|
|
974
|
+
SettingIds["POINT_SYSTEM_TWITTER_WEBHOOK_TOKEN"] = "point-system.twitterWebhookToken";
|
|
975
|
+
SettingIds["POINT_SYSTEM_GUIDE_LINK"] = "point-system.guideLink";
|
|
976
|
+
})(SettingIds || (exports.SettingIds = SettingIds = {}));
|
|
977
|
+
var AffDashboardVisibilitySettingEnum;
|
|
978
|
+
(function (AffDashboardVisibilitySettingEnum) {
|
|
979
|
+
AffDashboardVisibilitySettingEnum["DISABLED"] = "disabled";
|
|
980
|
+
AffDashboardVisibilitySettingEnum["ENABLED_FOR_ALL"] = "enabled for all";
|
|
981
|
+
AffDashboardVisibilitySettingEnum["ENABLED_FOR_AFFILIATES"] = "enabled for affiliates";
|
|
982
|
+
})(AffDashboardVisibilitySettingEnum || (exports.AffDashboardVisibilitySettingEnum = AffDashboardVisibilitySettingEnum = {}));
|
|
983
|
+
var CredentialNameEnum;
|
|
984
|
+
(function (CredentialNameEnum) {
|
|
985
|
+
CredentialNameEnum["API_TOKEN"] = "apiToken";
|
|
986
|
+
CredentialNameEnum["CLIENT_ID"] = "clientId";
|
|
987
|
+
CredentialNameEnum["CLIENT_SECRET"] = "clientSecret";
|
|
988
|
+
CredentialNameEnum["BEARER_TOKEN"] = "bearerToken";
|
|
989
|
+
CredentialNameEnum["REFRESH_TOKEN"] = "refreshToken";
|
|
990
|
+
CredentialNameEnum["ACCESS_TOKEN"] = "accessToken";
|
|
991
|
+
})(CredentialNameEnum || (exports.CredentialNameEnum = CredentialNameEnum = {}));
|
|
992
|
+
exports.settingIdToSecretType = {
|
|
993
|
+
'point-system.telegramApiToken': CredentialNameEnum.API_TOKEN,
|
|
994
|
+
'point-system.discordClientId': CredentialNameEnum.CLIENT_ID,
|
|
995
|
+
'point-system.discordClientSecret': CredentialNameEnum.CLIENT_SECRET,
|
|
996
|
+
'point-system.twitterClientSecret': CredentialNameEnum.CLIENT_SECRET,
|
|
997
|
+
'point-system.twitterClientId': CredentialNameEnum.CLIENT_ID,
|
|
998
|
+
'point-system.twitterBearerToken': CredentialNameEnum.BEARER_TOKEN,
|
|
999
|
+
'point-system.twitterRefreshToken': CredentialNameEnum.REFRESH_TOKEN,
|
|
1000
|
+
};
|
|
1001
|
+
exports.requiredColors = [
|
|
1002
|
+
'primary-1',
|
|
1003
|
+
'primary-2',
|
|
1004
|
+
'main-background',
|
|
1005
|
+
'primary-text',
|
|
1006
|
+
'module-background',
|
|
1007
|
+
'buy-text',
|
|
1008
|
+
'buy-background',
|
|
1009
|
+
'sell-text',
|
|
1010
|
+
'sell-background',
|
|
1011
|
+
'secondary-text',
|
|
1012
|
+
'input-background-default',
|
|
1013
|
+
'input-background-hover',
|
|
1014
|
+
'input-background-disabled',
|
|
1015
|
+
'input-border-default',
|
|
1016
|
+
'module-border',
|
|
1017
|
+
'button-disabled',
|
|
1018
|
+
'button-border',
|
|
1019
|
+
'input-border-active',
|
|
1020
|
+
'active-element-default',
|
|
1021
|
+
'hover-element-default',
|
|
1022
|
+
'dropdown-shadow',
|
|
1023
|
+
'button-text',
|
|
1024
|
+
'pair-active-row',
|
|
1025
|
+
];
|
|
1026
|
+
exports.defaultLogoSettingValue = `{"theme1":{"value":"${process.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${process.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${process.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;
|
|
1027
|
+
exports.defaultThemeSettingValue = '{"theme1":{"name":"dark","active":true,"value":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(1, 1, 1, 1)","primary-text":"rgba(255, 255, 255, 1)","module-background":"rgba(19, 23, 34, 1)","buy-text":"rgba(82, 164, 154, 1)","buy-background":"rgba(2, 199, 122, 0.25)","sell-text":"rgba(221, 94, 86, 1)","sell-background":"rgba(255, 59, 105, 0.25)","secondary-text":"rgba(127, 127, 127, 1)","input-background-default":"rgba(13, 15, 21, 1)","input-background-hover":"rgba(28, 33, 45, 1)","input-background-disabled":"rgba(25, 29, 41, 1)","input-border-default":"rgba(28, 33, 45, 1)","module-border":"rgba(28, 33, 45, 1)","button-disabled":"rgba(111, 113, 118, 1)","button-border":"rgba(255, 255, 255, 1)","input-border-active":"rgba(185, 163, 238, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgba(28, 33, 45, 1)"}},"theme2":{"name":"light","active":true,"value":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(249, 248, 248, 1)","primary-text":"rgba(0, 0, 0, 1)","module-background":"rgba(255, 255, 255, 1)","buy-text":"rgba(0, 112, 98, 1)","buy-background":"rgba(0, 112, 98, 0.25)","sell-text":"rgba(195, 12, 1, 1)","sell-background":"rgba(255, 59, 105, 0.25)","secondary-text":"rgba(127, 127, 127, 1)","button-disabled":"rgba(203, 199, 199, 1)","input-background-default":"rgba(255, 255, 255, 1)","input-background-hover":"rgba(249, 248, 248, 1)","input-background-disabled":"rgba(249, 248, 248, 1)","input-border-default":"rgba(228, 225, 225, 1)","module-border":"rgba(228, 225, 225, 1)","button-border":"rgba(170, 167, 167, 1)","input-border-active":"rgba(0, 0, 0, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgb(249, 248, 248)"}},"theme3":{"name":"purple","active":true,"value":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(255, 255, 255, 1)","primary-text":"rgba(0, 0, 0, 1)","secondary-text":"rgba(127, 127, 127, 1)","buy-text":"rgba(0, 112, 98, 1)","sell-text":"rgba(195, 12, 1, 1)","buy-background":"rgba(0, 112, 98, 0.25)","sell-background":"rgba(255, 59, 105, 0.25)","module-background":"rgba(254, 250, 255, 1)","module-border":"rgba(228, 225, 225, 1)","input-background-default":"rgba(255, 255, 255, 1)","input-background-hover":"rgba(249, 248, 248, 1)","input-background-disabled":"rgba(254, 250, 255, 1)","input-border-default":"rgba(228, 225, 225, 1)","input-border-active":"rgba(0, 0, 0, 1)","button-border":"rgba(170, 167, 167, 1)","button-disabled":"rgba(203, 199, 199, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgb(249, 248, 248)"}}}';
|
|
1028
|
+
var defaultThemesValue;
|
|
1029
|
+
(function (defaultThemesValue) {
|
|
1030
|
+
defaultThemesValue["theme1"] = "{\"name\":\"dark\",\"id\":\"theme1\",\"active\":true, \"chartColors\":{\"bullish_candle_color\": \"rgba(2, 199, 122, 0.25)\",\"bearish_candle_color\": \"rgba(221, 94, 86, 1)\",\"bullish_wick_color\": \"rgba(2, 199, 122, 0.25)\",\"bearish_wick_color\": \"rgba(221, 94, 86, 1)\",\"bullish_outline_color\": \"rgba(2, 199, 122, 0.25)\",\"bearish_outline_color\": \"rgba(221, 94, 86, 1)\",\"line_color\": \"rgba(41, 98, 255, 1)\",\"chart_background\": \"rgba(19, 23, 34, 1)\",\"chart_text\": \"rgba(127, 127, 127, 1)\"}, \"colors\":{\"primary-1\":\"rgba(118, 63, 229, 1)\",\"primary-2\":\"rgba(249, 132, 146, 1)\",\"main-background\":\"rgba(1, 1, 1, 1)\",\"primary-text\":\"rgba(255, 255, 255, 1)\",\"module-background\":\"rgba(19, 23, 34, 1)\",\"buy-text\":\"rgba(82, 164, 154, 1)\",\"buy-background\":\"rgba(2, 199, 122, 0.25)\",\"sell-text\":\"rgba(221, 94, 86, 1)\",\"sell-background\":\"rgba(255, 59, 105, 0.25)\",\"secondary-text\":\"rgba(127, 127, 127, 1)\",\"input-background-default\":\"rgba(13, 15, 21, 1)\",\"input-background-hover\":\"rgba(28, 33, 45, 1)\",\"input-background-disabled\":\"rgba(25, 29, 41, 1)\",\"input-border-default\":\"rgba(28, 33, 45, 1)\",\"module-border\":\"rgba(28, 33, 45, 1)\",\"button-disabled\":\"rgba(111, 113, 118, 1)\",\"button-border\":\"rgba(255, 255, 255, 1)\",\"input-border-active\":\"rgba(185, 163, 238, 1)\",\"active-element-default\":\"rgba(230, 136, 150, 1)\",\"hover-element-default\":\"rgba(185, 163, 238, 1)\",\"dropdown-shadow\":\"rgba(154, 92, 253, 0.45)\",\"button-text\":\"rgba(255, 255, 255, 1)\",\"pair-active-row\":\"rgba(28, 33, 45, 1)\"}}";
|
|
1031
|
+
defaultThemesValue["theme2"] = "{\"name\":\"light\",\"id\":\"theme2\",\"active\":true, \"chartColors\":{\"bullish_candle_color\": \"rgba(0, 112, 98, 1)\",\"bearish_candle_color\": \"rgba(195, 12, 1, 1)\",\"bullish_wick_color\": \"rgba(0, 112, 98, 1)\",\"bearish_wick_color\": \"rgba(195, 12, 1, 1)\",\"bullish_outline_color\": \"rgba(0, 112, 98, 1)\",\"bearish_outline_color\": \"rgba(195, 12, 1, 1)\",\"line_color\": \"rgba(41, 98, 255, 1)\",\"chart_background\": \"rgba(255, 255, 255, 1)\",\"chart_text\": \"rgba(127, 127, 127, 1)\"}, \"colors\":{\"primary-1\":\"rgba(118, 63, 229, 1)\",\"primary-2\":\"rgba(249, 132, 146, 1)\",\"main-background\":\"rgba(249, 248, 248, 1)\",\"primary-text\":\"rgba(0, 0, 0, 1)\",\"module-background\":\"rgba(255, 255, 255, 1)\",\"buy-text\":\"rgba(0, 112, 98, 1)\",\"buy-background\":\"rgba(0, 112, 98, 0.25)\",\"sell-text\":\"rgba(195, 12, 1, 1)\",\"sell-background\":\"rgba(255, 59, 105, 0.25)\",\"secondary-text\":\"rgba(127, 127, 127, 1)\",\"button-disabled\":\"rgba(203, 199, 199, 1)\",\"input-background-default\":\"rgba(255, 255, 255, 1)\",\"input-background-hover\":\"rgba(249, 248, 248, 1)\",\"input-background-disabled\":\"rgba(249, 248, 248, 1)\",\"input-border-default\":\"rgba(228, 225, 225, 1)\",\"module-border\":\"rgba(228, 225, 225, 1)\",\"button-border\":\"rgba(170, 167, 167, 1)\",\"input-border-active\":\"rgba(0, 0, 0, 1)\",\"active-element-default\":\"rgba(230, 136, 150, 1)\",\"hover-element-default\":\"rgba(185, 163, 238, 1)\",\"dropdown-shadow\":\"rgba(154, 92, 253, 0.45)\",\"button-text\":\"rgba(255, 255, 255, 1)\",\"pair-active-row\":\"rgb(249, 248, 248)\"}}";
|
|
1032
|
+
defaultThemesValue["theme3"] = "{\"name\":\"purple\",\"id\":\"theme3\",\"active\":true, \"chartColors\":{\"bullish_candle_color\": \"rgba(0, 112, 98, 1)\",\"bearish_candle_color\": \"rgba(195, 12, 1, 1)\",\"bullish_wick_color\": \"rgba(0, 112, 98, 1)\",\"bearish_wick_color\": \"rgba(195, 12, 1, 1)\",\"bullish_outline_color\": \"rgba(0, 112, 98, 1)\",\"bearish_outline_color\": \"rgba(195, 12, 1, 1)\",\"line_color\": \"rgba(41, 98, 255, 1)\",\"chart_background\": \"rgba(254, 250, 255, 1)\",\"chart_text\": \"rgba(127, 127, 127, 1)\"}, \"colors\":{\"primary-1\":\"rgba(118, 63, 229, 1)\",\"primary-2\":\"rgba(249, 132, 146, 1)\",\"main-background\":\"rgba(255, 255, 255, 1)\",\"primary-text\":\"rgba(0, 0, 0, 1)\",\"secondary-text\":\"rgba(127, 127, 127, 1)\",\"buy-text\":\"rgba(0, 112, 98, 1)\",\"sell-text\":\"rgba(195, 12, 1, 1)\",\"buy-background\":\"rgba(0, 112, 98, 0.25)\",\"sell-background\":\"rgba(255, 59, 105, 0.25)\",\"module-background\":\"rgba(254, 250, 255, 1)\",\"module-border\":\"rgba(228, 225, 225, 1)\",\"input-background-default\":\"rgba(255, 255, 255, 1)\",\"input-background-hover\":\"rgba(249, 248, 248, 1)\",\"input-background-disabled\":\"rgba(254, 250, 255, 1)\",\"input-border-default\":\"rgba(228, 225, 225, 1)\",\"input-border-active\":\"rgba(0, 0, 0, 1)\",\"button-border\":\"rgba(170, 167, 167, 1)\",\"button-disabled\":\"rgba(203, 199, 199, 1)\",\"active-element-default\":\"rgba(230, 136, 150, 1)\",\"hover-element-default\":\"rgba(185, 163, 238, 1)\",\"dropdown-shadow\":\"rgba(154, 92, 253, 0.45)\",\"button-text\":\"rgba(255, 255, 255, 1)\",\"pair-active-row\":\"rgb(249, 248, 248)\"}}";
|
|
1033
|
+
})(defaultThemesValue || (exports.defaultThemesValue = defaultThemesValue = {}));
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
/***/ }),
|
|
1037
|
+
|
|
1038
|
+
/***/ 7270:
|
|
1039
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
1043
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1044
|
+
};
|
|
1045
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1046
|
+
exports.TradingApiHelper = void 0;
|
|
1047
|
+
const response_1 = __webpack_require__(935);
|
|
1048
|
+
const secret_helper_1 = __importDefault(__webpack_require__(3298));
|
|
1049
|
+
const baseModel_1 = __importDefault(__webpack_require__(2602));
|
|
1050
|
+
const axios_1 = __importDefault(__webpack_require__(2742));
|
|
1051
|
+
const algosdk_1 = __importDefault(__webpack_require__(9709));
|
|
1052
|
+
const algo_helper_1 = __webpack_require__(6897);
|
|
1053
|
+
const redisTradingDb = process.env.redisTradingPairDb;
|
|
1054
|
+
const token = process.env.NODE_TOKEN || "";
|
|
1055
|
+
const server = process.env.NODE_URL || "";
|
|
1056
|
+
const port = process.env.NODE_PORT || "";
|
|
1057
|
+
const algoClient = new algosdk_1.default.Algodv2(token, server, port);
|
|
1058
|
+
class TradingApiHelper extends baseModel_1.default {
|
|
1059
|
+
constructor(dataSource) {
|
|
1060
|
+
super("identities", dataSource);
|
|
1061
|
+
}
|
|
1062
|
+
async getPairInfo(pair_key, application_id = '0') {
|
|
1063
|
+
return this.dataSource.query(`CALL spForGetPairInfo(?, ?)`, [pair_key, application_id])
|
|
1064
|
+
.then(res => res[0][0])
|
|
1065
|
+
.catch(err => { throw new Error("Pair Not Found."); });
|
|
1066
|
+
}
|
|
1067
|
+
async getSlotsGraphDataNew(from, to, slot, pair_id) {
|
|
1068
|
+
const query = `call getslotDataNew('${from}', '${to}', '${slot}', ${pair_id})`;
|
|
1069
|
+
console.log('Graph Query -> ', query);
|
|
1070
|
+
return this.dataSource.query(`call getslotDataNew(?, ?, ?, ?)`, [from, to, slot, pair_id]);
|
|
1071
|
+
}
|
|
1072
|
+
async getSlotsGraphDataWithCountBack(countBack, to, slot, pair_id) {
|
|
1073
|
+
const query = `call getslotDataCountBack('${countBack}', '${to}', '${slot}', ${pair_id})`;
|
|
1074
|
+
console.log('Graph Query Countback -> ', query);
|
|
1075
|
+
return this.dataSource.query(`call getslotDataCountBack(?, ?, ?, ?)`, [countBack, to, slot, pair_id]).then(res => res[0]);
|
|
1076
|
+
}
|
|
1077
|
+
async deleteFavourite(oid) {
|
|
1078
|
+
return new Promise(async (resolve, reject) => {
|
|
1079
|
+
this.tableName = "favourite_pair";
|
|
1080
|
+
// tslint:disable-next-line:max-line-length
|
|
1081
|
+
this.deleteWhere = `'${oid}'`;
|
|
1082
|
+
this.deleteFavRecord().then((result) => {
|
|
1083
|
+
resolve(result);
|
|
1084
|
+
}, (error) => {
|
|
1085
|
+
console.log(error);
|
|
1086
|
+
resolve(false);
|
|
1087
|
+
});
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
async insertFavourite(pairId, userId) {
|
|
1091
|
+
return this.dataSource.query(`INSERT INTO favourite_pair (pair_id,user_address) VALUES (?, ?)`, [pairId, userId]);
|
|
1092
|
+
}
|
|
1093
|
+
tokenList(userId = "") {
|
|
1094
|
+
return new Promise(async (resolve, reject) => {
|
|
1095
|
+
try {
|
|
1096
|
+
this.userId = userId;
|
|
1097
|
+
this.tableName = "assets";
|
|
1098
|
+
// tslint:disable-next-line:max-line-length
|
|
1099
|
+
this.offsets = 0;
|
|
1100
|
+
this.limits = 1000;
|
|
1101
|
+
this.selectCols =
|
|
1102
|
+
"t1.*,t2.id as despensor_id, t2.created_at as dispensor_time";
|
|
1103
|
+
//this.selectWhere = "t1.is_active=1";
|
|
1104
|
+
/*if (userId !== "") {
|
|
1105
|
+
this.selectWhere = "is_active=1";
|
|
1106
|
+
}*/
|
|
1107
|
+
this.SelectAssetData().then(async (result) => {
|
|
1108
|
+
this.limits = 1000;
|
|
1109
|
+
//await RedisHelper.setString('activePairList', JSON.stringify(result), 0, redisTradingDb);
|
|
1110
|
+
resolve(result);
|
|
1111
|
+
}, (error) => {
|
|
1112
|
+
console.log(error);
|
|
1113
|
+
this.limits = 10;
|
|
1114
|
+
resolve(false);
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
catch (e) {
|
|
1118
|
+
return reject(e);
|
|
1119
|
+
}
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
despensIpCount(ip) {
|
|
1123
|
+
return this.dataSource.query(`CALL spCountIpDispensor(?)`, [ip]).then(res => res[0][0].total);
|
|
1124
|
+
}
|
|
1125
|
+
async googleCaptchaVerify(url) {
|
|
1126
|
+
return new Promise((resolve, reject) => {
|
|
1127
|
+
try {
|
|
1128
|
+
axios_1.default.post(url).then((success) => {
|
|
1129
|
+
if (success.data.success !== undefined && !success.data.success)
|
|
1130
|
+
return resolve(false);
|
|
1131
|
+
return resolve(true);
|
|
1132
|
+
}).catch((error) => {
|
|
1133
|
+
return resolve(false);
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
catch (e) {
|
|
1137
|
+
resolve(false);
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
async checkDispenserAssetAccess(pairId, userId, ip) {
|
|
1142
|
+
const query = `SELECT count(*) as assetsNum FROM user_asset_dispensor WHERE asset_id = ? AND created_at >= NOW() - INTERVAL 1 DAY`;
|
|
1143
|
+
let result = await this.dataSource.query(query + ' AND user_address = ?', [pairId, userId]);
|
|
1144
|
+
if (result["assetsNum"] >= response_1.SERVER.AVAILABLE_ASSETS_PER_USER) {
|
|
1145
|
+
return false;
|
|
1146
|
+
}
|
|
1147
|
+
if (!ip) {
|
|
1148
|
+
return false;
|
|
1149
|
+
}
|
|
1150
|
+
result = await this.dataSource.query(query + ' AND ip = ?', [pairId, ip]);
|
|
1151
|
+
if (result["assetsNum"] >= response_1.SERVER.AVAILABLE_ASSETS_PER_IP) {
|
|
1152
|
+
return false;
|
|
1153
|
+
}
|
|
1154
|
+
return true;
|
|
1155
|
+
}
|
|
1156
|
+
async groupTransaction(to, assets) {
|
|
1157
|
+
try {
|
|
1158
|
+
const mnemonic = process.env.DISPENSER_MNEMONIC || await secret_helper_1.default.getDispenserMnemonic();
|
|
1159
|
+
const myAccount = await algosdk_1.default.mnemonicToSecretKey(mnemonic);
|
|
1160
|
+
const from = myAccount.addr;
|
|
1161
|
+
const tnx = [];
|
|
1162
|
+
const transactions = [];
|
|
1163
|
+
const params = await (0, algo_helper_1.getTxnParams)(algoClient);
|
|
1164
|
+
const pairList = await this.tokenList(to);
|
|
1165
|
+
for (const asset of assets) {
|
|
1166
|
+
const abc = pairList.filter((un) => {
|
|
1167
|
+
if (un.asset_id == asset.asset)
|
|
1168
|
+
return un;
|
|
1169
|
+
});
|
|
1170
|
+
console.log('abc-------', abc);
|
|
1171
|
+
const min = Number(abc[0].min_dispnse), max = Number(abc[0].max_dispnse);
|
|
1172
|
+
const amount = (Math.floor(Math.random() * (max - min + 1)) + min) * 10 ** Number(asset.decimal);
|
|
1173
|
+
console.log("amount-----------", amount);
|
|
1174
|
+
let trnsaction;
|
|
1175
|
+
if (Number(asset.asset) === 0) {
|
|
1176
|
+
trnsaction = algosdk_1.default.makePaymentTxnWithSuggestedParamsFromObject({
|
|
1177
|
+
suggestedParams: {
|
|
1178
|
+
...params,
|
|
1179
|
+
},
|
|
1180
|
+
from: from,
|
|
1181
|
+
to: to,
|
|
1182
|
+
amount
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
else {
|
|
1186
|
+
trnsaction = algosdk_1.default.makeAssetTransferTxnWithSuggestedParams(from, to, undefined, undefined, amount, undefined, asset.asset, params);
|
|
1187
|
+
}
|
|
1188
|
+
transactions.push({ ...asset, amount });
|
|
1189
|
+
tnx.push(trnsaction);
|
|
1190
|
+
}
|
|
1191
|
+
let txgroup = await algosdk_1.default.assignGroupID(tnx);
|
|
1192
|
+
const signed = tnx.map((data) => data.signTxn(myAccount.sk));
|
|
1193
|
+
let tx = await algoClient.sendRawTransaction(signed).do();
|
|
1194
|
+
console.log('----------tx---------', tx);
|
|
1195
|
+
return transactions;
|
|
1196
|
+
}
|
|
1197
|
+
catch (error) {
|
|
1198
|
+
console.log('----------error---------', error);
|
|
1199
|
+
return null;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
async insertUserAsset(pairId, userId, ip, amount) {
|
|
1203
|
+
return this.dataSource.query(`INSERT INTO user_asset_dispensor (asset_id,user_address,ip, amount) VALUES (?, ?, ?, ?)`, [pairId, userId, ip, amount]);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
exports.TradingApiHelper = TradingApiHelper;
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
/***/ }),
|
|
1210
|
+
|
|
1211
|
+
/***/ 7359:
|
|
1212
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1216
|
+
exports.ChartQueryDto = exports.StatisticTypeQuery = exports.UsersQueryDto = exports.PairsQueryDto = exports.SmallTimeframeEnum = void 0;
|
|
1217
|
+
var SmallTimeframeEnum;
|
|
1218
|
+
(function (SmallTimeframeEnum) {
|
|
1219
|
+
SmallTimeframeEnum["last_7_days"] = "last_7_days";
|
|
1220
|
+
SmallTimeframeEnum["last_30_days"] = "last_30_days";
|
|
1221
|
+
SmallTimeframeEnum["last_90_days"] = "last_90_days";
|
|
1222
|
+
SmallTimeframeEnum["last_year"] = "last_year";
|
|
1223
|
+
})(SmallTimeframeEnum || (exports.SmallTimeframeEnum = SmallTimeframeEnum = {}));
|
|
1224
|
+
class PairsQueryDto {
|
|
1225
|
+
constructor() {
|
|
1226
|
+
this.timeRange = SmallTimeframeEnum.last_30_days;
|
|
1227
|
+
this.sortBy = 'volume_usd';
|
|
1228
|
+
this.order = 'desc';
|
|
1229
|
+
this.limit = 20;
|
|
1230
|
+
this.page = 1;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
exports.PairsQueryDto = PairsQueryDto;
|
|
1234
|
+
class UsersQueryDto {
|
|
1235
|
+
constructor() {
|
|
1236
|
+
this.timeRange = SmallTimeframeEnum.last_30_days;
|
|
1237
|
+
this.sortBy = 'volume_usd';
|
|
1238
|
+
this.order = 'desc';
|
|
1239
|
+
this.limit = 20;
|
|
1240
|
+
this.page = 1;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
exports.UsersQueryDto = UsersQueryDto;
|
|
1244
|
+
var StatisticTypeQuery;
|
|
1245
|
+
(function (StatisticTypeQuery) {
|
|
1246
|
+
StatisticTypeQuery["volume"] = "volume";
|
|
1247
|
+
StatisticTypeQuery["fees"] = "fees";
|
|
1248
|
+
StatisticTypeQuery["orders"] = "orders";
|
|
1249
|
+
StatisticTypeQuery["dau"] = "dau";
|
|
1250
|
+
})(StatisticTypeQuery || (exports.StatisticTypeQuery = StatisticTypeQuery = {}));
|
|
1251
|
+
class ChartQueryDto {
|
|
1252
|
+
constructor() {
|
|
1253
|
+
this.type = StatisticTypeQuery.volume;
|
|
1254
|
+
this.timeRange = SmallTimeframeEnum.last_7_days;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
exports.ChartQueryDto = ChartQueryDto;
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
/***/ }),
|
|
1261
|
+
|
|
1262
|
+
/***/ 8593:
|
|
1263
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1264
|
+
|
|
1265
|
+
|
|
1266
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1267
|
+
if (k2 === undefined) k2 = k;
|
|
1268
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1269
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1270
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
1271
|
+
}
|
|
1272
|
+
Object.defineProperty(o, k2, desc);
|
|
1273
|
+
}) : (function(o, m, k, k2) {
|
|
1274
|
+
if (k2 === undefined) k2 = k;
|
|
1275
|
+
o[k2] = m[k];
|
|
1276
|
+
}));
|
|
1277
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1278
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1279
|
+
}) : function(o, v) {
|
|
1280
|
+
o["default"] = v;
|
|
1281
|
+
});
|
|
1282
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
1283
|
+
var ownKeys = function(o) {
|
|
1284
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
1285
|
+
var ar = [];
|
|
1286
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
1287
|
+
return ar;
|
|
1288
|
+
};
|
|
1289
|
+
return ownKeys(o);
|
|
1290
|
+
};
|
|
1291
|
+
return function (mod) {
|
|
1292
|
+
if (mod && mod.__esModule) return mod;
|
|
1293
|
+
var result = {};
|
|
1294
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
1295
|
+
__setModuleDefault(result, mod);
|
|
1296
|
+
return result;
|
|
1297
|
+
};
|
|
1298
|
+
})();
|
|
1299
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1300
|
+
exports.decodeAddress = exports.encodeAddress = void 0;
|
|
1301
|
+
exports.concatArrays = concatArrays;
|
|
1302
|
+
exports.packData = packData;
|
|
1303
|
+
exports.unpackData = unpackData;
|
|
1304
|
+
exports.encodeArgArray = encodeArgArray;
|
|
1305
|
+
exports.encodeString = encodeString;
|
|
1306
|
+
exports.decodeString = decodeString;
|
|
1307
|
+
exports.encode32Bytes = encode32Bytes;
|
|
1308
|
+
exports.encodeUint64 = encodeUint64;
|
|
1309
|
+
exports.decodeUint64 = decodeUint64;
|
|
1310
|
+
exports.encodeBase64 = encodeBase64;
|
|
1311
|
+
exports.decodeBase64 = decodeBase64;
|
|
1312
|
+
exports.compareArrays = compareArrays;
|
|
1313
|
+
exports.getDeltaUint = getDeltaUint;
|
|
1314
|
+
exports.getDeltaBytes = getDeltaBytes;
|
|
1315
|
+
exports.toUnix = toUnix;
|
|
1316
|
+
exports.fromUnix = fromUnix;
|
|
1317
|
+
const algosdk_1 = __importStar(__webpack_require__(9709));
|
|
1318
|
+
// import sha512 from "js-sha512"
|
|
1319
|
+
const buffer_1 = __webpack_require__(18);
|
|
1320
|
+
function concatArrays(arrays) {
|
|
1321
|
+
return arrays.reduce((a, b) => Uint8Array.from([...a, ...b]));
|
|
1322
|
+
}
|
|
1323
|
+
function packData(value, format) {
|
|
1324
|
+
const chunks = [];
|
|
1325
|
+
for (const [name, type] of Object.entries(format)) {
|
|
1326
|
+
const v = value[name];
|
|
1327
|
+
if (v === undefined) {
|
|
1328
|
+
throw new Error(`Key ${name} missing from value`);
|
|
1329
|
+
}
|
|
1330
|
+
switch (type.type) {
|
|
1331
|
+
case 'address':
|
|
1332
|
+
if (v instanceof Uint8Array && v.length == 32) {
|
|
1333
|
+
chunks.push(v);
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
else if (typeof v === 'string') {
|
|
1337
|
+
chunks.push((0, algosdk_1.decodeAddress)(v).publicKey);
|
|
1338
|
+
}
|
|
1339
|
+
else {
|
|
1340
|
+
throw new Error(`${name}: Expected address, got ${v}`);
|
|
1341
|
+
}
|
|
1342
|
+
break;
|
|
1343
|
+
case 'bytes':
|
|
1344
|
+
if (v instanceof Uint8Array) {
|
|
1345
|
+
if (v.length == type.size) {
|
|
1346
|
+
chunks.push(v);
|
|
1347
|
+
break;
|
|
1348
|
+
}
|
|
1349
|
+
else {
|
|
1350
|
+
throw new Error(`${name}: Bytes length is wrong, expected ${type.size}, got ${v.length}`);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
else {
|
|
1354
|
+
throw new Error(`${name}: Expected bytes[${type.size}], got ${v}`);
|
|
1355
|
+
}
|
|
1356
|
+
case 'double':
|
|
1357
|
+
if (typeof v === 'number') {
|
|
1358
|
+
const bytes = new ArrayBuffer(8);
|
|
1359
|
+
buffer_1.Buffer.from(bytes).writeDoubleLE(v, 0);
|
|
1360
|
+
chunks.push(new Uint8Array(bytes));
|
|
1361
|
+
break;
|
|
1362
|
+
}
|
|
1363
|
+
else {
|
|
1364
|
+
throw new Error(`${name}: Expected double, got ${v}`);
|
|
1365
|
+
}
|
|
1366
|
+
case 'number':
|
|
1367
|
+
case 'uint':
|
|
1368
|
+
if (typeof v === 'bigint' || typeof v === 'number') {
|
|
1369
|
+
chunks.push(encodeUint64(v));
|
|
1370
|
+
break;
|
|
1371
|
+
}
|
|
1372
|
+
else {
|
|
1373
|
+
throw new Error(`${name}: Expected uint or number, got ${v}`);
|
|
1374
|
+
}
|
|
1375
|
+
case 'string':
|
|
1376
|
+
if (typeof v === 'string') {
|
|
1377
|
+
const str = encodeString(v);
|
|
1378
|
+
if (str.length == type.size) {
|
|
1379
|
+
chunks.push(str);
|
|
1380
|
+
break;
|
|
1381
|
+
}
|
|
1382
|
+
else {
|
|
1383
|
+
throw new Error(`${name}: Expected string length ${type.size}, got string length ${str.length}`);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
else {
|
|
1387
|
+
throw new Error(`${name}: Expected string length ${type.size}, got ${v}`);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
return concatArrays(chunks);
|
|
1392
|
+
}
|
|
1393
|
+
function unpackData(data, format) {
|
|
1394
|
+
const result = new Map();
|
|
1395
|
+
let index = 0;
|
|
1396
|
+
for (const [name, type] of Object.entries(format)) {
|
|
1397
|
+
if (index >= data.length) {
|
|
1398
|
+
throw new Error('Array index out of bounds');
|
|
1399
|
+
}
|
|
1400
|
+
let value;
|
|
1401
|
+
switch (type.type) {
|
|
1402
|
+
case 'address':
|
|
1403
|
+
value = (0, algosdk_1.encodeAddress)(data.slice(index, index + 32));
|
|
1404
|
+
index += 32;
|
|
1405
|
+
break;
|
|
1406
|
+
case 'bytes':
|
|
1407
|
+
value = data.slice(index, index + type.size);
|
|
1408
|
+
index += type.size;
|
|
1409
|
+
break;
|
|
1410
|
+
case 'double':
|
|
1411
|
+
value = buffer_1.Buffer.from(data.slice(index, index + 8)).readDoubleLE(0);
|
|
1412
|
+
index += 8;
|
|
1413
|
+
break;
|
|
1414
|
+
case 'number':
|
|
1415
|
+
value = Number(decodeUint64(data.slice(index, index + 8)));
|
|
1416
|
+
index += 8;
|
|
1417
|
+
break;
|
|
1418
|
+
case 'uint':
|
|
1419
|
+
value = decodeUint64(data.slice(index, index + 8));
|
|
1420
|
+
index += 8;
|
|
1421
|
+
break;
|
|
1422
|
+
case 'string':
|
|
1423
|
+
value = decodeString(data.slice(index, index + type.size));
|
|
1424
|
+
index += type.size;
|
|
1425
|
+
break;
|
|
1426
|
+
}
|
|
1427
|
+
result.set(name, value);
|
|
1428
|
+
}
|
|
1429
|
+
return Object.fromEntries(result);
|
|
1430
|
+
}
|
|
1431
|
+
function encodeArgArray(params) {
|
|
1432
|
+
return params.map(param => {
|
|
1433
|
+
if (param instanceof Uint8Array)
|
|
1434
|
+
return new Uint8Array(param);
|
|
1435
|
+
if (typeof param === "string")
|
|
1436
|
+
return encodeString(param);
|
|
1437
|
+
if (typeof param === "boolean")
|
|
1438
|
+
param = BigInt(param ? 1 : 0);
|
|
1439
|
+
if (typeof param === "number")
|
|
1440
|
+
param = BigInt(param);
|
|
1441
|
+
return encodeUint64(param);
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
function encodeString(value) {
|
|
1445
|
+
return new Uint8Array(buffer_1.Buffer.from(value));
|
|
1446
|
+
}
|
|
1447
|
+
function decodeString(value) {
|
|
1448
|
+
return buffer_1.Buffer.from(value).toString('utf-8');
|
|
1449
|
+
}
|
|
1450
|
+
function encode32Bytes(value) {
|
|
1451
|
+
const valueButes = algosdk_1.default.encodeUint64(value);
|
|
1452
|
+
return concatArrays([new Uint8Array(32 - valueButes.length), valueButes]);
|
|
1453
|
+
}
|
|
1454
|
+
function encodeUint64(value) {
|
|
1455
|
+
const bytes = buffer_1.Buffer.alloc(8);
|
|
1456
|
+
for (let index = 0; index < 8; index++)
|
|
1457
|
+
bytes[7 - index] = Number((BigInt(value) >> BigInt(index * 8)) & BigInt(0xFF));
|
|
1458
|
+
return new Uint8Array(bytes);
|
|
1459
|
+
}
|
|
1460
|
+
function decodeUint64(value) {
|
|
1461
|
+
let num = BigInt(0);
|
|
1462
|
+
for (let index = 0; index < 8 && value?.length; index++)
|
|
1463
|
+
num = (num << BigInt(8)) | BigInt(value[index]);
|
|
1464
|
+
return num;
|
|
1465
|
+
}
|
|
1466
|
+
function encodeBase64(value) {
|
|
1467
|
+
return buffer_1.Buffer.from(value).toString('base64');
|
|
1468
|
+
}
|
|
1469
|
+
function decodeBase64(value) {
|
|
1470
|
+
return buffer_1.Buffer.from(value, 'base64');
|
|
1471
|
+
}
|
|
1472
|
+
// export const sha256HashLength = 32
|
|
1473
|
+
// export function sha256Hash(arr: sha512.Message): Uint8Array {
|
|
1474
|
+
// return new Uint8Array(sha512.sha512_256.arrayBuffer(arr))
|
|
1475
|
+
// }
|
|
1476
|
+
// export function encodeApplicationAddress(id: number): Address {
|
|
1477
|
+
// const APP_ID_PREFIX = Buffer.from('appID');
|
|
1478
|
+
// const toBeSigned = concatArrays([APP_ID_PREFIX, encodeUint64(BigInt(id))]);
|
|
1479
|
+
// return encodeAddress(sha256Hash(toBeSigned));
|
|
1480
|
+
// }
|
|
1481
|
+
function compareArrays(a, b) {
|
|
1482
|
+
return a.length === b.length && a.reduce((equal, item, index) => equal && item === b[index], true);
|
|
1483
|
+
}
|
|
1484
|
+
function getDelta(response, key) {
|
|
1485
|
+
const delta = response['global-state-delta'].find((v) => v.key === key);
|
|
1486
|
+
if (delta === undefined)
|
|
1487
|
+
return undefined;
|
|
1488
|
+
return delta['value'];
|
|
1489
|
+
}
|
|
1490
|
+
function getDeltaUint(response, key) {
|
|
1491
|
+
const delta = getDelta(response, key);
|
|
1492
|
+
if (delta === undefined)
|
|
1493
|
+
return undefined;
|
|
1494
|
+
return BigInt(delta['uint']);
|
|
1495
|
+
}
|
|
1496
|
+
function getDeltaBytes(response, key) {
|
|
1497
|
+
const delta = getDelta(response, key);
|
|
1498
|
+
if (delta === undefined)
|
|
1499
|
+
return undefined;
|
|
1500
|
+
return decodeBase64(delta['bytes']);
|
|
1501
|
+
}
|
|
1502
|
+
function toUnix(date) {
|
|
1503
|
+
return Math.floor(date.getTime() / 1000);
|
|
1504
|
+
}
|
|
1505
|
+
function fromUnix(timestamp) {
|
|
1506
|
+
return new Date(timestamp * 1000);
|
|
1507
|
+
}
|
|
1508
|
+
var algosdk_2 = __webpack_require__(9709);
|
|
1509
|
+
Object.defineProperty(exports, "encodeAddress", ({ enumerable: true, get: function () { return algosdk_2.encodeAddress; } }));
|
|
1510
|
+
Object.defineProperty(exports, "decodeAddress", ({ enumerable: true, get: function () { return algosdk_2.decodeAddress; } }));
|
|
1511
|
+
|
|
1512
|
+
|
|
1513
|
+
/***/ }),
|
|
1514
|
+
|
|
1515
|
+
/***/ 9181:
|
|
1516
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
//--import { Asset } from "@ultrade/shared/db/entities/market/asset.entity";
|
|
1520
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1521
|
+
exports.AmmBucketKeys = exports.VALIDATOR_APP_ID = exports.CONTRACT_VERSION = exports.AmmForeignResources = exports.AmmChars = exports.AmmIds = exports.PoolType = void 0;
|
|
1522
|
+
var PoolType;
|
|
1523
|
+
(function (PoolType) {
|
|
1524
|
+
PoolType["STABLE"] = "stable";
|
|
1525
|
+
PoolType["CPMM"] = "constant_product";
|
|
1526
|
+
PoolType["LEND"] = "lending";
|
|
1527
|
+
PoolType["NANO"] = "nano";
|
|
1528
|
+
PoolType["MVNANO"] = "mvnano";
|
|
1529
|
+
})(PoolType || (exports.PoolType = PoolType = {}));
|
|
1530
|
+
var AmmIds;
|
|
1531
|
+
(function (AmmIds) {
|
|
1532
|
+
AmmIds[AmmIds["ultrade"] = 0] = "ultrade";
|
|
1533
|
+
AmmIds[AmmIds["tinyman"] = 1] = "tinyman";
|
|
1534
|
+
AmmIds[AmmIds["pactfi"] = 2] = "pactfi";
|
|
1535
|
+
AmmIds[AmmIds["humble"] = 3] = "humble";
|
|
1536
|
+
AmmIds[AmmIds["algofi"] = 4] = "algofi";
|
|
1537
|
+
})(AmmIds || (exports.AmmIds = AmmIds = {}));
|
|
1538
|
+
var AmmChars;
|
|
1539
|
+
(function (AmmChars) {
|
|
1540
|
+
AmmChars["ultrade"] = "U";
|
|
1541
|
+
AmmChars["tinyman"] = "T";
|
|
1542
|
+
AmmChars["pactfi"] = "P";
|
|
1543
|
+
AmmChars["humble"] = "H";
|
|
1544
|
+
AmmChars["algofi"] = "A";
|
|
1545
|
+
})(AmmChars || (exports.AmmChars = AmmChars = {}));
|
|
1546
|
+
var AmmForeignResources;
|
|
1547
|
+
(function (AmmForeignResources) {
|
|
1548
|
+
AmmForeignResources[AmmForeignResources["ultrade"] = 1] = "ultrade";
|
|
1549
|
+
AmmForeignResources[AmmForeignResources["tinyman"] = 2] = "tinyman";
|
|
1550
|
+
AmmForeignResources[AmmForeignResources["pactfi"] = 1] = "pactfi";
|
|
1551
|
+
AmmForeignResources[AmmForeignResources["humble"] = 1] = "humble";
|
|
1552
|
+
AmmForeignResources[AmmForeignResources["algofi"] = 2] = "algofi";
|
|
1553
|
+
})(AmmForeignResources || (exports.AmmForeignResources = AmmForeignResources = {}));
|
|
1554
|
+
exports.CONTRACT_VERSION = {
|
|
1555
|
+
V1_1: 'v1_1',
|
|
1556
|
+
V2: 'v2',
|
|
1557
|
+
};
|
|
1558
|
+
exports.VALIDATOR_APP_ID = {
|
|
1559
|
+
[exports.CONTRACT_VERSION.V1_1]: {
|
|
1560
|
+
testnet: 62368684,
|
|
1561
|
+
mainnet: 552635992,
|
|
1562
|
+
},
|
|
1563
|
+
[exports.CONTRACT_VERSION.V2]: {
|
|
1564
|
+
testnet: 148607000,
|
|
1565
|
+
mainnet: 1002541853,
|
|
1566
|
+
},
|
|
1567
|
+
};
|
|
1568
|
+
var AmmBucketKeys;
|
|
1569
|
+
(function (AmmBucketKeys) {
|
|
1570
|
+
AmmBucketKeys["ASSETS"] = "assets.json";
|
|
1571
|
+
AmmBucketKeys["TOP_ASSETS"] = "topAssets.json";
|
|
1572
|
+
})(AmmBucketKeys || (exports.AmmBucketKeys = AmmBucketKeys = {}));
|
|
1573
|
+
|
|
1574
|
+
|
|
1575
|
+
/***/ }),
|
|
1576
|
+
|
|
1577
|
+
/***/ 9709:
|
|
1578
|
+
/***/ ((module) => {
|
|
1579
|
+
|
|
1580
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__9709__;
|
|
1581
|
+
|
|
1582
|
+
/***/ }),
|
|
1583
|
+
|
|
1584
|
+
/***/ 9730:
|
|
1585
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1589
|
+
if (k2 === undefined) k2 = k;
|
|
1590
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1591
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1592
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
1593
|
+
}
|
|
1594
|
+
Object.defineProperty(o, k2, desc);
|
|
1595
|
+
}) : (function(o, m, k, k2) {
|
|
1596
|
+
if (k2 === undefined) k2 = k;
|
|
1597
|
+
o[k2] = m[k];
|
|
1598
|
+
}));
|
|
1599
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
1600
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1601
|
+
};
|
|
1602
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1603
|
+
exports.sortKeysInObject = sortKeysInObject;
|
|
1604
|
+
exports.round2 = round2;
|
|
1605
|
+
__exportStar(__webpack_require__(5910), exports);
|
|
1606
|
+
__exportStar(__webpack_require__(865), exports);
|
|
1607
|
+
__exportStar(__webpack_require__(839), exports);
|
|
1608
|
+
function sortKeysInObject(o) {
|
|
1609
|
+
return Object.keys(o).sort().reduce((acc, key) => ({ ...acc, [key]: o[key] }), {});
|
|
1610
|
+
}
|
|
1611
|
+
function round2(val) { return Math.round(val * 100) / 100; }
|
|
1612
|
+
|
|
1613
|
+
|
|
1614
|
+
/***/ })
|
|
1615
|
+
|
|
1616
|
+
/******/ });
|
|
1617
|
+
/************************************************************************/
|
|
1618
|
+
/******/ // The module cache
|
|
1619
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1620
|
+
/******/
|
|
1621
|
+
/******/ // The require function
|
|
1622
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1623
|
+
/******/ // Check if module is in cache
|
|
1624
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1625
|
+
/******/ if (cachedModule !== undefined) {
|
|
1626
|
+
/******/ return cachedModule.exports;
|
|
1627
|
+
/******/ }
|
|
1628
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1629
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1630
|
+
/******/ // no module.id needed
|
|
1631
|
+
/******/ // no module.loaded needed
|
|
1632
|
+
/******/ exports: {}
|
|
1633
|
+
/******/ };
|
|
1634
|
+
/******/
|
|
1635
|
+
/******/ // Execute the module function
|
|
1636
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1637
|
+
/******/
|
|
1638
|
+
/******/ // Return the exports of the module
|
|
1639
|
+
/******/ return module.exports;
|
|
1640
|
+
/******/ }
|
|
1641
|
+
/******/
|
|
1642
|
+
/************************************************************************/
|
|
1643
|
+
/******/
|
|
1644
|
+
/******/ // startup
|
|
1645
|
+
/******/ // Load entry module and return exports
|
|
1646
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
1647
|
+
/******/ var __webpack_exports__ = __webpack_require__(7270);
|
|
1648
|
+
/******/
|
|
1649
|
+
/******/ return __webpack_exports__;
|
|
1650
|
+
/******/ })()
|
|
1651
|
+
;
|
|
1652
|
+
});
|