@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.
Files changed (189) hide show
  1. package/dist/baseModel/base.model.d.ts +26 -0
  2. package/dist/baseModel/index.d.ts +2 -0
  3. package/dist/common/auth.helper.d.ts +4 -0
  4. package/dist/common/auth.helper.js +367 -0
  5. package/dist/common/awsKms.d.ts +2 -0
  6. package/dist/common/awsKms.js +265 -0
  7. package/dist/common/big-number.helper.d.ts +38 -0
  8. package/dist/common/big-number.helper.js +263 -0
  9. package/dist/common/index.d.ts +11 -0
  10. package/dist/common/index.js +2541 -0
  11. package/dist/common/indexer.helper.d.ts +2 -0
  12. package/dist/common/indexer.helper.js +387 -0
  13. package/dist/common/logger.d.ts +32 -0
  14. package/dist/common/logger.js +188 -0
  15. package/dist/common/mappers/codexAsset.mapper.d.ts +2 -0
  16. package/dist/common/mappers/codexAsset.mapper.js +40 -0
  17. package/dist/common/mappers/codexBalance.mapper.d.ts +2 -0
  18. package/dist/common/mappers/codexBalance.mapper.js +38 -0
  19. package/dist/common/mappers/index.d.ts +3 -0
  20. package/dist/common/mappers/index.js +1421 -0
  21. package/dist/common/mappers/trade.mapper.d.ts +6 -0
  22. package/dist/common/mappers/trade.mapper.js +1343 -0
  23. package/dist/common/migration.helpers.d.ts +4 -0
  24. package/dist/common/migration.helpers.js +44 -0
  25. package/dist/common/redis.helper.d.ts +27 -0
  26. package/dist/common/redis.helper.js +269 -0
  27. package/dist/common/secret.helper.d.ts +28 -0
  28. package/dist/common/secret.helper.js +144 -0
  29. package/dist/common/timestamp.helper.d.ts +1 -0
  30. package/dist/common/timestamp.helper.js +41 -0
  31. package/dist/common/utils/assert.d.ts +1 -0
  32. package/dist/common/utils/assert.js +32 -0
  33. package/dist/common/utils/decode.d.ts +5 -0
  34. package/dist/common/utils/decode.js +206 -0
  35. package/dist/common/utils/index.d.ts +9 -0
  36. package/dist/common/utils/index.js +122 -0
  37. package/dist/common/utils/social.d.ts +1 -0
  38. package/dist/common/utils/social.js +30 -0
  39. package/dist/common/utils/stat.d.ts +1 -0
  40. package/dist/common/utils/stat.js +274 -0
  41. package/dist/constants/allowedUrls.d.ts +1 -0
  42. package/dist/constants/auth.d.ts +2 -0
  43. package/dist/constants/cctp.d.ts +3 -0
  44. package/dist/constants/codex.d.ts +11 -0
  45. package/dist/constants/env.d.ts +6 -0
  46. package/dist/constants/index.d.ts +7 -0
  47. package/dist/constants/index.js +455 -0
  48. package/dist/constants/queue.d.ts +39 -0
  49. package/dist/constants/response.d.ts +82 -0
  50. package/dist/constants/settings.d.ts +2 -0
  51. package/dist/constants/social.d.ts +3 -0
  52. package/dist/constants/withdrawalWalletsMessage.d.ts +1 -0
  53. package/dist/enums/chains.enum.d.ts +50 -0
  54. package/dist/enums/db/account/index.d.ts +19 -0
  55. package/dist/enums/db/affiliate.enum.d.ts +7 -0
  56. package/dist/enums/db/available-pair-settings.enum.d.ts +12 -0
  57. package/dist/enums/db/chains.d.ts +30 -0
  58. package/dist/enums/db/common.enum.d.ts +4 -0
  59. package/dist/enums/db/component/index.d.ts +22 -0
  60. package/dist/enums/db/index.d.ts +21 -0
  61. package/dist/enums/db/market-maker.enum.d.ts +15 -0
  62. package/dist/enums/db/notification-center/userNotification.enum.d.ts +36 -0
  63. package/dist/enums/db/order-side.enum.d.ts +5 -0
  64. package/dist/enums/db/order-status.enum.d.ts +8 -0
  65. package/dist/enums/db/order-type.enum.d.ts +7 -0
  66. package/dist/enums/db/pending-actions.enum.d.ts +6 -0
  67. package/dist/enums/db/relayer.enum.d.ts +23 -0
  68. package/dist/enums/db/setting-type.enum.d.ts +8 -0
  69. package/dist/enums/db/social-action.enum.d.ts +24 -0
  70. package/dist/enums/db/social-prompt.enum.d.ts +8 -0
  71. package/dist/enums/db/social.enum.d.ts +10 -0
  72. package/dist/enums/db/state-type.enum.d.ts +9 -0
  73. package/dist/enums/db/trade.enums.d.ts +10 -0
  74. package/dist/enums/db/tradingKeyType.enum.d.ts +4 -0
  75. package/dist/enums/db/upgrade.enum.d.ts +5 -0
  76. package/dist/enums/db/withdrawal-wallet.enum.d.ts +5 -0
  77. package/dist/enums/index.d.ts +5 -0
  78. package/dist/enums/index.js +893 -0
  79. package/dist/enums/maintenanceMode.enum.d.ts +10 -0
  80. package/dist/enums/notification.enum.d.ts +7 -0
  81. package/dist/enums/social.enum.d.ts +10 -0
  82. package/dist/helpers/Encoding.d.ts +33 -0
  83. package/dist/helpers/Encoding.js +318 -0
  84. package/dist/helpers/algo.helper.d.ts +14 -0
  85. package/dist/helpers/algo.helper.js +1211 -0
  86. package/dist/helpers/api.helper.d.ts +16 -0
  87. package/dist/helpers/api.helper.js +1652 -0
  88. package/dist/helpers/assert.helper.d.ts +10 -0
  89. package/dist/helpers/assert.helper.js +1677 -0
  90. package/dist/helpers/atomic.helper.d.ts +21 -0
  91. package/dist/helpers/atomic.helper.js +712 -0
  92. package/dist/helpers/balance.helper.d.ts +13 -0
  93. package/dist/helpers/balance.helper.js +4330 -0
  94. package/dist/helpers/codex/common.helper.d.ts +24 -0
  95. package/dist/helpers/codex/common.helper.js +4246 -0
  96. package/dist/helpers/codex/index.d.ts +6 -0
  97. package/dist/helpers/codex/index.js +4246 -0
  98. package/dist/helpers/codex/mbr.helper.d.ts +6 -0
  99. package/dist/helpers/codex/mbr.helper.js +4246 -0
  100. package/dist/helpers/codex/mna.helper.d.ts +2 -0
  101. package/dist/helpers/codex/mna.helper.js +4246 -0
  102. package/dist/helpers/codex/order.helper.d.ts +6 -0
  103. package/dist/helpers/codex/order.helper.js +4246 -0
  104. package/dist/helpers/codex/setGlobal.helper.d.ts +27 -0
  105. package/dist/helpers/codex/setGlobal.helper.js +4312 -0
  106. package/dist/helpers/codex/transfer.helper.d.ts +21 -0
  107. package/dist/helpers/codex/transfer.helper.js +4246 -0
  108. package/dist/helpers/codex/txn.helper.d.ts +13 -0
  109. package/dist/helpers/codex/txn.helper.js +4246 -0
  110. package/dist/helpers/codex.helper.d.ts +106 -0
  111. package/dist/helpers/codex.helper.js +4246 -0
  112. package/dist/helpers/email.helper.d.ts +5 -0
  113. package/dist/helpers/email.helper.js +112 -0
  114. package/dist/helpers/eth.helper.d.ts +12 -0
  115. package/dist/helpers/eth.helper.js +4246 -0
  116. package/dist/helpers/hummingbots.helper.d.ts +2 -0
  117. package/dist/helpers/hummingbots.helper.js +163 -0
  118. package/dist/helpers/index.d.ts +5 -0
  119. package/dist/helpers/index.js +837 -0
  120. package/dist/helpers/interval.helpers.d.ts +9 -0
  121. package/dist/helpers/interval.helpers.js +110 -0
  122. package/dist/helpers/liquidity.helper.d.ts +6 -0
  123. package/dist/helpers/liquidity.helper.js +81 -0
  124. package/dist/helpers/order.helper.d.ts +7 -0
  125. package/dist/helpers/order.helper.js +946 -0
  126. package/dist/helpers/pair.helper.d.ts +9 -0
  127. package/dist/helpers/pair.helper.js +938 -0
  128. package/dist/helpers/pointSystem.helper.d.ts +14 -0
  129. package/dist/helpers/pointSystem.helper.js +392 -0
  130. package/dist/helpers/ticker.helpers.d.ts +8 -0
  131. package/dist/helpers/ticker.helpers.js +358 -0
  132. package/dist/helpers/vaa.helper.d.ts +2 -0
  133. package/dist/helpers/vaa.helper.js +4350 -0
  134. package/dist/helpers/withdraw.helper.d.ts +14 -0
  135. package/dist/helpers/withdraw.helper.js +4784 -0
  136. package/dist/interfaces/accountInfo.interface.d.ts +15 -0
  137. package/dist/interfaces/algostreamer/index.d.ts +49 -0
  138. package/dist/interfaces/api/affiliate.interface.d.ts +71 -0
  139. package/dist/interfaces/cache.interface.d.ts +25 -0
  140. package/dist/interfaces/confirmed-txn.interface.d.ts +46 -0
  141. package/dist/interfaces/controller.interface.d.ts +6 -0
  142. package/dist/interfaces/db/baseModel.interface.d.ts +5 -0
  143. package/dist/interfaces/db/hummingbot/index.d.ts +18 -0
  144. package/dist/interfaces/db/index.d.ts +10 -0
  145. package/dist/interfaces/db/market/index.d.ts +313 -0
  146. package/dist/interfaces/db/marketing/index.d.ts +48 -0
  147. package/dist/interfaces/db/notification_center/index.d.ts +33 -0
  148. package/dist/interfaces/db/relayer/index.d.ts +56 -0
  149. package/dist/interfaces/db/social/index.d.ts +188 -0
  150. package/dist/interfaces/db/softDeleteModel.interface.d.ts +4 -0
  151. package/dist/interfaces/db/white_label/index.d.ts +161 -0
  152. package/dist/interfaces/db/withdrawal_wallets/index.d.ts +12 -0
  153. package/dist/interfaces/dto/index.d.ts +62 -0
  154. package/dist/interfaces/emailService.interface.d.ts +4 -0
  155. package/dist/interfaces/index.d.ts +17 -0
  156. package/dist/interfaces/index.js +1319 -0
  157. package/dist/interfaces/kmsService.interface.d.ts +4 -0
  158. package/dist/interfaces/last-look-trade.interface.d.ts +10 -0
  159. package/dist/interfaces/market.interface.d.ts +17 -0
  160. package/dist/interfaces/order.interface.d.ts +162 -0
  161. package/dist/interfaces/pair.interface.d.ts +10 -0
  162. package/dist/interfaces/query.interface.d.ts +6 -0
  163. package/dist/interfaces/services/accountCache.interface.d.ts +15 -0
  164. package/dist/interfaces/services/algod.interface.d.ts +5 -0
  165. package/dist/interfaces/services/balances.interface.d.ts +11 -0
  166. package/dist/interfaces/services/coin-market-cap.interface.d.ts +124 -0
  167. package/dist/interfaces/services/index.d.ts +8 -0
  168. package/dist/interfaces/services/price-model.interface.d.ts +4 -0
  169. package/dist/interfaces/services/price-service.interface.d.ts +8 -0
  170. package/dist/interfaces/services/socialActivity.interface.d.ts +48 -0
  171. package/dist/interfaces/services/tmc.interface.d.ts +9 -0
  172. package/dist/interfaces/streaming.interface.d.ts +95 -0
  173. package/dist/interfaces/timestream.interface.d.ts +29 -0
  174. package/dist/interfaces/trading.interface.d.ts +235 -0
  175. package/dist/interfaces/tradingKey.interface.d.ts +26 -0
  176. package/dist/interfaces/transfer.interface.d.ts +12 -0
  177. package/dist/interfaces/wallet.interface.d.ts +89 -0
  178. package/dist/interfaces/withdrawalWallets.interface.d.ts +14 -0
  179. package/dist/types/algo-order.type.d.ts +10 -0
  180. package/dist/types/amm/amm.d.ts +163 -0
  181. package/dist/types/api/request.types.d.ts +99 -0
  182. package/dist/types/codex.types.d.ts +28 -0
  183. package/dist/types/hummingbots.types.d.ts +23 -0
  184. package/dist/types/index.d.ts +8 -0
  185. package/dist/types/index.js +362 -0
  186. package/dist/types/notification.type.d.ts +10 -0
  187. package/dist/types/settings.type.d.ts +162 -0
  188. package/dist/types/state.type.d.ts +4 -0
  189. package/package.json +78 -0
@@ -0,0 +1,1421 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("bignumber.js"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["bignumber.js"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("bignumber.js")) : factory(root["bignumber.js"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(global, (__WEBPACK_EXTERNAL_MODULE__6168__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 221:
16
+ /***/ ((__unused_webpack_module, exports) => {
17
+
18
+
19
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
20
+ exports.mapToCodexAssetDto = mapToCodexAssetDto;
21
+ function mapToCodexAssetDto(o, isArchived) {
22
+ return {
23
+ id: o.id,
24
+ address: o.address,
25
+ chainId: o.chainId,
26
+ name: o.name,
27
+ unitName: o.unitName,
28
+ decimals: o.decimals,
29
+ isGas: o.isGas,
30
+ img: o.img,
31
+ cmcLink: o.cmcLink,
32
+ isArchived: isArchived ? isArchived(o) : false,
33
+ };
34
+ }
35
+
36
+
37
+ /***/ }),
38
+
39
+ /***/ 835:
40
+ /***/ ((__unused_webpack_module, exports) => {
41
+
42
+
43
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
44
+ var OrderSide;
45
+ (function (OrderSide) {
46
+ OrderSide[OrderSide["Buy"] = 0] = "Buy";
47
+ OrderSide[OrderSide["Sell"] = 1] = "Sell";
48
+ })(OrderSide || (OrderSide = {}));
49
+ exports["default"] = OrderSide;
50
+
51
+
52
+ /***/ }),
53
+
54
+ /***/ 892:
55
+ /***/ ((__unused_webpack_module, exports) => {
56
+
57
+
58
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
59
+ exports.PairComponentStatusType = exports.ComponentType = exports.ComponentStatusType = void 0;
60
+ var ComponentStatusType;
61
+ (function (ComponentStatusType) {
62
+ ComponentStatusType["ACTIVE"] = "ACTIVE";
63
+ ComponentStatusType["FAILED"] = "FAILED";
64
+ ComponentStatusType["STARTING"] = "STARTING";
65
+ ComponentStatusType["DRAINING"] = "DRAINING";
66
+ ComponentStatusType["TERMINATING"] = "TERMINATING";
67
+ ComponentStatusType["TERMINATED"] = "TERMINATED";
68
+ })(ComponentStatusType || (exports.ComponentStatusType = ComponentStatusType = {}));
69
+ var ComponentType;
70
+ (function (ComponentType) {
71
+ ComponentType["MATCHING_ENGINE"] = "me";
72
+ ComponentType["ORDER_SERVICE"] = "ors";
73
+ ComponentType["API"] = "api";
74
+ ComponentType["SOCKET_SERVICE"] = "ws";
75
+ ComponentType["TRANSACTION_SERVICE"] = "tns";
76
+ })(ComponentType || (exports.ComponentType = ComponentType = {}));
77
+ var PairComponentStatusType;
78
+ (function (PairComponentStatusType) {
79
+ PairComponentStatusType["ACTIVE"] = "ACTIVE";
80
+ PairComponentStatusType["FAILED"] = "FAILED";
81
+ PairComponentStatusType["UNASSIGNED"] = "UNASSIGNED";
82
+ PairComponentStatusType["ASSIGNED"] = "ASSIGNED";
83
+ PairComponentStatusType["STARTING"] = "STARTING";
84
+ })(PairComponentStatusType || (exports.PairComponentStatusType = PairComponentStatusType = {}));
85
+
86
+
87
+ /***/ }),
88
+
89
+ /***/ 893:
90
+ /***/ ((__unused_webpack_module, exports) => {
91
+
92
+
93
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
94
+ exports.NON_REPEATABLE_ACTIONS = exports.ActionEnum = exports.ActionSource = void 0;
95
+ var ActionSource;
96
+ (function (ActionSource) {
97
+ ActionSource["COMPANY"] = "COMPANY";
98
+ ActionSource["TWITTER"] = "TWITTER";
99
+ ActionSource["DISCORD"] = "DISCORD";
100
+ ActionSource["TELEGRAM"] = "TELEGRAM";
101
+ })(ActionSource || (exports.ActionSource = ActionSource = {}));
102
+ var ActionEnum;
103
+ (function (ActionEnum) {
104
+ ActionEnum[ActionEnum["TWITTER_FOLLOW"] = 1] = "TWITTER_FOLLOW";
105
+ ActionEnum[ActionEnum["TWITTER_REPLY"] = 2] = "TWITTER_REPLY";
106
+ ActionEnum[ActionEnum["TWITTER_RETWEET"] = 3] = "TWITTER_RETWEET";
107
+ ActionEnum[ActionEnum["TWITTER_LIKE"] = 4] = "TWITTER_LIKE";
108
+ ActionEnum[ActionEnum["COMPANY_FIRST_LOGIN"] = 5] = "COMPANY_FIRST_LOGIN";
109
+ ActionEnum[ActionEnum["COMPANY_CONFIRM_EMAIL"] = 6] = "COMPANY_CONFIRM_EMAIL";
110
+ ActionEnum[ActionEnum["COMPANY_DEPOSIT"] = 7] = "COMPANY_DEPOSIT";
111
+ ActionEnum[ActionEnum["COMPANY_TRADE"] = 8] = "COMPANY_TRADE";
112
+ ActionEnum[ActionEnum["TELEGRAM_JOIN_GROUP"] = 9] = "TELEGRAM_JOIN_GROUP";
113
+ ActionEnum[ActionEnum["DISCORD_JOIN_SERVER"] = 10] = "DISCORD_JOIN_SERVER";
114
+ ActionEnum[ActionEnum["AFFILIATE_POINTS_REWARD"] = 11] = "AFFILIATE_POINTS_REWARD";
115
+ })(ActionEnum || (exports.ActionEnum = ActionEnum = {}));
116
+ exports.NON_REPEATABLE_ACTIONS = [
117
+ ActionEnum.TWITTER_FOLLOW,
118
+ ActionEnum.TELEGRAM_JOIN_GROUP,
119
+ ActionEnum.DISCORD_JOIN_SERVER,
120
+ ActionEnum.COMPANY_CONFIRM_EMAIL,
121
+ ActionEnum.COMPANY_FIRST_LOGIN,
122
+ ];
123
+
124
+
125
+ /***/ }),
126
+
127
+ /***/ 1048:
128
+ /***/ ((__unused_webpack_module, exports) => {
129
+
130
+
131
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
132
+ exports.WithdrawalWalletType = void 0;
133
+ var WithdrawalWalletType;
134
+ (function (WithdrawalWalletType) {
135
+ WithdrawalWalletType["SOLANA"] = "SOLANA";
136
+ WithdrawalWalletType["ALGORAND"] = "ALGORAND";
137
+ WithdrawalWalletType["EVM"] = "EVM";
138
+ })(WithdrawalWalletType || (exports.WithdrawalWalletType = WithdrawalWalletType = {}));
139
+
140
+
141
+ /***/ }),
142
+
143
+ /***/ 1134:
144
+ /***/ ((__unused_webpack_module, exports) => {
145
+
146
+
147
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
148
+ var OrderType;
149
+ (function (OrderType) {
150
+ OrderType[OrderType["Limit"] = 0] = "Limit";
151
+ OrderType[OrderType["IOC"] = 1] = "IOC";
152
+ OrderType[OrderType["POST"] = 2] = "POST";
153
+ OrderType[OrderType["Market"] = 3] = "Market";
154
+ })(OrderType || (OrderType = {}));
155
+ exports["default"] = OrderType;
156
+
157
+
158
+ /***/ }),
159
+
160
+ /***/ 1174:
161
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
162
+
163
+
164
+ var __importDefault = (this && this.__importDefault) || function (mod) {
165
+ return (mod && mod.__esModule) ? mod : { "default": mod };
166
+ };
167
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
168
+ exports.Operations = void 0;
169
+ exports.absolute = absolute;
170
+ exports.ceil = ceil;
171
+ exports.toFixed = toFixed;
172
+ exports.floor = floor;
173
+ exports.round = round;
174
+ exports.plus = plus;
175
+ exports.minus = minus;
176
+ exports.multiply = multiply;
177
+ exports.toUsd = toUsd;
178
+ exports.divide = divide;
179
+ exports.greaterThanOrEqual = greaterThanOrEqual;
180
+ exports.greaterThan = greaterThan;
181
+ exports.lessThanOrEqual = lessThanOrEqual;
182
+ exports.lessThan = lessThan;
183
+ exports.equal = equal;
184
+ exports.mod = mod;
185
+ exports.modZero = modZero;
186
+ exports.bn_operation = bn_operation;
187
+ exports.roundNumber = roundNumber;
188
+ exports.convertFromBaseUnits = convertFromBaseUnits;
189
+ exports.convertToBaseUnits = convertToBaseUnits;
190
+ const bignumber_js_1 = __importDefault(__webpack_require__(6168));
191
+ bignumber_js_1.default.config({ DECIMAL_PLACES: 40, EXPONENTIAL_AT: 45 });
192
+ var Operations;
193
+ (function (Operations) {
194
+ Operations["MINUS"] = "-";
195
+ Operations["PLUS"] = "+";
196
+ Operations["MULTIPLY"] = "*";
197
+ Operations["DIVIDE"] = "/";
198
+ Operations["GREATER_THAN_OR_EQUAL"] = ">=";
199
+ Operations["GREATER_THAN"] = ">";
200
+ Operations["LESS_THAN_OR_EQUAL"] = "<=";
201
+ Operations["LESS_THAN"] = "<";
202
+ Operations["EQUAL"] = "==";
203
+ Operations["MOD"] = "mod";
204
+ })(Operations || (exports.Operations = Operations = {}));
205
+ function absolute(value) {
206
+ let x = new bignumber_js_1.default(value);
207
+ const res = x.abs().toString();
208
+ // console.log('Absolute value', { value, res })
209
+ return res;
210
+ }
211
+ function ceil(value) {
212
+ let x = new bignumber_js_1.default(String(value));
213
+ const res = x.integerValue(bignumber_js_1.default.ROUND_CEIL).toString();
214
+ if (!equal(value, res)) {
215
+ console.log('Ceil value', { value, res });
216
+ }
217
+ return res;
218
+ }
219
+ function toFixed(value, decimalPlaces, roundUpToFirstSignificant = false) {
220
+ const x = new bignumber_js_1.default(String(value));
221
+ let res;
222
+ if (roundUpToFirstSignificant) {
223
+ const valueStr = x.toFixed();
224
+ const decimalIndex = valueStr.indexOf('.');
225
+ if (decimalIndex >= 0) {
226
+ const fractionalPart = valueStr.slice(decimalIndex + 1);
227
+ let leadingZeros = 0;
228
+ for (let char of fractionalPart) {
229
+ if (char === '0') {
230
+ leadingZeros++;
231
+ }
232
+ else {
233
+ break;
234
+ }
235
+ }
236
+ const totalDecimalPlaces = leadingZeros + 1;
237
+ res = x.toFixed(totalDecimalPlaces, bignumber_js_1.default.ROUND_UP);
238
+ }
239
+ else {
240
+ res = x.toFixed(0);
241
+ }
242
+ }
243
+ else {
244
+ res = x.toFixed(decimalPlaces);
245
+ }
246
+ console.log('Fixed value', { value, res });
247
+ return res;
248
+ }
249
+ function floor(value) {
250
+ let x = new bignumber_js_1.default(String(value));
251
+ const res = x.integerValue(bignumber_js_1.default.ROUND_FLOOR).toString();
252
+ console.log('Floor value', { value, res });
253
+ return res;
254
+ }
255
+ function round(value) {
256
+ let x = new bignumber_js_1.default(String(value));
257
+ const res = x.integerValue(bignumber_js_1.default.ROUND_HALF_UP).toString();
258
+ console.log('Round value', { value, res });
259
+ return res;
260
+ }
261
+ function plus(value1, value2) {
262
+ return bn_operation(value1, value2, Operations.PLUS);
263
+ }
264
+ function minus(value1, value2) {
265
+ return bn_operation(value1, value2, Operations.MINUS);
266
+ }
267
+ function multiply(value1, value2) {
268
+ return bn_operation(value1, value2, Operations.MULTIPLY);
269
+ }
270
+ function toUsd(amount, price) {
271
+ return multiply(amount, price || 0);
272
+ }
273
+ ;
274
+ function divide(value1, value2) {
275
+ return bn_operation(value1, value2, Operations.DIVIDE);
276
+ }
277
+ function greaterThanOrEqual(value1, value2) {
278
+ return Boolean(bn_operation(value1, value2, Operations.GREATER_THAN_OR_EQUAL));
279
+ }
280
+ function greaterThan(value1, value2) {
281
+ return Boolean(bn_operation(value1, value2, Operations.GREATER_THAN));
282
+ }
283
+ function lessThanOrEqual(value1, value2) {
284
+ return Boolean(bn_operation(value1, value2, Operations.LESS_THAN_OR_EQUAL));
285
+ }
286
+ function lessThan(value1, value2) {
287
+ return Boolean(bn_operation(value1, value2, Operations.LESS_THAN));
288
+ }
289
+ function equal(value1, value2) {
290
+ return Boolean(bn_operation(value1, value2, Operations.EQUAL));
291
+ }
292
+ function mod(value1, value2) {
293
+ return bn_operation(value1, value2, Operations.MOD);
294
+ }
295
+ function modZero(value1, value2) {
296
+ return equal(mod(value1, value2), 0);
297
+ }
298
+ function bn_operation(a, b, operation) {
299
+ a = new bignumber_js_1.default(String(a));
300
+ b = new bignumber_js_1.default(String(b));
301
+ switch (operation.toLowerCase()) {
302
+ case '-':
303
+ return a.minus(b).toString();
304
+ case '+':
305
+ return a.plus(b).toString();
306
+ case '*':
307
+ case 'x':
308
+ return a.multipliedBy(b).toString();
309
+ case '÷':
310
+ case '/':
311
+ return a.dividedBy(b).toString();
312
+ case '>=':
313
+ return a.isGreaterThanOrEqualTo(b);
314
+ case '>':
315
+ return a.isGreaterThan(b);
316
+ case '<=':
317
+ return a.isLessThanOrEqualTo(b);
318
+ case '<':
319
+ return a.isLessThan(b);
320
+ case '==':
321
+ return a.isEqualTo(b);
322
+ case 'mod':
323
+ return a.modulo(b);
324
+ default:
325
+ break;
326
+ }
327
+ }
328
+ function getExponentialNumberComponents(x) {
329
+ if (x.toString().includes('e')) {
330
+ const parts = x.toString().split('e');
331
+ return [parseFloat(parts[0]), parseFloat(parts[1])];
332
+ }
333
+ return [x, 0];
334
+ }
335
+ function generateExponentialNumberFromComponents(decimalPart, exponent) {
336
+ return decimalPart + (exponent < 0 ? `e${exponent}` : `e+${exponent}`);
337
+ }
338
+ function roundNumber({ decimalPlaces = 0 }, x) {
339
+ if (decimalPlaces > 0) {
340
+ const [decimal, decimalExponentialPart] = getExponentialNumberComponents(x);
341
+ const [rounded, roundedExponentialPart] = getExponentialNumberComponents(Math.round(Number(generateExponentialNumberFromComponents(decimal, decimalExponentialPart + decimalPlaces))));
342
+ return Number(generateExponentialNumberFromComponents(rounded, roundedExponentialPart - decimalPlaces));
343
+ }
344
+ return Math.round(x);
345
+ }
346
+ function convertFromBaseUnits(assetDecimals, quantity) {
347
+ const decimals = Number(assetDecimals);
348
+ return roundNumber({ decimalPlaces: decimals },
349
+ // eslint-disable-next-line no-magic-numbers
350
+ Math.pow(10, -decimals) * Number(quantity));
351
+ }
352
+ /**
353
+ * Computs quantity * 10^(assetDecimals) and rounds the result
354
+ */
355
+ function convertToBaseUnits(assetDecimals, quantity) {
356
+ // eslint-disable-next-line no-magic-numbers
357
+ const baseAmount = Math.pow(10, Number(assetDecimals)) * Number(quantity);
358
+ // make sure the final value is an integer. This prevents this kind of computation errors: 0.0012 * 100000 = 119.99999999999999 and rounds this result into 120
359
+ return roundNumber({ decimalPlaces: 0 }, baseAmount);
360
+ }
361
+
362
+
363
+ /***/ }),
364
+
365
+ /***/ 1283:
366
+ /***/ ((__unused_webpack_module, exports) => {
367
+
368
+
369
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
370
+ exports.StateType = void 0;
371
+ var StateType;
372
+ (function (StateType) {
373
+ StateType["VERSION"] = "version";
374
+ StateType["LAST_ALGO_BLOCK"] = "last_algo_block";
375
+ StateType["PRICES_PROVIDER_API_KEY"] = "prices_provider_api_key";
376
+ StateType["DEFAULT_API_DOMAIN"] = "default_api_domain";
377
+ StateType["NONCE_ACCOUNTS_SOLANA"] = "nonce_accounts_solana";
378
+ StateType["ARCHIVE_DATA_BATCH_SIZE"] = "archive_data_batch_size";
379
+ StateType["ARCHIVE_TASK_LOCK"] = "archive_task_lock";
380
+ })(StateType || (exports.StateType = StateType = {}));
381
+
382
+
383
+ /***/ }),
384
+
385
+ /***/ 1492:
386
+ /***/ ((__unused_webpack_module, exports) => {
387
+
388
+
389
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
390
+ var OrderStatus;
391
+ (function (OrderStatus) {
392
+ OrderStatus[OrderStatus["Open"] = 1] = "Open";
393
+ OrderStatus[OrderStatus["Canceled"] = 2] = "Canceled";
394
+ OrderStatus[OrderStatus["Matched"] = 3] = "Matched";
395
+ OrderStatus[OrderStatus["SelfMatched"] = 4] = "SelfMatched";
396
+ OrderStatus[OrderStatus["Expired"] = 5] = "Expired";
397
+ })(OrderStatus || (OrderStatus = {}));
398
+ exports["default"] = OrderStatus;
399
+
400
+
401
+ /***/ }),
402
+
403
+ /***/ 1682:
404
+ /***/ ((__unused_webpack_module, exports) => {
405
+
406
+
407
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
408
+ exports.SettingTypeColumn = void 0;
409
+ var SettingTypeColumn;
410
+ (function (SettingTypeColumn) {
411
+ SettingTypeColumn["STRING"] = "string";
412
+ SettingTypeColumn["BOOLEAN"] = "boolean";
413
+ SettingTypeColumn["INT"] = "int";
414
+ SettingTypeColumn["FLOAT"] = "float";
415
+ SettingTypeColumn["SINGLE_CHOICE"] = "single-choice";
416
+ SettingTypeColumn["MULTI_CHOICE"] = "multi-choice";
417
+ })(SettingTypeColumn || (exports.SettingTypeColumn = SettingTypeColumn = {}));
418
+
419
+
420
+ /***/ }),
421
+
422
+ /***/ 2137:
423
+ /***/ ((__unused_webpack_module, exports) => {
424
+
425
+
426
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
427
+ exports.mapToCodexBalanceDto = mapToCodexBalanceDto;
428
+ function mapToCodexBalanceDto(o) {
429
+ return {
430
+ hash: o.hash,
431
+ loginAddress: o.loginAddress,
432
+ loginChainId: o.loginChainId,
433
+ tokenId: o.token?.id,
434
+ tokenAddress: o.tokenId,
435
+ tokenChainId: o.tokenChainId,
436
+ amount: o.amount,
437
+ lockedAmount: o.lockedAmount
438
+ };
439
+ }
440
+
441
+
442
+ /***/ }),
443
+
444
+ /***/ 2224:
445
+ /***/ ((__unused_webpack_module, exports) => {
446
+
447
+
448
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
449
+ exports.AffiliateSortByEnum = void 0;
450
+ var AffiliateSortByEnum;
451
+ (function (AffiliateSortByEnum) {
452
+ AffiliateSortByEnum["INVITED_ACCOUNTS_COUNT"] = "invitedAccountsCount";
453
+ AffiliateSortByEnum["CREATED_AT"] = "createdAt";
454
+ AffiliateSortByEnum["FEE_SHARE"] = "feeShare";
455
+ AffiliateSortByEnum["ADDRESS"] = "address";
456
+ AffiliateSortByEnum["REFERRAL_TRADING_VOLUME"] = "referralTradingVolume";
457
+ })(AffiliateSortByEnum || (exports.AffiliateSortByEnum = AffiliateSortByEnum = {}));
458
+
459
+
460
+ /***/ }),
461
+
462
+ /***/ 2228:
463
+ /***/ ((__unused_webpack_module, exports) => {
464
+
465
+
466
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
467
+ exports.HTTPSRPC_MAINNET = exports.HTTPSRPC_TESTNET = exports.ChainNames = exports.Chains = void 0;
468
+ var Chains;
469
+ (function (Chains) {
470
+ Chains[Chains["Solana"] = 1] = "Solana";
471
+ Chains[Chains["Algorand"] = 8] = "Algorand";
472
+ Chains[Chains["Polygon"] = 5] = "Polygon";
473
+ Chains[Chains["Bsc"] = 4] = "Bsc";
474
+ Chains[Chains["Avalanche"] = 6] = "Avalanche";
475
+ Chains[Chains["Arbitrum"] = 23] = "Arbitrum";
476
+ Chains[Chains["Optimism"] = 24] = "Optimism";
477
+ Chains[Chains["Base"] = 30] = "Base";
478
+ Chains[Chains["Ethereum"] = 2] = "Ethereum";
479
+ Chains[Chains["Sepolia"] = 10002] = "Sepolia";
480
+ Chains[Chains["ArbitrumSepolia"] = 10003] = "ArbitrumSepolia";
481
+ Chains[Chains["BaseSepolia"] = 10004] = "BaseSepolia";
482
+ Chains[Chains["OptimismSepolia"] = 10005] = "OptimismSepolia";
483
+ Chains[Chains["PolygonAmoy"] = 10007] = "PolygonAmoy";
484
+ })(Chains || (exports.Chains = Chains = {}));
485
+ exports.ChainNames = {
486
+ [Chains.Solana]: "Solana",
487
+ [Chains.Ethereum]: "Ethereum",
488
+ [Chains.Polygon]: "Polygon",
489
+ [Chains.Bsc]: "BNB Chain",
490
+ [Chains.Avalanche]: "Avalanche",
491
+ [Chains.Algorand]: "Algorand",
492
+ [Chains.Arbitrum]: "Arbitrum",
493
+ [Chains.Optimism]: "Optimism",
494
+ [Chains.Base]: "Base",
495
+ [Chains.Sepolia]: "Ethereum Sepolia",
496
+ [Chains.ArbitrumSepolia]: "Arbitrum Sepolia",
497
+ [Chains.BaseSepolia]: "Base Sepolia",
498
+ [Chains.OptimismSepolia]: "Optimism Sepolia",
499
+ [Chains.PolygonAmoy]: "Polygon Amoy",
500
+ };
501
+ exports.HTTPSRPC_TESTNET = {
502
+ [Chains.Bsc]: [
503
+ '',
504
+ 'https://bsc-testnet.public.blastapi.io',
505
+ 'https://bsc-testnet.blockpi.network/v1/rpc/private',
506
+ 'https://bsc-testnet-rpc.publicnode.com',
507
+ 'https://api.zan.top/bsc-testnet',
508
+ 'https://data-seed-prebsc-2-s1.bnbchain.org:8545',
509
+ 'https://data-seed-prebsc-2-s2.bnbchain.org:8545',
510
+ 'https://data-seed-prebsc-2-s3.bnbchain.org:8545',
511
+ 'https://data-seed-prebsc-1-s1.bnbchain.org:8545',
512
+ 'https://data-seed-prebsc-1-s2.bnbchain.org:8545',
513
+ 'https://data-seed-prebsc-1-s3.bnbchain.org:8545',
514
+ 'https://endpoints.omniatech.io/v1/bsc/testnet/public',
515
+ ],
516
+ [Chains.Avalanche]: [
517
+ '',
518
+ 'https://rpc.ankr.com/avalanche_fuji',
519
+ 'https://rpc.ankr.com/avalanche_fuji-c',
520
+ 'https://api.avax-test.network/ext/bc/C/rpc',
521
+ 'https://ava-testnet.public.blastapi.io/ext/bc/C/rpc',
522
+ 'https://endpoints.omniatech.io/v1/avax/fuji/public',
523
+ 'https://avalanche-fuji.blockpi.network/v1/rpc/private',
524
+ 'https://avalanche-fuji-c-chain-rpc.publicnode.com',
525
+ 'https://avalanche-fuji.blockpi.network/v1/rpc/private',
526
+ ],
527
+ [Chains.Sepolia]: [
528
+ 'https://ethereum-sepolia-rpc.publicnode.com',
529
+ 'https://sepolia.gateway.tenderly.co',
530
+ 'https://eth-sepolia.public.blastapi.io',
531
+ 'https://ethereum-sepolia.blockpi.network/v1/rpc/private',
532
+ 'https://sepolia.drpc.org',
533
+ 'https://endpoints.omniatech.io/v1/eth/sepolia/public',
534
+ 'https://1rpc.io/sepolia',
535
+ 'https://gateway.tenderly.co/public/sepolia',
536
+ 'https://sepolia.gateway.tenderly.co',
537
+ 'https://api.zan.top/eth-sepolia',
538
+ 'https://ethereum-sepolia.rpc.subquery.network/public',
539
+ ],
540
+ [Chains.ArbitrumSepolia]: [
541
+ '',
542
+ 'https://arbitrum-sepolia.blockpi.network/v1/rpc/private ',
543
+ 'https://arbitrum-sepolia.gateway.tenderly.co',
544
+ 'https://endpoints.omniatech.io/v1/arbitrum/sepolia/public',
545
+ 'https://api.zan.top/arb-sepolia',
546
+ 'https://sepolia-rollup.arbitrum.io/rpc',
547
+ ],
548
+ [Chains.BaseSepolia]: [
549
+ '',
550
+ 'https://sepolia.base.org',
551
+ 'https://base-sepolia-rpc.publicnode.com',
552
+ 'https://base-sepolia.gateway.tenderly.co',
553
+ 'https://base-sepolia.blockpi.network/v1/rpc/private',
554
+ 'https://node.histori.xyz/base-sepolia/8ry9f6t9dct1se2hlagxnd9n2a',
555
+ ],
556
+ [Chains.OptimismSepolia]: [
557
+ '',
558
+ 'https://optimism-sepolia.blockpi.network/v1/rpc/private',
559
+ 'https://sepolia.optimism.io',
560
+ 'https://api.zan.top/opt-sepolia',
561
+ 'https://optimism-sepolia.gateway.tenderly.co',
562
+ 'https://optimism-sepolia.drpc.org',
563
+ 'https://endpoints.omniatech.io/v1/op/sepolia/public',
564
+ ],
565
+ [Chains.PolygonAmoy]: [
566
+ 'https://rpc-amoy.polygon.technology',
567
+ 'https://polygon-amoy-bor-rpc.publicnode.com',
568
+ 'https://rpc.ankr.com/polygon_amoy',
569
+ 'https://polygon-amoy.drpc.org',
570
+ 'https://api.zan.top/polygon-amoy',
571
+ 'https://polygon-amoy.gateway.tenderly.co',
572
+ ],
573
+ };
574
+ exports.HTTPSRPC_MAINNET = {
575
+ [Chains.Ethereum]: [
576
+ '',
577
+ 'https://eth.llamarpc.com',
578
+ 'https://ethereum.blockpi.network/v1/rpc/public',
579
+ 'https://eth-mainnet.nodereal.io/v1/1659dfb40aa24bbb8153a677b98064d7',
580
+ 'https://uk.rpc.blxrbdn.com',
581
+ 'https://singapore.rpc.blxrbdn.com',
582
+ 'https://virginia.rpc.blxrbdn.com',
583
+ 'https://eth-mainnet.public.blastapi.io',
584
+ 'https://api.securerpc.com/v1',
585
+ 'https://mainnet.gateway.tenderly.co',
586
+ 'https://eth-pokt.nodies.app',
587
+ 'https://eth.blockrazor.xyz',
588
+ 'https://eth.merkle.io',
589
+ 'https://gateway.tenderly.co/public/mainnet',
590
+ 'https://eth.rpc.blxrbdn.com',
591
+ ],
592
+ [Chains.Bsc]: [
593
+ '',
594
+ 'https://bsc.blockrazor.xyz',
595
+ 'https://bscrpc.com',
596
+ 'https://bsc-mainnet.public.blastapi.io',
597
+ 'https://binance.llamarpc.com',
598
+ 'https://go.getblock.io/cc778cdbdf5c4b028ec9456e0e6c0cf3',
599
+ 'https://bsc-pokt.nodies.app',
600
+ 'https://56.rpc.thirdweb.com',
601
+ 'https://bsc.blockpi.network/v1/rpc/private',
602
+ 'https://bsc.rpc.blxrbdn.com',
603
+ 'https://bsc-dataseed.bnbchain.org',
604
+ 'https://endpoints.omniatech.io/v1/bsc/mainnet/public',
605
+ 'https://bsc-dataseed1.ninicoin.io',
606
+ 'https://bsc-dataseed2.defibit.io',
607
+ 'https://bsc-dataseed2.ninicoin.io',
608
+ 'https://0.48.club',
609
+ 'https://bsc-dataseed3.defibit.io',
610
+ ],
611
+ [Chains.Polygon]: [
612
+ '',
613
+ 'https://polygon.llamarpc.com',
614
+ 'https://polygon-rpc.com',
615
+ 'https://rpc-mainnet.matic.quiknode.pro',
616
+ 'https://endpoints.omniatech.io/v1/matic/mainnet/public',
617
+ 'https://polygon-pokt.nodies.app',
618
+ 'https://polygon-bor-rpc.publicnode.com',
619
+ 'https://polygon.rpc.subquery.network/public',
620
+ 'https://polygon-bor-rpc.publicnode.com',
621
+ 'https://polygon.blockpi.network/v1/rpc/private',
622
+ 'https://polygon.api.onfinality.io/public',
623
+ 'https://polygon.lava.build',
624
+ 'https://api.zan.top/polygon-mainnet',
625
+ 'https://polygon.meowrpc.com',
626
+ ],
627
+ [Chains.Avalanche]: [
628
+ '',
629
+ 'https://avalanche-c-chain-rpc.publicnode.com',
630
+ 'https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc',
631
+ 'https://endpoints.omniatech.io/v1/avax/mainnet/public',
632
+ 'https://avalanche-c-chain-rpc.publicnode.com',
633
+ 'https://avalanche.blockpi.network/v1/rpc/private',
634
+ 'https://avalanche.public-rpc.com',
635
+ 'https://avalanche.drpc.org',
636
+ 'https://avax.meowrpc.com',
637
+ 'https://endpoints.omniatech.io/v1/avax/mainnet/public',
638
+ 'https://api.avax.network/ext/bc/C/rpc',
639
+ 'https://1rpc.io/avax/c',
640
+ 'https://avax-pokt.nodies.app/ext/bc/C/rpc',
641
+ 'https://endpoints.omniatech.io/v1/avax/mainnet/public',
642
+ 'https://api.zan.top/avax-mainnet/ext/bc/C/rpc',
643
+ ],
644
+ [Chains.Arbitrum]: [
645
+ '',
646
+ 'https://arbitrum.llamarpc.com',
647
+ 'https://arbitrum.rpc.subquery.network/public',
648
+ 'https://endpoints.omniatech.io/v1/arbitrum/one/public',
649
+ 'https://arbitrum.meowrpc.com',
650
+ 'https://arbitrum.gateway.tenderly.co',
651
+ 'https://arbitrum-one.public.blastapi.io',
652
+ 'https://arb1.lava.build',
653
+ 'https://arbitrum-one.publicnode.com',
654
+ 'https://arbitrum.blockpi.network/v1/rpc/public',
655
+ 'https://arb-pokt.nodies.app',
656
+ 'https://api.zan.top/arb-one',
657
+ 'https://arb1.arbitrum.io/rpc',
658
+ 'https://arbitrum.drpc.org',
659
+ 'https://1rpc.io/arb',
660
+ ],
661
+ [Chains.Optimism]: [
662
+ '',
663
+ 'https://optimism.llamarpc.com',
664
+ 'https://op-pokt.nodies.app',
665
+ 'https://optimism-mainnet.public.blastapi.io',
666
+ 'https://optimism.blockpi.network/v1/rpc/public',
667
+ 'https://endpoints.omniatech.io/v1/op/mainnet/public',
668
+ 'https://optimism-rpc.publicnode.com',
669
+ 'https://optimism.drpc.org',
670
+ 'https://1rpc.io/op',
671
+ 'https://optimism.gateway.tenderly.co',
672
+ 'https://optimism.lava.build',
673
+ 'https://optimism.rpc.subquery.network/public',
674
+ 'https://mainnet.optimism.io',
675
+ 'https://optimism-rpc.publicnode.com',
676
+ 'https://gateway.tenderly.co/public/optimism',
677
+ ],
678
+ [Chains.Base]: [
679
+ '',
680
+ 'https://base.llamarpc.com',
681
+ 'https://base-mainnet.public.blastapi.io',
682
+ 'https://base-rpc.publicnode.com',
683
+ 'https://base.blockpi.network/v1/rpc/public',
684
+ 'https://base.drpc.org',
685
+ 'https://mainnet.base.org',
686
+ 'https://base.api.onfinality.io/public',
687
+ 'https://base-pokt.nodies.app',
688
+ 'https://1rpc.io/base',
689
+ 'https://developer-access-mainnet.base.org',
690
+ 'https://endpoints.omniatech.io/v1/base/mainnet/public',
691
+ 'https://base.rpc.subquery.network/public',
692
+ 'https://base.api.onfinality.io/public',
693
+ 'https://base.meowrpc.com',
694
+ 'https://base.gateway.tenderly.co',
695
+ ],
696
+ };
697
+
698
+
699
+ /***/ }),
700
+
701
+ /***/ 2623:
702
+ /***/ ((__unused_webpack_module, exports) => {
703
+
704
+
705
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
706
+ exports.TransactionType = exports.CCTPStatus = exports.ActionTypeEnum = exports.OperationStatusEnum = void 0;
707
+ var OperationStatusEnum;
708
+ (function (OperationStatusEnum) {
709
+ OperationStatusEnum["Pending"] = "pending";
710
+ OperationStatusEnum["Completed"] = "completed";
711
+ OperationStatusEnum["Failed"] = "failed";
712
+ OperationStatusEnum["Received"] = "received";
713
+ })(OperationStatusEnum || (exports.OperationStatusEnum = OperationStatusEnum = {}));
714
+ var ActionTypeEnum;
715
+ (function (ActionTypeEnum) {
716
+ ActionTypeEnum["Deposit"] = "deposit";
717
+ ActionTypeEnum["Withdraw"] = "withdraw";
718
+ ActionTypeEnum["Rebalance"] = "rebalance";
719
+ })(ActionTypeEnum || (exports.ActionTypeEnum = ActionTypeEnum = {}));
720
+ var CCTPStatus;
721
+ (function (CCTPStatus) {
722
+ CCTPStatus["PENDING"] = "pending";
723
+ CCTPStatus["COMPLETED"] = "completed";
724
+ CCTPStatus["FAILED"] = "failed";
725
+ })(CCTPStatus || (exports.CCTPStatus = CCTPStatus = {}));
726
+ var TransactionType;
727
+ (function (TransactionType) {
728
+ TransactionType["USER_TO_TMC"] = "user_to_tmc";
729
+ TransactionType["TMC_TO_USER"] = "tmc_to_user";
730
+ TransactionType["RELAYER_TO_TMC"] = "relayer_to_tmc";
731
+ TransactionType["RELAYER_TO_CODEX"] = "relayer_to_codex";
732
+ TransactionType["RELAYER_TO_CIRCLE"] = "relayer_to_circle";
733
+ })(TransactionType || (exports.TransactionType = TransactionType = {}));
734
+
735
+
736
+ /***/ }),
737
+
738
+ /***/ 2739:
739
+ /***/ ((__unused_webpack_module, exports) => {
740
+
741
+
742
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
743
+ exports.Notification = void 0;
744
+ var Notification;
745
+ (function (Notification) {
746
+ Notification[Notification["SELF_TRADE"] = 1] = "SELF_TRADE";
747
+ Notification[Notification["FULL_FILLED"] = 2] = "FULL_FILLED";
748
+ Notification[Notification["FULL_CANCELLED"] = 3] = "FULL_CANCELLED";
749
+ Notification[Notification["PARTIALLY_CANCELLED"] = 4] = "PARTIALLY_CANCELLED";
750
+ Notification[Notification["CREATED"] = 5] = "CREATED";
751
+ })(Notification || (exports.Notification = Notification = {}));
752
+
753
+
754
+ /***/ }),
755
+
756
+ /***/ 2797:
757
+ /***/ ((__unused_webpack_module, exports) => {
758
+
759
+
760
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
761
+ var AvailablePairSettings;
762
+ (function (AvailablePairSettings) {
763
+ AvailablePairSettings["MFT_AUDIO_LINK"] = "mft.audioLink";
764
+ AvailablePairSettings["MFT_TITLE"] = "mft.title";
765
+ AvailablePairSettings["MODE_PRE_SALE"] = "mode.preSale";
766
+ AvailablePairSettings["MAKER_FEE"] = "makerFee";
767
+ AvailablePairSettings["TAKER_FEE"] = "takerFee";
768
+ AvailablePairSettings["VIEW_BASE_COIN_ICON_LINK"] = "view.baseCoinIconLink";
769
+ AvailablePairSettings["VIEW_BASE_COIN_MARKET_LINK"] = "view.baseCoinMarketLink";
770
+ AvailablePairSettings["VIEW_PRICE_COIN_ICON_LINK"] = "view.priceCoinIconLink";
771
+ AvailablePairSettings["VIEW_PRICE_COIN_MARKET_LINK"] = "view.priceCoinMarketLink";
772
+ })(AvailablePairSettings || (AvailablePairSettings = {}));
773
+ exports["default"] = AvailablePairSettings;
774
+
775
+
776
+ /***/ }),
777
+
778
+ /***/ 3004:
779
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
780
+
781
+
782
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
783
+ if (k2 === undefined) k2 = k;
784
+ var desc = Object.getOwnPropertyDescriptor(m, k);
785
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
786
+ desc = { enumerable: true, get: function() { return m[k]; } };
787
+ }
788
+ Object.defineProperty(o, k2, desc);
789
+ }) : (function(o, m, k, k2) {
790
+ if (k2 === undefined) k2 = k;
791
+ o[k2] = m[k];
792
+ }));
793
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
794
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
795
+ };
796
+ var __importDefault = (this && this.__importDefault) || function (mod) {
797
+ return (mod && mod.__esModule) ? mod : { "default": mod };
798
+ };
799
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
800
+ exports.TradingKeyType = exports.OrderType = exports.OrderStatus = exports.OrderSide = exports.AvailablePairSettings = void 0;
801
+ const available_pair_settings_enum_1 = __importDefault(__webpack_require__(2797));
802
+ exports.AvailablePairSettings = available_pair_settings_enum_1.default;
803
+ const order_side_enum_1 = __importDefault(__webpack_require__(835));
804
+ exports.OrderSide = order_side_enum_1.default;
805
+ const order_status_enum_1 = __importDefault(__webpack_require__(1492));
806
+ exports.OrderStatus = order_status_enum_1.default;
807
+ const order_type_enum_1 = __importDefault(__webpack_require__(1134));
808
+ exports.OrderType = order_type_enum_1.default;
809
+ const tradingKeyType_enum_1 = __webpack_require__(3487);
810
+ Object.defineProperty(exports, "TradingKeyType", ({ enumerable: true, get: function () { return tradingKeyType_enum_1.TradingKeyType; } }));
811
+ __exportStar(__webpack_require__(893), exports);
812
+ __exportStar(__webpack_require__(3338), exports);
813
+ __exportStar(__webpack_require__(3245), exports);
814
+ __exportStar(__webpack_require__(6828), exports);
815
+ __exportStar(__webpack_require__(2224), exports);
816
+ __exportStar(__webpack_require__(892), exports);
817
+ __exportStar(__webpack_require__(2623), exports);
818
+ __exportStar(__webpack_require__(3854), exports);
819
+ __exportStar(__webpack_require__(4132), exports);
820
+ __exportStar(__webpack_require__(3516), exports);
821
+ __exportStar(__webpack_require__(4199), exports);
822
+ __exportStar(__webpack_require__(1682), exports);
823
+ __exportStar(__webpack_require__(1283), exports);
824
+ __exportStar(__webpack_require__(5237), exports);
825
+ __exportStar(__webpack_require__(1048), exports);
826
+
827
+
828
+ /***/ }),
829
+
830
+ /***/ 3245:
831
+ /***/ ((__unused_webpack_module, exports) => {
832
+
833
+
834
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
835
+ exports.PromptTypeEnum = void 0;
836
+ var PromptTypeEnum;
837
+ (function (PromptTypeEnum) {
838
+ PromptTypeEnum["INSTRUCTIONS"] = "INSTRUCTIONS";
839
+ PromptTypeEnum["TEXT_STYLE"] = "TEXT_STYLE";
840
+ PromptTypeEnum["TEXT_TONE"] = "TEXT_TONE";
841
+ PromptTypeEnum["REACTION_TYPE"] = "REACTION_TYPE";
842
+ PromptTypeEnum["COMMENT_LENGTH"] = "COMMENT_LENGTH";
843
+ PromptTypeEnum["CONTEXT"] = "CONTEXT";
844
+ })(PromptTypeEnum || (exports.PromptTypeEnum = PromptTypeEnum = {}));
845
+
846
+
847
+ /***/ }),
848
+
849
+ /***/ 3338:
850
+ /***/ ((__unused_webpack_module, exports) => {
851
+
852
+
853
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
854
+ exports.TweetType = exports.SeasonStatusEnum = void 0;
855
+ var SeasonStatusEnum;
856
+ (function (SeasonStatusEnum) {
857
+ SeasonStatusEnum["CREATED"] = "created";
858
+ SeasonStatusEnum["STARTED"] = "started";
859
+ SeasonStatusEnum["PAUSED"] = "paused";
860
+ SeasonStatusEnum["CLOSED"] = "closed";
861
+ })(SeasonStatusEnum || (exports.SeasonStatusEnum = SeasonStatusEnum = {}));
862
+ var TweetType;
863
+ (function (TweetType) {
864
+ TweetType["Post"] = "POST";
865
+ TweetType["Comment"] = "COMMENT";
866
+ })(TweetType || (exports.TweetType = TweetType = {}));
867
+
868
+
869
+ /***/ }),
870
+
871
+ /***/ 3487:
872
+ /***/ ((__unused_webpack_module, exports) => {
873
+
874
+
875
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
876
+ exports.TradingKeyType = void 0;
877
+ var TradingKeyType;
878
+ (function (TradingKeyType) {
879
+ TradingKeyType["User"] = "User";
880
+ TradingKeyType["Api"] = "API";
881
+ })(TradingKeyType || (exports.TradingKeyType = TradingKeyType = {}));
882
+
883
+
884
+ /***/ }),
885
+
886
+ /***/ 3516:
887
+ /***/ ((__unused_webpack_module, exports) => {
888
+
889
+
890
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
891
+ exports.SortDirectionEnum = void 0;
892
+ var SortDirectionEnum;
893
+ (function (SortDirectionEnum) {
894
+ SortDirectionEnum["ASCENDING"] = "ASC";
895
+ SortDirectionEnum["DESCENDING"] = "DESC";
896
+ })(SortDirectionEnum || (exports.SortDirectionEnum = SortDirectionEnum = {}));
897
+
898
+
899
+ /***/ }),
900
+
901
+ /***/ 3854:
902
+ /***/ ((__unused_webpack_module, exports) => {
903
+
904
+
905
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
906
+ exports.TradeSubStatus = exports.TradeStatus = void 0;
907
+ var TradeStatus;
908
+ (function (TradeStatus) {
909
+ TradeStatus["Unconfirmed"] = "UNCONFIRMED";
910
+ TradeStatus["Confirmed"] = "CONFIRMED";
911
+ TradeStatus["Rejected"] = "REJECTED";
912
+ })(TradeStatus || (exports.TradeStatus = TradeStatus = {}));
913
+ var TradeSubStatus;
914
+ (function (TradeSubStatus) {
915
+ TradeSubStatus["RESUBMITTED"] = "RESUBMITTED";
916
+ TradeSubStatus["PROCESSED"] = "PROCESSED";
917
+ TradeSubStatus["REMATCHED"] = "REMATCHED";
918
+ })(TradeSubStatus || (exports.TradeSubStatus = TradeSubStatus = {}));
919
+
920
+
921
+ /***/ }),
922
+
923
+ /***/ 4132:
924
+ /***/ ((__unused_webpack_module, exports) => {
925
+
926
+
927
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
928
+ exports.MarketMakerSortByEnum = exports.MarketMakerRebateTier = void 0;
929
+ var MarketMakerRebateTier;
930
+ (function (MarketMakerRebateTier) {
931
+ MarketMakerRebateTier[MarketMakerRebateTier["FIRST"] = 1] = "FIRST";
932
+ MarketMakerRebateTier[MarketMakerRebateTier["SECOND"] = 2] = "SECOND";
933
+ MarketMakerRebateTier[MarketMakerRebateTier["THIRD"] = 3] = "THIRD";
934
+ MarketMakerRebateTier[MarketMakerRebateTier["FOURTH"] = 4] = "FOURTH";
935
+ })(MarketMakerRebateTier || (exports.MarketMakerRebateTier = MarketMakerRebateTier = {}));
936
+ var MarketMakerSortByEnum;
937
+ (function (MarketMakerSortByEnum) {
938
+ MarketMakerSortByEnum["REBATE_TIER"] = "rebateTier";
939
+ MarketMakerSortByEnum["CREATED_AT"] = "createdAt";
940
+ MarketMakerSortByEnum["NAME"] = "name";
941
+ MarketMakerSortByEnum["TAKER_FEE"] = "takerFee";
942
+ MarketMakerSortByEnum["ENABLED"] = "enabled";
943
+ MarketMakerSortByEnum["ADDRESS"] = "address";
944
+ MarketMakerSortByEnum["CHAIN"] = "chainId";
945
+ })(MarketMakerSortByEnum || (exports.MarketMakerSortByEnum = MarketMakerSortByEnum = {}));
946
+
947
+
948
+ /***/ }),
949
+
950
+ /***/ 4199:
951
+ /***/ ((__unused_webpack_module, exports) => {
952
+
953
+
954
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
955
+ exports.ScheduledNotificationStatusEnum = exports.NotificationStatusEnum = exports.NotificationPriorityEnum = exports.CombinedNotificationEnum = exports.AccountNotificationEnum = exports.GlobalNotificationEnum = void 0;
956
+ var GlobalNotificationEnum;
957
+ (function (GlobalNotificationEnum) {
958
+ GlobalNotificationEnum["GLOBAL_PAIR_DELISTING"] = "GLOBAL_PAIR_DELISTING";
959
+ GlobalNotificationEnum["GLOBAL_NEW_PAIR_LISTING"] = "GLOBAL_NEW_PAIR_LISTING";
960
+ GlobalNotificationEnum["GLOBAL_SYSTEM_MAINTENANCE"] = "GLOBAL_SYSTEM_MAINTENANCE";
961
+ GlobalNotificationEnum["GLOBAL_SMART_CONTRACT_UPDATE"] = "GLOBAL_SMART_CONTRACT_UPDATE";
962
+ })(GlobalNotificationEnum || (exports.GlobalNotificationEnum = GlobalNotificationEnum = {}));
963
+ var AccountNotificationEnum;
964
+ (function (AccountNotificationEnum) {
965
+ AccountNotificationEnum["ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT"] = "ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT";
966
+ AccountNotificationEnum["ACCOUNT_KYC_STATUS_CHANGED"] = "ACCOUNT_KYC_STATUS_CHANGED";
967
+ AccountNotificationEnum["ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED"] = "ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED";
968
+ })(AccountNotificationEnum || (exports.AccountNotificationEnum = AccountNotificationEnum = {}));
969
+ exports.CombinedNotificationEnum = {
970
+ ...GlobalNotificationEnum,
971
+ ...AccountNotificationEnum,
972
+ };
973
+ var NotificationPriorityEnum;
974
+ (function (NotificationPriorityEnum) {
975
+ NotificationPriorityEnum["CRITICAL"] = "CRITICAL";
976
+ NotificationPriorityEnum["IMPORTANT"] = "IMPORTANT";
977
+ NotificationPriorityEnum["INFO"] = "INFO";
978
+ })(NotificationPriorityEnum || (exports.NotificationPriorityEnum = NotificationPriorityEnum = {}));
979
+ var NotificationStatusEnum;
980
+ (function (NotificationStatusEnum) {
981
+ NotificationStatusEnum["UNREAD"] = "UNREAD";
982
+ NotificationStatusEnum["READ"] = "READ";
983
+ })(NotificationStatusEnum || (exports.NotificationStatusEnum = NotificationStatusEnum = {}));
984
+ var ScheduledNotificationStatusEnum;
985
+ (function (ScheduledNotificationStatusEnum) {
986
+ ScheduledNotificationStatusEnum["PENDING"] = "PENDING";
987
+ ScheduledNotificationStatusEnum["PROCESSED"] = "PROCESSED";
988
+ ScheduledNotificationStatusEnum["FAILED"] = "FAILED";
989
+ })(ScheduledNotificationStatusEnum || (exports.ScheduledNotificationStatusEnum = ScheduledNotificationStatusEnum = {}));
990
+
991
+
992
+ /***/ }),
993
+
994
+ /***/ 5237:
995
+ /***/ ((__unused_webpack_module, exports) => {
996
+
997
+
998
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
999
+ exports.UpgradeStatus = void 0;
1000
+ var UpgradeStatus;
1001
+ (function (UpgradeStatus) {
1002
+ UpgradeStatus["SUCCESS"] = "success";
1003
+ UpgradeStatus["FAILED"] = "failed";
1004
+ UpgradeStatus["PENDING"] = "pending";
1005
+ })(UpgradeStatus || (exports.UpgradeStatus = UpgradeStatus = {}));
1006
+
1007
+
1008
+ /***/ }),
1009
+
1010
+ /***/ 5320:
1011
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1012
+
1013
+
1014
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1015
+ exports.mapToUserTradeDto = mapToUserTradeDto;
1016
+ exports.mapToOrderTradeDto = mapToOrderTradeDto;
1017
+ exports.isMaker = isMaker;
1018
+ const order_helper_1 = __webpack_require__(7542);
1019
+ const utils_1 = __webpack_require__(8398);
1020
+ const big_number_helper_1 = __webpack_require__(1174);
1021
+ const _enums_1 = __webpack_require__(9965);
1022
+ function mapToUserTradeDto(t, baseAsset, priceAsset) {
1023
+ const o = t.buyOrder && t.sellOrder
1024
+ ? (t.buyOrderId > t.sellOrderId ? t.buyOrder : t.sellOrder) // which order is self order
1025
+ : (t.buyOrder || t.sellOrder); // user order
1026
+ return {
1027
+ pairId: t.pairId,
1028
+ orderId: o?.id,
1029
+ orderSide: (o && (0, order_helper_1.mapOrderSideToShort)(o.side)),
1030
+ ...mapAssets(baseAsset, priceAsset),
1031
+ ...mapTrade(t, o),
1032
+ };
1033
+ }
1034
+ function mapToOrderTradeDto(order, trades, pairKey, baseAsset, priceAsset) {
1035
+ return {
1036
+ id: order.id,
1037
+ pairId: order.pairId,
1038
+ // @ts-ignore
1039
+ pair: pairKey || order.pair?.pairKey,
1040
+ ...mapAssets(baseAsset, priceAsset),
1041
+ amount: order.amount,
1042
+ price: order.price,
1043
+ total: order.total,
1044
+ filledAmount: order.filledAmount,
1045
+ filledTotal: order.filledTotal,
1046
+ avgPrice: order.excutedPrice,
1047
+ status: order.status,
1048
+ side: order.side,
1049
+ type: order.type,
1050
+ userId: order.userId,
1051
+ createdAt: order.createdAt?.getTime(),
1052
+ completedAt: order.completedAt?.getTime() || null,
1053
+ updatedAt: order.updatedAt?.getTime(),
1054
+ trades: trades && trades.map((t) => mapTrade(t, order)),
1055
+ };
1056
+ }
1057
+ function mapAssets(baseAsset, priceAsset) {
1058
+ return {
1059
+ baseTokenId: baseAsset?.id,
1060
+ baseTokenDecimal: baseAsset?.decimals,
1061
+ quoteTokenId: priceAsset?.id,
1062
+ quoteTokenDecimal: priceAsset?.decimals,
1063
+ };
1064
+ }
1065
+ function mapTrade(t, o) {
1066
+ return {
1067
+ tradeId: t.tradeId,
1068
+ status: t.txStatus,
1069
+ amount: t.amount,
1070
+ total: t.total,
1071
+ price: t.price,
1072
+ fee: o && t.tradeFees
1073
+ .filter(f => (0, utils_1.equalIgnoreCase)(f.address, o.userId))
1074
+ .reduce((acc, cur) => (0, big_number_helper_1.plus)(acc, cur.fee), '0'),
1075
+ createdAt: t.createdAt?.getTime(),
1076
+ updatedAt: t.updatedAt?.getTime(),
1077
+ isBuyer: o && o.side === _enums_1.OrderSide.Buy,
1078
+ isMaker: o && isMaker(o.side, t.tradeSide),
1079
+ };
1080
+ }
1081
+ function isMaker(oSide, tSide) {
1082
+ return oSide === _enums_1.OrderSide.Buy && tSide === _enums_1.OrderSide.Sell
1083
+ || oSide === _enums_1.OrderSide.Sell && tSide === _enums_1.OrderSide.Buy;
1084
+ }
1085
+
1086
+
1087
+ /***/ }),
1088
+
1089
+ /***/ 6119:
1090
+ /***/ ((__unused_webpack_module, exports) => {
1091
+
1092
+
1093
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1094
+ exports.TwitterAccessScopeEnum = void 0;
1095
+ var TwitterAccessScopeEnum;
1096
+ (function (TwitterAccessScopeEnum) {
1097
+ TwitterAccessScopeEnum["USERS_READ"] = "users.read";
1098
+ TwitterAccessScopeEnum["FOLLOWS_READ"] = "follows.read";
1099
+ TwitterAccessScopeEnum["FOLLOWS_WRITE"] = "follows.write";
1100
+ TwitterAccessScopeEnum["TWEET_READ"] = "tweet.read";
1101
+ TwitterAccessScopeEnum["TWEET_WRITE"] = "tweet.write";
1102
+ TwitterAccessScopeEnum["OFFLINE_ACCESS"] = "offline.access";
1103
+ TwitterAccessScopeEnum["LIKE_READ"] = "like.read";
1104
+ TwitterAccessScopeEnum["LIKE_WRITE"] = "like.write";
1105
+ })(TwitterAccessScopeEnum || (exports.TwitterAccessScopeEnum = TwitterAccessScopeEnum = {}));
1106
+
1107
+
1108
+ /***/ }),
1109
+
1110
+ /***/ 6168:
1111
+ /***/ ((module) => {
1112
+
1113
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6168__;
1114
+
1115
+ /***/ }),
1116
+
1117
+ /***/ 6828:
1118
+ /***/ ((__unused_webpack_module, exports) => {
1119
+
1120
+
1121
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1122
+ exports.KYCAuthenticationStatus = exports.LastLookAction = exports.FeeTier = void 0;
1123
+ var FeeTier;
1124
+ (function (FeeTier) {
1125
+ FeeTier[FeeTier["FEE_TIER_1"] = 1] = "FEE_TIER_1";
1126
+ FeeTier[FeeTier["FEE_TIER_2"] = 2] = "FEE_TIER_2";
1127
+ FeeTier[FeeTier["FEE_TIER_3"] = 3] = "FEE_TIER_3";
1128
+ FeeTier[FeeTier["FEE_TIER_4"] = 4] = "FEE_TIER_4";
1129
+ FeeTier[FeeTier["FEE_TIER_5"] = 5] = "FEE_TIER_5";
1130
+ FeeTier[FeeTier["FEE_TIER_6"] = 6] = "FEE_TIER_6";
1131
+ })(FeeTier || (exports.FeeTier = FeeTier = {}));
1132
+ var LastLookAction;
1133
+ (function (LastLookAction) {
1134
+ LastLookAction[LastLookAction["Approve"] = 1] = "Approve";
1135
+ LastLookAction[LastLookAction["Reject"] = 0] = "Reject";
1136
+ })(LastLookAction || (exports.LastLookAction = LastLookAction = {}));
1137
+ var KYCAuthenticationStatus;
1138
+ (function (KYCAuthenticationStatus) {
1139
+ KYCAuthenticationStatus["INITIATED"] = "INITIATED";
1140
+ KYCAuthenticationStatus["CREATED"] = "CREATED";
1141
+ KYCAuthenticationStatus["PROCESSING"] = "PROCESSING";
1142
+ KYCAuthenticationStatus["APPROVED"] = "APPROVED";
1143
+ KYCAuthenticationStatus["REJECTED"] = "REJECTED";
1144
+ })(KYCAuthenticationStatus || (exports.KYCAuthenticationStatus = KYCAuthenticationStatus = {}));
1145
+
1146
+
1147
+ /***/ }),
1148
+
1149
+ /***/ 6978:
1150
+ /***/ ((__unused_webpack_module, exports) => {
1151
+
1152
+
1153
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1154
+ exports.MaintenanceMode = void 0;
1155
+ var MaintenanceMode;
1156
+ (function (MaintenanceMode) {
1157
+ MaintenanceMode[MaintenanceMode["Off"] = 0] = "Off";
1158
+ MaintenanceMode[MaintenanceMode["Full"] = 1] = "Full";
1159
+ MaintenanceMode[MaintenanceMode["Partial"] = 2] = "Partial";
1160
+ MaintenanceMode[MaintenanceMode["Scheduled"] = 3] = "Scheduled";
1161
+ })(MaintenanceMode || (exports.MaintenanceMode = MaintenanceMode = {}));
1162
+
1163
+
1164
+ /***/ }),
1165
+
1166
+ /***/ 7542:
1167
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1168
+
1169
+
1170
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1171
+ exports.mapOrderSideFromShort = mapOrderSideFromShort;
1172
+ exports.mapOrderSideToShort = mapOrderSideToShort;
1173
+ exports.mapOrderTypeShort = mapOrderTypeShort;
1174
+ exports.mapOrderSideFromShortToLong = mapOrderSideFromShortToLong;
1175
+ exports.mapOrderTypeShortToLong = mapOrderTypeShortToLong;
1176
+ const _enums_1 = __webpack_require__(9965);
1177
+ function mapOrderSideFromShort(value) {
1178
+ switch (value) {
1179
+ case "B": return _enums_1.OrderSide.Buy;
1180
+ case "S": return _enums_1.OrderSide.Sell;
1181
+ default:
1182
+ throw new Error("Unknown order side short type: " + value);
1183
+ }
1184
+ }
1185
+ function mapOrderSideToShort(value) {
1186
+ switch (value) {
1187
+ case _enums_1.OrderSide.Buy: return "B";
1188
+ case _enums_1.OrderSide.Sell: return "S";
1189
+ default:
1190
+ throw new Error("Unknown order side type: " + value);
1191
+ }
1192
+ }
1193
+ function mapOrderTypeShort(value) {
1194
+ switch (value) {
1195
+ case "I": return _enums_1.OrderType.IOC;
1196
+ case "P": return _enums_1.OrderType.POST;
1197
+ case "M": return _enums_1.OrderType.Market;
1198
+ case "L":
1199
+ default:
1200
+ return _enums_1.OrderType.Limit;
1201
+ }
1202
+ }
1203
+ function mapOrderSideFromShortToLong(value) {
1204
+ switch (value) {
1205
+ case "B": return "BUY";
1206
+ case "S": return "SELL";
1207
+ default:
1208
+ throw new Error("Unknown order side short type: " + value);
1209
+ }
1210
+ }
1211
+ function mapOrderTypeShortToLong(value) {
1212
+ switch (value) {
1213
+ case "I": return "IOC";
1214
+ case "P": return "POST";
1215
+ case "M": return "Market";
1216
+ case "L":
1217
+ default:
1218
+ return "Limit";
1219
+ }
1220
+ }
1221
+
1222
+
1223
+ /***/ }),
1224
+
1225
+ /***/ 8398:
1226
+ /***/ ((__unused_webpack_module, exports) => {
1227
+
1228
+
1229
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1230
+ exports.equalIgnoreCase = exports.listDateFormat = void 0;
1231
+ exports.getRandomInt = getRandomInt;
1232
+ exports.getDomains = getDomains;
1233
+ exports.cutEvent = cutEvent;
1234
+ exports.maskingString = maskingString;
1235
+ exports.removeField = removeField;
1236
+ const listDateFormat = (date) => {
1237
+ let newDAte = new Date(date);
1238
+ let parsedDate = newDAte.toLocaleDateString('default', {
1239
+ year: 'numeric',
1240
+ month: 'numeric',
1241
+ day: 'numeric',
1242
+ });
1243
+ let time = newDAte.toLocaleTimeString('en-US', {
1244
+ hour12: true,
1245
+ hour: '2-digit',
1246
+ minute: '2-digit',
1247
+ });
1248
+ return parsedDate + ' ' + time;
1249
+ };
1250
+ exports.listDateFormat = listDateFormat;
1251
+ const equalIgnoreCase = (value1, value2) => {
1252
+ return String(value1).toLowerCase() === String(value2).toLowerCase();
1253
+ };
1254
+ exports.equalIgnoreCase = equalIgnoreCase;
1255
+ function getRandomInt(min, max) {
1256
+ min = Math.ceil(min);
1257
+ max = Math.floor(max);
1258
+ return Math.floor(Math.random() * (max - min + 1)) + min;
1259
+ }
1260
+ function getDomains(domain) {
1261
+ const domains = [];
1262
+ const parts = domain.split('.');
1263
+ for (let i = 0; i < parts.length - 1; i++) {
1264
+ domains.push(parts.slice(i).join('.'));
1265
+ }
1266
+ return domains;
1267
+ }
1268
+ ;
1269
+ function cutEvent(event) {
1270
+ const headers = event.headers && removeUndefined({
1271
+ 'Authorization': event.headers['Authorization']?.substring(0, 200),
1272
+ 'CloudFront-Viewer-Country': event.headers['CloudFront-Viewer-Country'],
1273
+ 'Host': event.headers['Host'],
1274
+ 'origin': event.headers['origin'],
1275
+ 'Referer': event.headers['Referer'],
1276
+ 'User-Agent': event.headers['User-Agent'],
1277
+ 'wl-domain': event.headers['wl-domain'],
1278
+ 'X-API-Key': maskingString(event.headers['X-API-Key']),
1279
+ 'X-Forwarded-For': event.headers['X-Forwarded-For'],
1280
+ 'X-Forwarded-Port': event.headers['X-Forwarded-Port'],
1281
+ 'X-Forwarded-Proto': event.headers['X-Forwarded-Proto'],
1282
+ 'X-Trading-Key': event.headers['X-Trading-Key'],
1283
+ 'X-Wallet-Address': event.headers['X-Wallet-Address'],
1284
+ 'X-Wallet-Token': event.headers['X-Wallet-Token'],
1285
+ 'accessToken': maskingString(event.headers['accessToken']),
1286
+ 'companyId': event.headers['companyId'],
1287
+ 'seasonId': event.headers['seasonId'],
1288
+ });
1289
+ const requestContext = event.requestContext && removeUndefined({
1290
+ identity: event.requestContext.identity && removeUndefined({
1291
+ 'userAgent': event.requestContext.identity['userAgent'],
1292
+ 'sourceIp': event.requestContext.identity['sourceIp'],
1293
+ }),
1294
+ domainName: event.requestContext.domainName,
1295
+ });
1296
+ return removeUndefined({
1297
+ manage: event.manage,
1298
+ path: event.path,
1299
+ httpMethod: event.httpMethod,
1300
+ headers,
1301
+ requestContext,
1302
+ });
1303
+ }
1304
+ function maskingString(str) {
1305
+ if (!str?.length)
1306
+ return str;
1307
+ const maskLen = Math.round(str.length / 3);
1308
+ const start = maskLen;
1309
+ const end = str.length - maskLen;
1310
+ const maskedStr = str.substring(0, start) + "*".repeat(maskLen) + str.substring(end);
1311
+ return maskedStr;
1312
+ }
1313
+ function removeField(obj, fieldToRemove) {
1314
+ if (Array.isArray(obj)) {
1315
+ return obj.map(item => removeField(item, fieldToRemove));
1316
+ }
1317
+ else if (typeof obj === 'object' && obj !== null) {
1318
+ return Object.fromEntries(Object.entries(obj)
1319
+ .filter(([key]) => key !== fieldToRemove)
1320
+ .map(([key, value]) => [key, removeField(value, fieldToRemove)]));
1321
+ }
1322
+ return obj; // Return primitives as-is
1323
+ }
1324
+ function removeUndefined(obj) {
1325
+ return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
1326
+ }
1327
+
1328
+
1329
+ /***/ }),
1330
+
1331
+ /***/ 9321:
1332
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1333
+
1334
+
1335
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1336
+ if (k2 === undefined) k2 = k;
1337
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1338
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1339
+ desc = { enumerable: true, get: function() { return m[k]; } };
1340
+ }
1341
+ Object.defineProperty(o, k2, desc);
1342
+ }) : (function(o, m, k, k2) {
1343
+ if (k2 === undefined) k2 = k;
1344
+ o[k2] = m[k];
1345
+ }));
1346
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1347
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1348
+ };
1349
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1350
+ __exportStar(__webpack_require__(221), exports);
1351
+ __exportStar(__webpack_require__(2137), exports);
1352
+ __exportStar(__webpack_require__(5320), exports);
1353
+
1354
+
1355
+ /***/ }),
1356
+
1357
+ /***/ 9965:
1358
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1359
+
1360
+
1361
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1362
+ if (k2 === undefined) k2 = k;
1363
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1364
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1365
+ desc = { enumerable: true, get: function() { return m[k]; } };
1366
+ }
1367
+ Object.defineProperty(o, k2, desc);
1368
+ }) : (function(o, m, k, k2) {
1369
+ if (k2 === undefined) k2 = k;
1370
+ o[k2] = m[k];
1371
+ }));
1372
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1373
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1374
+ };
1375
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1376
+ __exportStar(__webpack_require__(2228), exports);
1377
+ __exportStar(__webpack_require__(6978), exports);
1378
+ __exportStar(__webpack_require__(2739), exports);
1379
+ __exportStar(__webpack_require__(6119), exports);
1380
+ __exportStar(__webpack_require__(3004), exports);
1381
+
1382
+
1383
+ /***/ })
1384
+
1385
+ /******/ });
1386
+ /************************************************************************/
1387
+ /******/ // The module cache
1388
+ /******/ var __webpack_module_cache__ = {};
1389
+ /******/
1390
+ /******/ // The require function
1391
+ /******/ function __webpack_require__(moduleId) {
1392
+ /******/ // Check if module is in cache
1393
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
1394
+ /******/ if (cachedModule !== undefined) {
1395
+ /******/ return cachedModule.exports;
1396
+ /******/ }
1397
+ /******/ // Create a new module (and put it into the cache)
1398
+ /******/ var module = __webpack_module_cache__[moduleId] = {
1399
+ /******/ // no module.id needed
1400
+ /******/ // no module.loaded needed
1401
+ /******/ exports: {}
1402
+ /******/ };
1403
+ /******/
1404
+ /******/ // Execute the module function
1405
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1406
+ /******/
1407
+ /******/ // Return the exports of the module
1408
+ /******/ return module.exports;
1409
+ /******/ }
1410
+ /******/
1411
+ /************************************************************************/
1412
+ /******/
1413
+ /******/ // startup
1414
+ /******/ // Load entry module and return exports
1415
+ /******/ // This entry module is referenced by other modules so it can't be inlined
1416
+ /******/ var __webpack_exports__ = __webpack_require__(9321);
1417
+ /******/
1418
+ /******/ return __webpack_exports__;
1419
+ /******/ })()
1420
+ ;
1421
+ });