@typus/typus-sdk 1.2.25 → 1.2.26

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.
@@ -18,17 +18,18 @@ export interface StrategyV2 {
18
18
  target_rounds: string[];
19
19
  receipts: TypusBidReceipt[];
20
20
  active: boolean;
21
- string_padding: string[];
21
+ u64_padding: string[];
22
22
  bid_times: string;
23
23
  bid_round: string;
24
24
  bid_ts_ms: string;
25
25
  bid_rounds: string[];
26
26
  accumulated_profit: string;
27
- remaining_balance: string;
28
- gain_to_harvest: string;
27
+ remaining_balance: string | undefined;
28
+ gain_to_harvest: string | undefined;
29
29
  my_bids: {
30
30
  [key: string]: BidShare;
31
31
  };
32
+ status: "active" | "insufficient balance" | "finished";
32
33
  }
33
34
  export interface TypusBidReceipt {
34
35
  id: string;
@@ -173,8 +173,6 @@ function getUserStrategies(provider, packageId, registry, strategyPool, user
173
173
  }),
174
174
  accumulated_profit: reader.read64(),
175
175
  strategy_index: reader.read64(),
176
- // remaining_balance: reader.read64(),
177
- // gain_to_harvest: reader.read64(),
178
176
  };
179
177
  var my_bids = Array.from(new Map()).reduce(function (map, _a) {
180
178
  var _b = __read(_a, 2), key = _b[0], value = _b[1];
@@ -209,6 +207,17 @@ function getUserStrategies(provider, packageId, registry, strategyPool, user
209
207
  });
210
208
  // console.log(my_bids);
211
209
  strategy.my_bids = my_bids;
210
+ strategy.remaining_balance = strategy.u64_padding.at(0);
211
+ strategy.gain_to_harvest = strategy.u64_padding.at(1);
212
+ if (strategy.bid_times == strategy.max_times) {
213
+ strategy.status = "finished";
214
+ }
215
+ else if (!strategy.active) {
216
+ strategy.status = "insufficient balance";
217
+ }
218
+ else {
219
+ strategy.status = "active";
220
+ }
212
221
  // console.log(strategy);
213
222
  strategies.push(strategy);
214
223
  });
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.2.25",
5
+ "version": "1.2.26",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/kiosk": "0.7.12",