@typus/typus-sdk 1.1.21 → 1.1.23
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.
|
@@ -3,9 +3,10 @@ import { Vault } from "./view-function";
|
|
|
3
3
|
export declare function getUserHistory(provider: JsonRpcProvider, originPackage: string, vaults: {
|
|
4
4
|
[key: string]: Vault;
|
|
5
5
|
}, sender: string, startTimeMs: number): Promise<TxHistory[]>;
|
|
6
|
-
interface TxHistory {
|
|
6
|
+
export interface TxHistory {
|
|
7
7
|
Index: string;
|
|
8
8
|
Action: string;
|
|
9
|
+
Period: string | undefined;
|
|
9
10
|
Amount: string | undefined;
|
|
10
11
|
Vault: string | undefined;
|
|
11
12
|
RiskLevel: string | undefined;
|
|
@@ -14,4 +15,3 @@ interface TxHistory {
|
|
|
14
15
|
Date: Date;
|
|
15
16
|
txDigest: string;
|
|
16
17
|
}
|
|
17
|
-
export {};
|
|
@@ -89,13 +89,13 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
89
89
|
return type.startsWith(originPackage) || type.includes("typus_nft::First") || type.includes("typus_nft::ExpUpEvent");
|
|
90
90
|
})
|
|
91
91
|
.reduce(function (promise, event) { return __awaiter(_this, void 0, void 0, function () {
|
|
92
|
-
var txHistory, functionType, action, Action, Amount, Vault, RiskLevel, Tails, Exp, o_token, v, period, optionType, i, i, token, amount, amount, token, amount, size, token, amount, i, b_token, size, bidder_balance;
|
|
93
|
-
var _a;
|
|
94
|
-
return __generator(this, function (
|
|
95
|
-
switch (
|
|
92
|
+
var txHistory, functionType, action, Action, Amount, Period, Vault, RiskLevel, Tails, Exp, o_token, v, period, optionType, i, i, token, amount, amount, token, amount, size, token, amount, i, b_token, size, bidder_balance;
|
|
93
|
+
var _a, _b;
|
|
94
|
+
return __generator(this, function (_c) {
|
|
95
|
+
switch (_c.label) {
|
|
96
96
|
case 0: return [4 /*yield*/, promise];
|
|
97
97
|
case 1:
|
|
98
|
-
txHistory =
|
|
98
|
+
txHistory = _c.sent();
|
|
99
99
|
functionType = (_a = new RegExp("^([^::]+)::([^::]+)::([^<]+)").exec(event.type)) === null || _a === void 0 ? void 0 : _a.slice(1, 4);
|
|
100
100
|
action = functionType[2];
|
|
101
101
|
if (event.parsedJson.index) {
|
|
@@ -122,6 +122,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
122
122
|
period = "";
|
|
123
123
|
break;
|
|
124
124
|
}
|
|
125
|
+
Period = period;
|
|
125
126
|
optionType = void 0;
|
|
126
127
|
switch (v.info.optionType) {
|
|
127
128
|
case "0":
|
|
@@ -292,7 +293,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
292
293
|
return [2 /*return*/, txHistory];
|
|
293
294
|
}
|
|
294
295
|
txHistory.push({
|
|
295
|
-
Index: vaults[event.parsedJson.index].info.index,
|
|
296
|
+
Index: (_b = vaults[event.parsedJson.index]) === null || _b === void 0 ? void 0 : _b.info.index,
|
|
297
|
+
Period: Period,
|
|
296
298
|
Action: Action,
|
|
297
299
|
Amount: Amount,
|
|
298
300
|
Vault: Vault,
|