@ultrade/shared 1.0.6 → 1.0.7

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