@typus/typus-sdk 1.2.55 → 1.2.57
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TxHistory } from "../../utils/typus-dov-single-v2/user-history";
|
|
2
2
|
export declare function getDepositorCashFlows(userHistory: TxHistory[]): Map<string, DepositorCashFlow>;
|
|
3
|
-
interface DepositorCashFlow {
|
|
3
|
+
export interface DepositorCashFlow {
|
|
4
4
|
D_TOKEN: string | undefined;
|
|
5
5
|
totalDeposit: number;
|
|
6
6
|
totalWithdraw: number;
|
|
@@ -9,4 +9,3 @@ interface DepositorCashFlow {
|
|
|
9
9
|
netDeposit: number | undefined;
|
|
10
10
|
totalHarvest: Map<string, number>;
|
|
11
11
|
}
|
|
12
|
-
export {};
|
|
@@ -17,4 +17,4 @@ export interface TxHistory {
|
|
|
17
17
|
Date: Date;
|
|
18
18
|
txDigest: string;
|
|
19
19
|
}
|
|
20
|
-
export declare function
|
|
20
|
+
export declare function getFromSentio(event: string, userAddress: string, startTimestamp: string): Promise<any[]>;
|
|
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
42
|
+
exports.getFromSentio = exports.getAutoBidEvents = exports.getUserEvents = exports.getUserHistory = void 0;
|
|
43
43
|
var token_1 = require("../token");
|
|
44
44
|
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
45
45
|
function getUserHistory(provider, originPackage, vaults, sender, startTimeMs) {
|
|
@@ -66,7 +66,7 @@ function getUserHistory(provider, originPackage, vaults, sender, startTimeMs) {
|
|
|
66
66
|
return false;
|
|
67
67
|
}
|
|
68
68
|
}));
|
|
69
|
-
return [4 /*yield*/, parseTxHistory(datas, originPackage, vaults)];
|
|
69
|
+
return [4 /*yield*/, parseTxHistory(datas.sort(function (a, b) { return Number(b.timestampMs) - Number(a.timestampMs); }), originPackage, vaults)];
|
|
70
70
|
case 3:
|
|
71
71
|
txHistory = _a.sent();
|
|
72
72
|
return [2 /*return*/, txHistory];
|
|
@@ -461,7 +461,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
461
461
|
});
|
|
462
462
|
});
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function getFromSentio(event, userAddress, startTimestamp) {
|
|
465
465
|
return __awaiter(this, void 0, void 0, function () {
|
|
466
466
|
var apiUrl, headers, requestData, jsonData, response, data;
|
|
467
467
|
return __generator(this, function (_a) {
|
|
@@ -474,7 +474,7 @@ function getUserBid(startTimestamp, userAddress) {
|
|
|
474
474
|
};
|
|
475
475
|
requestData = {
|
|
476
476
|
sqlQuery: {
|
|
477
|
-
sql: "\n SELECT *\n FROM
|
|
477
|
+
sql: "\n SELECT *\n FROM ".concat(event, "\n WHERE distinct_id = \"").concat(userAddress, "\" && timestamp >= ").concat(startTimestamp, "\n ORDER BY timestamp DESC;\n "),
|
|
478
478
|
size: 1000,
|
|
479
479
|
},
|
|
480
480
|
};
|
|
@@ -494,4 +494,11 @@ function getUserBid(startTimestamp, userAddress) {
|
|
|
494
494
|
});
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
exports.
|
|
497
|
+
exports.getFromSentio = getFromSentio;
|
|
498
|
+
function getUserHistoryFromSentio(vaults, sender, startTimeMs) {
|
|
499
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
500
|
+
return __generator(this, function (_a) {
|
|
501
|
+
return [2 /*return*/];
|
|
502
|
+
});
|
|
503
|
+
});
|
|
504
|
+
}
|