@ultrade/shared 1.0.6 → 1.0.8

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