@typus/typus-sdk 1.2.84-dapp-kit → 1.2.84-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 +1 -3
- package/lib/utils/_framework/util.d.ts +5 -5
- package/lib/utils/api/sentio/reward-generated.js +24 -4
- package/lib/utils/nft-staking/user-entry.d.ts +1 -1
- package/lib/utils/nft-staking/user-entry.js +12 -12
- package/lib/utils/tools.d.ts +0 -4
- package/lib/utils/tools.js +1 -26
- 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/lib/utils/user/view-functions.d.ts +1 -1
- package/lib/utils/user/view-functions.js +3 -3
- package/package.json +4 -7
- package/lib/utils/typus-dov-single-v2/function/bidding.d.ts +0 -143
- package/lib/utils/typus-dov-single-v2/function/bidding.js +0 -822
- package/lib/utils/typus-dov-single-v2/function/token.d.ts +0 -21
- package/lib/utils/typus-dov-single-v2/function/token.js +0 -36
- package/lib/utils/typus-dov-single-v2/function/vault.d.ts +0 -8
- package/lib/utils/typus-dov-single-v2/function/vault.js +0 -23
package/lib/config.json
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"TGLD_COIN_METADATA": "0x3a070c729606334a2be7c51ab28da9a1101b0de01452dd62c10cda0f7a5795d2",
|
|
6
6
|
"TGLD_TOKEN_POLICY": "0xd9461bd329f1df24be9698131b6e2c2b9eaac7c9cf6d76689112f2e57be12009",
|
|
7
7
|
"NFT_TRANSFER_POLICY": "0x55475b9e16d9a0176dcef37f83a1921b15f2cbd2711a5f30b9d952c0c8f5f957",
|
|
8
|
-
"STRATEGY_POOL": "0x2c60ddd50d76beb00faa025962d566359a6ea05b1f7f19ac6bd050f4db8c885c",
|
|
9
8
|
"PACKAGE_ORIGIN": {
|
|
10
9
|
"DOV_SINGLE": "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a",
|
|
11
10
|
"FRAMEWORK": "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274",
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
"TYPUS": "0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a"
|
|
16
15
|
},
|
|
17
16
|
"PACKAGE": {
|
|
18
|
-
"DOV_SINGLE": "
|
|
17
|
+
"DOV_SINGLE": "0x5395c48f9bd7ee96586fa1e10f22fc1cb2455f83994ca919aaef51ae4db40242",
|
|
19
18
|
"FRAMEWORK": "0x946d188d91cabd4fe15ef763e463a6738db1965814d3fd790085b4720cf90e28",
|
|
20
19
|
"MFUD": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
|
|
21
20
|
"NFT": "0xba06aae31d9b7c9f651e783272c7e4f776fb5ae17e89d525b75a17b099f58202",
|
|
@@ -55,7 +54,6 @@
|
|
|
55
54
|
"TGLD_COIN_METADATA": "0xf77f8aabe64dccef0e568f2ef58a6ca74bdfb31786507cc35b7626a4df0d0ebc",
|
|
56
55
|
"TGLD_TOKEN_POLICY": "0x17875c2f772053cd148bd2b8b8a40160db3f841825d8963192f8394d5c18974c",
|
|
57
56
|
"NFT_TRANSFER_POLICY": "0x1c62271ecc443c3d92a8fe8f5662e877856d26b971d967f66937a65f55160831",
|
|
58
|
-
"STRATEGY_POOL": "0x50b01081469d032e04bfcbd057614b1359376920f55c7bebd076e0e2af07a57f",
|
|
59
57
|
"PACKAGE_ORIGIN": {
|
|
60
58
|
"DOV_SINGLE": "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f",
|
|
61
59
|
"FRAMEWORK": "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded",
|
|
@@ -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;
|
|
@@ -165,7 +165,7 @@ function getAccumulatedRewardGeneratedUSD() {
|
|
|
165
165
|
queries: [
|
|
166
166
|
{
|
|
167
167
|
metricsQuery: {
|
|
168
|
-
query: "
|
|
168
|
+
query: "premiumUSD",
|
|
169
169
|
alias: "",
|
|
170
170
|
id: "a",
|
|
171
171
|
labelSelector: {},
|
|
@@ -173,14 +173,34 @@ function getAccumulatedRewardGeneratedUSD() {
|
|
|
173
173
|
op: "SUM",
|
|
174
174
|
grouping: [],
|
|
175
175
|
},
|
|
176
|
-
functions: [
|
|
177
|
-
|
|
176
|
+
functions: [
|
|
177
|
+
{
|
|
178
|
+
name: "sum_over_time",
|
|
179
|
+
arguments: [
|
|
180
|
+
{
|
|
181
|
+
durationValue: {
|
|
182
|
+
value: 100,
|
|
183
|
+
unit: "w",
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
disabled: true,
|
|
178
190
|
},
|
|
179
191
|
dataSource: "METRICS",
|
|
180
192
|
sourceName: "",
|
|
181
193
|
},
|
|
182
194
|
],
|
|
183
|
-
formulas: [
|
|
195
|
+
formulas: [
|
|
196
|
+
{
|
|
197
|
+
expression: "a/2",
|
|
198
|
+
alias: "",
|
|
199
|
+
id: "A",
|
|
200
|
+
disabled: false,
|
|
201
|
+
functions: [],
|
|
202
|
+
},
|
|
203
|
+
],
|
|
184
204
|
};
|
|
185
205
|
jsonDataV1 = JSON.stringify(requestDataV1);
|
|
186
206
|
return [4 /*yield*/, fetch(apiUrlV1, {
|
|
@@ -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];
|
package/lib/utils/tools.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import BigNumber from "bignumber.js";
|
|
2
1
|
export declare function U64FromBytes(x: any): bigint;
|
|
3
2
|
export declare function AddressFromBytes(x: any): string;
|
|
4
|
-
export declare const insertAt: (str: string, sub: string, pos: number) => string;
|
|
5
|
-
export declare const checkNumber: (str: any) => boolean;
|
|
6
|
-
export declare const countFloating: (value: number | BigNumber) => number;
|
package/lib/utils/tools.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
3
|
+
exports.AddressFromBytes = exports.U64FromBytes = void 0;
|
|
8
4
|
function U64FromBytes(x) {
|
|
9
5
|
var u64 = BigInt(0);
|
|
10
6
|
for (var i = 0; i < x.length; i++) {
|
|
@@ -22,24 +18,3 @@ function AddressFromBytes(x) {
|
|
|
22
18
|
return address;
|
|
23
19
|
}
|
|
24
20
|
exports.AddressFromBytes = AddressFromBytes;
|
|
25
|
-
var insertAt = function (str, sub, pos) { return "".concat(str.slice(0, pos)).concat(sub).concat(str.slice(pos)); };
|
|
26
|
-
exports.insertAt = insertAt;
|
|
27
|
-
var checkNumber = function (str) {
|
|
28
|
-
if (typeof str != "string")
|
|
29
|
-
return false; // we only process strings!
|
|
30
|
-
return (
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
!isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...
|
|
33
|
-
!isNaN(parseFloat(str))); // ...and ensure strings of whitespace fail
|
|
34
|
-
};
|
|
35
|
-
exports.checkNumber = checkNumber;
|
|
36
|
-
var countFloating = function (value) {
|
|
37
|
-
var num = (0, bignumber_js_1.default)(value).toFixed().replace(/,/g, "");
|
|
38
|
-
if (value instanceof bignumber_js_1.default) {
|
|
39
|
-
num = value.toFixed().replace(/,/g, "");
|
|
40
|
-
}
|
|
41
|
-
if (!num.includes("."))
|
|
42
|
-
return 0;
|
|
43
|
-
return num.split(".")[1].length;
|
|
44
|
-
};
|
|
45
|
-
exports.countFloating = countFloating;
|
|
@@ -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;
|