@typus/typus-sdk 1.3.23-tails-staking-merged-main → 1.3.23

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/lib/config.json CHANGED
@@ -1,33 +1,31 @@
1
1
  {
2
2
  "MAINNET": {
3
3
  "RPC_ENDPOINT": "https://fullnode.mainnet.sui.io:443",
4
- "TYPUS_VERSION": "0xd2882b992e986250b3304b59530700bc3850939f9a77e9e9dfa9cf1656f84b3d",
5
- "TGLD_COIN_METADATA": "0x3a070c729606334a2be7c51ab28da9a1101b0de01452dd62c10cda0f7a5795d2",
6
- "TGLD_TOKEN_POLICY": "0xd9461bd329f1df24be9698131b6e2c2b9eaac7c9cf6d76689112f2e57be12009",
7
- "NFT_TRANSFER_POLICY": "0x55475b9e16d9a0176dcef37f83a1921b15f2cbd2711a5f30b9d952c0c8f5f957",
8
- "STRATEGY_POOL": "0x2c60ddd50d76beb00faa025962d566359a6ea05b1f7f19ac6bd050f4db8c885c",
9
4
  "PACKAGE_ORIGIN": {
10
5
  "DOV_SINGLE": "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a",
11
6
  "FRAMEWORK": "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274",
7
+ "EXP_GUESS": "0x37816d28c34cc0df82655ca97b3f066112a5f3c202cbb4aaa76c8af54e779750",
12
8
  "MFUD": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
13
9
  "NFT": "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196",
14
10
  "ORACLE": "0x855eb2d260ee42b898266e6df90bfd3c4ed821ccb253a352c159c223244a4b8a",
15
11
  "TYPUS": "0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a"
16
12
  },
17
13
  "PACKAGE": {
18
- "DOV_SINGLE": "0x011840332be097b422abb8336970b0be1d7333df22134cd5c3be9d9a1cb956d0",
19
- "FRAMEWORK": "0x8638b586ad122d2887d0685d1996a88adc1b7a8a81906fc7f68b25dcbac25cb5",
14
+ "DOV_SINGLE": "0x81398b9385545e1ed051092d990159a1a896bceeb796923ca43b6c9be96c83f4",
15
+ "FRAMEWORK": "0x083b89937db53d8dd797dee3ba431083fee43c6bf5993005886daba19e942fb2",
16
+ "EXP_GUESS": "0xb1cc7379a7375808eaf4cda927a6f3a14363b6d131c020f4828119b87731fe03",
20
17
  "MFUD": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
21
18
  "NFT": "0xba06aae31d9b7c9f651e783272c7e4f776fb5ae17e89d525b75a17b099f58202",
22
19
  "ORACLE": "0x978f65df8570a075298598a9965c18de9087f9e888eb3430fe20334f5c554cfd",
23
- "TYPUS": "0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a"
20
+ "TYPUS": "0xf5c7e61fd28d1ed38711f03e1c5ffc6c5b8435eff386132fc5822efe6d90b138"
24
21
  },
25
22
  "REGISTRY": {
26
23
  "AIRDROP": "0x4b451f4632bd64af82d5e6fe46e20705c9468bd46d6758a0f7093fde2930d084",
27
24
  "DOV_SINGLE": "0x3d70b09359e3ca8301ae0abeda4f2fdf72ce313ba58c919ce568e5f535fd2ea8",
25
+ "EXP_GUESS": "0x7679ab7157f13ec945579e3098ba589eb8b4eec841c775799d2aa22b565187c7",
28
26
  "LEADERBOARD": "0xc515a3e7fd12ba902f7f1ebe52c676136e1b34cb614ae9c79a46b257ca7d5534",
29
27
  "MFUD": "0xb8d7e7ab783e56700c0212bd9f0938bba9dd3e7241c149e6c52b21334ec45ece",
30
- "TAILS_STAKING": "",
28
+ "TAILS_STAKING": "0xeca3e88577dc3f45df8b7bace51f26b126271ce4c5fa33b3739fd7b69fc16559",
31
29
  "TGLD": "0x8ee1af362fe9e0a29f6bad48d8ff44249ece5aaa77a4302c2ffcc90950e52ed2",
32
30
  "USER": "0xb1b16eb4845b5ee1a29432b1f2bcfe8cbb33c234492baf31a706d82e28e18bce"
33
31
  },
@@ -48,13 +46,21 @@
48
46
  "TURBOS": "0x819ff07b5768d7b9b428b69b123140f6a74b04eaa978a4cbab9055025bd1536d",
49
47
  "WBTC": "0x61813dc2e46dba41b14507857827f0ed7e99b0be242548828769728b81c8fab5",
50
48
  "WETH": "0x253bbaaa35275240cf6df03258489707ea059762831e4102ebaabafd442bc935"
49
+ },
50
+ "OBJECT": {
51
+ "TYPUS_VERSION": "0xd2882b992e986250b3304b59530700bc3850939f9a77e9e9dfa9cf1656f84b3d",
52
+ "TGLD_COIN_METADATA": "0x3a070c729606334a2be7c51ab28da9a1101b0de01452dd62c10cda0f7a5795d2",
53
+ "TGLD_TOKEN_POLICY": "0xd9461bd329f1df24be9698131b6e2c2b9eaac7c9cf6d76689112f2e57be12009",
54
+ "NFT_TRANSFER_POLICY": "0x55475b9e16d9a0176dcef37f83a1921b15f2cbd2711a5f30b9d952c0c8f5f957",
55
+ "STRATEGY_POOL": "0x2c60ddd50d76beb00faa025962d566359a6ea05b1f7f19ac6bd050f4db8c885c",
56
+ "TAILS_IDS": "0x3a6a403eb7c123b6f4d25081078b6f07c0ee5987d3ac8ab3e6bcf707c1b0e778"
51
57
  }
52
58
  },
53
59
  "TESTNET": {
54
60
  "RPC_ENDPOINT": "https://sui-testnet.blastapi.io:443/7f446a12-c4ab-4e3c-b2d8-ebb0fcbe5cdd",
55
61
  "PACKAGE_ORIGIN": {
56
62
  "DOV_SINGLE": "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f",
57
- "TAILS_EXP": "0x9b43ee208a3b235810c145bca1161d1a71d08bfe76b1e55bb3db319ea95d0149",
63
+ "EXP_GUESS": "0x9b43ee208a3b235810c145bca1161d1a71d08bfe76b1e55bb3db319ea95d0149",
58
64
  "FRAMEWORK": "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded",
59
65
  "MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
60
66
  "NFT": "0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828",
@@ -64,19 +70,19 @@
64
70
  },
65
71
  "PACKAGE": {
66
72
  "DOV_SINGLE": "0x2e462aa0224bec76acaea81c51ca5b9ae4b27ec50281a764797c84148c8a463f",
67
- "TAILS_EXP": "0x4aab9bfc3efe279981d73eca80129356238508d3f2ffdda38a4832faf94e0b9a",
73
+ "EXP_GUESS": "0x4aab9bfc3efe279981d73eca80129356238508d3f2ffdda38a4832faf94e0b9a",
68
74
  "FRAMEWORK": "0x90ca6e2393e3adc91b4e9b70ab16c017e5f70f7094b6f09b913fef2833a656e9",
69
75
  "MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
70
76
  "NFT": "0x0f5162014f18686640b8d0adefd60c3fe5b377413ec4f1e77001c67d96f8501a",
71
77
  "ORACLE": "0x71fbc7acaf513561dabdeb846e7dd5288108e56edb0b6de8d4999c4dfce21f66",
72
- "TYPUS": "0x459289f0c0ab93157fa49b42d7f61ac816dcca4879d6cedb832d4eea86926945"
78
+ "TYPUS": "0x88124ef8caf346cc19bf7447e72cf540fb6f228f16806effdc3dafccee747264"
73
79
  },
74
80
  "REGISTRY": {
75
81
  "AIRDROP": "0xfb2fbf261f6050d100bcd026ffa0076e088506b1bec26313947239303e2a0224",
76
82
  "DOV_SINGLE": "0x0285cbf4aa8585be6c978235d11d06fa35773266ede040d38d34e1d79b049460",
77
83
  "LEADERBOARD": "0x4faabe5a4a509a145fc9bae95761d34c11571da4cb25d681f06ffcbadbc355e7",
78
84
  "MFUD": "0x7ad87901531693f1baa541712947860dcc543617e11b14993ad70d20daf159c6",
79
- "TAILS_EXP": "0x37e0c8c80a5099d5dfe1b0aeae62e3f01916be73935090efb9c95279b7bb1ce7",
85
+ "EXP_GUESS": "0x37e0c8c80a5099d5dfe1b0aeae62e3f01916be73935090efb9c95279b7bb1ce7",
80
86
  "TAILS_STAKING": "0x989bd585b580dfc22d9d7656a5807b2f6c8fe36260a2003ef697adc8a38d21af",
81
87
  "TGLD": "0x2118b4056c89d90a6dc40d198fbe239cb8e83f7ea20daaf4ea53341c7fdb043c",
82
88
  "USER": "0x5f1894a3680949111a7530d63ceda6857d31521ab2de625e9f826cae17c9a7f3",
@@ -87,7 +93,8 @@
87
93
  "MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c::mfud::MFUD",
88
94
  "SUI": "0x2::sui::SUI",
89
95
  "TGLD": "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::tgld::TGLD",
90
- "USDT": "0xa38dad920880f81ea514de6db007d3a84e9116a29c60b3e69bbe418c2d9f553c::usdt::USDT"
96
+ "USDT": "0xa38dad920880f81ea514de6db007d3a84e9116a29c60b3e69bbe418c2d9f553c::usdt::USDT",
97
+ "AFSUI": "0xd31923b6821fb7ba32d23e514b43d307da6ef991f9ef1af2cc4e26a0992ac87a::afsui::AFSUI"
91
98
  },
92
99
  "ORACLE": {
93
100
  "AFSUI": "0xacd75f051b8be445226f92d873fbf9bbc26fe25cec5708b1aeec44286dbbef5b",
@@ -57,6 +57,7 @@ function getPlaygrounds(provider, diceRegistry) {
57
57
  case 0: return [4 /*yield*/, provider.getDynamicFields({ parentId: diceRegistry })];
58
58
  case 1:
59
59
  playgroundIds = (_a.sent()).data
60
+ .filter(function (a) { return a.objectType.endsWith("Playground"); })
60
61
  .sort(function (a, b) { return Number(a.name.value) - Number(b.name.value); })
61
62
  .map(function (x) { return x.objectId; });
62
63
  return [4 /*yield*/, provider.multiGetObjects({
@@ -152,6 +152,7 @@ registry, index, coins, amount, guess_1, larger_than_1, guess_2, larger_than_2)
152
152
  tx.pure(larger_than_1),
153
153
  tx.pure(guess_2),
154
154
  tx.pure(larger_than_2),
155
+ // tx.object("0x8"), // TODO: waiting for upgrade
155
156
  ],
156
157
  });
157
158
  tx.setGasBudget(gasBudget);
@@ -1,4 +1,4 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { TransactionBlock, TransactionObjectInput } from "@mysten/sui.js/transactions";
2
2
  /**
3
3
  entry fun upload_ids(
4
4
  version: &Version,
@@ -13,7 +13,7 @@ export declare function getUploadIdsTx(input: {
13
13
  typusEcosystemVersion: string;
14
14
  typusTailsStakingRegistry: string;
15
15
  ids: string[];
16
- }): Promise<TransactionBlock>;
16
+ }): TransactionBlock;
17
17
  /**
18
18
  entry fun remove_ids(
19
19
  version: &Version,
@@ -28,7 +28,7 @@ export declare function getRemoveIdsTx(input: {
28
28
  typusEcosystemVersion: string;
29
29
  typusTailsStakingRegistry: string;
30
30
  count: string;
31
- }): Promise<TransactionBlock>;
31
+ }): TransactionBlock;
32
32
  /**
33
33
  entry fun upload_levels(
34
34
  version: &Version,
@@ -43,7 +43,7 @@ export declare function getUploadLevelsTx(input: {
43
43
  typusEcosystemVersion: string;
44
44
  typusTailsStakingRegistry: string;
45
45
  count: string;
46
- }): Promise<TransactionBlock>;
46
+ }): TransactionBlock;
47
47
  /**
48
48
  entry fun remove_levels(
49
49
  version: &Version,
@@ -58,7 +58,7 @@ export declare function getRemoveLevelsTx(input: {
58
58
  typusEcosystemVersion: string;
59
59
  typusTailsStakingRegistry: string;
60
60
  count: string;
61
- }): Promise<TransactionBlock>;
61
+ }): TransactionBlock;
62
62
  /**
63
63
  entry fun upload_ipfs_urls(
64
64
  version: &Version,
@@ -75,7 +75,7 @@ export declare function getUploadIpfsUrlsTx(input: {
75
75
  typusTailsStakingRegistry: string;
76
76
  level: string;
77
77
  urls: string[][];
78
- }): Promise<TransactionBlock>;
78
+ }): TransactionBlock;
79
79
  /**
80
80
  entry fun remove_ipfs_urls(
81
81
  version: &Version,
@@ -90,7 +90,7 @@ export declare function getRemoveIpfsUrlsTx(input: {
90
90
  typusEcosystemVersion: string;
91
91
  typusTailsStakingRegistry: string;
92
92
  level: string;
93
- }): Promise<TransactionBlock>;
93
+ }): TransactionBlock;
94
94
  /**
95
95
  entry fun upload_webp_bytes(
96
96
  version: &Version,
@@ -109,7 +109,7 @@ export declare function getUploadWebpBytesTx(input: {
109
109
  number: string;
110
110
  level: string;
111
111
  bytes: string[];
112
- }): Promise<TransactionBlock>;
112
+ }): TransactionBlock;
113
113
  /**
114
114
  entry fun remove_webp_bytes(
115
115
  version: &Version,
@@ -126,7 +126,7 @@ export declare function getRemoveWebpBytesTx(input: {
126
126
  typusTailsStakingRegistry: string;
127
127
  number: string;
128
128
  level: string;
129
- }): Promise<TransactionBlock>;
129
+ }): TransactionBlock;
130
130
  /**
131
131
  entry fun update_tails_staking_registry_config(
132
132
  version: &Version,
@@ -143,7 +143,7 @@ export declare function getUpdateTailsStakingRegistryConfigTx(input: {
143
143
  typusTailsStakingRegistry: string;
144
144
  index: string;
145
145
  value: string;
146
- }): Promise<TransactionBlock>;
146
+ }): TransactionBlock;
147
147
  /**
148
148
  entry fun set_profit_sharing<TOKEN>(
149
149
  version: &Version,
@@ -159,11 +159,11 @@ export declare function getSetProfitSharingTx(input: {
159
159
  typusEcosystemVersion: string;
160
160
  typusTailsStakingRegistry: string;
161
161
  typeArguments: string[];
162
- level_profits: string;
163
- coins: string[];
162
+ levelProfits: string[];
163
+ coin: TransactionObjectInput;
164
164
  amount: string;
165
165
  tsMs: string;
166
- }): Promise<TransactionBlock>;
166
+ }): TransactionBlock;
167
167
  /**
168
168
  entry fun remove_profit_sharing<TOKEN>(
169
169
  version: &Version,
@@ -179,4 +179,4 @@ export declare function getRemoveProfitSharingTx(input: {
179
179
  typusTailsStakingRegistry: string;
180
180
  typeArguments: string[];
181
181
  recipient: string;
182
- }): Promise<TransactionBlock>;
182
+ }): TransactionBlock;
@@ -1,40 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.getRemoveProfitSharingTx = exports.getSetProfitSharingTx = exports.getUpdateTailsStakingRegistryConfigTx = exports.getRemoveWebpBytesTx = exports.getUploadWebpBytesTx = exports.getRemoveIpfsUrlsTx = exports.getUploadIpfsUrlsTx = exports.getRemoveLevelsTx = exports.getUploadLevelsTx = exports.getRemoveIdsTx = exports.getUploadIdsTx = void 0;
40
4
  /**
@@ -46,21 +10,16 @@ exports.getRemoveProfitSharingTx = exports.getSetProfitSharingTx = exports.getUp
46
10
  ) {
47
11
  */
48
12
  function getUploadIdsTx(input) {
49
- return __awaiter(this, void 0, void 0, function () {
50
- var result;
51
- return __generator(this, function (_a) {
52
- result = input.tx.moveCall({
53
- target: "".concat(input.typusPackageId, "::tails_staking::upload_ids"),
54
- typeArguments: [],
55
- arguments: [
56
- input.tx.object(input.typusEcosystemVersion),
57
- input.tx.object(input.typusTailsStakingRegistry),
58
- input.tx.pure(input.ids),
59
- ],
60
- });
61
- return [2 /*return*/, input.tx];
62
- });
13
+ var result = input.tx.moveCall({
14
+ target: "".concat(input.typusPackageId, "::tails_staking::upload_ids"),
15
+ typeArguments: [],
16
+ arguments: [
17
+ input.tx.object(input.typusEcosystemVersion),
18
+ input.tx.object(input.typusTailsStakingRegistry),
19
+ input.tx.pure(input.ids),
20
+ ],
63
21
  });
22
+ return input.tx;
64
23
  }
65
24
  exports.getUploadIdsTx = getUploadIdsTx;
66
25
  /**
@@ -72,21 +31,16 @@ exports.getUploadIdsTx = getUploadIdsTx;
72
31
  ) {
73
32
  */
74
33
  function getRemoveIdsTx(input) {
75
- return __awaiter(this, void 0, void 0, function () {
76
- var result;
77
- return __generator(this, function (_a) {
78
- result = input.tx.moveCall({
79
- target: "".concat(input.typusPackageId, "::tails_staking::remove_ids"),
80
- typeArguments: [],
81
- arguments: [
82
- input.tx.object(input.typusEcosystemVersion),
83
- input.tx.object(input.typusTailsStakingRegistry),
84
- input.tx.pure(input.count),
85
- ],
86
- });
87
- return [2 /*return*/, input.tx];
88
- });
34
+ var result = input.tx.moveCall({
35
+ target: "".concat(input.typusPackageId, "::tails_staking::remove_ids"),
36
+ typeArguments: [],
37
+ arguments: [
38
+ input.tx.object(input.typusEcosystemVersion),
39
+ input.tx.object(input.typusTailsStakingRegistry),
40
+ input.tx.pure(input.count),
41
+ ],
89
42
  });
43
+ return input.tx;
90
44
  }
91
45
  exports.getRemoveIdsTx = getRemoveIdsTx;
92
46
  /**
@@ -98,21 +52,16 @@ exports.getRemoveIdsTx = getRemoveIdsTx;
98
52
  ) {
99
53
  */
100
54
  function getUploadLevelsTx(input) {
101
- return __awaiter(this, void 0, void 0, function () {
102
- var result;
103
- return __generator(this, function (_a) {
104
- result = input.tx.moveCall({
105
- target: "".concat(input.typusPackageId, "::tails_staking::upload_levels"),
106
- typeArguments: [],
107
- arguments: [
108
- input.tx.object(input.typusEcosystemVersion),
109
- input.tx.object(input.typusTailsStakingRegistry),
110
- input.tx.pure(input.count),
111
- ],
112
- });
113
- return [2 /*return*/, input.tx];
114
- });
55
+ var result = input.tx.moveCall({
56
+ target: "".concat(input.typusPackageId, "::tails_staking::upload_levels"),
57
+ typeArguments: [],
58
+ arguments: [
59
+ input.tx.object(input.typusEcosystemVersion),
60
+ input.tx.object(input.typusTailsStakingRegistry),
61
+ input.tx.pure(input.count),
62
+ ],
115
63
  });
64
+ return input.tx;
116
65
  }
117
66
  exports.getUploadLevelsTx = getUploadLevelsTx;
118
67
  /**
@@ -124,21 +73,16 @@ exports.getUploadLevelsTx = getUploadLevelsTx;
124
73
  ) {
125
74
  */
126
75
  function getRemoveLevelsTx(input) {
127
- return __awaiter(this, void 0, void 0, function () {
128
- var result;
129
- return __generator(this, function (_a) {
130
- result = input.tx.moveCall({
131
- target: "".concat(input.typusPackageId, "::tails_staking::remove_levels"),
132
- typeArguments: [],
133
- arguments: [
134
- input.tx.object(input.typusEcosystemVersion),
135
- input.tx.object(input.typusTailsStakingRegistry),
136
- input.tx.pure(input.count),
137
- ],
138
- });
139
- return [2 /*return*/, input.tx];
140
- });
76
+ var result = input.tx.moveCall({
77
+ target: "".concat(input.typusPackageId, "::tails_staking::remove_levels"),
78
+ typeArguments: [],
79
+ arguments: [
80
+ input.tx.object(input.typusEcosystemVersion),
81
+ input.tx.object(input.typusTailsStakingRegistry),
82
+ input.tx.pure(input.count),
83
+ ],
141
84
  });
85
+ return input.tx;
142
86
  }
143
87
  exports.getRemoveLevelsTx = getRemoveLevelsTx;
144
88
  /**
@@ -151,22 +95,17 @@ exports.getRemoveLevelsTx = getRemoveLevelsTx;
151
95
  ) {
152
96
  */
153
97
  function getUploadIpfsUrlsTx(input) {
154
- return __awaiter(this, void 0, void 0, function () {
155
- var result;
156
- return __generator(this, function (_a) {
157
- result = input.tx.moveCall({
158
- target: "".concat(input.typusPackageId, "::tails_staking::upload_ipfs_urls"),
159
- typeArguments: [],
160
- arguments: [
161
- input.tx.object(input.typusEcosystemVersion),
162
- input.tx.object(input.typusTailsStakingRegistry),
163
- input.tx.pure(input.level),
164
- input.tx.pure(input.urls),
165
- ],
166
- });
167
- return [2 /*return*/, input.tx];
168
- });
98
+ var result = input.tx.moveCall({
99
+ target: "".concat(input.typusPackageId, "::tails_staking::upload_ipfs_urls"),
100
+ typeArguments: [],
101
+ arguments: [
102
+ input.tx.object(input.typusEcosystemVersion),
103
+ input.tx.object(input.typusTailsStakingRegistry),
104
+ input.tx.pure(input.level),
105
+ input.tx.pure(input.urls),
106
+ ],
169
107
  });
108
+ return input.tx;
170
109
  }
171
110
  exports.getUploadIpfsUrlsTx = getUploadIpfsUrlsTx;
172
111
  /**
@@ -178,21 +117,16 @@ exports.getUploadIpfsUrlsTx = getUploadIpfsUrlsTx;
178
117
  ) {
179
118
  */
180
119
  function getRemoveIpfsUrlsTx(input) {
181
- return __awaiter(this, void 0, void 0, function () {
182
- var result;
183
- return __generator(this, function (_a) {
184
- result = input.tx.moveCall({
185
- target: "".concat(input.typusPackageId, "::tails_staking::remove_ipfs_urls"),
186
- typeArguments: [],
187
- arguments: [
188
- input.tx.object(input.typusEcosystemVersion),
189
- input.tx.object(input.typusTailsStakingRegistry),
190
- input.tx.pure(input.level),
191
- ],
192
- });
193
- return [2 /*return*/, input.tx];
194
- });
120
+ var result = input.tx.moveCall({
121
+ target: "".concat(input.typusPackageId, "::tails_staking::remove_ipfs_urls"),
122
+ typeArguments: [],
123
+ arguments: [
124
+ input.tx.object(input.typusEcosystemVersion),
125
+ input.tx.object(input.typusTailsStakingRegistry),
126
+ input.tx.pure(input.level),
127
+ ],
195
128
  });
129
+ return input.tx;
196
130
  }
197
131
  exports.getRemoveIpfsUrlsTx = getRemoveIpfsUrlsTx;
198
132
  /**
@@ -206,23 +140,18 @@ exports.getRemoveIpfsUrlsTx = getRemoveIpfsUrlsTx;
206
140
  ) {
207
141
  */
208
142
  function getUploadWebpBytesTx(input) {
209
- return __awaiter(this, void 0, void 0, function () {
210
- var result;
211
- return __generator(this, function (_a) {
212
- result = input.tx.moveCall({
213
- target: "".concat(input.typusPackageId, "::tails_staking::upload_webp_bytes"),
214
- typeArguments: [],
215
- arguments: [
216
- input.tx.object(input.typusEcosystemVersion),
217
- input.tx.object(input.typusTailsStakingRegistry),
218
- input.tx.pure(input.number),
219
- input.tx.pure(input.level),
220
- input.tx.pure(input.bytes),
221
- ],
222
- });
223
- return [2 /*return*/, input.tx];
224
- });
143
+ var result = input.tx.moveCall({
144
+ target: "".concat(input.typusPackageId, "::tails_staking::upload_webp_bytes"),
145
+ typeArguments: [],
146
+ arguments: [
147
+ input.tx.object(input.typusEcosystemVersion),
148
+ input.tx.object(input.typusTailsStakingRegistry),
149
+ input.tx.pure(input.number),
150
+ input.tx.pure(input.level),
151
+ input.tx.pure(input.bytes),
152
+ ],
225
153
  });
154
+ return input.tx;
226
155
  }
227
156
  exports.getUploadWebpBytesTx = getUploadWebpBytesTx;
228
157
  /**
@@ -235,22 +164,17 @@ exports.getUploadWebpBytesTx = getUploadWebpBytesTx;
235
164
  ) {
236
165
  */
237
166
  function getRemoveWebpBytesTx(input) {
238
- return __awaiter(this, void 0, void 0, function () {
239
- var result;
240
- return __generator(this, function (_a) {
241
- result = input.tx.moveCall({
242
- target: "".concat(input.typusPackageId, "::tails_staking::remove_webp_bytes"),
243
- typeArguments: [],
244
- arguments: [
245
- input.tx.object(input.typusEcosystemVersion),
246
- input.tx.object(input.typusTailsStakingRegistry),
247
- input.tx.pure(input.number),
248
- input.tx.pure(input.level),
249
- ],
250
- });
251
- return [2 /*return*/, input.tx];
252
- });
167
+ var result = input.tx.moveCall({
168
+ target: "".concat(input.typusPackageId, "::tails_staking::remove_webp_bytes"),
169
+ typeArguments: [],
170
+ arguments: [
171
+ input.tx.object(input.typusEcosystemVersion),
172
+ input.tx.object(input.typusTailsStakingRegistry),
173
+ input.tx.pure(input.number),
174
+ input.tx.pure(input.level),
175
+ ],
253
176
  });
177
+ return input.tx;
254
178
  }
255
179
  exports.getRemoveWebpBytesTx = getRemoveWebpBytesTx;
256
180
  /**
@@ -263,22 +187,17 @@ exports.getRemoveWebpBytesTx = getRemoveWebpBytesTx;
263
187
  ) {
264
188
  */
265
189
  function getUpdateTailsStakingRegistryConfigTx(input) {
266
- return __awaiter(this, void 0, void 0, function () {
267
- var result;
268
- return __generator(this, function (_a) {
269
- result = input.tx.moveCall({
270
- target: "".concat(input.typusPackageId, "::tails_staking::update_tails_staking_registry_config"),
271
- typeArguments: [],
272
- arguments: [
273
- input.tx.object(input.typusEcosystemVersion),
274
- input.tx.object(input.typusTailsStakingRegistry),
275
- input.tx.pure(input.index),
276
- input.tx.pure(input.value),
277
- ],
278
- });
279
- return [2 /*return*/, input.tx];
280
- });
190
+ input.tx.moveCall({
191
+ target: "".concat(input.typusPackageId, "::tails_staking::update_tails_staking_registry_config"),
192
+ typeArguments: [],
193
+ arguments: [
194
+ input.tx.object(input.typusEcosystemVersion),
195
+ input.tx.object(input.typusTailsStakingRegistry),
196
+ input.tx.pure(input.index),
197
+ input.tx.pure(input.value),
198
+ ],
281
199
  });
200
+ return input.tx;
282
201
  }
283
202
  exports.getUpdateTailsStakingRegistryConfigTx = getUpdateTailsStakingRegistryConfigTx;
284
203
  /**
@@ -291,24 +210,19 @@ exports.getUpdateTailsStakingRegistryConfigTx = getUpdateTailsStakingRegistryCon
291
210
  ) {
292
211
  */
293
212
  function getSetProfitSharingTx(input) {
294
- return __awaiter(this, void 0, void 0, function () {
295
- var result;
296
- return __generator(this, function (_a) {
297
- result = input.tx.moveCall({
298
- target: "".concat(input.typusPackageId, "::tails_staking::set_profit_sharing"),
299
- typeArguments: input.typeArguments,
300
- arguments: [
301
- input.tx.object(input.typusEcosystemVersion),
302
- input.tx.object(input.typusTailsStakingRegistry),
303
- input.tx.pure(input.level_profits),
304
- input.tx.makeMoveVec({ objects: input.coins.map(function (coin) { return input.tx.object(coin); }) }),
305
- input.tx.pure(input.amount),
306
- input.tx.pure(input.tsMs),
307
- ],
308
- });
309
- return [2 /*return*/, input.tx];
310
- });
213
+ var result = input.tx.moveCall({
214
+ target: "".concat(input.typusPackageId, "::tails_staking::set_profit_sharing"),
215
+ typeArguments: input.typeArguments,
216
+ arguments: [
217
+ input.tx.object(input.typusEcosystemVersion),
218
+ input.tx.object(input.typusTailsStakingRegistry),
219
+ input.tx.pure(input.levelProfits),
220
+ input.tx.object(input.coin),
221
+ input.tx.pure(input.amount),
222
+ input.tx.pure(input.tsMs),
223
+ ],
311
224
  });
225
+ return input.tx;
312
226
  }
313
227
  exports.getSetProfitSharingTx = getSetProfitSharingTx;
314
228
  /**
@@ -320,20 +234,15 @@ exports.getSetProfitSharingTx = getSetProfitSharingTx;
320
234
  ) {
321
235
  */
322
236
  function getRemoveProfitSharingTx(input) {
323
- return __awaiter(this, void 0, void 0, function () {
324
- var result;
325
- return __generator(this, function (_a) {
326
- result = input.tx.moveCall({
327
- target: "".concat(input.typusPackageId, "::tails_staking::remove_profit_sharing"),
328
- typeArguments: input.typeArguments,
329
- arguments: [
330
- input.tx.object(input.typusEcosystemVersion),
331
- input.tx.object(input.typusTailsStakingRegistry),
332
- input.tx.pure(input.recipient),
333
- ],
334
- });
335
- return [2 /*return*/, input.tx];
336
- });
237
+ var result = input.tx.moveCall({
238
+ target: "".concat(input.typusPackageId, "::tails_staking::remove_profit_sharing"),
239
+ typeArguments: input.typeArguments,
240
+ arguments: [
241
+ input.tx.object(input.typusEcosystemVersion),
242
+ input.tx.object(input.typusTailsStakingRegistry),
243
+ input.tx.pure(input.recipient),
244
+ ],
337
245
  });
246
+ return input.tx;
338
247
  }
339
248
  exports.getRemoveProfitSharingTx = getRemoveProfitSharingTx;
@@ -282,10 +282,9 @@ exports.getClaimProfitSharingTx = getClaimProfitSharingTx;
282
282
  */
283
283
  function getLevelUpTx(input) {
284
284
  return __awaiter(this, void 0, void 0, function () {
285
- var result;
286
285
  return __generator(this, function (_a) {
287
- result = input.tx.moveCall({
288
- target: "".concat(input.typusPackageId, "::tails_staking::daily_sign_up"),
286
+ input.tx.moveCall({
287
+ target: "".concat(input.typusPackageId, "::tails_staking::level_up"),
289
288
  typeArguments: [],
290
289
  arguments: [
291
290
  input.tx.object(input.typusEcosystemVersion),
@@ -13,3 +13,9 @@ export declare function getStakingInfo(input: {
13
13
  typusTailsStakingRegistry: string;
14
14
  user: string;
15
15
  }): Promise<StakingInfo>;
16
+ export declare function getLevelCounts(input: {
17
+ provider: SuiClient;
18
+ typusPackageId: string;
19
+ typusEcosystemVersion: string;
20
+ typusTailsStakingRegistry: string;
21
+ }): Promise<number[]>;
@@ -36,14 +36,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getStakingInfo = exports.SENDER = void 0;
39
+ exports.getLevelCounts = exports.getStakingInfo = exports.SENDER = void 0;
40
40
  var transactions_1 = require("@mysten/sui.js/transactions");
41
41
  var bcs_1 = require("@mysten/bcs");
42
42
  var tools_1 = require("../tools");
43
43
  exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
44
44
  function getStakingInfo(input) {
45
45
  return __awaiter(this, void 0, void 0, function () {
46
- var transactionBlock, results, bytes, reader;
46
+ var transactionBlock, results, bytes, reader, length;
47
47
  return __generator(this, function (_a) {
48
48
  switch (_a.label) {
49
49
  case 0:
@@ -62,21 +62,57 @@ function getStakingInfo(input) {
62
62
  results = (_a.sent()).results;
63
63
  bytes = results[results.length - 1].returnValues[0][0];
64
64
  reader = new bcs_1.BcsReader(new Uint8Array(bytes));
65
- reader.readULEB();
66
- return [2 /*return*/, {
67
- user: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
68
- tails: reader.readVec(function (reader) {
69
- return reader.read64();
70
- }),
71
- profits: reader.readVec(function (reader) {
72
- return reader.read64();
73
- }),
74
- u64Padding: reader.readVec(function (reader) {
75
- return reader.read64();
76
- }),
77
- }];
65
+ length = reader.readULEB();
66
+ if (length > 0) {
67
+ return [2 /*return*/, {
68
+ user: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
69
+ tails: reader.readVec(function (reader) {
70
+ return reader.read64();
71
+ }),
72
+ profits: reader.readVec(function (reader) {
73
+ return reader.read64();
74
+ }),
75
+ u64Padding: reader.readVec(function (reader) {
76
+ return reader.read64();
77
+ }),
78
+ }];
79
+ }
80
+ else {
81
+ return [2 /*return*/, {
82
+ user: input.user,
83
+ tails: [],
84
+ profits: [],
85
+ u64Padding: ["0"],
86
+ }];
87
+ }
88
+ return [2 /*return*/];
78
89
  }
79
90
  });
80
91
  });
81
92
  }
82
93
  exports.getStakingInfo = getStakingInfo;
94
+ function getLevelCounts(input) {
95
+ return __awaiter(this, void 0, void 0, function () {
96
+ var transactionBlock, results, bytes, reader;
97
+ return __generator(this, function (_a) {
98
+ switch (_a.label) {
99
+ case 0:
100
+ transactionBlock = new transactions_1.TransactionBlock();
101
+ transactionBlock.moveCall({
102
+ target: "".concat(input.typusPackageId, "::tails_staking::get_level_counts"),
103
+ typeArguments: [],
104
+ arguments: [transactionBlock.pure(input.typusEcosystemVersion), transactionBlock.pure(input.typusTailsStakingRegistry)],
105
+ });
106
+ return [4 /*yield*/, input.provider.devInspectTransactionBlock({ sender: exports.SENDER, transactionBlock: transactionBlock })];
107
+ case 1:
108
+ results = (_a.sent()).results;
109
+ bytes = results[results.length - 1].returnValues[0][0];
110
+ reader = new bcs_1.BcsReader(new Uint8Array(bytes));
111
+ return [2 /*return*/, reader.readVec(function (reader) {
112
+ return Number.parseInt(reader.read64());
113
+ })];
114
+ }
115
+ });
116
+ });
117
+ }
118
+ exports.getLevelCounts = getLevelCounts;
@@ -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";
@@ -1,5 +1,5 @@
1
1
  import { SuiClient, SuiObjectResponse } from "@mysten/sui.js/client";
2
- import { KioskClient } from "@mysten/kiosk";
2
+ import { KioskClient, KioskListing } from "@mysten/kiosk";
3
3
  export declare function getPool(provider: SuiClient, pool: string): Promise<PoolData>;
4
4
  export interface PoolData {
5
5
  pool_id: string;
@@ -16,8 +16,9 @@ export interface TailsId {
16
16
  nftId: string;
17
17
  kiosk: string;
18
18
  kioskCap: string;
19
- tails: Tails;
19
+ tails: Tails | undefined;
20
20
  isPersonal: boolean;
21
+ listing?: KioskListing;
21
22
  }
22
23
  export interface kioskOwnerCap {
23
24
  kioskId: string;
@@ -25,7 +26,7 @@ export interface kioskOwnerCap {
25
26
  isPersonal: boolean;
26
27
  }
27
28
  export declare function getkioskOwnerCaps(datas: SuiObjectResponse[]): kioskOwnerCap[];
28
- export declare function getTailsIds(kioskClient: KioskClient, nftConfig: any, kioskOwnerCaps: kioskOwnerCap[]): Promise<TailsId[]>;
29
+ export declare function getTailsIds(kioskClient: KioskClient, NFT_PACKAGE_ORIGIN: string, kioskOwnerCaps: kioskOwnerCap[]): Promise<TailsId[]>;
29
30
  export interface TailsWithType extends Tails {
30
31
  type: string | null | undefined;
31
32
  }
@@ -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,9 +203,9 @@ 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
- // console.log(item.data);
208
+ // console.log(item);
209
209
  // @ts-ignore
210
210
  var tails = item.data;
211
211
  var t = {
@@ -213,6 +213,7 @@ function getTailsIds(kioskClient, nftConfig, kioskOwnerCaps) {
213
213
  kioskCap: kioskOwnerCap.objectId,
214
214
  isPersonal: kioskOwnerCap.isPersonal,
215
215
  nftId: item.objectId,
216
+ listing: item.listing,
216
217
  tails: tails,
217
218
  };
218
219
  return t;
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.23-tails-staking-merged-main",
5
+ "version": "1.3.23",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.8.10",