@typus/typus-sdk 1.1.20 → 1.1.22
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.
|
@@ -105,16 +105,38 @@ function getHistory(provider, dicePackage, playgrounds) {
|
|
|
105
105
|
var coinType = "0x" + playground.stake_token;
|
|
106
106
|
var asset = (0, token_1.typeArgToAsset)(coinType);
|
|
107
107
|
var decimal = (0, token_1.assetToDecimal)(asset);
|
|
108
|
-
var guess_1 = drawEvent.larger_than_1
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
var guess_1 = (drawEvent.larger_than_1 ? "> " : "< ") + "".concat(Number(drawEvent.guess_1) / 100);
|
|
109
|
+
var guess_2 = (drawEvent.larger_than_2 ? "> " : "< ") + "".concat(Number(drawEvent.guess_2) / 100);
|
|
110
|
+
var result_1 = "".concat(Number(drawEvent.answer_1) / 100);
|
|
111
|
+
switch (drawEvent.result_1) {
|
|
112
|
+
case "0":
|
|
113
|
+
result_1 += " W";
|
|
114
|
+
break;
|
|
115
|
+
case "1":
|
|
116
|
+
result_1 += " L";
|
|
117
|
+
break;
|
|
118
|
+
case "2":
|
|
119
|
+
result_1 += " C";
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
var result_2 = "".concat(Number(drawEvent.answer_2) / 100);
|
|
123
|
+
switch (drawEvent.result_2) {
|
|
124
|
+
case "0":
|
|
125
|
+
result_2 += " W";
|
|
126
|
+
break;
|
|
127
|
+
case "1":
|
|
128
|
+
result_2 += " L";
|
|
129
|
+
break;
|
|
130
|
+
case "2":
|
|
131
|
+
result_2 += " C";
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
114
134
|
var display = {
|
|
115
135
|
player: drawEvent.player,
|
|
116
136
|
guess_1: guess_1,
|
|
117
137
|
guess_2: guess_2,
|
|
138
|
+
result_1: result_1,
|
|
139
|
+
result_2: result_2,
|
|
118
140
|
bet_amount: "".concat(Number(drawEvent.stake_amount) / Math.pow(10, decimal), " ").concat(asset),
|
|
119
141
|
exp: "".concat(Number(drawEvent.exp), " EXP"),
|
|
120
142
|
};
|
|
@@ -4,6 +4,7 @@ export declare function getUserHistory(provider: JsonRpcProvider, originPackage:
|
|
|
4
4
|
[key: string]: Vault;
|
|
5
5
|
}, sender: string, startTimeMs: number): Promise<TxHistory[]>;
|
|
6
6
|
interface TxHistory {
|
|
7
|
+
Index: string;
|
|
7
8
|
Action: string;
|
|
8
9
|
Amount: string | undefined;
|
|
9
10
|
Vault: string | undefined;
|
|
@@ -90,12 +90,12 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
90
90
|
})
|
|
91
91
|
.reduce(function (promise, event) { return __awaiter(_this, void 0, void 0, function () {
|
|
92
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 (
|
|
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) {
|
|
@@ -292,6 +292,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
292
292
|
return [2 /*return*/, txHistory];
|
|
293
293
|
}
|
|
294
294
|
txHistory.push({
|
|
295
|
+
Index: (_b = vaults[event.parsedJson.index]) === null || _b === void 0 ? void 0 : _b.info.index,
|
|
295
296
|
Action: Action,
|
|
296
297
|
Amount: Amount,
|
|
297
298
|
Vault: Vault,
|