@typus/typus-sdk 1.3.27-tails-staking → 1.3.29-tails-staking
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 +1 -1
- package/lib/utils/tails-staking/authorized-entry.d.ts +14 -14
- package/lib/utils/tails-staking/authorized-entry.js +107 -198
- package/lib/utils/tails-staking/view-function.d.ts +6 -0
- package/lib/utils/tails-staking/view-function.js +26 -1
- package/lib/utils/typus-dov-single-v2/user-history.js +3 -0
- package/package.json +1 -1
package/lib/config.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
|
|
70
70
|
"NFT": "0x0f5162014f18686640b8d0adefd60c3fe5b377413ec4f1e77001c67d96f8501a",
|
|
71
71
|
"ORACLE": "0x71fbc7acaf513561dabdeb846e7dd5288108e56edb0b6de8d4999c4dfce21f66",
|
|
72
|
-
"TYPUS": "
|
|
72
|
+
"TYPUS": "0x581c0faa8a33fc123a346a2afee6a74f4c19022b08310506c47dfb2a6ecc9995"
|
|
73
73
|
},
|
|
74
74
|
"REGISTRY": {
|
|
75
75
|
"AIRDROP": "0xfb2fbf261f6050d100bcd026ffa0076e088506b1bec26313947239303e2a0224",
|
|
@@ -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
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
|
|
163
|
-
|
|
162
|
+
levelProfits: string[];
|
|
163
|
+
coin: TransactionObjectInput;
|
|
164
164
|
amount: string;
|
|
165
165
|
tsMs: string;
|
|
166
|
-
}):
|
|
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
|
-
}):
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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;
|
|
@@ -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,7 +36,7 @@ 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");
|
|
@@ -91,3 +91,28 @@ function getStakingInfo(input) {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
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;
|
|
@@ -193,6 +193,9 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
193
193
|
Action = "Train Tail";
|
|
194
194
|
Tails = "#".concat(event.parsedJson.log[0]);
|
|
195
195
|
Exp = event.parsedJson.log[1];
|
|
196
|
+
if (Number(Exp) == 0) {
|
|
197
|
+
return [2 /*return*/, txHistory];
|
|
198
|
+
}
|
|
196
199
|
}
|
|
197
200
|
break;
|
|
198
201
|
case "LevelUpEvent":
|