@typus/typus-sdk 1.4.7-b → 1.4.7-d
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/dist/src/dice/fetch.d.ts +4 -1
- package/dist/src/dice/fetch.js +19 -2
- package/package.json +1 -1
package/dist/src/dice/fetch.d.ts
CHANGED
|
@@ -42,7 +42,6 @@ export declare function parseHistory(datas: any, playgrounds: Playground[]): Pro
|
|
|
42
42
|
export interface DrawEvent {
|
|
43
43
|
answer_1: string;
|
|
44
44
|
answer_2: string;
|
|
45
|
-
exp: string;
|
|
46
45
|
game_id: string;
|
|
47
46
|
guess_1: string;
|
|
48
47
|
guess_2: string;
|
|
@@ -58,6 +57,9 @@ export interface DrawEvent {
|
|
|
58
57
|
signer: string;
|
|
59
58
|
stake_amount: string;
|
|
60
59
|
timestampMs: string;
|
|
60
|
+
exp?: string;
|
|
61
|
+
exp_amount?: string;
|
|
62
|
+
reward?: string;
|
|
61
63
|
}
|
|
62
64
|
export interface DrawDisplay {
|
|
63
65
|
game_id: string;
|
|
@@ -69,6 +71,7 @@ export interface DrawDisplay {
|
|
|
69
71
|
bet_amount: string;
|
|
70
72
|
exp: string;
|
|
71
73
|
timestampMs: string;
|
|
74
|
+
reward?: string;
|
|
72
75
|
}
|
|
73
76
|
export interface ProfitSharing {
|
|
74
77
|
level_profits: string[];
|
package/dist/src/dice/fetch.js
CHANGED
|
@@ -189,7 +189,15 @@ function parseHistory(datas, playgrounds) {
|
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
var stake_amount = Number(drawEvent.stake_amount) / Math.pow(10, decimal);
|
|
192
|
-
var amount
|
|
192
|
+
var amount;
|
|
193
|
+
if (asset == "FUD") {
|
|
194
|
+
amount = "".concat(stake_amount / 1000000, "m");
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
amount = stake_amount;
|
|
198
|
+
}
|
|
199
|
+
var exp = Number(drawEvent.exp) | Number(drawEvent.exp_amount);
|
|
200
|
+
// console.log(drawEvent);
|
|
193
201
|
var display = {
|
|
194
202
|
game_id: drawEvent.game_id,
|
|
195
203
|
player: drawEvent.player,
|
|
@@ -198,9 +206,18 @@ function parseHistory(datas, playgrounds) {
|
|
|
198
206
|
result_1: result_1,
|
|
199
207
|
result_2: result_2,
|
|
200
208
|
bet_amount: "".concat(amount, " ").concat(asset),
|
|
201
|
-
exp: "".concat(
|
|
209
|
+
exp: "".concat(exp, " EXP"),
|
|
202
210
|
timestampMs: drawEvent.timestampMs,
|
|
203
211
|
};
|
|
212
|
+
if (drawEvent.reward) {
|
|
213
|
+
var reward = Number(drawEvent.reward) / Math.pow(10, decimal);
|
|
214
|
+
if (asset == "FUD") {
|
|
215
|
+
display.reward = "".concat(reward / 1000000, "m ").concat(asset);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
display.reward = "".concat(reward, " ").concat(asset);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
204
221
|
return display;
|
|
205
222
|
});
|
|
206
223
|
return [2 /*return*/, result];
|