@typus/typus-sdk 1.1.23 → 1.1.24
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.
|
@@ -4,7 +4,7 @@ export declare function getUserHistory(provider: JsonRpcProvider, originPackage:
|
|
|
4
4
|
[key: string]: Vault;
|
|
5
5
|
}, sender: string, startTimeMs: number): Promise<TxHistory[]>;
|
|
6
6
|
export interface TxHistory {
|
|
7
|
-
Index: string;
|
|
7
|
+
Index: string | undefined;
|
|
8
8
|
Action: string;
|
|
9
9
|
Period: string | undefined;
|
|
10
10
|
Amount: string | undefined;
|
|
@@ -89,15 +89,16 @@ 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, 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
|
|
94
|
-
return __generator(this, function (
|
|
95
|
-
switch (
|
|
92
|
+
var txHistory, functionType, action, Action, Amount, Index, 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;
|
|
94
|
+
return __generator(this, function (_b) {
|
|
95
|
+
switch (_b.label) {
|
|
96
96
|
case 0: return [4 /*yield*/, promise];
|
|
97
97
|
case 1:
|
|
98
|
-
txHistory =
|
|
98
|
+
txHistory = _b.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
|
+
Index = event.parsedJson.index;
|
|
101
102
|
if (event.parsedJson.index) {
|
|
102
103
|
v = vaults[event.parsedJson.index];
|
|
103
104
|
if (v) {
|
|
@@ -244,11 +245,13 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
244
245
|
amount = Number(event.parsedJson.amount) / Math.pow(10, Number(event.parsedJson.decimal));
|
|
245
246
|
Action = action.slice(0, action.length - 5);
|
|
246
247
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
248
|
+
Index = event.parsedJson.index;
|
|
247
249
|
if (i != -1) {
|
|
248
250
|
txHistory[i].Action = Action;
|
|
249
251
|
txHistory[i].Amount = Amount;
|
|
250
252
|
txHistory[i].Vault = Vault;
|
|
251
253
|
txHistory[i].RiskLevel = RiskLevel;
|
|
254
|
+
txHistory[i].Index = Index;
|
|
252
255
|
return [2 /*return*/, txHistory];
|
|
253
256
|
}
|
|
254
257
|
break;
|
|
@@ -293,7 +296,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
293
296
|
return [2 /*return*/, txHistory];
|
|
294
297
|
}
|
|
295
298
|
txHistory.push({
|
|
296
|
-
Index:
|
|
299
|
+
Index: Index,
|
|
297
300
|
Period: Period,
|
|
298
301
|
Action: Action,
|
|
299
302
|
Amount: Amount,
|