@typus/typus-sdk 1.2.74-dappkit → 1.2.75-tails-exp
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 +2 -2
- package/lib/utils/_framework/util.d.ts +5 -5
- package/lib/utils/api/sentio/reward-generated.d.ts +2 -0
- package/lib/utils/api/sentio/reward-generated.js +84 -1
- package/lib/utils/leaderboard/authority-entry.js +2 -2
- package/lib/utils/nft-staking/user-entry.d.ts +1 -1
- package/lib/utils/nft-staking/user-entry.js +12 -12
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.d.ts +29 -62
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.js +106 -226
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +37 -130
- package/lib/utils/typus-dov-single-v2/user-entry.js +57 -352
- package/package.json +3 -3
package/lib/config.json
CHANGED
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"LOCKED_VAULT": "0xe79b7ba69b750d30ac7ae171483a4064d0bb34090493fef3c844a11b05818d79"
|
|
65
65
|
},
|
|
66
66
|
"PACKAGE": {
|
|
67
|
-
"DOV_SINGLE": "
|
|
67
|
+
"DOV_SINGLE": "0xa4fe84c953785d9dcb388a860d30e3a1e46eeb9647f80c40359c192424f19938",
|
|
68
68
|
"FRAMEWORK": "0xa304e225551b619b07c06d8965462b268138b2c5774fd22ad8853ef91fbb9771",
|
|
69
69
|
"MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
|
|
70
70
|
"NFT": "0x0f5162014f18686640b8d0adefd60c3fe5b377413ec4f1e77001c67d96f8501a",
|
|
71
71
|
"ORACLE": "0x71fbc7acaf513561dabdeb846e7dd5288108e56edb0b6de8d4999c4dfce21f66",
|
|
72
|
-
"TYPUS": "
|
|
72
|
+
"TYPUS": "0x01840fac0c84618087065346acdbac28bdec4326c416fcd2dc6d2f1b7d86fe62"
|
|
73
73
|
},
|
|
74
74
|
"REGISTRY": {
|
|
75
75
|
"AIRDROP": "0xfb2fbf261f6050d100bcd026ffa0076e088506b1bec26313947239303e2a0224",
|
|
@@ -18,33 +18,33 @@ export declare function parseTypeName(name: string): {
|
|
|
18
18
|
export declare function isTransactionArgument(arg: GenericArg): arg is TransactionArgument;
|
|
19
19
|
export declare function isTransactionObjectArgument(arg: GenericArg): arg is TransactionObjectArgument;
|
|
20
20
|
export declare function obj(txb: TransactionBlock, arg: ObjectArg): {
|
|
21
|
+
type: "pure";
|
|
21
22
|
index: number;
|
|
22
23
|
kind: "Input";
|
|
23
|
-
type: "pure";
|
|
24
24
|
value?: any;
|
|
25
25
|
} | TransactionObjectArgument;
|
|
26
26
|
export declare function pure(txb: TransactionBlock, arg: PureArg, type: string): {
|
|
27
|
+
type: "pure";
|
|
27
28
|
index: number;
|
|
28
29
|
kind: "Input";
|
|
29
|
-
type: "pure";
|
|
30
30
|
value?: any;
|
|
31
31
|
} | TransactionObjectArgument;
|
|
32
32
|
export declare function option(txb: TransactionBlock, type: string, arg: GenericArg | null): {
|
|
33
|
+
type: "pure";
|
|
33
34
|
index: number;
|
|
34
35
|
kind: "Input";
|
|
35
|
-
type: "pure";
|
|
36
36
|
value?: any;
|
|
37
37
|
} | TransactionObjectArgument;
|
|
38
38
|
export declare function generic(txb: TransactionBlock, type: string, arg: GenericArg): {
|
|
39
|
+
type: "pure";
|
|
39
40
|
index: number;
|
|
40
41
|
kind: "Input";
|
|
41
|
-
type: "pure";
|
|
42
42
|
value?: any;
|
|
43
43
|
} | TransactionObjectArgument;
|
|
44
44
|
export declare function vector(txb: TransactionBlock, itemType: string, items: Array<GenericArg> | TransactionArgument): {
|
|
45
|
+
type: "pure";
|
|
45
46
|
index: number;
|
|
46
47
|
kind: "Input";
|
|
47
|
-
type: "pure";
|
|
48
48
|
value?: any;
|
|
49
49
|
} | TransactionObjectArgument;
|
|
50
50
|
export declare function typeArgIsPure(type: string): boolean;
|
|
@@ -11,4 +11,6 @@ interface TokenAmount {
|
|
|
11
11
|
}
|
|
12
12
|
/** Returns Accumulated Users [v1, v2] */
|
|
13
13
|
export declare function getAccumulatedUser(): Promise<number[]>;
|
|
14
|
+
/** Returns Accumulated Notional Volume in USD [v1, v2] */
|
|
15
|
+
export declare function getAccumulatedNotionalVolumeUSD(): Promise<number[]>;
|
|
14
16
|
export {};
|
|
@@ -47,7 +47,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
47
47
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.getAccumulatedUser = exports.getTotalProfitSharing = exports.getTotalProfitSharingClaimed = exports.getAccumulatedRewardGeneratedUSD = exports.getTotalPremium = exports.getTotalDepositorIncentive = void 0;
|
|
50
|
+
exports.getAccumulatedNotionalVolumeUSD = exports.getAccumulatedUser = exports.getTotalProfitSharing = exports.getTotalProfitSharingClaimed = exports.getAccumulatedRewardGeneratedUSD = exports.getTotalPremium = exports.getTotalDepositorIncentive = void 0;
|
|
51
51
|
var headers = {
|
|
52
52
|
"api-key": "tz3JJ6stG7Fux6ueRSRA5mdpC9U0lozI3",
|
|
53
53
|
"Content-Type": "application/json",
|
|
@@ -453,6 +453,89 @@ function getAccumulatedUser() {
|
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
exports.getAccumulatedUser = getAccumulatedUser;
|
|
456
|
+
/** Returns Accumulated Notional Volume in USD [v1, v2] */
|
|
457
|
+
function getAccumulatedNotionalVolumeUSD() {
|
|
458
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
459
|
+
var apiUrls, result, apiUrls_2, apiUrls_2_1, apiUrl, requestData, jsonData, response, data, e_4_1;
|
|
460
|
+
var e_4, _a;
|
|
461
|
+
return __generator(this, function (_b) {
|
|
462
|
+
switch (_b.label) {
|
|
463
|
+
case 0:
|
|
464
|
+
apiUrls = [
|
|
465
|
+
"https://app.sentio.xyz/api/v1/insights/typus/typus_v1/query",
|
|
466
|
+
"https://app.sentio.xyz/api/v1/insights/typus/typus_v2/query",
|
|
467
|
+
];
|
|
468
|
+
result = [];
|
|
469
|
+
_b.label = 1;
|
|
470
|
+
case 1:
|
|
471
|
+
_b.trys.push([1, 7, 8, 9]);
|
|
472
|
+
apiUrls_2 = __values(apiUrls), apiUrls_2_1 = apiUrls_2.next();
|
|
473
|
+
_b.label = 2;
|
|
474
|
+
case 2:
|
|
475
|
+
if (!!apiUrls_2_1.done) return [3 /*break*/, 6];
|
|
476
|
+
apiUrl = apiUrls_2_1.value;
|
|
477
|
+
requestData = {
|
|
478
|
+
timeRange: {
|
|
479
|
+
start: "now",
|
|
480
|
+
end: "now",
|
|
481
|
+
step: 3600,
|
|
482
|
+
timezone: "Asia/Taipei",
|
|
483
|
+
},
|
|
484
|
+
limit: 1,
|
|
485
|
+
queries: [
|
|
486
|
+
{
|
|
487
|
+
metricsQuery: {
|
|
488
|
+
query: "AccumulatedNotionalVolumeUSD",
|
|
489
|
+
alias: "",
|
|
490
|
+
id: "a",
|
|
491
|
+
labelSelector: {},
|
|
492
|
+
aggregate: {
|
|
493
|
+
op: "SUM",
|
|
494
|
+
grouping: [],
|
|
495
|
+
},
|
|
496
|
+
functions: [],
|
|
497
|
+
disabled: false,
|
|
498
|
+
},
|
|
499
|
+
dataSource: "METRICS",
|
|
500
|
+
sourceName: "",
|
|
501
|
+
},
|
|
502
|
+
],
|
|
503
|
+
formulas: [],
|
|
504
|
+
};
|
|
505
|
+
jsonData = JSON.stringify(requestData);
|
|
506
|
+
return [4 /*yield*/, fetch(apiUrl, {
|
|
507
|
+
method: "POST",
|
|
508
|
+
headers: headers,
|
|
509
|
+
body: jsonData,
|
|
510
|
+
})];
|
|
511
|
+
case 3:
|
|
512
|
+
response = _b.sent();
|
|
513
|
+
return [4 /*yield*/, response.json()];
|
|
514
|
+
case 4:
|
|
515
|
+
data = _b.sent();
|
|
516
|
+
console.log(data.results[0]);
|
|
517
|
+
result.push(data.results[0].matrix.samples[0].values[0].value);
|
|
518
|
+
_b.label = 5;
|
|
519
|
+
case 5:
|
|
520
|
+
apiUrls_2_1 = apiUrls_2.next();
|
|
521
|
+
return [3 /*break*/, 2];
|
|
522
|
+
case 6: return [3 /*break*/, 9];
|
|
523
|
+
case 7:
|
|
524
|
+
e_4_1 = _b.sent();
|
|
525
|
+
e_4 = { error: e_4_1 };
|
|
526
|
+
return [3 /*break*/, 9];
|
|
527
|
+
case 8:
|
|
528
|
+
try {
|
|
529
|
+
if (apiUrls_2_1 && !apiUrls_2_1.done && (_a = apiUrls_2.return)) _a.call(apiUrls_2);
|
|
530
|
+
}
|
|
531
|
+
finally { if (e_4) throw e_4.error; }
|
|
532
|
+
return [7 /*endfinally*/];
|
|
533
|
+
case 9: return [2 /*return*/, result];
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
exports.getAccumulatedNotionalVolumeUSD = getAccumulatedNotionalVolumeUSD;
|
|
456
539
|
var token_1 = require("../../token");
|
|
457
540
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
458
541
|
return __generator(this, function (_a) {
|
|
@@ -56,7 +56,7 @@ function getActivateLeaderboardTx(gasBudget, packageId, version, typusLeaderboar
|
|
|
56
56
|
tx.moveCall({
|
|
57
57
|
target: "".concat(packageId, "::leaderboard::activate_leaderboard"),
|
|
58
58
|
typeArguments: [],
|
|
59
|
-
arguments: [tx.object(version), tx.object(typusLeaderboardRegistry), tx.
|
|
59
|
+
arguments: [tx.object(version), tx.object(typusLeaderboardRegistry), tx.pure(key), tx.pure(start_ts_ms), tx.pure(end_ts_ms)],
|
|
60
60
|
});
|
|
61
61
|
tx.setGasBudget(gasBudget);
|
|
62
62
|
return [2 /*return*/, tx];
|
|
@@ -81,7 +81,7 @@ function getDeactivateLeaderboardTx(gasBudget, packageId, version, typusLeaderbo
|
|
|
81
81
|
tx.moveCall({
|
|
82
82
|
target: "".concat(packageId, "::leaderboard::deactivate_leaderboard"),
|
|
83
83
|
typeArguments: [],
|
|
84
|
-
arguments: [tx.object(version), tx.object(typusLeaderboardRegistry), tx.
|
|
84
|
+
arguments: [tx.object(version), tx.object(typusLeaderboardRegistry), tx.pure(key), tx.pure(id)],
|
|
85
85
|
});
|
|
86
86
|
tx.setGasBudget(gasBudget);
|
|
87
87
|
return [2 /*return*/, tx];
|
|
@@ -51,7 +51,7 @@ export declare function getDailyAttendTx(gasBudget: number, nftPackageId: string
|
|
|
51
51
|
ctx: &mut TxContext
|
|
52
52
|
)
|
|
53
53
|
*/
|
|
54
|
-
export declare function getSnapshotTx(gasBudget: number, nftPackageId: string, registry: string): Promise<TransactionBlock>;
|
|
54
|
+
export declare function getSnapshotTx(gasBudget: number, typusEcosystemVersion: string, typusUserRegistry: string, nftPackageId: string, registry: string, amount: string): Promise<TransactionBlock>;
|
|
55
55
|
export declare function getNewBidTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, priceOracle: string, coins: string[], size: string, premium_required: string, // fe float * b_token_decimal
|
|
56
56
|
usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
57
57
|
export declare function getDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, coins: string[], amount: string, usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
@@ -216,11 +216,11 @@ function getSwitchNftTx(gasBudget, nftPackageId, registry, personalKioskPackageI
|
|
|
216
216
|
return __generator(this, function (_c) {
|
|
217
217
|
tx = new transactions_1.TransactionBlock();
|
|
218
218
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
|
|
219
|
-
tx.moveCall({
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
});
|
|
219
|
+
// tx.moveCall({
|
|
220
|
+
// target: `${nftPackageId}::tails_staking::snapshot`,
|
|
221
|
+
// typeArguments: [],
|
|
222
|
+
// arguments: [tx.object(registry), tx.object(CLOCK)],
|
|
223
|
+
// });
|
|
224
224
|
tx.moveCall({
|
|
225
225
|
target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
|
|
226
226
|
typeArguments: typeArguments,
|
|
@@ -307,11 +307,11 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, typeArguments, kiosk
|
|
|
307
307
|
var tx, _a, personalKioskCap, borrow;
|
|
308
308
|
return __generator(this, function (_b) {
|
|
309
309
|
tx = new transactions_1.TransactionBlock();
|
|
310
|
-
tx.moveCall({
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
});
|
|
310
|
+
// tx.moveCall({
|
|
311
|
+
// target: `${nftPackageId}::tails_staking::snapshot`,
|
|
312
|
+
// typeArguments: [],
|
|
313
|
+
// arguments: [tx.object(registry), tx.object(CLOCK)],
|
|
314
|
+
// });
|
|
315
315
|
tx.moveCall({
|
|
316
316
|
target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
|
|
317
317
|
typeArguments: typeArguments,
|
|
@@ -380,7 +380,7 @@ exports.getDailyAttendTx = getDailyAttendTx;
|
|
|
380
380
|
ctx: &mut TxContext
|
|
381
381
|
)
|
|
382
382
|
*/
|
|
383
|
-
function getSnapshotTx(gasBudget, nftPackageId, registry) {
|
|
383
|
+
function getSnapshotTx(gasBudget, typusEcosystemVersion, typusUserRegistry, nftPackageId, registry, amount) {
|
|
384
384
|
return __awaiter(this, void 0, void 0, function () {
|
|
385
385
|
var tx;
|
|
386
386
|
return __generator(this, function (_a) {
|
|
@@ -388,7 +388,7 @@ function getSnapshotTx(gasBudget, nftPackageId, registry) {
|
|
|
388
388
|
tx.moveCall({
|
|
389
389
|
target: "".concat(nftPackageId, "::tails_staking::snapshot"),
|
|
390
390
|
typeArguments: [],
|
|
391
|
-
arguments: [tx.object(
|
|
391
|
+
arguments: [tx.object(typusEcosystemVersion), tx.object(typusUserRegistry), tx.object(registry), tx.pure(amount)],
|
|
392
392
|
});
|
|
393
393
|
tx.setGasBudget(gasBudget);
|
|
394
394
|
return [2 /*return*/, tx];
|
|
@@ -1,96 +1,63 @@
|
|
|
1
1
|
import { TransactionBlock, TransactionObjectArgument } from "@mysten/sui.js/transactions";
|
|
2
|
-
export declare function
|
|
3
|
-
tx: TransactionBlock;
|
|
4
|
-
typusFrameworkOriginPackageId: string;
|
|
5
|
-
typusDovSinglePackageId: string;
|
|
6
|
-
typusDovSingleRegistry: string;
|
|
7
|
-
mfudPackageId: string;
|
|
8
|
-
mfudRegistry: string;
|
|
9
|
-
mfudAmount: string;
|
|
10
|
-
typeArguments: string[];
|
|
11
|
-
index: string;
|
|
12
|
-
receipts: string[] | TransactionObjectArgument[];
|
|
13
|
-
user: string;
|
|
14
|
-
coins: string[];
|
|
15
|
-
}): TransactionBlock;
|
|
16
|
-
export declare function getWithdrawTx(input: {
|
|
17
|
-
tx: TransactionBlock;
|
|
18
|
-
typusFrameworkOriginPackageId: string;
|
|
19
|
-
typusFrameworkPackageId: string;
|
|
20
|
-
typusDovSinglePackageId: string;
|
|
21
|
-
typusDovSingleRegistry: string;
|
|
22
|
-
mfudPackageId: string;
|
|
23
|
-
mfudRegistry: string;
|
|
24
|
-
typeArguments: string[];
|
|
25
|
-
index: string;
|
|
26
|
-
receipts: string[] | TransactionObjectArgument[];
|
|
27
|
-
user: string;
|
|
28
|
-
amount?: string;
|
|
29
|
-
}): TransactionBlock;
|
|
30
|
-
export declare function getUnsubscribeTx(input: {
|
|
31
|
-
tx: TransactionBlock;
|
|
32
|
-
typusFrameworkOriginPackageId: string;
|
|
33
|
-
typusDovSinglePackageId: string;
|
|
34
|
-
typusDovSingleRegistry: string;
|
|
35
|
-
typeArguments: string[];
|
|
36
|
-
index: string;
|
|
37
|
-
receipts: string[] | TransactionObjectArgument[];
|
|
38
|
-
user: string;
|
|
39
|
-
amount?: string;
|
|
40
|
-
}): TransactionBlock;
|
|
41
|
-
export declare function getCompoundTx(input: {
|
|
42
|
-
tx: TransactionBlock;
|
|
43
|
-
typusFrameworkOriginPackageId: string;
|
|
44
|
-
typusFrameworkPackageId: string;
|
|
45
|
-
typusDovSinglePackageId: string;
|
|
46
|
-
typusDovSingleRegistry: string;
|
|
47
|
-
mfudPackageId: string;
|
|
48
|
-
mfudRegistry: string;
|
|
49
|
-
typeArguments: string[];
|
|
50
|
-
index: string;
|
|
51
|
-
receipts: string[] | TransactionObjectArgument[];
|
|
52
|
-
user: string;
|
|
53
|
-
incentiveToken?: string;
|
|
54
|
-
}): TransactionBlock;
|
|
55
|
-
export declare function getClaimTx(input: {
|
|
2
|
+
export declare function getRaiseFundTx(input: {
|
|
56
3
|
tx: TransactionBlock;
|
|
4
|
+
typusEcosystemVersion: string;
|
|
5
|
+
typusUserRegistry: string;
|
|
6
|
+
typusLeaderboardRegistry: string;
|
|
57
7
|
typusFrameworkOriginPackageId: string;
|
|
58
8
|
typusFrameworkPackageId: string;
|
|
59
9
|
typusDovSinglePackageId: string;
|
|
60
10
|
typusDovSingleRegistry: string;
|
|
61
|
-
|
|
62
|
-
|
|
11
|
+
typusTokenPackageId: string;
|
|
12
|
+
typusTokenRegistry: string;
|
|
13
|
+
typusTokenType: string;
|
|
63
14
|
typeArguments: string[];
|
|
64
15
|
index: string;
|
|
65
16
|
receipts: string[] | TransactionObjectArgument[];
|
|
17
|
+
raiseCoins: string[];
|
|
18
|
+
raiseAmount: string;
|
|
19
|
+
raiseFromPremium: boolean;
|
|
20
|
+
raiseFromInactive: boolean;
|
|
66
21
|
user: string;
|
|
67
22
|
}): TransactionBlock;
|
|
68
|
-
export declare function
|
|
23
|
+
export declare function getReduceFundTx(input: {
|
|
69
24
|
tx: TransactionBlock;
|
|
25
|
+
typusEcosystemVersion: string;
|
|
26
|
+
typusUserRegistry: string;
|
|
27
|
+
typusLeaderboardRegistry: string;
|
|
70
28
|
typusFrameworkOriginPackageId: string;
|
|
71
29
|
typusFrameworkPackageId: string;
|
|
72
30
|
typusDovSinglePackageId: string;
|
|
73
31
|
typusDovSingleRegistry: string;
|
|
74
|
-
mfudPackageId: string;
|
|
75
|
-
mfudRegistry: string;
|
|
76
32
|
typeArguments: string[];
|
|
33
|
+
typusTokenPackageId: string;
|
|
34
|
+
typusTokenRegistry: string;
|
|
35
|
+
typusTokenType: string;
|
|
77
36
|
index: string;
|
|
78
37
|
receipts: string[] | TransactionObjectArgument[];
|
|
38
|
+
reduceFromWarmup: string;
|
|
39
|
+
reduceFromActive: string;
|
|
40
|
+
reduceFromPremium: boolean;
|
|
41
|
+
reduceFromInactive: boolean;
|
|
42
|
+
reduceFromIncentive: boolean;
|
|
79
43
|
user: string;
|
|
80
|
-
incentiveToken?: string;
|
|
81
44
|
}): TransactionBlock;
|
|
82
|
-
export declare function
|
|
45
|
+
export declare function getDepositTx(input: {
|
|
83
46
|
tx: TransactionBlock;
|
|
47
|
+
typusEcosystemVersion: string;
|
|
48
|
+
typusUserRegistry: string;
|
|
49
|
+
typusLeaderboardRegistry: string;
|
|
84
50
|
typusFrameworkOriginPackageId: string;
|
|
85
|
-
typusFrameworkPackageId: string;
|
|
86
51
|
typusDovSinglePackageId: string;
|
|
87
52
|
typusDovSingleRegistry: string;
|
|
88
53
|
mfudPackageId: string;
|
|
89
54
|
mfudRegistry: string;
|
|
55
|
+
mfudAmount: string;
|
|
90
56
|
typeArguments: string[];
|
|
91
57
|
index: string;
|
|
92
58
|
receipts: string[] | TransactionObjectArgument[];
|
|
93
59
|
user: string;
|
|
60
|
+
coins: string[];
|
|
94
61
|
}): TransactionBlock;
|
|
95
62
|
export declare function getNewBidTx(input: {
|
|
96
63
|
tx: TransactionBlock;
|