@typus/typus-perp-sdk 1.0.54-feat-exp → 1.0.54-feat-exp-c
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/dist/src/api/sentio.js +2 -2
- package/dist/src/index.js +2 -2
- package/dist/src/user/tlp.js +9 -18
- package/package.json +1 -1
package/dist/src/api/sentio.js
CHANGED
|
@@ -248,7 +248,7 @@ function getTotalVolumeFromSentio() {
|
|
|
248
248
|
return [4 /*yield*/, response.json()];
|
|
249
249
|
case 2:
|
|
250
250
|
data = _a.sent();
|
|
251
|
-
result = data.results[0].matrix.samples[0].values
|
|
251
|
+
result = data.results[0].matrix.samples[0].values.at(-1).value;
|
|
252
252
|
// console.log(result);
|
|
253
253
|
return [2 /*return*/, result];
|
|
254
254
|
}
|
|
@@ -312,7 +312,7 @@ function getAccumulatedUser() {
|
|
|
312
312
|
return [4 /*yield*/, response.json()];
|
|
313
313
|
case 2:
|
|
314
314
|
data = _a.sent();
|
|
315
|
-
result = data.results[0].matrix.samples[0].values
|
|
315
|
+
result = data.results[0].matrix.samples[0].values.at(-1).value;
|
|
316
316
|
// console.log(result);
|
|
317
317
|
return [2 /*return*/, result];
|
|
318
318
|
}
|
package/dist/src/index.js
CHANGED
|
@@ -39,8 +39,8 @@ exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
|
39
39
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
40
40
|
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
|
41
41
|
exports.STAKE_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
42
|
-
? "
|
|
43
|
-
: "
|
|
42
|
+
? "0xd9965c09d5ad7d69306b7c550b3b135d94b34f98c3adc379a7333fff2f05808b"
|
|
43
|
+
: "0x34ba6bf1893409b1a7494350189e060ee79cc2aba6f0c5e4045af9372d96fe85";
|
|
44
44
|
exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
45
45
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
46
46
|
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
package/dist/src/user/tlp.js
CHANGED
|
@@ -137,15 +137,6 @@ function mintStakeLp(config, tx, pythClient, input) {
|
|
|
137
137
|
// console.log(iToken);
|
|
138
138
|
if (input.userShareId) {
|
|
139
139
|
harvestStakeReward(config, tx, { stakePool: input.stakePool, userShareId: input.userShareId, user: input.user });
|
|
140
|
-
(0, functions_2.snapshot)(tx, {
|
|
141
|
-
version: __1.STAKE_POOL_VERSION,
|
|
142
|
-
registry: __1.STAKE_POOL,
|
|
143
|
-
index: BigInt(0),
|
|
144
|
-
clock: constants_1.CLOCK,
|
|
145
|
-
userShareId: BigInt(input.userShareId),
|
|
146
|
-
typusEcosystemVersion: config.version.typus,
|
|
147
|
-
typusUserRegistry: config.registry.typus.user,
|
|
148
|
-
});
|
|
149
140
|
}
|
|
150
141
|
cToken = constants_1.tokenType[__1.NETWORK][input.cTOKEN];
|
|
151
142
|
lpCoin = (0, functions_1.mintLp)(tx, [cToken, __1.TLP_TOKEN], {
|
|
@@ -202,15 +193,6 @@ function unstakeBurn(config, tx, pythClient, input) {
|
|
|
202
193
|
finally { if (e_2) throw e_2.error; }
|
|
203
194
|
}
|
|
204
195
|
harvestStakeReward(config, tx, { stakePool: input.stakePool, userShareId: input.userShareId, user: input.user });
|
|
205
|
-
(0, functions_2.snapshot)(tx, {
|
|
206
|
-
version: __1.STAKE_POOL_VERSION,
|
|
207
|
-
registry: __1.STAKE_POOL,
|
|
208
|
-
index: BigInt(0),
|
|
209
|
-
clock: constants_1.CLOCK,
|
|
210
|
-
userShareId: BigInt(input.userShareId),
|
|
211
|
-
typusEcosystemVersion: config.version.typus,
|
|
212
|
-
typusUserRegistry: config.registry.typus.user,
|
|
213
|
-
});
|
|
214
196
|
lpCoin = (0, functions_2.unstake)(tx, __1.TLP_TOKEN, {
|
|
215
197
|
version: __1.STAKE_POOL_VERSION,
|
|
216
198
|
registry: __1.STAKE_POOL,
|
|
@@ -364,6 +346,15 @@ function harvestStakeReward(config, tx, input) {
|
|
|
364
346
|
var e_4, _a;
|
|
365
347
|
return __generator(this, function (_b) {
|
|
366
348
|
iTokens = input.stakePool.incentives.map(function (i) { return i.tokenType.name; });
|
|
349
|
+
(0, functions_2.snapshot)(tx, {
|
|
350
|
+
version: __1.STAKE_POOL_VERSION,
|
|
351
|
+
registry: __1.STAKE_POOL,
|
|
352
|
+
index: BigInt(0),
|
|
353
|
+
clock: constants_1.CLOCK,
|
|
354
|
+
userShareId: BigInt(input.userShareId),
|
|
355
|
+
typusEcosystemVersion: config.version.typus,
|
|
356
|
+
typusUserRegistry: config.registry.typus.user,
|
|
357
|
+
});
|
|
367
358
|
try {
|
|
368
359
|
for (iTokens_1 = __values(iTokens), iTokens_1_1 = iTokens_1.next(); !iTokens_1_1.done; iTokens_1_1 = iTokens_1.next()) {
|
|
369
360
|
iToken = iTokens_1_1.value;
|