@typus/typus-sdk 1.0.84 → 1.0.85

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.
@@ -86,7 +86,7 @@ function parseTxHistory(datas, originPackage) {
86
86
  return type.startsWith(originPackage);
87
87
  })
88
88
  .reduce(function (promise, event) { return __awaiter(_this, void 0, void 0, function () {
89
- var txHistory, functionType, action, matches, typeArgs, assets, asset, b_asset, parsedJson;
89
+ var txHistory, functionType, action, matches, typeArgs, assets, asset, b_asset, parsedJson, i, incentive_value;
90
90
  var _a;
91
91
  return __generator(this, function (_b) {
92
92
  switch (_b.label) {
@@ -102,17 +102,24 @@ function parseTxHistory(datas, originPackage) {
102
102
  asset = action == "NewBid" ? assets[2] : assets[0];
103
103
  b_asset = assets[1];
104
104
  parsedJson = event.parsedJson;
105
- txHistory.push({
106
- Vault: parsedJson.index,
107
- Action: action,
108
- Date: new Date(Number(event.timestampMs)),
109
- txDigest: event.id.txDigest,
110
- Asset: asset,
111
- Amount: Number(parsedJson.amount) / Math.pow(10, (0, token_1.assetToDecimal)(asset)),
112
- Fee: Number(parsedJson.fee) / Math.pow(10, (0, token_1.assetToDecimal)(asset)),
113
- BidSize: Number(parsedJson.size) / Math.pow(10, (0, token_1.assetToDecimal)(asset)),
114
- BidPaid: Number(parsedJson.coin_value) / Math.pow(10, (0, token_1.assetToDecimal)(b_asset)),
115
- });
105
+ if (action == "IncentiveNewBid") {
106
+ i = txHistory.findIndex(function (x) { return x.txDigest == event.id.txDigest; });
107
+ incentive_value = Number(parsedJson.incentive_value) / Math.pow(10, (0, token_1.assetToDecimal)(asset));
108
+ txHistory[i].BidPaid = txHistory[i].BidPaid - incentive_value;
109
+ }
110
+ else {
111
+ txHistory.push({
112
+ Vault: parsedJson.index,
113
+ Action: action,
114
+ Date: new Date(Number(event.timestampMs)),
115
+ txDigest: event.id.txDigest,
116
+ Asset: asset,
117
+ Amount: Number(parsedJson.amount) / Math.pow(10, (0, token_1.assetToDecimal)(asset)),
118
+ Fee: Number(parsedJson.fee) / Math.pow(10, (0, token_1.assetToDecimal)(asset)),
119
+ BidSize: Number(parsedJson.size) / Math.pow(10, (0, token_1.assetToDecimal)(asset)),
120
+ BidPaid: Number(parsedJson.coin_value) / Math.pow(10, (0, token_1.assetToDecimal)(b_asset)),
121
+ });
122
+ }
116
123
  return [2 /*return*/, txHistory];
117
124
  }
118
125
  return [2 /*return*/];
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.0.84",
5
+ "version": "1.0.85",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/sui.js": "^0.37.1",