@typus/typus-sdk 1.3.2 → 1.3.21

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.
@@ -171,19 +171,18 @@ exports.tokenOrder = {
171
171
  CETUS: 5,
172
172
  WETH: 6,
173
173
  ETH: 6,
174
- HASUI: 7,
175
- FUD: 8,
176
- INJ: 9,
177
- JUP: 10,
178
- NAVX: 11,
179
- SCA: 12,
180
- SEI: 13,
181
- WSOL: 14,
182
- SOL: 15,
183
- TURBOS: 16,
184
- USDC: 17,
185
- USDT: 18,
186
- USDY: 19,
174
+ FUD: 7,
175
+ INJ: 8,
176
+ JUP: 9,
177
+ NAVX: 10,
178
+ SCA: 11,
179
+ SEI: 12,
180
+ WSOL: 13,
181
+ SOL: 14,
182
+ TURBOS: 15,
183
+ USDC: 16,
184
+ USDT: 17,
185
+ USDY: 18,
187
186
  VSUI: 20,
188
187
  };
189
188
  exports.optionTypeOrder = {
@@ -137,7 +137,10 @@ function parseTxHistory(datas, originPackage, vaults) {
137
137
  case 0: return [4 /*yield*/, datas
138
138
  .filter(function (event) {
139
139
  var type = event.type;
140
- return event.packageId == originPackage || type.includes("typus_nft::First") || type.includes("typus_nft::ExpUpEvent");
140
+ return (event.packageId == originPackage ||
141
+ type.includes("typus_nft::First") ||
142
+ type.includes("typus_nft::ExpUpEvent") ||
143
+ type.includes("tails_staking"));
141
144
  })
142
145
  .sort(function (a, b) {
143
146
  // From Old to New!
@@ -149,7 +152,7 @@ function parseTxHistory(datas, originPackage, vaults) {
149
152
  }
150
153
  })
151
154
  .reduce(function (promise, event) { return __awaiter(_this, void 0, void 0, function () {
152
- var txHistory, functionType, action, Action, Amount, Index, Period, Vault, RiskLevel, Tails, Exp, d_token, b_token, o_token, i, i, i, token, amount, token, amount, amount, token, amount, token, amount, token, amount, b_token_name, b_token_amount, i_token_name, i_token_amount, token, amount, token, amount, deposit_amount, deposit_amount, balance, balance, profit, profit, token, amount, amount, token, amount, size, token, amount, token, amount, size, bidder_balance;
155
+ var txHistory, functionType, action, Action, Amount, Index, Period, Vault, RiskLevel, Tails, Exp, d_token, b_token, o_token, token, amount, i, i, i, token, amount, token, amount, amount, token, amount, token, amount, token, amount, b_token_name, b_token_amount, i_token_name, i_token_amount, token, amount, token, amount, deposit_amount, deposit_amount, balance, balance, profit, profit, token, amount, amount, token, amount, size, token, amount, token, amount, size, bidder_balance;
153
156
  var _a, _b, _c;
154
157
  var _d;
155
158
  return __generator(this, function (_e) {
@@ -165,6 +168,52 @@ function parseTxHistory(datas, originPackage, vaults) {
165
168
  _a = __read(parseVaultInfo(vaults, Index, action), 6), Period = _a[0], Vault = _a[1], RiskLevel = _a[2], d_token = _a[3], b_token = _a[4], o_token = _a[5];
166
169
  }
167
170
  switch (action) {
171
+ // new version events
172
+ case "StakeTailsEvent":
173
+ Action = "Stake";
174
+ Amount = "0.05 SUI";
175
+ Tails = "#".concat(event.parsedJson.log[0]);
176
+ break;
177
+ case "UnstakeTailsEvent":
178
+ Action = "Unstake";
179
+ Tails = "#".concat(event.parsedJson.log[0]);
180
+ break;
181
+ case "DailySignUpEvent":
182
+ Action = "Check In";
183
+ Tails = event.parsedJson.tails.map(function (num) { return "#".concat(num); }).join(" ");
184
+ Exp = event.parsedJson.log[0];
185
+ break;
186
+ case "TransferTailsEvent":
187
+ Action = "Transfer";
188
+ Amount = "0.01 SUI";
189
+ Tails = "#".concat(event.parsedJson.log[0]);
190
+ break;
191
+ case "ExpUpEvent":
192
+ if (event.parsedJson.log) {
193
+ Action = "Train Tail";
194
+ Tails = "#".concat(event.parsedJson.log[0]);
195
+ Exp = event.parsedJson.log[1];
196
+ if (Number(Exp) == 0) {
197
+ return [2 /*return*/, txHistory];
198
+ }
199
+ }
200
+ break;
201
+ case "LevelUpEvent":
202
+ if (event.parsedJson.log) {
203
+ Action = "Level Up to Level ".concat(event.parsedJson.log[1]);
204
+ Tails = "#".concat(event.parsedJson.log[0]);
205
+ }
206
+ break;
207
+ case "ClaimProfitSharingEvent":
208
+ if (event.parsedJson.profit_asset) {
209
+ token = (0, token_1.typeArgToAsset)("0x" + event.parsedJson.profit_asset.name);
210
+ amount = Number(event.parsedJson.log[0]) / Math.pow(10, (0, token_1.assetToDecimal)(token));
211
+ Action = "Harvest Dice Profit";
212
+ Tails = event.parsedJson.tails.map(function (num) { return "#".concat(num); }).join(" ");
213
+ Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
214
+ }
215
+ break;
216
+ // old version events
168
217
  case "StakeNftEvent":
169
218
  Action = "Stake";
170
219
  Amount = "0.05 SUI";
@@ -25,7 +25,7 @@ export interface kioskOwnerCap {
25
25
  isPersonal: boolean;
26
26
  }
27
27
  export declare function getkioskOwnerCaps(datas: SuiObjectResponse[]): kioskOwnerCap[];
28
- export declare function getTailsIds(kioskClient: KioskClient, nftConfig: any, kioskOwnerCaps: kioskOwnerCap[]): Promise<TailsId[]>;
28
+ export declare function getTailsIds(kioskClient: KioskClient, NFT_PACKAGE_ORIGIN: string, kioskOwnerCaps: kioskOwnerCap[]): Promise<TailsId[]>;
29
29
  export interface TailsWithType extends Tails {
30
30
  type: string | null | undefined;
31
31
  }
@@ -187,7 +187,7 @@ function getkioskOwnerCaps(datas) {
187
187
  return kioskOwnerCaps;
188
188
  }
189
189
  exports.getkioskOwnerCaps = getkioskOwnerCaps;
190
- function getTailsIds(kioskClient, nftConfig, kioskOwnerCaps) {
190
+ function getTailsIds(kioskClient, NFT_PACKAGE_ORIGIN, kioskOwnerCaps) {
191
191
  return __awaiter(this, void 0, void 0, function () {
192
192
  var Tails, _loop_1, kioskOwnerCaps_1, kioskOwnerCaps_1_1, kioskOwnerCap, e_2_1;
193
193
  var e_2, _a;
@@ -203,7 +203,7 @@ function getTailsIds(kioskClient, nftConfig, kioskOwnerCaps) {
203
203
  case 1:
204
204
  res = _c.sent();
205
205
  tails = res.items
206
- .filter(function (item) { return item.type == "".concat(nftConfig.NFT_PACKAGE_ORIGIN, "::typus_nft::Tails"); })
206
+ .filter(function (item) { return item.type == "".concat(NFT_PACKAGE_ORIGIN, "::typus_nft::Tails"); })
207
207
  .map(function (item) {
208
208
  // console.log(item.data);
209
209
  // @ts-ignore
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.3.2",
5
+ "version": "1.3.21",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.8.10",