@typus/typus-sdk 1.4.7-a → 1.4.7-c

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.
@@ -9,14 +9,22 @@ export interface Playground {
9
9
  opened_games: Map<string, Game>;
10
10
  game_config: GameConfig;
11
11
  is_active: boolean;
12
+ exp_config?: ExpConfig;
12
13
  }
13
14
  export interface GameConfig {
14
15
  max_stake: string;
15
16
  min_stake: string;
16
17
  stake_lot_size: string;
17
- base_exp_divisor: string;
18
- losses_multiplier_bp: string;
19
18
  critical_hits_multiplier_bp: string;
19
+ base_exp_divisor?: string;
20
+ losses_multiplier_bp?: string;
21
+ banker_edge_bp?: string;
22
+ max_single_game_loss_ratio_bp?: string;
23
+ u64_padding?: string[];
24
+ }
25
+ export interface ExpConfig {
26
+ base_exp_divisor: string;
27
+ u64_padding: string[];
20
28
  }
21
29
  export interface Game {
22
30
  game_id: string;
@@ -34,7 +42,6 @@ export declare function parseHistory(datas: any, playgrounds: Playground[]): Pro
34
42
  export interface DrawEvent {
35
43
  answer_1: string;
36
44
  answer_2: string;
37
- exp: string;
38
45
  game_id: string;
39
46
  guess_1: string;
40
47
  guess_2: string;
@@ -50,6 +57,9 @@ export interface DrawEvent {
50
57
  signer: string;
51
58
  stake_amount: string;
52
59
  timestampMs: string;
60
+ exp?: string;
61
+ exp_amount?: string;
62
+ reward?: string;
53
63
  }
54
64
  export interface DrawDisplay {
55
65
  game_id: string;
@@ -61,6 +71,7 @@ export interface DrawDisplay {
61
71
  bet_amount: string;
62
72
  exp: string;
63
73
  timestampMs: string;
74
+ reward?: string;
64
75
  }
65
76
  export interface ProfitSharing {
66
77
  level_profits: string[];
@@ -109,6 +109,9 @@ function getPlaygrounds(provider, diceRegistry) {
109
109
  game_config: game_config,
110
110
  is_active: fields.is_active,
111
111
  };
112
+ if (fields.exp_config) {
113
+ playground.exp_config = fields.exp_config.fields;
114
+ }
112
115
  // console.log(playground);
113
116
  return playground;
114
117
  });
@@ -186,7 +189,15 @@ function parseHistory(datas, playgrounds) {
186
189
  break;
187
190
  }
188
191
  var stake_amount = Number(drawEvent.stake_amount) / Math.pow(10, decimal);
189
- var amount = stake_amount > 1000000 ? "".concat(stake_amount / 1000000, " m") : stake_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);
190
201
  var display = {
191
202
  game_id: drawEvent.game_id,
192
203
  player: drawEvent.player,
@@ -195,9 +206,18 @@ function parseHistory(datas, playgrounds) {
195
206
  result_1: result_1,
196
207
  result_2: result_2,
197
208
  bet_amount: "".concat(amount, " ").concat(asset),
198
- exp: "".concat(Number(drawEvent.exp), " EXP"),
209
+ exp: "".concat(exp, " EXP"),
199
210
  timestampMs: drawEvent.timestampMs,
200
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
+ }
201
221
  return display;
202
222
  });
203
223
  return [2 /*return*/, result];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.4.7-a",
5
+ "version": "1.4.7-c",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.8.10",