@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,1753 +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
- /***/ 696:
30
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
31
-
32
-
33
- var __importDefault = (this && this.__importDefault) || function (mod) {
34
- return (mod && mod.__esModule) ? mod : { "default": mod };
35
- };
36
- Object.defineProperty(exports, "__esModule", ({ value: true }));
37
- exports.encodeMessage = encodeMessage;
38
- exports.generateTxnForSign = generateTxnForSign;
39
- exports.signTxn = signTxn;
40
- const algosdk_1 = __importDefault(__webpack_require__(8115));
41
- const Encoding_1 = __webpack_require__(8593);
42
- function encodeMessage(msg) {
43
- return (0, Encoding_1.encodeString)(msg);
44
- // removed by dead control flow
45
-
46
- // removed by dead control flow
47
-
48
- }
49
- function generateTxnForSign(addr, note, encoding) {
50
- return algosdk_1.default.makePaymentTxnWithSuggestedParamsFromObject({
51
- from: addr,
52
- to: addr,
53
- amount: 0,
54
- note: note && new Uint8Array(Buffer.from(note, encoding)),
55
- suggestedParams: {
56
- fee: 0,
57
- firstRound: 1,
58
- lastRound: 2,
59
- genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
60
- genesisID: 'testnet-v1.0',
61
- },
62
- });
63
- }
64
- function signTxn(activeAddress, data, encoding, signTransactions) {
65
- return signTransaction(generateTxnForSign(activeAddress, data, encoding), signTransactions);
66
- }
67
- async function signTransaction(rawTxn, signTransactions) {
68
- const encodedTransaction = algosdk_1.default.encodeUnsignedTransaction(rawTxn);
69
- const signedTransactions = await signTransactions([encodedTransaction]);
70
- const decodedTxns = algosdk_1.default.decodeSignedTransaction(signedTransactions[0]);
71
- const signature = new Uint8Array(decodedTxns.sig);
72
- return signature;
73
- }
74
-
75
-
76
- /***/ }),
77
-
78
- /***/ 835:
79
- /***/ ((__unused_webpack_module, exports) => {
80
-
81
-
82
- Object.defineProperty(exports, "__esModule", ({ value: true }));
83
- var OrderSide;
84
- (function (OrderSide) {
85
- OrderSide[OrderSide["Buy"] = 0] = "Buy";
86
- OrderSide[OrderSide["Sell"] = 1] = "Sell";
87
- })(OrderSide || (OrderSide = {}));
88
- exports["default"] = OrderSide;
89
-
90
-
91
- /***/ }),
92
-
93
- /***/ 892:
94
- /***/ ((__unused_webpack_module, exports) => {
95
-
96
-
97
- Object.defineProperty(exports, "__esModule", ({ value: true }));
98
- exports.PairComponentStatusType = exports.ComponentType = exports.ComponentStatusType = void 0;
99
- var ComponentStatusType;
100
- (function (ComponentStatusType) {
101
- ComponentStatusType["ACTIVE"] = "ACTIVE";
102
- ComponentStatusType["FAILED"] = "FAILED";
103
- ComponentStatusType["STARTING"] = "STARTING";
104
- ComponentStatusType["DRAINING"] = "DRAINING";
105
- ComponentStatusType["TERMINATING"] = "TERMINATING";
106
- ComponentStatusType["TERMINATED"] = "TERMINATED";
107
- })(ComponentStatusType || (exports.ComponentStatusType = ComponentStatusType = {}));
108
- var ComponentType;
109
- (function (ComponentType) {
110
- ComponentType["MATCHING_ENGINE"] = "me";
111
- ComponentType["ORDER_SERVICE"] = "ors";
112
- ComponentType["API"] = "api";
113
- ComponentType["SOCKET_SERVICE"] = "ws";
114
- ComponentType["TRANSACTION_SERVICE"] = "tns";
115
- })(ComponentType || (exports.ComponentType = ComponentType = {}));
116
- var PairComponentStatusType;
117
- (function (PairComponentStatusType) {
118
- PairComponentStatusType["ACTIVE"] = "ACTIVE";
119
- PairComponentStatusType["FAILED"] = "FAILED";
120
- PairComponentStatusType["UNASSIGNED"] = "UNASSIGNED";
121
- PairComponentStatusType["ASSIGNED"] = "ASSIGNED";
122
- PairComponentStatusType["STARTING"] = "STARTING";
123
- })(PairComponentStatusType || (exports.PairComponentStatusType = PairComponentStatusType = {}));
124
-
125
-
126
- /***/ }),
127
-
128
- /***/ 893:
129
- /***/ ((__unused_webpack_module, exports) => {
130
-
131
-
132
- Object.defineProperty(exports, "__esModule", ({ value: true }));
133
- exports.NON_REPEATABLE_ACTIONS = exports.ActionEnum = exports.ActionSource = void 0;
134
- var ActionSource;
135
- (function (ActionSource) {
136
- ActionSource["COMPANY"] = "COMPANY";
137
- ActionSource["TWITTER"] = "TWITTER";
138
- ActionSource["DISCORD"] = "DISCORD";
139
- ActionSource["TELEGRAM"] = "TELEGRAM";
140
- })(ActionSource || (exports.ActionSource = ActionSource = {}));
141
- var ActionEnum;
142
- (function (ActionEnum) {
143
- ActionEnum[ActionEnum["TWITTER_FOLLOW"] = 1] = "TWITTER_FOLLOW";
144
- ActionEnum[ActionEnum["TWITTER_REPLY"] = 2] = "TWITTER_REPLY";
145
- ActionEnum[ActionEnum["TWITTER_RETWEET"] = 3] = "TWITTER_RETWEET";
146
- ActionEnum[ActionEnum["TWITTER_LIKE"] = 4] = "TWITTER_LIKE";
147
- ActionEnum[ActionEnum["COMPANY_FIRST_LOGIN"] = 5] = "COMPANY_FIRST_LOGIN";
148
- ActionEnum[ActionEnum["COMPANY_CONFIRM_EMAIL"] = 6] = "COMPANY_CONFIRM_EMAIL";
149
- ActionEnum[ActionEnum["COMPANY_DEPOSIT"] = 7] = "COMPANY_DEPOSIT";
150
- ActionEnum[ActionEnum["COMPANY_TRADE"] = 8] = "COMPANY_TRADE";
151
- ActionEnum[ActionEnum["TELEGRAM_JOIN_GROUP"] = 9] = "TELEGRAM_JOIN_GROUP";
152
- ActionEnum[ActionEnum["DISCORD_JOIN_SERVER"] = 10] = "DISCORD_JOIN_SERVER";
153
- ActionEnum[ActionEnum["AFFILIATE_POINTS_REWARD"] = 11] = "AFFILIATE_POINTS_REWARD";
154
- })(ActionEnum || (exports.ActionEnum = ActionEnum = {}));
155
- exports.NON_REPEATABLE_ACTIONS = [
156
- ActionEnum.TWITTER_FOLLOW,
157
- ActionEnum.TELEGRAM_JOIN_GROUP,
158
- ActionEnum.DISCORD_JOIN_SERVER,
159
- ActionEnum.COMPANY_CONFIRM_EMAIL,
160
- ActionEnum.COMPANY_FIRST_LOGIN,
161
- ];
162
-
163
-
164
- /***/ }),
165
-
166
- /***/ 1048:
167
- /***/ ((__unused_webpack_module, exports) => {
168
-
169
-
170
- Object.defineProperty(exports, "__esModule", ({ value: true }));
171
- exports.WithdrawalWalletType = void 0;
172
- var WithdrawalWalletType;
173
- (function (WithdrawalWalletType) {
174
- WithdrawalWalletType["SOLANA"] = "SOLANA";
175
- WithdrawalWalletType["ALGORAND"] = "ALGORAND";
176
- WithdrawalWalletType["EVM"] = "EVM";
177
- })(WithdrawalWalletType || (exports.WithdrawalWalletType = WithdrawalWalletType = {}));
178
-
179
-
180
- /***/ }),
181
-
182
- /***/ 1134:
183
- /***/ ((__unused_webpack_module, exports) => {
184
-
185
-
186
- Object.defineProperty(exports, "__esModule", ({ value: true }));
187
- var OrderType;
188
- (function (OrderType) {
189
- OrderType[OrderType["Limit"] = 0] = "Limit";
190
- OrderType[OrderType["IOC"] = 1] = "IOC";
191
- OrderType[OrderType["POST"] = 2] = "POST";
192
- OrderType[OrderType["Market"] = 3] = "Market";
193
- })(OrderType || (OrderType = {}));
194
- exports["default"] = OrderType;
195
-
196
-
197
- /***/ }),
198
-
199
- /***/ 1174:
200
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
201
-
202
-
203
- var __importDefault = (this && this.__importDefault) || function (mod) {
204
- return (mod && mod.__esModule) ? mod : { "default": mod };
205
- };
206
- Object.defineProperty(exports, "__esModule", ({ value: true }));
207
- exports.Operations = void 0;
208
- exports.absolute = absolute;
209
- exports.ceil = ceil;
210
- exports.toFixed = toFixed;
211
- exports.floor = floor;
212
- exports.round = round;
213
- exports.plus = plus;
214
- exports.minus = minus;
215
- exports.multiply = multiply;
216
- exports.toUsd = toUsd;
217
- exports.divide = divide;
218
- exports.greaterThanOrEqual = greaterThanOrEqual;
219
- exports.greaterThan = greaterThan;
220
- exports.lessThanOrEqual = lessThanOrEqual;
221
- exports.lessThan = lessThan;
222
- exports.equal = equal;
223
- exports.mod = mod;
224
- exports.modZero = modZero;
225
- exports.bn_operation = bn_operation;
226
- exports.roundNumber = roundNumber;
227
- exports.convertFromBaseUnits = convertFromBaseUnits;
228
- exports.convertToBaseUnits = convertToBaseUnits;
229
- const bignumber_js_1 = __importDefault(__webpack_require__(4978));
230
- bignumber_js_1.default.config({ DECIMAL_PLACES: 40, EXPONENTIAL_AT: 45 });
231
- var Operations;
232
- (function (Operations) {
233
- Operations["MINUS"] = "-";
234
- Operations["PLUS"] = "+";
235
- Operations["MULTIPLY"] = "*";
236
- Operations["DIVIDE"] = "/";
237
- Operations["GREATER_THAN_OR_EQUAL"] = ">=";
238
- Operations["GREATER_THAN"] = ">";
239
- Operations["LESS_THAN_OR_EQUAL"] = "<=";
240
- Operations["LESS_THAN"] = "<";
241
- Operations["EQUAL"] = "==";
242
- Operations["MOD"] = "mod";
243
- })(Operations || (exports.Operations = Operations = {}));
244
- function absolute(value) {
245
- let x = new bignumber_js_1.default(value);
246
- const res = x.abs().toString();
247
- return res;
248
- }
249
- function ceil(value) {
250
- let x = new bignumber_js_1.default(String(value));
251
- const res = x.integerValue(bignumber_js_1.default.ROUND_CEIL).toString();
252
- if (!equal(value, res)) {
253
- console.log('Ceil value', { value, res });
254
- }
255
- return res;
256
- }
257
- function toFixed(value, decimalPlaces, roundUpToFirstSignificant = false) {
258
- const x = new bignumber_js_1.default(String(value));
259
- let res;
260
- if (roundUpToFirstSignificant) {
261
- const valueStr = x.toFixed();
262
- const decimalIndex = valueStr.indexOf('.');
263
- if (decimalIndex >= 0) {
264
- const fractionalPart = valueStr.slice(decimalIndex + 1);
265
- let leadingZeros = 0;
266
- for (let char of fractionalPart) {
267
- if (char === '0') {
268
- leadingZeros++;
269
- }
270
- else {
271
- break;
272
- }
273
- }
274
- const totalDecimalPlaces = leadingZeros + 1;
275
- res = x.toFixed(totalDecimalPlaces, bignumber_js_1.default.ROUND_UP);
276
- }
277
- else {
278
- res = x.toFixed(0);
279
- }
280
- }
281
- else {
282
- res = x.toFixed(decimalPlaces);
283
- }
284
- console.log('Fixed value', { value, res });
285
- return res;
286
- }
287
- function floor(value) {
288
- let x = new bignumber_js_1.default(String(value));
289
- const res = x.integerValue(bignumber_js_1.default.ROUND_FLOOR).toString();
290
- console.log('Floor value', { value, res });
291
- return res;
292
- }
293
- function round(value) {
294
- let x = new bignumber_js_1.default(String(value));
295
- const res = x.integerValue(bignumber_js_1.default.ROUND_HALF_UP).toString();
296
- console.log('Round value', { value, res });
297
- return res;
298
- }
299
- function plus(value1, value2) {
300
- return bn_operation(value1, value2, Operations.PLUS);
301
- }
302
- function minus(value1, value2) {
303
- return bn_operation(value1, value2, Operations.MINUS);
304
- }
305
- function multiply(value1, value2) {
306
- return bn_operation(value1, value2, Operations.MULTIPLY);
307
- }
308
- function toUsd(amount, price) {
309
- return multiply(amount, price || 0);
310
- }
311
- ;
312
- function divide(value1, value2) {
313
- return bn_operation(value1, value2, Operations.DIVIDE);
314
- }
315
- function greaterThanOrEqual(value1, value2) {
316
- return Boolean(bn_operation(value1, value2, Operations.GREATER_THAN_OR_EQUAL));
317
- }
318
- function greaterThan(value1, value2) {
319
- return Boolean(bn_operation(value1, value2, Operations.GREATER_THAN));
320
- }
321
- function lessThanOrEqual(value1, value2) {
322
- return Boolean(bn_operation(value1, value2, Operations.LESS_THAN_OR_EQUAL));
323
- }
324
- function lessThan(value1, value2) {
325
- return Boolean(bn_operation(value1, value2, Operations.LESS_THAN));
326
- }
327
- function equal(value1, value2) {
328
- return Boolean(bn_operation(value1, value2, Operations.EQUAL));
329
- }
330
- function mod(value1, value2) {
331
- return bn_operation(value1, value2, Operations.MOD);
332
- }
333
- function modZero(value1, value2) {
334
- return equal(mod(value1, value2), 0);
335
- }
336
- function bn_operation(a, b, operation) {
337
- a = new bignumber_js_1.default(String(a));
338
- b = new bignumber_js_1.default(String(b));
339
- switch (operation.toLowerCase()) {
340
- case '-':
341
- return a.minus(b).toString();
342
- case '+':
343
- return a.plus(b).toString();
344
- case '*':
345
- case 'x':
346
- return a.multipliedBy(b).toString();
347
- case '÷':
348
- case '/':
349
- return a.dividedBy(b).toString();
350
- case '>=':
351
- return a.isGreaterThanOrEqualTo(b);
352
- case '>':
353
- return a.isGreaterThan(b);
354
- case '<=':
355
- return a.isLessThanOrEqualTo(b);
356
- case '<':
357
- return a.isLessThan(b);
358
- case '==':
359
- return a.isEqualTo(b);
360
- case 'mod':
361
- return a.modulo(b);
362
- default:
363
- break;
364
- }
365
- }
366
- function getExponentialNumberComponents(x) {
367
- if (x.toString().includes('e')) {
368
- const parts = x.toString().split('e');
369
- return [parseFloat(parts[0]), parseFloat(parts[1])];
370
- }
371
- return [x, 0];
372
- }
373
- function generateExponentialNumberFromComponents(decimalPart, exponent) {
374
- return decimalPart + (exponent < 0 ? `e${exponent}` : `e+${exponent}`);
375
- }
376
- function roundNumber({ decimalPlaces = 0 }, x) {
377
- if (decimalPlaces > 0) {
378
- const [decimal, decimalExponentialPart] = getExponentialNumberComponents(x);
379
- const [rounded, roundedExponentialPart] = getExponentialNumberComponents(Math.round(Number(generateExponentialNumberFromComponents(decimal, decimalExponentialPart + decimalPlaces))));
380
- return Number(generateExponentialNumberFromComponents(rounded, roundedExponentialPart - decimalPlaces));
381
- }
382
- return Math.round(x);
383
- }
384
- function convertFromBaseUnits(assetDecimals, quantity) {
385
- const decimals = Number(assetDecimals);
386
- return roundNumber({ decimalPlaces: decimals }, Math.pow(10, -decimals) * Number(quantity));
387
- }
388
- function convertToBaseUnits(assetDecimals, quantity) {
389
- const baseAmount = Math.pow(10, Number(assetDecimals)) * Number(quantity);
390
- return roundNumber({ decimalPlaces: 0 }, baseAmount);
391
- }
392
-
393
-
394
- /***/ }),
395
-
396
- /***/ 1283:
397
- /***/ ((__unused_webpack_module, exports) => {
398
-
399
-
400
- Object.defineProperty(exports, "__esModule", ({ value: true }));
401
- exports.StateType = void 0;
402
- var StateType;
403
- (function (StateType) {
404
- StateType["VERSION"] = "version";
405
- StateType["LAST_ALGO_BLOCK"] = "last_algo_block";
406
- StateType["PRICES_PROVIDER_API_KEY"] = "prices_provider_api_key";
407
- StateType["DEFAULT_API_DOMAIN"] = "default_api_domain";
408
- StateType["NONCE_ACCOUNTS_SOLANA"] = "nonce_accounts_solana";
409
- StateType["ARCHIVE_DATA_BATCH_SIZE"] = "archive_data_batch_size";
410
- StateType["ARCHIVE_TASK_LOCK"] = "archive_task_lock";
411
- })(StateType || (exports.StateType = StateType = {}));
412
-
413
-
414
- /***/ }),
415
-
416
- /***/ 1492:
417
- /***/ ((__unused_webpack_module, exports) => {
418
-
419
-
420
- Object.defineProperty(exports, "__esModule", ({ value: true }));
421
- var OrderStatus;
422
- (function (OrderStatus) {
423
- OrderStatus[OrderStatus["Open"] = 1] = "Open";
424
- OrderStatus[OrderStatus["Canceled"] = 2] = "Canceled";
425
- OrderStatus[OrderStatus["Matched"] = 3] = "Matched";
426
- OrderStatus[OrderStatus["SelfMatched"] = 4] = "SelfMatched";
427
- OrderStatus[OrderStatus["Expired"] = 5] = "Expired";
428
- })(OrderStatus || (OrderStatus = {}));
429
- exports["default"] = OrderStatus;
430
-
431
-
432
- /***/ }),
433
-
434
- /***/ 1682:
435
- /***/ ((__unused_webpack_module, exports) => {
436
-
437
-
438
- Object.defineProperty(exports, "__esModule", ({ value: true }));
439
- exports.SettingTypeColumn = void 0;
440
- var SettingTypeColumn;
441
- (function (SettingTypeColumn) {
442
- SettingTypeColumn["STRING"] = "string";
443
- SettingTypeColumn["BOOLEAN"] = "boolean";
444
- SettingTypeColumn["INT"] = "int";
445
- SettingTypeColumn["FLOAT"] = "float";
446
- SettingTypeColumn["SINGLE_CHOICE"] = "single-choice";
447
- SettingTypeColumn["MULTI_CHOICE"] = "multi-choice";
448
- })(SettingTypeColumn || (exports.SettingTypeColumn = SettingTypeColumn = {}));
449
-
450
-
451
- /***/ }),
452
-
453
- /***/ 2137:
454
- /***/ ((__unused_webpack_module, exports) => {
455
-
456
-
457
- Object.defineProperty(exports, "__esModule", ({ value: true }));
458
- exports.mapToCodexBalanceDto = mapToCodexBalanceDto;
459
- function mapToCodexBalanceDto(o) {
460
- return {
461
- hash: o.hash,
462
- loginAddress: o.loginAddress,
463
- loginChainId: o.loginChainId,
464
- tokenId: o.token?.id,
465
- tokenAddress: o.tokenId,
466
- tokenChainId: o.tokenChainId,
467
- amount: o.amount,
468
- lockedAmount: o.lockedAmount
469
- };
470
- }
471
-
472
-
473
- /***/ }),
474
-
475
- /***/ 2224:
476
- /***/ ((__unused_webpack_module, exports) => {
477
-
478
-
479
- Object.defineProperty(exports, "__esModule", ({ value: true }));
480
- exports.AffiliateSortByEnum = void 0;
481
- var AffiliateSortByEnum;
482
- (function (AffiliateSortByEnum) {
483
- AffiliateSortByEnum["INVITED_ACCOUNTS_COUNT"] = "invitedAccountsCount";
484
- AffiliateSortByEnum["CREATED_AT"] = "createdAt";
485
- AffiliateSortByEnum["FEE_SHARE"] = "feeShare";
486
- AffiliateSortByEnum["ADDRESS"] = "address";
487
- AffiliateSortByEnum["REFERRAL_TRADING_VOLUME"] = "referralTradingVolume";
488
- })(AffiliateSortByEnum || (exports.AffiliateSortByEnum = AffiliateSortByEnum = {}));
489
-
490
-
491
- /***/ }),
492
-
493
- /***/ 2228:
494
- /***/ ((__unused_webpack_module, exports) => {
495
-
496
-
497
- Object.defineProperty(exports, "__esModule", ({ value: true }));
498
- exports.HTTPSRPC_MAINNET = exports.HTTPSRPC_TESTNET = exports.ChainNames = exports.Chains = void 0;
499
- var Chains;
500
- (function (Chains) {
501
- Chains[Chains["Solana"] = 1] = "Solana";
502
- Chains[Chains["Algorand"] = 8] = "Algorand";
503
- Chains[Chains["Polygon"] = 5] = "Polygon";
504
- Chains[Chains["Bsc"] = 4] = "Bsc";
505
- Chains[Chains["Avalanche"] = 6] = "Avalanche";
506
- Chains[Chains["Arbitrum"] = 23] = "Arbitrum";
507
- Chains[Chains["Optimism"] = 24] = "Optimism";
508
- Chains[Chains["Base"] = 30] = "Base";
509
- Chains[Chains["Ethereum"] = 2] = "Ethereum";
510
- Chains[Chains["Sepolia"] = 10002] = "Sepolia";
511
- Chains[Chains["ArbitrumSepolia"] = 10003] = "ArbitrumSepolia";
512
- Chains[Chains["BaseSepolia"] = 10004] = "BaseSepolia";
513
- Chains[Chains["OptimismSepolia"] = 10005] = "OptimismSepolia";
514
- Chains[Chains["PolygonAmoy"] = 10007] = "PolygonAmoy";
515
- })(Chains || (exports.Chains = Chains = {}));
516
- exports.ChainNames = {
517
- [Chains.Solana]: "Solana",
518
- [Chains.Ethereum]: "Ethereum",
519
- [Chains.Polygon]: "Polygon",
520
- [Chains.Bsc]: "BNB Chain",
521
- [Chains.Avalanche]: "Avalanche",
522
- [Chains.Algorand]: "Algorand",
523
- [Chains.Arbitrum]: "Arbitrum",
524
- [Chains.Optimism]: "Optimism",
525
- [Chains.Base]: "Base",
526
- [Chains.Sepolia]: "Ethereum Sepolia",
527
- [Chains.ArbitrumSepolia]: "Arbitrum Sepolia",
528
- [Chains.BaseSepolia]: "Base Sepolia",
529
- [Chains.OptimismSepolia]: "Optimism Sepolia",
530
- [Chains.PolygonAmoy]: "Polygon Amoy",
531
- };
532
- exports.HTTPSRPC_TESTNET = {
533
- [Chains.Bsc]: [
534
- '',
535
- 'https://bsc-testnet.public.blastapi.io',
536
- 'https://bsc-testnet.blockpi.network/v1/rpc/private',
537
- 'https://bsc-testnet-rpc.publicnode.com',
538
- 'https://api.zan.top/bsc-testnet',
539
- 'https://data-seed-prebsc-2-s1.bnbchain.org:8545',
540
- 'https://data-seed-prebsc-2-s2.bnbchain.org:8545',
541
- 'https://data-seed-prebsc-2-s3.bnbchain.org:8545',
542
- 'https://data-seed-prebsc-1-s1.bnbchain.org:8545',
543
- 'https://data-seed-prebsc-1-s2.bnbchain.org:8545',
544
- 'https://data-seed-prebsc-1-s3.bnbchain.org:8545',
545
- 'https://endpoints.omniatech.io/v1/bsc/testnet/public',
546
- ],
547
- [Chains.Avalanche]: [
548
- '',
549
- 'https://rpc.ankr.com/avalanche_fuji',
550
- 'https://rpc.ankr.com/avalanche_fuji-c',
551
- 'https://api.avax-test.network/ext/bc/C/rpc',
552
- 'https://ava-testnet.public.blastapi.io/ext/bc/C/rpc',
553
- 'https://endpoints.omniatech.io/v1/avax/fuji/public',
554
- 'https://avalanche-fuji.blockpi.network/v1/rpc/private',
555
- 'https://avalanche-fuji-c-chain-rpc.publicnode.com',
556
- 'https://avalanche-fuji.blockpi.network/v1/rpc/private',
557
- ],
558
- [Chains.Sepolia]: [
559
- 'https://ethereum-sepolia-rpc.publicnode.com',
560
- 'https://sepolia.gateway.tenderly.co',
561
- 'https://eth-sepolia.public.blastapi.io',
562
- 'https://ethereum-sepolia.blockpi.network/v1/rpc/private',
563
- 'https://sepolia.drpc.org',
564
- 'https://endpoints.omniatech.io/v1/eth/sepolia/public',
565
- 'https://1rpc.io/sepolia',
566
- 'https://gateway.tenderly.co/public/sepolia',
567
- 'https://sepolia.gateway.tenderly.co',
568
- 'https://api.zan.top/eth-sepolia',
569
- 'https://ethereum-sepolia.rpc.subquery.network/public',
570
- ],
571
- [Chains.ArbitrumSepolia]: [
572
- '',
573
- 'https://arbitrum-sepolia.blockpi.network/v1/rpc/private ',
574
- 'https://arbitrum-sepolia.gateway.tenderly.co',
575
- 'https://endpoints.omniatech.io/v1/arbitrum/sepolia/public',
576
- 'https://api.zan.top/arb-sepolia',
577
- 'https://sepolia-rollup.arbitrum.io/rpc',
578
- ],
579
- [Chains.BaseSepolia]: [
580
- '',
581
- 'https://sepolia.base.org',
582
- 'https://base-sepolia-rpc.publicnode.com',
583
- 'https://base-sepolia.gateway.tenderly.co',
584
- 'https://base-sepolia.blockpi.network/v1/rpc/private',
585
- 'https://node.histori.xyz/base-sepolia/8ry9f6t9dct1se2hlagxnd9n2a',
586
- ],
587
- [Chains.OptimismSepolia]: [
588
- '',
589
- 'https://optimism-sepolia.blockpi.network/v1/rpc/private',
590
- 'https://sepolia.optimism.io',
591
- 'https://api.zan.top/opt-sepolia',
592
- 'https://optimism-sepolia.gateway.tenderly.co',
593
- 'https://optimism-sepolia.drpc.org',
594
- 'https://endpoints.omniatech.io/v1/op/sepolia/public',
595
- ],
596
- [Chains.PolygonAmoy]: [
597
- 'https://rpc-amoy.polygon.technology',
598
- 'https://polygon-amoy-bor-rpc.publicnode.com',
599
- 'https://rpc.ankr.com/polygon_amoy',
600
- 'https://polygon-amoy.drpc.org',
601
- 'https://api.zan.top/polygon-amoy',
602
- 'https://polygon-amoy.gateway.tenderly.co',
603
- ],
604
- };
605
- exports.HTTPSRPC_MAINNET = {
606
- [Chains.Ethereum]: [
607
- '',
608
- 'https://eth.llamarpc.com',
609
- 'https://ethereum.blockpi.network/v1/rpc/public',
610
- 'https://eth-mainnet.nodereal.io/v1/1659dfb40aa24bbb8153a677b98064d7',
611
- 'https://uk.rpc.blxrbdn.com',
612
- 'https://singapore.rpc.blxrbdn.com',
613
- 'https://virginia.rpc.blxrbdn.com',
614
- 'https://eth-mainnet.public.blastapi.io',
615
- 'https://api.securerpc.com/v1',
616
- 'https://mainnet.gateway.tenderly.co',
617
- 'https://eth-pokt.nodies.app',
618
- 'https://eth.blockrazor.xyz',
619
- 'https://eth.merkle.io',
620
- 'https://gateway.tenderly.co/public/mainnet',
621
- 'https://eth.rpc.blxrbdn.com',
622
- ],
623
- [Chains.Bsc]: [
624
- '',
625
- 'https://bsc.blockrazor.xyz',
626
- 'https://bscrpc.com',
627
- 'https://bsc-mainnet.public.blastapi.io',
628
- 'https://binance.llamarpc.com',
629
- 'https://go.getblock.io/cc778cdbdf5c4b028ec9456e0e6c0cf3',
630
- 'https://bsc-pokt.nodies.app',
631
- 'https://56.rpc.thirdweb.com',
632
- 'https://bsc.blockpi.network/v1/rpc/private',
633
- 'https://bsc.rpc.blxrbdn.com',
634
- 'https://bsc-dataseed.bnbchain.org',
635
- 'https://endpoints.omniatech.io/v1/bsc/mainnet/public',
636
- 'https://bsc-dataseed1.ninicoin.io',
637
- 'https://bsc-dataseed2.defibit.io',
638
- 'https://bsc-dataseed2.ninicoin.io',
639
- 'https://0.48.club',
640
- 'https://bsc-dataseed3.defibit.io',
641
- ],
642
- [Chains.Polygon]: [
643
- '',
644
- 'https://polygon.llamarpc.com',
645
- 'https://polygon-rpc.com',
646
- 'https://rpc-mainnet.matic.quiknode.pro',
647
- 'https://endpoints.omniatech.io/v1/matic/mainnet/public',
648
- 'https://polygon-pokt.nodies.app',
649
- 'https://polygon-bor-rpc.publicnode.com',
650
- 'https://polygon.rpc.subquery.network/public',
651
- 'https://polygon-bor-rpc.publicnode.com',
652
- 'https://polygon.blockpi.network/v1/rpc/private',
653
- 'https://polygon.api.onfinality.io/public',
654
- 'https://polygon.lava.build',
655
- 'https://api.zan.top/polygon-mainnet',
656
- 'https://polygon.meowrpc.com',
657
- ],
658
- [Chains.Avalanche]: [
659
- '',
660
- 'https://avalanche-c-chain-rpc.publicnode.com',
661
- 'https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc',
662
- 'https://endpoints.omniatech.io/v1/avax/mainnet/public',
663
- 'https://avalanche-c-chain-rpc.publicnode.com',
664
- 'https://avalanche.blockpi.network/v1/rpc/private',
665
- 'https://avalanche.public-rpc.com',
666
- 'https://avalanche.drpc.org',
667
- 'https://avax.meowrpc.com',
668
- 'https://endpoints.omniatech.io/v1/avax/mainnet/public',
669
- 'https://api.avax.network/ext/bc/C/rpc',
670
- 'https://1rpc.io/avax/c',
671
- 'https://avax-pokt.nodies.app/ext/bc/C/rpc',
672
- 'https://endpoints.omniatech.io/v1/avax/mainnet/public',
673
- 'https://api.zan.top/avax-mainnet/ext/bc/C/rpc',
674
- ],
675
- [Chains.Arbitrum]: [
676
- '',
677
- 'https://arbitrum.llamarpc.com',
678
- 'https://arbitrum.rpc.subquery.network/public',
679
- 'https://endpoints.omniatech.io/v1/arbitrum/one/public',
680
- 'https://arbitrum.meowrpc.com',
681
- 'https://arbitrum.gateway.tenderly.co',
682
- 'https://arbitrum-one.public.blastapi.io',
683
- 'https://arb1.lava.build',
684
- 'https://arbitrum-one.publicnode.com',
685
- 'https://arbitrum.blockpi.network/v1/rpc/public',
686
- 'https://arb-pokt.nodies.app',
687
- 'https://api.zan.top/arb-one',
688
- 'https://arb1.arbitrum.io/rpc',
689
- 'https://arbitrum.drpc.org',
690
- 'https://1rpc.io/arb',
691
- ],
692
- [Chains.Optimism]: [
693
- '',
694
- 'https://optimism.llamarpc.com',
695
- 'https://op-pokt.nodies.app',
696
- 'https://optimism-mainnet.public.blastapi.io',
697
- 'https://optimism.blockpi.network/v1/rpc/public',
698
- 'https://endpoints.omniatech.io/v1/op/mainnet/public',
699
- 'https://optimism-rpc.publicnode.com',
700
- 'https://optimism.drpc.org',
701
- 'https://1rpc.io/op',
702
- 'https://optimism.gateway.tenderly.co',
703
- 'https://optimism.lava.build',
704
- 'https://optimism.rpc.subquery.network/public',
705
- 'https://mainnet.optimism.io',
706
- 'https://optimism-rpc.publicnode.com',
707
- 'https://gateway.tenderly.co/public/optimism',
708
- ],
709
- [Chains.Base]: [
710
- '',
711
- 'https://base.llamarpc.com',
712
- 'https://base-mainnet.public.blastapi.io',
713
- 'https://base-rpc.publicnode.com',
714
- 'https://base.blockpi.network/v1/rpc/public',
715
- 'https://base.drpc.org',
716
- 'https://mainnet.base.org',
717
- 'https://base.api.onfinality.io/public',
718
- 'https://base-pokt.nodies.app',
719
- 'https://1rpc.io/base',
720
- 'https://developer-access-mainnet.base.org',
721
- 'https://endpoints.omniatech.io/v1/base/mainnet/public',
722
- 'https://base.rpc.subquery.network/public',
723
- 'https://base.api.onfinality.io/public',
724
- 'https://base.meowrpc.com',
725
- 'https://base.gateway.tenderly.co',
726
- ],
727
- };
728
-
729
-
730
- /***/ }),
731
-
732
- /***/ 2623:
733
- /***/ ((__unused_webpack_module, exports) => {
734
-
735
-
736
- Object.defineProperty(exports, "__esModule", ({ value: true }));
737
- exports.TransactionType = exports.CCTPStatus = exports.ActionTypeEnum = exports.OperationStatusEnum = void 0;
738
- var OperationStatusEnum;
739
- (function (OperationStatusEnum) {
740
- OperationStatusEnum["Pending"] = "pending";
741
- OperationStatusEnum["Completed"] = "completed";
742
- OperationStatusEnum["Failed"] = "failed";
743
- OperationStatusEnum["Received"] = "received";
744
- })(OperationStatusEnum || (exports.OperationStatusEnum = OperationStatusEnum = {}));
745
- var ActionTypeEnum;
746
- (function (ActionTypeEnum) {
747
- ActionTypeEnum["Deposit"] = "deposit";
748
- ActionTypeEnum["Withdraw"] = "withdraw";
749
- ActionTypeEnum["Rebalance"] = "rebalance";
750
- })(ActionTypeEnum || (exports.ActionTypeEnum = ActionTypeEnum = {}));
751
- var CCTPStatus;
752
- (function (CCTPStatus) {
753
- CCTPStatus["PENDING"] = "pending";
754
- CCTPStatus["COMPLETED"] = "completed";
755
- CCTPStatus["FAILED"] = "failed";
756
- })(CCTPStatus || (exports.CCTPStatus = CCTPStatus = {}));
757
- var TransactionType;
758
- (function (TransactionType) {
759
- TransactionType["USER_TO_TMC"] = "user_to_tmc";
760
- TransactionType["TMC_TO_USER"] = "tmc_to_user";
761
- TransactionType["RELAYER_TO_TMC"] = "relayer_to_tmc";
762
- TransactionType["RELAYER_TO_CODEX"] = "relayer_to_codex";
763
- TransactionType["RELAYER_TO_CIRCLE"] = "relayer_to_circle";
764
- })(TransactionType || (exports.TransactionType = TransactionType = {}));
765
-
766
-
767
- /***/ }),
768
-
769
- /***/ 2739:
770
- /***/ ((__unused_webpack_module, exports) => {
771
-
772
-
773
- Object.defineProperty(exports, "__esModule", ({ value: true }));
774
- exports.Notification = void 0;
775
- var Notification;
776
- (function (Notification) {
777
- Notification[Notification["SELF_TRADE"] = 1] = "SELF_TRADE";
778
- Notification[Notification["FULL_FILLED"] = 2] = "FULL_FILLED";
779
- Notification[Notification["FULL_CANCELLED"] = 3] = "FULL_CANCELLED";
780
- Notification[Notification["PARTIALLY_CANCELLED"] = 4] = "PARTIALLY_CANCELLED";
781
- Notification[Notification["CREATED"] = 5] = "CREATED";
782
- })(Notification || (exports.Notification = Notification = {}));
783
-
784
-
785
- /***/ }),
786
-
787
- /***/ 2797:
788
- /***/ ((__unused_webpack_module, exports) => {
789
-
790
-
791
- Object.defineProperty(exports, "__esModule", ({ value: true }));
792
- var AvailablePairSettings;
793
- (function (AvailablePairSettings) {
794
- AvailablePairSettings["MFT_AUDIO_LINK"] = "mft.audioLink";
795
- AvailablePairSettings["MFT_TITLE"] = "mft.title";
796
- AvailablePairSettings["MODE_PRE_SALE"] = "mode.preSale";
797
- AvailablePairSettings["MAKER_FEE"] = "makerFee";
798
- AvailablePairSettings["TAKER_FEE"] = "takerFee";
799
- AvailablePairSettings["VIEW_BASE_COIN_ICON_LINK"] = "view.baseCoinIconLink";
800
- AvailablePairSettings["VIEW_BASE_COIN_MARKET_LINK"] = "view.baseCoinMarketLink";
801
- AvailablePairSettings["VIEW_PRICE_COIN_ICON_LINK"] = "view.priceCoinIconLink";
802
- AvailablePairSettings["VIEW_PRICE_COIN_MARKET_LINK"] = "view.priceCoinMarketLink";
803
- })(AvailablePairSettings || (AvailablePairSettings = {}));
804
- exports["default"] = AvailablePairSettings;
805
-
806
-
807
- /***/ }),
808
-
809
- /***/ 3004:
810
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
811
-
812
-
813
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
814
- if (k2 === undefined) k2 = k;
815
- var desc = Object.getOwnPropertyDescriptor(m, k);
816
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
817
- desc = { enumerable: true, get: function() { return m[k]; } };
818
- }
819
- Object.defineProperty(o, k2, desc);
820
- }) : (function(o, m, k, k2) {
821
- if (k2 === undefined) k2 = k;
822
- o[k2] = m[k];
823
- }));
824
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
825
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
826
- };
827
- var __importDefault = (this && this.__importDefault) || function (mod) {
828
- return (mod && mod.__esModule) ? mod : { "default": mod };
829
- };
830
- Object.defineProperty(exports, "__esModule", ({ value: true }));
831
- exports.TradingKeyType = exports.OrderType = exports.OrderStatus = exports.OrderSide = exports.AvailablePairSettings = void 0;
832
- const available_pair_settings_enum_1 = __importDefault(__webpack_require__(2797));
833
- exports.AvailablePairSettings = available_pair_settings_enum_1.default;
834
- const order_side_enum_1 = __importDefault(__webpack_require__(835));
835
- exports.OrderSide = order_side_enum_1.default;
836
- const order_status_enum_1 = __importDefault(__webpack_require__(1492));
837
- exports.OrderStatus = order_status_enum_1.default;
838
- const order_type_enum_1 = __importDefault(__webpack_require__(1134));
839
- exports.OrderType = order_type_enum_1.default;
840
- const tradingKeyType_enum_1 = __webpack_require__(3487);
841
- Object.defineProperty(exports, "TradingKeyType", ({ enumerable: true, get: function () { return tradingKeyType_enum_1.TradingKeyType; } }));
842
- __exportStar(__webpack_require__(893), exports);
843
- __exportStar(__webpack_require__(3338), exports);
844
- __exportStar(__webpack_require__(3245), exports);
845
- __exportStar(__webpack_require__(6828), exports);
846
- __exportStar(__webpack_require__(2224), exports);
847
- __exportStar(__webpack_require__(892), exports);
848
- __exportStar(__webpack_require__(2623), exports);
849
- __exportStar(__webpack_require__(3854), exports);
850
- __exportStar(__webpack_require__(4132), exports);
851
- __exportStar(__webpack_require__(3516), exports);
852
- __exportStar(__webpack_require__(4199), exports);
853
- __exportStar(__webpack_require__(1682), exports);
854
- __exportStar(__webpack_require__(1283), exports);
855
- __exportStar(__webpack_require__(5237), exports);
856
- __exportStar(__webpack_require__(1048), exports);
857
-
858
-
859
- /***/ }),
860
-
861
- /***/ 3245:
862
- /***/ ((__unused_webpack_module, exports) => {
863
-
864
-
865
- Object.defineProperty(exports, "__esModule", ({ value: true }));
866
- exports.PromptTypeEnum = void 0;
867
- var PromptTypeEnum;
868
- (function (PromptTypeEnum) {
869
- PromptTypeEnum["INSTRUCTIONS"] = "INSTRUCTIONS";
870
- PromptTypeEnum["TEXT_STYLE"] = "TEXT_STYLE";
871
- PromptTypeEnum["TEXT_TONE"] = "TEXT_TONE";
872
- PromptTypeEnum["REACTION_TYPE"] = "REACTION_TYPE";
873
- PromptTypeEnum["COMMENT_LENGTH"] = "COMMENT_LENGTH";
874
- PromptTypeEnum["CONTEXT"] = "CONTEXT";
875
- })(PromptTypeEnum || (exports.PromptTypeEnum = PromptTypeEnum = {}));
876
-
877
-
878
- /***/ }),
879
-
880
- /***/ 3338:
881
- /***/ ((__unused_webpack_module, exports) => {
882
-
883
-
884
- Object.defineProperty(exports, "__esModule", ({ value: true }));
885
- exports.TweetType = exports.SeasonStatusEnum = void 0;
886
- var SeasonStatusEnum;
887
- (function (SeasonStatusEnum) {
888
- SeasonStatusEnum["CREATED"] = "created";
889
- SeasonStatusEnum["STARTED"] = "started";
890
- SeasonStatusEnum["PAUSED"] = "paused";
891
- SeasonStatusEnum["CLOSED"] = "closed";
892
- })(SeasonStatusEnum || (exports.SeasonStatusEnum = SeasonStatusEnum = {}));
893
- var TweetType;
894
- (function (TweetType) {
895
- TweetType["Post"] = "POST";
896
- TweetType["Comment"] = "COMMENT";
897
- })(TweetType || (exports.TweetType = TweetType = {}));
898
-
899
-
900
- /***/ }),
901
-
902
- /***/ 3487:
903
- /***/ ((__unused_webpack_module, exports) => {
904
-
905
-
906
- Object.defineProperty(exports, "__esModule", ({ value: true }));
907
- exports.TradingKeyType = void 0;
908
- var TradingKeyType;
909
- (function (TradingKeyType) {
910
- TradingKeyType["User"] = "User";
911
- TradingKeyType["Api"] = "API";
912
- })(TradingKeyType || (exports.TradingKeyType = TradingKeyType = {}));
913
-
914
-
915
- /***/ }),
916
-
917
- /***/ 3516:
918
- /***/ ((__unused_webpack_module, exports) => {
919
-
920
-
921
- Object.defineProperty(exports, "__esModule", ({ value: true }));
922
- exports.SortDirectionEnum = void 0;
923
- var SortDirectionEnum;
924
- (function (SortDirectionEnum) {
925
- SortDirectionEnum["ASCENDING"] = "ASC";
926
- SortDirectionEnum["DESCENDING"] = "DESC";
927
- })(SortDirectionEnum || (exports.SortDirectionEnum = SortDirectionEnum = {}));
928
-
929
-
930
- /***/ }),
931
-
932
- /***/ 3528:
933
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
934
-
935
-
936
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
937
- if (k2 === undefined) k2 = k;
938
- var desc = Object.getOwnPropertyDescriptor(m, k);
939
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
940
- desc = { enumerable: true, get: function() { return m[k]; } };
941
- }
942
- Object.defineProperty(o, k2, desc);
943
- }) : (function(o, m, k, k2) {
944
- if (k2 === undefined) k2 = k;
945
- o[k2] = m[k];
946
- }));
947
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
948
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
949
- };
950
- Object.defineProperty(exports, "__esModule", ({ value: true }));
951
- __exportStar(__webpack_require__(9321), exports);
952
- __exportStar(__webpack_require__(8398), exports);
953
- __exportStar(__webpack_require__(696), exports);
954
- __exportStar(__webpack_require__(1174), exports);
955
-
956
-
957
- /***/ }),
958
-
959
- /***/ 3854:
960
- /***/ ((__unused_webpack_module, exports) => {
961
-
962
-
963
- Object.defineProperty(exports, "__esModule", ({ value: true }));
964
- exports.TradeSubStatus = exports.TradeStatus = void 0;
965
- var TradeStatus;
966
- (function (TradeStatus) {
967
- TradeStatus["Unconfirmed"] = "UNCONFIRMED";
968
- TradeStatus["Confirmed"] = "CONFIRMED";
969
- TradeStatus["Rejected"] = "REJECTED";
970
- })(TradeStatus || (exports.TradeStatus = TradeStatus = {}));
971
- var TradeSubStatus;
972
- (function (TradeSubStatus) {
973
- TradeSubStatus["RESUBMITTED"] = "RESUBMITTED";
974
- TradeSubStatus["PROCESSED"] = "PROCESSED";
975
- TradeSubStatus["REMATCHED"] = "REMATCHED";
976
- })(TradeSubStatus || (exports.TradeSubStatus = TradeSubStatus = {}));
977
-
978
-
979
- /***/ }),
980
-
981
- /***/ 4132:
982
- /***/ ((__unused_webpack_module, exports) => {
983
-
984
-
985
- Object.defineProperty(exports, "__esModule", ({ value: true }));
986
- exports.MarketMakerSortByEnum = exports.MarketMakerRebateTier = void 0;
987
- var MarketMakerRebateTier;
988
- (function (MarketMakerRebateTier) {
989
- MarketMakerRebateTier[MarketMakerRebateTier["FIRST"] = 1] = "FIRST";
990
- MarketMakerRebateTier[MarketMakerRebateTier["SECOND"] = 2] = "SECOND";
991
- MarketMakerRebateTier[MarketMakerRebateTier["THIRD"] = 3] = "THIRD";
992
- MarketMakerRebateTier[MarketMakerRebateTier["FOURTH"] = 4] = "FOURTH";
993
- })(MarketMakerRebateTier || (exports.MarketMakerRebateTier = MarketMakerRebateTier = {}));
994
- var MarketMakerSortByEnum;
995
- (function (MarketMakerSortByEnum) {
996
- MarketMakerSortByEnum["REBATE_TIER"] = "rebateTier";
997
- MarketMakerSortByEnum["CREATED_AT"] = "createdAt";
998
- MarketMakerSortByEnum["NAME"] = "name";
999
- MarketMakerSortByEnum["TAKER_FEE"] = "takerFee";
1000
- MarketMakerSortByEnum["ENABLED"] = "enabled";
1001
- MarketMakerSortByEnum["ADDRESS"] = "address";
1002
- MarketMakerSortByEnum["CHAIN"] = "chainId";
1003
- })(MarketMakerSortByEnum || (exports.MarketMakerSortByEnum = MarketMakerSortByEnum = {}));
1004
-
1005
-
1006
- /***/ }),
1007
-
1008
- /***/ 4199:
1009
- /***/ ((__unused_webpack_module, exports) => {
1010
-
1011
-
1012
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1013
- exports.ScheduledNotificationStatusEnum = exports.NotificationStatusEnum = exports.NotificationPriorityEnum = exports.CombinedNotificationEnum = exports.AccountNotificationEnum = exports.GlobalNotificationEnum = void 0;
1014
- var GlobalNotificationEnum;
1015
- (function (GlobalNotificationEnum) {
1016
- GlobalNotificationEnum["GLOBAL_PAIR_DELISTING"] = "GLOBAL_PAIR_DELISTING";
1017
- GlobalNotificationEnum["GLOBAL_NEW_PAIR_LISTING"] = "GLOBAL_NEW_PAIR_LISTING";
1018
- GlobalNotificationEnum["GLOBAL_SYSTEM_MAINTENANCE"] = "GLOBAL_SYSTEM_MAINTENANCE";
1019
- GlobalNotificationEnum["GLOBAL_SMART_CONTRACT_UPDATE"] = "GLOBAL_SMART_CONTRACT_UPDATE";
1020
- })(GlobalNotificationEnum || (exports.GlobalNotificationEnum = GlobalNotificationEnum = {}));
1021
- var AccountNotificationEnum;
1022
- (function (AccountNotificationEnum) {
1023
- AccountNotificationEnum["ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT"] = "ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT";
1024
- AccountNotificationEnum["ACCOUNT_KYC_STATUS_CHANGED"] = "ACCOUNT_KYC_STATUS_CHANGED";
1025
- AccountNotificationEnum["ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED"] = "ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED";
1026
- })(AccountNotificationEnum || (exports.AccountNotificationEnum = AccountNotificationEnum = {}));
1027
- exports.CombinedNotificationEnum = {
1028
- ...GlobalNotificationEnum,
1029
- ...AccountNotificationEnum,
1030
- };
1031
- var NotificationPriorityEnum;
1032
- (function (NotificationPriorityEnum) {
1033
- NotificationPriorityEnum["CRITICAL"] = "CRITICAL";
1034
- NotificationPriorityEnum["IMPORTANT"] = "IMPORTANT";
1035
- NotificationPriorityEnum["INFO"] = "INFO";
1036
- })(NotificationPriorityEnum || (exports.NotificationPriorityEnum = NotificationPriorityEnum = {}));
1037
- var NotificationStatusEnum;
1038
- (function (NotificationStatusEnum) {
1039
- NotificationStatusEnum["UNREAD"] = "UNREAD";
1040
- NotificationStatusEnum["READ"] = "READ";
1041
- })(NotificationStatusEnum || (exports.NotificationStatusEnum = NotificationStatusEnum = {}));
1042
- var ScheduledNotificationStatusEnum;
1043
- (function (ScheduledNotificationStatusEnum) {
1044
- ScheduledNotificationStatusEnum["PENDING"] = "PENDING";
1045
- ScheduledNotificationStatusEnum["PROCESSED"] = "PROCESSED";
1046
- ScheduledNotificationStatusEnum["FAILED"] = "FAILED";
1047
- })(ScheduledNotificationStatusEnum || (exports.ScheduledNotificationStatusEnum = ScheduledNotificationStatusEnum = {}));
1048
-
1049
-
1050
- /***/ }),
1051
-
1052
- /***/ 4978:
1053
- /***/ ((module) => {
1054
-
1055
- module.exports = require("bignumber.js");
1056
-
1057
- /***/ }),
1058
-
1059
- /***/ 5237:
1060
- /***/ ((__unused_webpack_module, exports) => {
1061
-
1062
-
1063
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1064
- exports.UpgradeStatus = void 0;
1065
- var UpgradeStatus;
1066
- (function (UpgradeStatus) {
1067
- UpgradeStatus["SUCCESS"] = "success";
1068
- UpgradeStatus["FAILED"] = "failed";
1069
- UpgradeStatus["PENDING"] = "pending";
1070
- })(UpgradeStatus || (exports.UpgradeStatus = UpgradeStatus = {}));
1071
-
1072
-
1073
- /***/ }),
1074
-
1075
- /***/ 5320:
1076
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1077
-
1078
-
1079
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1080
- exports.mapToUserTradeDto = mapToUserTradeDto;
1081
- exports.mapToOrderTradeDto = mapToOrderTradeDto;
1082
- exports.isMaker = isMaker;
1083
- const order_helper_1 = __webpack_require__(7542);
1084
- const utils_1 = __webpack_require__(8398);
1085
- const big_number_helper_1 = __webpack_require__(1174);
1086
- const _enums_1 = __webpack_require__(9965);
1087
- function mapToUserTradeDto(t, baseAsset, priceAsset) {
1088
- const o = t.buyOrder && t.sellOrder
1089
- ? (t.buyOrderId > t.sellOrderId ? t.buyOrder : t.sellOrder)
1090
- : (t.buyOrder || t.sellOrder);
1091
- return {
1092
- pairId: t.pairId,
1093
- orderId: o?.id,
1094
- orderSide: (o && (0, order_helper_1.mapOrderSideToShort)(o.side)),
1095
- ...mapAssets(baseAsset, priceAsset),
1096
- ...mapTrade(t, o),
1097
- };
1098
- }
1099
- function mapToOrderTradeDto(order, trades, pairKey, baseAsset, priceAsset) {
1100
- return {
1101
- id: order.id,
1102
- pairId: order.pairId,
1103
- pair: pairKey || order.pair?.pairKey,
1104
- ...mapAssets(baseAsset, priceAsset),
1105
- amount: order.amount,
1106
- price: order.price,
1107
- total: order.total,
1108
- filledAmount: order.filledAmount,
1109
- filledTotal: order.filledTotal,
1110
- avgPrice: order.excutedPrice,
1111
- status: order.status,
1112
- side: order.side,
1113
- type: order.type,
1114
- userId: order.userId,
1115
- createdAt: order.createdAt?.getTime(),
1116
- completedAt: order.completedAt?.getTime() || null,
1117
- updatedAt: order.updatedAt?.getTime(),
1118
- trades: trades && trades.map((t) => mapTrade(t, order)),
1119
- };
1120
- }
1121
- function mapAssets(baseAsset, priceAsset) {
1122
- return {
1123
- baseTokenId: baseAsset?.id,
1124
- baseTokenDecimal: baseAsset?.decimals,
1125
- quoteTokenId: priceAsset?.id,
1126
- quoteTokenDecimal: priceAsset?.decimals,
1127
- };
1128
- }
1129
- function mapTrade(t, o) {
1130
- return {
1131
- tradeId: t.tradeId,
1132
- status: t.txStatus,
1133
- amount: t.amount,
1134
- total: t.total,
1135
- price: t.price,
1136
- fee: o && t.tradeFees
1137
- .filter(f => (0, utils_1.equalIgnoreCase)(f.address, o.userId))
1138
- .reduce((acc, cur) => (0, big_number_helper_1.plus)(acc, cur.fee), '0'),
1139
- createdAt: t.createdAt?.getTime(),
1140
- updatedAt: t.updatedAt?.getTime(),
1141
- isBuyer: o && o.side === _enums_1.OrderSide.Buy,
1142
- isMaker: o && isMaker(o.side, t.tradeSide),
1143
- };
1144
- }
1145
- function isMaker(oSide, tSide) {
1146
- return oSide === _enums_1.OrderSide.Buy && tSide === _enums_1.OrderSide.Sell
1147
- || oSide === _enums_1.OrderSide.Sell && tSide === _enums_1.OrderSide.Buy;
1148
- }
1149
-
1150
-
1151
- /***/ }),
1152
-
1153
- /***/ 6119:
1154
- /***/ ((__unused_webpack_module, exports) => {
1155
-
1156
-
1157
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1158
- exports.TwitterAccessScopeEnum = void 0;
1159
- var TwitterAccessScopeEnum;
1160
- (function (TwitterAccessScopeEnum) {
1161
- TwitterAccessScopeEnum["USERS_READ"] = "users.read";
1162
- TwitterAccessScopeEnum["FOLLOWS_READ"] = "follows.read";
1163
- TwitterAccessScopeEnum["FOLLOWS_WRITE"] = "follows.write";
1164
- TwitterAccessScopeEnum["TWEET_READ"] = "tweet.read";
1165
- TwitterAccessScopeEnum["TWEET_WRITE"] = "tweet.write";
1166
- TwitterAccessScopeEnum["OFFLINE_ACCESS"] = "offline.access";
1167
- TwitterAccessScopeEnum["LIKE_READ"] = "like.read";
1168
- TwitterAccessScopeEnum["LIKE_WRITE"] = "like.write";
1169
- })(TwitterAccessScopeEnum || (exports.TwitterAccessScopeEnum = TwitterAccessScopeEnum = {}));
1170
-
1171
-
1172
- /***/ }),
1173
-
1174
- /***/ 6828:
1175
- /***/ ((__unused_webpack_module, exports) => {
1176
-
1177
-
1178
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1179
- exports.KYCAuthenticationStatus = exports.LastLookAction = exports.FeeTier = void 0;
1180
- var FeeTier;
1181
- (function (FeeTier) {
1182
- FeeTier[FeeTier["FEE_TIER_1"] = 1] = "FEE_TIER_1";
1183
- FeeTier[FeeTier["FEE_TIER_2"] = 2] = "FEE_TIER_2";
1184
- FeeTier[FeeTier["FEE_TIER_3"] = 3] = "FEE_TIER_3";
1185
- FeeTier[FeeTier["FEE_TIER_4"] = 4] = "FEE_TIER_4";
1186
- FeeTier[FeeTier["FEE_TIER_5"] = 5] = "FEE_TIER_5";
1187
- FeeTier[FeeTier["FEE_TIER_6"] = 6] = "FEE_TIER_6";
1188
- })(FeeTier || (exports.FeeTier = FeeTier = {}));
1189
- var LastLookAction;
1190
- (function (LastLookAction) {
1191
- LastLookAction[LastLookAction["Approve"] = 1] = "Approve";
1192
- LastLookAction[LastLookAction["Reject"] = 0] = "Reject";
1193
- })(LastLookAction || (exports.LastLookAction = LastLookAction = {}));
1194
- var KYCAuthenticationStatus;
1195
- (function (KYCAuthenticationStatus) {
1196
- KYCAuthenticationStatus["INITIATED"] = "INITIATED";
1197
- KYCAuthenticationStatus["CREATED"] = "CREATED";
1198
- KYCAuthenticationStatus["PROCESSING"] = "PROCESSING";
1199
- KYCAuthenticationStatus["APPROVED"] = "APPROVED";
1200
- KYCAuthenticationStatus["REJECTED"] = "REJECTED";
1201
- })(KYCAuthenticationStatus || (exports.KYCAuthenticationStatus = KYCAuthenticationStatus = {}));
1202
-
1203
-
1204
- /***/ }),
1205
-
1206
- /***/ 6978:
1207
- /***/ ((__unused_webpack_module, exports) => {
1208
-
1209
-
1210
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1211
- exports.MaintenanceMode = void 0;
1212
- var MaintenanceMode;
1213
- (function (MaintenanceMode) {
1214
- MaintenanceMode[MaintenanceMode["Off"] = 0] = "Off";
1215
- MaintenanceMode[MaintenanceMode["Full"] = 1] = "Full";
1216
- MaintenanceMode[MaintenanceMode["Partial"] = 2] = "Partial";
1217
- MaintenanceMode[MaintenanceMode["Scheduled"] = 3] = "Scheduled";
1218
- })(MaintenanceMode || (exports.MaintenanceMode = MaintenanceMode = {}));
1219
-
1220
-
1221
- /***/ }),
1222
-
1223
- /***/ 7542:
1224
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1225
-
1226
-
1227
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1228
- exports.mapOrderSideFromShort = mapOrderSideFromShort;
1229
- exports.mapOrderSideToShort = mapOrderSideToShort;
1230
- exports.mapOrderTypeShort = mapOrderTypeShort;
1231
- exports.mapOrderSideFromShortToLong = mapOrderSideFromShortToLong;
1232
- exports.mapOrderTypeShortToLong = mapOrderTypeShortToLong;
1233
- const _enums_1 = __webpack_require__(9965);
1234
- function mapOrderSideFromShort(value) {
1235
- switch (value) {
1236
- case "B": return _enums_1.OrderSide.Buy;
1237
- case "S": return _enums_1.OrderSide.Sell;
1238
- default:
1239
- throw new Error("Unknown order side short type: " + value);
1240
- }
1241
- }
1242
- function mapOrderSideToShort(value) {
1243
- switch (value) {
1244
- case _enums_1.OrderSide.Buy: return "B";
1245
- case _enums_1.OrderSide.Sell: return "S";
1246
- default:
1247
- throw new Error("Unknown order side type: " + value);
1248
- }
1249
- }
1250
- function mapOrderTypeShort(value) {
1251
- switch (value) {
1252
- case "I": return _enums_1.OrderType.IOC;
1253
- case "P": return _enums_1.OrderType.POST;
1254
- case "M": return _enums_1.OrderType.Market;
1255
- case "L":
1256
- default:
1257
- return _enums_1.OrderType.Limit;
1258
- }
1259
- }
1260
- function mapOrderSideFromShortToLong(value) {
1261
- switch (value) {
1262
- case "B": return "BUY";
1263
- case "S": return "SELL";
1264
- default:
1265
- throw new Error("Unknown order side short type: " + value);
1266
- }
1267
- }
1268
- function mapOrderTypeShortToLong(value) {
1269
- switch (value) {
1270
- case "I": return "IOC";
1271
- case "P": return "POST";
1272
- case "M": return "Market";
1273
- case "L":
1274
- default:
1275
- return "Limit";
1276
- }
1277
- }
1278
-
1279
-
1280
- /***/ }),
1281
-
1282
- /***/ 8115:
1283
- /***/ ((module) => {
1284
-
1285
- module.exports = require("algosdk");
1286
-
1287
- /***/ }),
1288
-
1289
- /***/ 8398:
1290
- /***/ ((__unused_webpack_module, exports) => {
1291
-
1292
-
1293
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1294
- exports.equalIgnoreCase = exports.listDateFormat = void 0;
1295
- exports.getRandomInt = getRandomInt;
1296
- exports.getDomains = getDomains;
1297
- exports.cutEvent = cutEvent;
1298
- exports.maskingString = maskingString;
1299
- exports.removeField = removeField;
1300
- const listDateFormat = (date) => {
1301
- let newDAte = new Date(date);
1302
- let parsedDate = newDAte.toLocaleDateString('default', {
1303
- year: 'numeric',
1304
- month: 'numeric',
1305
- day: 'numeric',
1306
- });
1307
- let time = newDAte.toLocaleTimeString('en-US', {
1308
- hour12: true,
1309
- hour: '2-digit',
1310
- minute: '2-digit',
1311
- });
1312
- return parsedDate + ' ' + time;
1313
- };
1314
- exports.listDateFormat = listDateFormat;
1315
- const equalIgnoreCase = (value1, value2) => {
1316
- return String(value1).toLowerCase() === String(value2).toLowerCase();
1317
- };
1318
- exports.equalIgnoreCase = equalIgnoreCase;
1319
- function getRandomInt(min, max) {
1320
- min = Math.ceil(min);
1321
- max = Math.floor(max);
1322
- return Math.floor(Math.random() * (max - min + 1)) + min;
1323
- }
1324
- function getDomains(domain) {
1325
- const domains = [];
1326
- const parts = domain.split('.');
1327
- for (let i = 0; i < parts.length - 1; i++) {
1328
- domains.push(parts.slice(i).join('.'));
1329
- }
1330
- return domains;
1331
- }
1332
- ;
1333
- function cutEvent(event) {
1334
- const headers = event.headers && removeUndefined({
1335
- 'Authorization': event.headers['Authorization']?.substring(0, 200),
1336
- 'CloudFront-Viewer-Country': event.headers['CloudFront-Viewer-Country'],
1337
- 'Host': event.headers['Host'],
1338
- 'origin': event.headers['origin'],
1339
- 'Referer': event.headers['Referer'],
1340
- 'User-Agent': event.headers['User-Agent'],
1341
- 'wl-domain': event.headers['wl-domain'],
1342
- 'X-API-Key': maskingString(event.headers['X-API-Key']),
1343
- 'X-Forwarded-For': event.headers['X-Forwarded-For'],
1344
- 'X-Forwarded-Port': event.headers['X-Forwarded-Port'],
1345
- 'X-Forwarded-Proto': event.headers['X-Forwarded-Proto'],
1346
- 'X-Trading-Key': event.headers['X-Trading-Key'],
1347
- 'X-Wallet-Address': event.headers['X-Wallet-Address'],
1348
- 'X-Wallet-Token': event.headers['X-Wallet-Token'],
1349
- 'accessToken': maskingString(event.headers['accessToken']),
1350
- 'companyId': event.headers['companyId'],
1351
- 'seasonId': event.headers['seasonId'],
1352
- });
1353
- const requestContext = event.requestContext && removeUndefined({
1354
- identity: event.requestContext.identity && removeUndefined({
1355
- 'userAgent': event.requestContext.identity['userAgent'],
1356
- 'sourceIp': event.requestContext.identity['sourceIp'],
1357
- }),
1358
- domainName: event.requestContext.domainName,
1359
- });
1360
- return removeUndefined({
1361
- manage: event.manage,
1362
- path: event.path,
1363
- httpMethod: event.httpMethod,
1364
- headers,
1365
- requestContext,
1366
- });
1367
- }
1368
- function maskingString(str) {
1369
- if (!str?.length)
1370
- return str;
1371
- const maskLen = Math.round(str.length / 3);
1372
- const start = maskLen;
1373
- const end = str.length - maskLen;
1374
- const maskedStr = str.substring(0, start) + "*".repeat(maskLen) + str.substring(end);
1375
- return maskedStr;
1376
- }
1377
- function removeField(obj, fieldToRemove) {
1378
- if (Array.isArray(obj)) {
1379
- return obj.map(item => removeField(item, fieldToRemove));
1380
- }
1381
- else if (typeof obj === 'object' && obj !== null) {
1382
- return Object.fromEntries(Object.entries(obj)
1383
- .filter(([key]) => key !== fieldToRemove)
1384
- .map(([key, value]) => [key, removeField(value, fieldToRemove)]));
1385
- }
1386
- return obj;
1387
- }
1388
- function removeUndefined(obj) {
1389
- return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
1390
- }
1391
-
1392
-
1393
- /***/ }),
1394
-
1395
- /***/ 8593:
1396
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1397
-
1398
-
1399
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1400
- if (k2 === undefined) k2 = k;
1401
- var desc = Object.getOwnPropertyDescriptor(m, k);
1402
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1403
- desc = { enumerable: true, get: function() { return m[k]; } };
1404
- }
1405
- Object.defineProperty(o, k2, desc);
1406
- }) : (function(o, m, k, k2) {
1407
- if (k2 === undefined) k2 = k;
1408
- o[k2] = m[k];
1409
- }));
1410
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1411
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1412
- }) : function(o, v) {
1413
- o["default"] = v;
1414
- });
1415
- var __importStar = (this && this.__importStar) || (function () {
1416
- var ownKeys = function(o) {
1417
- ownKeys = Object.getOwnPropertyNames || function (o) {
1418
- var ar = [];
1419
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
1420
- return ar;
1421
- };
1422
- return ownKeys(o);
1423
- };
1424
- return function (mod) {
1425
- if (mod && mod.__esModule) return mod;
1426
- var result = {};
1427
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
1428
- __setModuleDefault(result, mod);
1429
- return result;
1430
- };
1431
- })();
1432
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1433
- exports.decodeAddress = exports.encodeAddress = void 0;
1434
- exports.concatArrays = concatArrays;
1435
- exports.packData = packData;
1436
- exports.unpackData = unpackData;
1437
- exports.encodeArgArray = encodeArgArray;
1438
- exports.encodeString = encodeString;
1439
- exports.decodeString = decodeString;
1440
- exports.encode32Bytes = encode32Bytes;
1441
- exports.encodeUint64 = encodeUint64;
1442
- exports.decodeUint64 = decodeUint64;
1443
- exports.encodeBase64 = encodeBase64;
1444
- exports.decodeBase64 = decodeBase64;
1445
- exports.compareArrays = compareArrays;
1446
- exports.getDeltaUint = getDeltaUint;
1447
- exports.getDeltaBytes = getDeltaBytes;
1448
- exports.toUnix = toUnix;
1449
- exports.fromUnix = fromUnix;
1450
- const algosdk_1 = __importStar(__webpack_require__(8115));
1451
- const buffer_1 = __webpack_require__(9428);
1452
- function concatArrays(arrays) {
1453
- return arrays.reduce((a, b) => Uint8Array.from([...a, ...b]));
1454
- }
1455
- function packData(value, format) {
1456
- const chunks = [];
1457
- for (const [name, type] of Object.entries(format)) {
1458
- const v = value[name];
1459
- if (v === undefined) {
1460
- throw new Error(`Key ${name} missing from value`);
1461
- }
1462
- switch (type.type) {
1463
- case 'address':
1464
- if (v instanceof Uint8Array && v.length == 32) {
1465
- chunks.push(v);
1466
- break;
1467
- }
1468
- else if (typeof v === 'string') {
1469
- chunks.push((0, algosdk_1.decodeAddress)(v).publicKey);
1470
- }
1471
- else {
1472
- throw new Error(`${name}: Expected address, got ${v}`);
1473
- }
1474
- break;
1475
- case 'bytes':
1476
- if (v instanceof Uint8Array) {
1477
- if (v.length == type.size) {
1478
- chunks.push(v);
1479
- break;
1480
- }
1481
- else {
1482
- throw new Error(`${name}: Bytes length is wrong, expected ${type.size}, got ${v.length}`);
1483
- }
1484
- }
1485
- else {
1486
- throw new Error(`${name}: Expected bytes[${type.size}], got ${v}`);
1487
- }
1488
- case 'double':
1489
- if (typeof v === 'number') {
1490
- const bytes = new ArrayBuffer(8);
1491
- buffer_1.Buffer.from(bytes).writeDoubleLE(v, 0);
1492
- chunks.push(new Uint8Array(bytes));
1493
- break;
1494
- }
1495
- else {
1496
- throw new Error(`${name}: Expected double, got ${v}`);
1497
- }
1498
- case 'number':
1499
- case 'uint':
1500
- if (typeof v === 'bigint' || typeof v === 'number') {
1501
- chunks.push(encodeUint64(v));
1502
- break;
1503
- }
1504
- else {
1505
- throw new Error(`${name}: Expected uint or number, got ${v}`);
1506
- }
1507
- case 'string':
1508
- if (typeof v === 'string') {
1509
- const str = encodeString(v);
1510
- if (str.length == type.size) {
1511
- chunks.push(str);
1512
- break;
1513
- }
1514
- else {
1515
- throw new Error(`${name}: Expected string length ${type.size}, got string length ${str.length}`);
1516
- }
1517
- }
1518
- else {
1519
- throw new Error(`${name}: Expected string length ${type.size}, got ${v}`);
1520
- }
1521
- }
1522
- }
1523
- return concatArrays(chunks);
1524
- }
1525
- function unpackData(data, format) {
1526
- const result = new Map();
1527
- let index = 0;
1528
- for (const [name, type] of Object.entries(format)) {
1529
- if (index >= data.length) {
1530
- throw new Error('Array index out of bounds');
1531
- }
1532
- let value;
1533
- switch (type.type) {
1534
- case 'address':
1535
- value = (0, algosdk_1.encodeAddress)(data.slice(index, index + 32));
1536
- index += 32;
1537
- break;
1538
- case 'bytes':
1539
- value = data.slice(index, index + type.size);
1540
- index += type.size;
1541
- break;
1542
- case 'double':
1543
- value = buffer_1.Buffer.from(data.slice(index, index + 8)).readDoubleLE(0);
1544
- index += 8;
1545
- break;
1546
- case 'number':
1547
- value = Number(decodeUint64(data.slice(index, index + 8)));
1548
- index += 8;
1549
- break;
1550
- case 'uint':
1551
- value = decodeUint64(data.slice(index, index + 8));
1552
- index += 8;
1553
- break;
1554
- case 'string':
1555
- value = decodeString(data.slice(index, index + type.size));
1556
- index += type.size;
1557
- break;
1558
- }
1559
- result.set(name, value);
1560
- }
1561
- return Object.fromEntries(result);
1562
- }
1563
- function encodeArgArray(params) {
1564
- return params.map(param => {
1565
- if (param instanceof Uint8Array)
1566
- return new Uint8Array(param);
1567
- if (typeof param === "string")
1568
- return encodeString(param);
1569
- if (typeof param === "boolean")
1570
- param = BigInt(param ? 1 : 0);
1571
- if (typeof param === "number")
1572
- param = BigInt(param);
1573
- return encodeUint64(param);
1574
- });
1575
- }
1576
- function encodeString(value) {
1577
- return new Uint8Array(buffer_1.Buffer.from(value));
1578
- }
1579
- function decodeString(value) {
1580
- return buffer_1.Buffer.from(value).toString('utf-8');
1581
- }
1582
- function encode32Bytes(value) {
1583
- const valueButes = algosdk_1.default.encodeUint64(value);
1584
- return concatArrays([new Uint8Array(32 - valueButes.length), valueButes]);
1585
- }
1586
- function encodeUint64(value) {
1587
- const bytes = buffer_1.Buffer.alloc(8);
1588
- for (let index = 0; index < 8; index++)
1589
- bytes[7 - index] = Number((BigInt(value) >> BigInt(index * 8)) & BigInt(0xFF));
1590
- return new Uint8Array(bytes);
1591
- }
1592
- function decodeUint64(value) {
1593
- let num = BigInt(0);
1594
- for (let index = 0; index < 8 && value?.length; index++)
1595
- num = (num << BigInt(8)) | BigInt(value[index]);
1596
- return num;
1597
- }
1598
- function encodeBase64(value) {
1599
- return buffer_1.Buffer.from(value).toString('base64');
1600
- }
1601
- function decodeBase64(value) {
1602
- return buffer_1.Buffer.from(value, 'base64');
1603
- }
1604
- function compareArrays(a, b) {
1605
- return a.length === b.length && a.reduce((equal, item, index) => equal && item === b[index], true);
1606
- }
1607
- function getDelta(response, key) {
1608
- const delta = response['global-state-delta'].find((v) => v.key === key);
1609
- if (delta === undefined)
1610
- return undefined;
1611
- return delta['value'];
1612
- }
1613
- function getDeltaUint(response, key) {
1614
- const delta = getDelta(response, key);
1615
- if (delta === undefined)
1616
- return undefined;
1617
- return BigInt(delta['uint']);
1618
- }
1619
- function getDeltaBytes(response, key) {
1620
- const delta = getDelta(response, key);
1621
- if (delta === undefined)
1622
- return undefined;
1623
- return decodeBase64(delta['bytes']);
1624
- }
1625
- function toUnix(date) {
1626
- return Math.floor(date.getTime() / 1000);
1627
- }
1628
- function fromUnix(timestamp) {
1629
- return new Date(timestamp * 1000);
1630
- }
1631
- var algosdk_2 = __webpack_require__(8115);
1632
- Object.defineProperty(exports, "encodeAddress", ({ enumerable: true, get: function () { return algosdk_2.encodeAddress; } }));
1633
- Object.defineProperty(exports, "decodeAddress", ({ enumerable: true, get: function () { return algosdk_2.decodeAddress; } }));
1634
-
1635
-
1636
- /***/ }),
1637
-
1638
- /***/ 9275:
1639
- /***/ ((__unused_webpack_module, exports) => {
1640
-
1641
-
1642
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1643
- exports.RabbitConnectionStatus = void 0;
1644
- var RabbitConnectionStatus;
1645
- (function (RabbitConnectionStatus) {
1646
- RabbitConnectionStatus["CONNECTED"] = "CONNECTED";
1647
- RabbitConnectionStatus["CONNECTING"] = "CONNECTING";
1648
- RabbitConnectionStatus["DISCONNECTED"] = "DISCONNECTED";
1649
- RabbitConnectionStatus["DISCONNECTING"] = "DISCONNECTING";
1650
- RabbitConnectionStatus["PENDING"] = "PENDING";
1651
- })(RabbitConnectionStatus || (exports.RabbitConnectionStatus = RabbitConnectionStatus = {}));
1652
-
1653
-
1654
- /***/ }),
1655
-
1656
- /***/ 9321:
1657
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1658
-
1659
-
1660
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1661
- if (k2 === undefined) k2 = k;
1662
- var desc = Object.getOwnPropertyDescriptor(m, k);
1663
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1664
- desc = { enumerable: true, get: function() { return m[k]; } };
1665
- }
1666
- Object.defineProperty(o, k2, desc);
1667
- }) : (function(o, m, k, k2) {
1668
- if (k2 === undefined) k2 = k;
1669
- o[k2] = m[k];
1670
- }));
1671
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
1672
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1673
- };
1674
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1675
- __exportStar(__webpack_require__(221), exports);
1676
- __exportStar(__webpack_require__(2137), exports);
1677
- __exportStar(__webpack_require__(5320), exports);
1678
-
1679
-
1680
- /***/ }),
1681
-
1682
- /***/ 9428:
1683
- /***/ ((module) => {
1684
-
1685
- module.exports = require("buffer");
1686
-
1687
- /***/ }),
1688
-
1689
- /***/ 9965:
1690
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1691
-
1692
-
1693
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1694
- if (k2 === undefined) k2 = k;
1695
- var desc = Object.getOwnPropertyDescriptor(m, k);
1696
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1697
- desc = { enumerable: true, get: function() { return m[k]; } };
1698
- }
1699
- Object.defineProperty(o, k2, desc);
1700
- }) : (function(o, m, k, k2) {
1701
- if (k2 === undefined) k2 = k;
1702
- o[k2] = m[k];
1703
- }));
1704
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
1705
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1706
- };
1707
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1708
- __exportStar(__webpack_require__(2228), exports);
1709
- __exportStar(__webpack_require__(6978), exports);
1710
- __exportStar(__webpack_require__(2739), exports);
1711
- __exportStar(__webpack_require__(6119), exports);
1712
- __exportStar(__webpack_require__(3004), exports);
1713
- __exportStar(__webpack_require__(9275), exports);
1714
-
1715
-
1716
- /***/ })
1717
-
1718
- /******/ });
1719
- /************************************************************************/
1720
- /******/ // The module cache
1721
- /******/ var __webpack_module_cache__ = {};
1722
- /******/
1723
- /******/ // The require function
1724
- /******/ function __webpack_require__(moduleId) {
1725
- /******/ // Check if module is in cache
1726
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
1727
- /******/ if (cachedModule !== undefined) {
1728
- /******/ return cachedModule.exports;
1729
- /******/ }
1730
- /******/ // Create a new module (and put it into the cache)
1731
- /******/ var module = __webpack_module_cache__[moduleId] = {
1732
- /******/ // no module.id needed
1733
- /******/ // no module.loaded needed
1734
- /******/ exports: {}
1735
- /******/ };
1736
- /******/
1737
- /******/ // Execute the module function
1738
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1739
- /******/
1740
- /******/ // Return the exports of the module
1741
- /******/ return module.exports;
1742
- /******/ }
1743
- /******/
1744
- /************************************************************************/
1745
- /******/
1746
- /******/ // startup
1747
- /******/ // Load entry module and return exports
1748
- /******/ // This entry module is referenced by other modules so it can't be inlined
1749
- /******/ var __webpack_exports__ = __webpack_require__(3528);
1750
- /******/ module.exports = __webpack_exports__;
1751
- /******/
1752
- /******/ })()
1753
- ;
1
+ var H=Object.create;var d=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var r in t)d(e,r,{get:t[r],enumerable:!0})},_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of z(t))!Y.call(e,o)&&o!==r&&d(e,o,{get:()=>t[o],enumerable:!(n=W(t,o))||n.enumerable});return e};var m=(e,t,r)=>(r=e!=null?H(K(e)):{},_(t||!e||!e.__esModule?d(r,"default",{value:e,enumerable:!0}):r,e)),q=e=>_(d({},"__esModule",{value:!0}),e);var Te={};$(Te,{Operations:()=>L,absolute:()=>re,bn_operation:()=>p,ceil:()=>ne,convertFromBaseUnits:()=>be,convertToBaseUnits:()=>Ee,cutEvent:()=>te,divide:()=>ce,encodeMessage:()=>Ae,equal:()=>g,equalIgnoreCase:()=>E,floor:()=>ie,generateTxnForSign:()=>v,getDomains:()=>ee,getRandomInt:()=>Z,greaterThan:()=>le,greaterThanOrEqual:()=>de,isMaker:()=>P,lessThan:()=>me,lessThanOrEqual:()=>ue,listDateFormat:()=>Q,mapToCodexAssetDto:()=>X,mapToCodexBalanceDto:()=>j,mapToOrderTradeDto:()=>ge,mapToUserTradeDto:()=>Ie,maskingString:()=>h,minus:()=>pe,mod:()=>w,modZero:()=>he,multiply:()=>S,plus:()=>I,removeField:()=>b,round:()=>se,roundNumber:()=>A,signTxn:()=>fe,toFixed:()=>oe,toUsd:()=>ae});module.exports=q(Te);function X(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 j(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 O=(r=>(r[r.Buy=0]="Buy",r[r.Sell=1]="Sell",r))(O||{}),a=O;var N=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(N||{}),C=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(C||{}),Ke={...N,...C};function R(e){switch(e){case a.Buy:return"B";case a.Sell:return"S";default:throw new Error("Unknown order side type: "+e)}}var Q=e=>{let t=new Date(e),r=t.toLocaleDateString("default",{year:"numeric",month:"numeric",day:"numeric"}),n=t.toLocaleTimeString("en-US",{hour12:!0,hour:"2-digit",minute:"2-digit"});return r+" "+n},E=(e,t)=>String(e).toLowerCase()===String(t).toLowerCase();function Z(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function ee(e){let t=[],r=e.split(".");for(let n=0;n<r.length-1;n++)t.push(r.slice(n).join("."));return t}function te(e){let t=e.headers&&l({Authorization:e.headers.Authorization?.substring(0,200),"CloudFront-Viewer-Country":e.headers["CloudFront-Viewer-Country"],Host:e.headers.Host,origin:e.headers.origin,Referer:e.headers.Referer,"User-Agent":e.headers["User-Agent"],"wl-domain":e.headers["wl-domain"],"X-API-Key":h(e.headers["X-API-Key"]),"X-Forwarded-For":e.headers["X-Forwarded-For"],"X-Forwarded-Port":e.headers["X-Forwarded-Port"],"X-Forwarded-Proto":e.headers["X-Forwarded-Proto"],"X-Trading-Key":e.headers["X-Trading-Key"],"X-Wallet-Address":e.headers["X-Wallet-Address"],"X-Wallet-Token":e.headers["X-Wallet-Token"],accessToken:h(e.headers.accessToken),companyId:e.headers.companyId,seasonId:e.headers.seasonId}),r=e.requestContext&&l({identity:e.requestContext.identity&&l({userAgent:e.requestContext.identity.userAgent,sourceIp:e.requestContext.identity.sourceIp}),domainName:e.requestContext.domainName});return l({manage:e.manage,path:e.path,httpMethod:e.httpMethod,headers:t,requestContext:r})}function h(e){if(!e?.length)return e;let t=Math.round(e.length/3),r=t,n=e.length-t;return e.substring(0,r)+"*".repeat(t)+e.substring(n)}function b(e,t){return Array.isArray(e)?e.map(r=>b(r,t)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).filter(([r])=>r!==t).map(([r,n])=>[r,b(n,t)])):e}function l(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}var i=m(require("bignumber.js"));i.default.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var L=(s=>(s.MINUS="-",s.PLUS="+",s.MULTIPLY="*",s.DIVIDE="/",s.GREATER_THAN_OR_EQUAL=">=",s.GREATER_THAN=">",s.LESS_THAN_OR_EQUAL="<=",s.LESS_THAN="<",s.EQUAL="==",s.MOD="mod",s))(L||{});function re(e){return new i.default(e).abs().toString()}function ne(e){let r=new i.default(String(e)).integerValue(i.default.ROUND_CEIL).toString();return g(e,r)||console.log("Ceil value",{value:e,res:r}),r}function oe(e,t,r=!1){let n=new i.default(String(e)),o;if(r){let c=n.toFixed(),x=c.indexOf(".");if(x>=0){let M=c.slice(x+1),T=0;for(let s of M)if(s==="0")T++;else break;let V=T+1;o=n.toFixed(V,i.default.ROUND_UP)}else o=n.toFixed(0)}else o=n.toFixed(t);return console.log("Fixed value",{value:e,res:o}),o}function ie(e){let r=new i.default(String(e)).integerValue(i.default.ROUND_FLOOR).toString();return console.log("Floor value",{value:e,res:r}),r}function se(e){let r=new i.default(String(e)).integerValue(i.default.ROUND_HALF_UP).toString();return console.log("Round value",{value:e,res:r}),r}function I(e,t){return p(e,t,"+")}function pe(e,t){return p(e,t,"-")}function S(e,t){return p(e,t,"*")}function ae(e,t){return S(e,t||0)}function ce(e,t){return p(e,t,"/")}function de(e,t){return!!p(e,t,">=")}function le(e,t){return!!p(e,t,">")}function ue(e,t){return!!p(e,t,"<=")}function me(e,t){return!!p(e,t,"<")}function g(e,t){return!!p(e,t,"==")}function w(e,t){return p(e,t,"mod")}function he(e,t){return g(w(e,t),0)}function p(e,t,r){switch(e=new i.default(String(e)),t=new i.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 D(e){if(e.toString().includes("e")){let t=e.toString().split("e");return[parseFloat(t[0]),parseFloat(t[1])]}return[e,0]}function y(e,t){return e+(t<0?`e${t}`:`e+${t}`)}function A({decimalPlaces:e=0},t){if(e>0){let[r,n]=D(t),[o,c]=D(Math.round(Number(y(r,n+e))));return Number(y(o,c-e))}return Math.round(t)}function be(e,t){let r=Number(e);return A({decimalPlaces:r},Math.pow(10,-r)*Number(t))}function Ee(e,t){let r=Math.pow(10,Number(e))*Number(t);return A({decimalPlaces:0},r)}function Ie(e,t,r){let n=e.buyOrder&&e.sellOrder?e.buyOrderId>e.sellOrderId?e.buyOrder:e.sellOrder:e.buyOrder||e.sellOrder;return{pairId:e.pairId,orderId:n?.id,orderSide:n&&R(n.side),...U(t,r),...k(e,n)}}function ge(e,t,r,n,o){return{id:e.id,pairId:e.pairId,pair:r||e.pair?.pairKey,...U(n,o),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(c=>k(c,e))}}function U(e,t){return{baseTokenId:e?.id,baseTokenDecimal:e?.decimals,quoteTokenId:t?.id,quoteTokenDecimal:t?.decimals}}function k(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,n)=>I(r,n.fee),"0"),createdAt:e.createdAt?.getTime(),updatedAt:e.updatedAt?.getTime(),isBuyer:t&&t.side===a.Buy,isMaker:t&&P(t.side,e.tradeSide)}}function P(e,t){return e===a.Buy&&t===a.Sell||e===a.Sell&&t===a.Buy}var u=m(require("algosdk"));var f=m(require("algosdk")),F=require("buffer"),G=require("algosdk");function B(e){return new Uint8Array(F.Buffer.from(e))}function Ae(e){return B(e)}function v(e,t,r){return u.default.makePaymentTxnWithSuggestedParamsFromObject({from:e,to:e,amount:0,note:t&&new Uint8Array(Buffer.from(t,r)),suggestedParams:{fee:0,firstRound:1,lastRound:2,genesisHash:"SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=",genesisID:"testnet-v1.0"}})}function fe(e,t,r,n){return xe(v(e,t,r),n)}async function xe(e,t){let r=u.default.encodeUnsignedTransaction(e),n=await t([r]),o=u.default.decodeSignedTransaction(n[0]);return new Uint8Array(o.sig)}0&&(module.exports={Operations,absolute,bn_operation,ceil,convertFromBaseUnits,convertToBaseUnits,cutEvent,divide,encodeMessage,equal,equalIgnoreCase,floor,generateTxnForSign,getDomains,getRandomInt,greaterThan,greaterThanOrEqual,isMaker,lessThan,lessThanOrEqual,listDateFormat,mapToCodexAssetDto,mapToCodexBalanceDto,mapToOrderTradeDto,mapToUserTradeDto,maskingString,minus,mod,modZero,multiply,plus,removeField,round,roundNumber,signTxn,toFixed,toUsd});