@ultrade/shared 1.0.2 → 1.0.4

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 (38) hide show
  1. package/dist/common/index.d.ts +0 -6
  2. package/dist/common/index.js +0 -739
  3. package/dist/constants/index.d.ts +0 -1
  4. package/dist/constants/index.js +0 -78
  5. package/dist/helpers/assert.helper.js +0 -78
  6. package/dist/helpers/atomic.helper.js +0 -78
  7. package/dist/helpers/balance.helper.js +0 -78
  8. package/dist/helpers/codex/common.helper.js +0 -78
  9. package/dist/helpers/codex/index.js +0 -78
  10. package/dist/helpers/codex/mbr.helper.js +0 -78
  11. package/dist/helpers/codex/mna.helper.js +0 -78
  12. package/dist/helpers/codex/order.helper.js +0 -78
  13. package/dist/helpers/codex/setGlobal.helper.js +0 -78
  14. package/dist/helpers/codex/transfer.helper.js +0 -78
  15. package/dist/helpers/codex/txn.helper.js +0 -78
  16. package/dist/helpers/codex.helper.js +0 -78
  17. package/dist/helpers/eth.helper.js +0 -78
  18. package/dist/helpers/vaa.helper.js +0 -78
  19. package/dist/helpers/withdraw.helper.js +0 -78
  20. package/package.json +3 -11
  21. package/dist/common/awsKms.d.ts +0 -2
  22. package/dist/common/awsKms.js +0 -255
  23. package/dist/common/indexer.helper.d.ts +0 -2
  24. package/dist/common/indexer.helper.js +0 -377
  25. package/dist/common/logger.d.ts +0 -32
  26. package/dist/common/logger.js +0 -178
  27. package/dist/common/migration.helpers.d.ts +0 -4
  28. package/dist/common/migration.helpers.js +0 -33
  29. package/dist/common/redis.helper.d.ts +0 -27
  30. package/dist/common/redis.helper.js +0 -249
  31. package/dist/common/secret.helper.d.ts +0 -28
  32. package/dist/common/secret.helper.js +0 -129
  33. package/dist/constants/queue.d.ts +0 -39
  34. package/dist/helpers/email.helper.d.ts +0 -5
  35. package/dist/helpers/email.helper.js +0 -101
  36. package/dist/helpers/hummingbots.helper.d.ts +0 -2
  37. package/dist/helpers/hummingbots.helper.js +0 -152
  38. package/dist/interfaces/controller.interface.d.ts +0 -6
@@ -1,152 +0,0 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ var __webpack_modules__ = ({
4
-
5
- /***/ 913:
6
- /***/ ((module) => {
7
-
8
- module.exports = require("yaml");
9
-
10
- /***/ }),
11
-
12
- /***/ 3089:
13
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
14
-
15
-
16
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- var desc = Object.getOwnPropertyDescriptor(m, k);
19
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
- desc = { enumerable: true, get: function() { return m[k]; } };
21
- }
22
- Object.defineProperty(o, k2, desc);
23
- }) : (function(o, m, k, k2) {
24
- if (k2 === undefined) k2 = k;
25
- o[k2] = m[k];
26
- }));
27
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
- Object.defineProperty(o, "default", { enumerable: true, value: v });
29
- }) : function(o, v) {
30
- o["default"] = v;
31
- });
32
- var __importStar = (this && this.__importStar) || (function () {
33
- var ownKeys = function(o) {
34
- ownKeys = Object.getOwnPropertyNames || function (o) {
35
- var ar = [];
36
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
37
- return ar;
38
- };
39
- return ownKeys(o);
40
- };
41
- return function (mod) {
42
- if (mod && mod.__esModule) return mod;
43
- var result = {};
44
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
45
- __setModuleDefault(result, mod);
46
- return result;
47
- };
48
- })();
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", ({ value: true }));
53
- exports.encryptSecretValue = encryptSecretValue;
54
- exports.createStrategyHash = createStrategyHash;
55
- const crypto_1 = __importDefault(__webpack_require__(6982));
56
- const ethUtil = __importStar(__webpack_require__(7835));
57
- const yaml_1 = __webpack_require__(913);
58
- function encryptSecretValue(password, value) {
59
- const passwordBytes = Buffer.from(password, 'utf-8');
60
- const kdf = 'pbkdf2';
61
- const dklen = 32;
62
- const salt = crypto_1.default.randomBytes(16);
63
- const iterations = 1000000;
64
- const hashFunction = 'hmac-sha256';
65
- const derivedKey = crypto_1.default.pbkdf2Sync(passwordBytes, salt, iterations, dklen, 'sha256');
66
- const iv = crypto_1.default.randomBytes(16);
67
- const encryptKey = derivedKey.slice(0, 16);
68
- const cipher = crypto_1.default.createCipheriv('aes-128-ctr', encryptKey, iv);
69
- const ciphertext = Buffer.concat([cipher.update(Buffer.from(value, 'utf-8')), cipher.final()]);
70
- const mac = ethUtil.keccak256(Buffer.concat([derivedKey.slice(16, 32), ciphertext]));
71
- const keyfileJson = {
72
- crypto: {
73
- cipher: 'aes-128-ctr',
74
- cipherparams: {
75
- iv: iv.toString('hex'),
76
- },
77
- ciphertext: ciphertext.toString('hex'),
78
- kdf: kdf,
79
- kdfparams: {
80
- c: iterations,
81
- dklen: dklen,
82
- prf: hashFunction,
83
- salt: salt.toString('hex'),
84
- },
85
- mac: mac.toString(),
86
- },
87
- version: 3,
88
- };
89
- const jsonStr = JSON.stringify(keyfileJson);
90
- const encryptedValue = Buffer.from(jsonStr).toString('hex');
91
- return encryptedValue;
92
- }
93
- function createStrategyHash(partnerId, yamlString) {
94
- const yamlAsJson = JSON.stringify((0, yaml_1.parse)(yamlString));
95
- const combinedString = `${partnerId}:${yamlAsJson}`;
96
- const hash = crypto_1.default.createHash('sha256').update(combinedString).digest('hex');
97
- return hash;
98
- }
99
-
100
-
101
- /***/ }),
102
-
103
- /***/ 6982:
104
- /***/ ((module) => {
105
-
106
- module.exports = require("crypto");
107
-
108
- /***/ }),
109
-
110
- /***/ 7835:
111
- /***/ ((module) => {
112
-
113
- module.exports = require("ethereumjs-util");
114
-
115
- /***/ })
116
-
117
- /******/ });
118
- /************************************************************************/
119
- /******/ // The module cache
120
- /******/ var __webpack_module_cache__ = {};
121
- /******/
122
- /******/ // The require function
123
- /******/ function __webpack_require__(moduleId) {
124
- /******/ // Check if module is in cache
125
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
126
- /******/ if (cachedModule !== undefined) {
127
- /******/ return cachedModule.exports;
128
- /******/ }
129
- /******/ // Create a new module (and put it into the cache)
130
- /******/ var module = __webpack_module_cache__[moduleId] = {
131
- /******/ // no module.id needed
132
- /******/ // no module.loaded needed
133
- /******/ exports: {}
134
- /******/ };
135
- /******/
136
- /******/ // Execute the module function
137
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
138
- /******/
139
- /******/ // Return the exports of the module
140
- /******/ return module.exports;
141
- /******/ }
142
- /******/
143
- /************************************************************************/
144
- /******/
145
- /******/ // startup
146
- /******/ // Load entry module and return exports
147
- /******/ // This entry module is referenced by other modules so it can't be inlined
148
- /******/ var __webpack_exports__ = __webpack_require__(3089);
149
- /******/ module.exports = __webpack_exports__;
150
- /******/
151
- /******/ })()
152
- ;
@@ -1,6 +0,0 @@
1
- import { Router } from 'express';
2
- interface Controller {
3
- path: string;
4
- router: Router;
5
- }
6
- export default Controller;