@sonarwatch/portfolio-core 0.5.2 → 0.5.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.
- package/CHANGELOG.md +17 -9
- package/package.json +1 -1
- package/src/BorrowLendRate.d.ts +12 -0
- package/src/BorrowLendRate.js +5 -0
- package/src/BorrowLendRate.js.map +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/utils/index.d.ts +0 -1
- package/src/utils/index.js +0 -1
- package/src/utils/index.js.map +1 -1
- package/src/helpers/runInBatch.d.ts +0 -1
- package/src/helpers/runInBatch.js +0 -25
- package/src/helpers/runInBatch.js.map +0 -1
- package/src/helpers/sleep.d.ts +0 -1
- package/src/helpers/sleep.js +0 -20
- package/src/helpers/sleep.js.map +0 -1
- package/src/utils/md5.d.ts +0 -2
- package/src/utils/md5.js +0 -17
- package/src/utils/md5.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,18 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
-
## [0.5.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## [0.5.1](https://github.com/sonarwatch/portfolio/compare/core-0.5.0...core-0.5.1) (2023-07-20)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# [0.5.0](https://github.com/sonarwatch/portfolio/compare/core-0.4.49...core-0.5.0) (2023-07-20)
|
|
5
|
+
## [0.5.4](https://github.com/sonarwatch/portfolio/compare/core-0.5.3...core-0.5.4) (2023-07-21)
|
|
14
6
|
|
|
15
7
|
|
|
16
8
|
|
|
9
|
+
## [0.5.3](https://github.com/sonarwatch/portfolio/compare/core-0.5.2...core-0.5.3) (2023-07-20)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [0.5.2](https://github.com/sonarwatch/portfolio/compare/core-0.5.1...core-0.5.2) (2023-07-20)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.5.1](https://github.com/sonarwatch/portfolio/compare/core-0.5.0...core-0.5.1) (2023-07-20)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# [0.5.0](https://github.com/sonarwatch/portfolio/compare/core-0.4.49...core-0.5.0) (2023-07-20)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
17
25
|
## [0.4.49](https://github.com/sonarwatch/portfolio/compare/core-0.4.48...core-0.4.49) (2023-07-19)
|
|
18
26
|
|
|
19
27
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Yield } from './Yield';
|
|
2
|
+
export declare const borrowLendRatesPrefix = "bl-rates";
|
|
3
|
+
export type BorrowLendRate = {
|
|
4
|
+
tokenAddress: string;
|
|
5
|
+
depositYield: Yield;
|
|
6
|
+
depositedAmount: number;
|
|
7
|
+
borrowYield: Yield;
|
|
8
|
+
borrowedAmount: number;
|
|
9
|
+
utilizationRatio?: number;
|
|
10
|
+
platformId: string;
|
|
11
|
+
poolName: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BorrowLendRate.js","sourceRoot":"","sources":["../../../../packages/core/src/BorrowLendRate.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAG,UAAU,CAAC"}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -26,4 +26,5 @@ __exportStar(require("./Portfolio"), exports);
|
|
|
26
26
|
__exportStar(require("./TokenList"), exports);
|
|
27
27
|
__exportStar(require("./TokenPrice"), exports);
|
|
28
28
|
__exportStar(require("./Yield"), exports);
|
|
29
|
+
__exportStar(require("./BorrowLendRate"), exports);
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/core/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/core/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,0CAAwB;AACxB,mDAAiC"}
|
package/src/utils/index.d.ts
CHANGED
package/src/utils/index.js
CHANGED
|
@@ -35,5 +35,4 @@ __exportStar(require("./sortPortfolioElement"), exports);
|
|
|
35
35
|
__exportStar(require("./sortPortfolioElements"), exports);
|
|
36
36
|
__exportStar(require("./assertNetworkId"), exports);
|
|
37
37
|
__exportStar(require("./assertAddressSystem"), exports);
|
|
38
|
-
__exportStar(require("./md5"), exports);
|
|
39
38
|
//# sourceMappingURL=index.js.map
|
package/src/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,iDAA+B;AAC/B,sDAAoC;AACpC,kDAAgC;AAChC,uDAAqC;AACrC,4DAA0C;AAC1C,gDAA8B;AAC9B,oDAAkC;AAClC,qDAAmC;AACnC,+DAA6C;AAC7C,2DAAyC;AACzC,uDAAqC;AACrC,kEAAgD;AAChD,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,oDAAkC;AAClC,wDAAsC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,iDAA+B;AAC/B,sDAAoC;AACpC,kDAAgC;AAChC,uDAAqC;AACrC,4DAA0C;AAC1C,gDAA8B;AAC9B,oDAAkC;AAClC,qDAAmC;AACnC,+DAA6C;AAC7C,2DAAyC;AACzC,uDAAqC;AACrC,kEAAgD;AAChD,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,oDAAkC;AAClC,wDAAsC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function runInBatch<T>(functionsToRun: (() => Promise<T>)[], batchSize?: number): Promise<PromiseSettledResult<T>[]>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function runInBatch(functionsToRun, batchSize = 100) {
|
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
const results = [];
|
|
15
|
-
while (functionsToRun.length !== 0) {
|
|
16
|
-
const currFunctionsToRun = functionsToRun.splice(0, batchSize);
|
|
17
|
-
const promises = currFunctionsToRun.map((fToRun) => fToRun());
|
|
18
|
-
const currResults = yield Promise.allSettled(promises);
|
|
19
|
-
results.push(...currResults);
|
|
20
|
-
}
|
|
21
|
-
return results;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
exports.default = runInBatch;
|
|
25
|
-
//# sourceMappingURL=runInBatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runInBatch.js","sourceRoot":"","sources":["../../../../../packages/core/src/helpers/runInBatch.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAA8B,UAAU,CACtC,cAAoC,EACpC,SAAS,GAAG,GAAG;;QAEf,MAAM,OAAO,GAA8B,EAAE,CAAC;QAE9C,OAAO,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YAClC,MAAM,kBAAkB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;YAC/D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;YAC9D,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACvD,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;SAC9B;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AAdD,6BAcC"}
|
package/src/helpers/sleep.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function sleep(ms?: number): Promise<unknown>;
|
package/src/helpers/sleep.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function sleep(ms = 100) {
|
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
return new Promise((r) => {
|
|
15
|
-
setTimeout(r, ms);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
exports.default = sleep;
|
|
20
|
-
//# sourceMappingURL=sleep.js.map
|
package/src/helpers/sleep.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../../../../packages/core/src/helpers/sleep.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAA8B,KAAK,CAAC,EAAE,GAAG,GAAG;;QAC1C,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACvB,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAJD,wBAIC"}
|
package/src/utils/md5.d.ts
DELETED
package/src/utils/md5.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isMd5 = exports.md5 = void 0;
|
|
7
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
8
|
-
function md5(str) {
|
|
9
|
-
return node_crypto_1.default.createHash('md5').update(str).digest('hex');
|
|
10
|
-
}
|
|
11
|
-
exports.md5 = md5;
|
|
12
|
-
const regexExp = /^[a-f0-9]{32}$/gi;
|
|
13
|
-
function isMd5(str) {
|
|
14
|
-
return regexExp.test(str);
|
|
15
|
-
}
|
|
16
|
-
exports.isMd5 = isMd5;
|
|
17
|
-
//# sourceMappingURL=md5.js.map
|
package/src/utils/md5.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"md5.js","sourceRoot":"","sources":["../../../../../packages/core/src/utils/md5.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAiC;AAEjC,SAAgB,GAAG,CAAC,GAAW;IAC7B,OAAO,qBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAFD,kBAEC;AAED,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AACpC,SAAgB,KAAK,CAAC,GAAW;IAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAFD,sBAEC"}
|