@typus/typus-sdk 1.4.18 → 1.4.19
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/config-mainnet.json +3 -3
- package/dist/src/auto-bid/token-user-entry.d.ts +9 -0
- package/dist/src/auto-bid/token-user-entry.js +126 -0
- package/dist/src/typus/airdrop/authority-entry.d.ts +14 -2
- package/dist/src/typus/airdrop/authority-entry.js +27 -32
- package/dist/src/typus/airdrop/user-entry.d.ts +2 -5
- package/dist/src/typus/airdrop/user-entry.js +8 -8
- package/dist/src/typus/airdrop/view-function.d.ts +2 -5
- package/dist/src/typus/airdrop/view-function.js +5 -5
- package/dist/src/typus/leaderboard/authority-entry.d.ts +10 -2
- package/dist/src/typus/leaderboard/authority-entry.js +12 -13
- package/dist/src/typus/leaderboard/view-function.d.ts +2 -5
- package/dist/src/typus/leaderboard/view-function.js +6 -6
- package/dist/src/typus/tails-staking/authority-entry.d.ts +12 -55
- package/dist/src/typus/tails-staking/authority-entry.js +73 -97
- package/dist/src/typus/tails-staking/user-entry.d.ts +14 -44
- package/dist/src/typus/tails-staking/user-entry.js +123 -123
- package/dist/src/typus/tails-staking/view-function.d.ts +3 -11
- package/dist/src/typus/tails-staking/view-function.js +10 -10
- package/dist/src/typus/user/view-function.d.ts +2 -5
- package/dist/src/typus/user/view-function.js +5 -5
- package/dist/src/typus-dov-single-v2/authority-entry.d.ts +26 -18
- package/dist/src/typus-dov-single-v2/authority-entry.js +23 -114
- package/dist/src/typus-dov-single-v2/function/bidding.js +4 -5
- package/dist/src/typus-dov-single-v2/token-user-entry.d.ts +11 -84
- package/dist/src/typus-dov-single-v2/token-user-entry.js +191 -316
- package/dist/src/typus-dov-single-v2/user-entry.d.ts +11 -69
- package/dist/src/typus-dov-single-v2/user-entry.js +183 -194
- package/dist/src/typus-dov-single-v2/view-function.d.ts +20 -6
- package/dist/src/typus-dov-single-v2/view-function.js +37 -43
- package/dist/src/typus-perp/user/orderWithBidReceipt.js +1 -5
- package/dist/src/typus-safu/index.d.ts +2 -1
- package/dist/src/typus-safu/index.js +2 -1
- package/dist/src/typus-safu/user-history.d.ts +12 -0
- package/dist/src/typus-safu/user-history.js +312 -0
- package/dist/src/utils/typusConfig.d.ts +1 -0
- package/package.json +1 -1
package/dist/config-mainnet.json
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"DICE": "0x14f1676b7a3b3a6c35eeff747bdb6fcb5bfe920755086c4af1079c23107c22aa",
|
|
17
17
|
"FRAMEWORK": "0x5c6648fb219c046256488486d23d4af7bc562d5ab5c382e1f4b558066a327fe8",
|
|
18
18
|
"TOKEN": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
|
|
19
|
-
"NFT": "
|
|
19
|
+
"NFT": "0x153ead7b2ccad1483458d41f0daffa35965d89960d1024a4883ba52fb18332b3",
|
|
20
20
|
"ORACLE": "0x978f65df8570a075298598a9965c18de9087f9e888eb3430fe20334f5c554cfd",
|
|
21
|
-
"TYPUS": "
|
|
21
|
+
"TYPUS": "0xea14501c603e8fcd907087d3aa7cb7adb4d7b3a7ea5e078cc9e8f05c67bc8034",
|
|
22
22
|
"PERP": "",
|
|
23
|
-
"SAFU": "
|
|
23
|
+
"SAFU": "0x86b7b8da287b130d347721a8fc529cbd7b922bd0edfcd2789413a4d118485eb3"
|
|
24
24
|
},
|
|
25
25
|
"VERSION": {
|
|
26
26
|
"TYPUS": "0xd2882b992e986250b3304b59530700bc3850939f9a77e9e9dfa9cf1656f84b3d",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
|
+
export declare function getMfudNewStrategyTx(gasBudget: number, packageId: string, typeArguments: string[], // D_TOKEN, B_TOKEN
|
|
3
|
+
registry: string, strategy_pool: string, vault_index: string, signal_index: string, coins: string[], mfudPackageId: string, mfudRegistry: string, mfudAmount: string, size: string, price_percentage: string, max_times: string, target_rounds: string[]): TransactionBlock;
|
|
4
|
+
export declare function getMfudUpdateStrategyTx(gasBudget: number, packageId: string, typeArguments: string[], // D_TOKEN, B_TOKEN
|
|
5
|
+
registry: string, strategy_pool: string, vault_index: string, signal_index: string, strategy_index: string, coins: string[], mfudPackageId: string, mfudRegistry: string, mfudAmount: string, size: string | null, price_percentage: string | null, max_times: string | null, target_rounds: string[]): TransactionBlock;
|
|
6
|
+
export declare function getMfudCloseStrategyTx(gasBudget: number, packageId: string, typeArguments: string[], // D_TOKEN, B_TOKEN
|
|
7
|
+
registry: string, strategy_pool: string, vault_index: string, signal_index: string, strategy_index: string, mfudPackageId: string, mfudRegistry: string, sender: string): TransactionBlock;
|
|
8
|
+
export declare function getMfudWithdrawProfitStrategyTx(gasBudget: number, packageId: string, typeArguments: string[], // D_TOKEN, B_TOKEN
|
|
9
|
+
registry: string, strategy_pool: string, vault_index: string, signal_index: string, strategy_index: string, mfudPackageId: string, mfudRegistry: string, sender: string, txBlock?: TransactionBlock): TransactionBlock;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.getMfudNewStrategyTx = getMfudNewStrategyTx;
|
|
20
|
+
exports.getMfudUpdateStrategyTx = getMfudUpdateStrategyTx;
|
|
21
|
+
exports.getMfudCloseStrategyTx = getMfudCloseStrategyTx;
|
|
22
|
+
exports.getMfudWithdrawProfitStrategyTx = getMfudWithdrawProfitStrategyTx;
|
|
23
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
24
|
+
function getMfudNewStrategyTx(gasBudget, packageId, typeArguments, // D_TOKEN, B_TOKEN
|
|
25
|
+
registry, strategy_pool, vault_index, signal_index, coins, mfudPackageId, mfudRegistry, mfudAmount, size, price_percentage, max_times, target_rounds) {
|
|
26
|
+
var tx = new transactions_1.TransactionBlock();
|
|
27
|
+
var input_coin = tx.moveCall({
|
|
28
|
+
target: "".concat(mfudPackageId, "::mfud::mint"),
|
|
29
|
+
arguments: [tx.object(mfudRegistry), tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }), tx.pure(mfudAmount)],
|
|
30
|
+
});
|
|
31
|
+
tx.moveCall({
|
|
32
|
+
target: "".concat(packageId, "::auto_bid::new_strategy"),
|
|
33
|
+
typeArguments: typeArguments,
|
|
34
|
+
arguments: [
|
|
35
|
+
tx.object(registry),
|
|
36
|
+
tx.object(strategy_pool),
|
|
37
|
+
tx.pure(vault_index),
|
|
38
|
+
tx.pure(signal_index),
|
|
39
|
+
tx.pure(size),
|
|
40
|
+
tx.pure(price_percentage),
|
|
41
|
+
tx.pure(max_times),
|
|
42
|
+
tx.pure(target_rounds),
|
|
43
|
+
input_coin,
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
tx.setGasBudget(gasBudget);
|
|
47
|
+
return tx;
|
|
48
|
+
}
|
|
49
|
+
function getMfudUpdateStrategyTx(gasBudget, packageId, typeArguments, // D_TOKEN, B_TOKEN
|
|
50
|
+
registry, strategy_pool, vault_index, signal_index, strategy_index, coins, mfudPackageId, mfudRegistry, mfudAmount, size, price_percentage, max_times, target_rounds) {
|
|
51
|
+
var tx = new transactions_1.TransactionBlock();
|
|
52
|
+
var _a = __read(tx.moveCall({
|
|
53
|
+
target: "".concat(mfudPackageId, "::mfud::mint"),
|
|
54
|
+
arguments: [tx.object(mfudRegistry), tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }), tx.pure(mfudAmount)],
|
|
55
|
+
}), 1), input_coin = _a[0];
|
|
56
|
+
tx.moveCall({
|
|
57
|
+
target: "".concat(packageId, "::auto_bid::update_strategy"),
|
|
58
|
+
typeArguments: typeArguments,
|
|
59
|
+
arguments: [
|
|
60
|
+
tx.object(registry),
|
|
61
|
+
tx.object(strategy_pool),
|
|
62
|
+
tx.pure(vault_index),
|
|
63
|
+
tx.pure(signal_index),
|
|
64
|
+
tx.pure(strategy_index),
|
|
65
|
+
tx.pure(size ? [size] : []),
|
|
66
|
+
tx.pure(price_percentage ? [price_percentage] : []),
|
|
67
|
+
tx.pure(max_times ? [max_times] : []),
|
|
68
|
+
tx.pure(target_rounds),
|
|
69
|
+
tx.makeMoveVec({ objects: [input_coin] }),
|
|
70
|
+
],
|
|
71
|
+
});
|
|
72
|
+
tx.setGasBudget(gasBudget);
|
|
73
|
+
return tx;
|
|
74
|
+
}
|
|
75
|
+
function getMfudCloseStrategyTx(gasBudget, packageId, typeArguments, // D_TOKEN, B_TOKEN
|
|
76
|
+
registry, strategy_pool, vault_index, signal_index, strategy_index, mfudPackageId, mfudRegistry, sender) {
|
|
77
|
+
var tx = new transactions_1.TransactionBlock();
|
|
78
|
+
var _a = __read(tx.moveCall({
|
|
79
|
+
target: "".concat(packageId, "::auto_bid::close_strategy"),
|
|
80
|
+
typeArguments: typeArguments,
|
|
81
|
+
arguments: [tx.object(registry), tx.object(strategy_pool), tx.pure(vault_index), tx.pure(signal_index), tx.pure(strategy_index)],
|
|
82
|
+
}), 2), d_token = _a[0], b_token = _a[1];
|
|
83
|
+
if (typeArguments[0].endsWith("MFUD")) {
|
|
84
|
+
var fud_coin = tx.moveCall({
|
|
85
|
+
target: "".concat(mfudPackageId, "::mfud::burn"),
|
|
86
|
+
arguments: [tx.object(mfudRegistry), d_token],
|
|
87
|
+
});
|
|
88
|
+
tx.transferObjects([tx.object(fud_coin)], sender);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
tx.transferObjects([d_token], sender);
|
|
92
|
+
}
|
|
93
|
+
if (typeArguments[1].endsWith("MFUD")) {
|
|
94
|
+
var fud_coin = tx.moveCall({
|
|
95
|
+
target: "".concat(mfudPackageId, "::mfud::burn"),
|
|
96
|
+
arguments: [tx.object(mfudRegistry), b_token],
|
|
97
|
+
});
|
|
98
|
+
tx.transferObjects([tx.object(fud_coin)], sender);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
tx.transferObjects([b_token], sender);
|
|
102
|
+
}
|
|
103
|
+
tx.setGasBudget(gasBudget);
|
|
104
|
+
return tx;
|
|
105
|
+
}
|
|
106
|
+
function getMfudWithdrawProfitStrategyTx(gasBudget, packageId, typeArguments, // D_TOKEN, B_TOKEN
|
|
107
|
+
registry, strategy_pool, vault_index, signal_index, strategy_index, mfudPackageId, mfudRegistry, sender, txBlock) {
|
|
108
|
+
var tx = txBlock ? txBlock : new transactions_1.TransactionBlock();
|
|
109
|
+
var d_token = tx.moveCall({
|
|
110
|
+
target: "".concat(packageId, "::auto_bid::withdraw_profit"),
|
|
111
|
+
typeArguments: typeArguments,
|
|
112
|
+
arguments: [tx.object(registry), tx.object(strategy_pool), tx.pure(vault_index), tx.pure(signal_index), tx.pure(strategy_index)],
|
|
113
|
+
});
|
|
114
|
+
if (typeArguments[0].endsWith("MFUD")) {
|
|
115
|
+
var fud_coin = tx.moveCall({
|
|
116
|
+
target: "".concat(mfudPackageId, "::mfud::burn"),
|
|
117
|
+
arguments: [tx.object(mfudRegistry), d_token],
|
|
118
|
+
});
|
|
119
|
+
tx.transferObjects([tx.object(fud_coin)], sender);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
tx.transferObjects([d_token], sender);
|
|
123
|
+
}
|
|
124
|
+
tx.setGasBudget(gasBudget);
|
|
125
|
+
return tx;
|
|
126
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
2
3
|
/**
|
|
3
4
|
public fun remove_airdrop<TOKEN>(
|
|
4
5
|
version: &Version,
|
|
@@ -7,7 +8,11 @@ import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
|
7
8
|
ctx: &mut TxContext,
|
|
8
9
|
): Balance<TOKEN>
|
|
9
10
|
*/
|
|
10
|
-
export declare function getRemoveAirdropTx(
|
|
11
|
+
export declare function getRemoveAirdropTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
12
|
+
typeArguments: string[];
|
|
13
|
+
key: string;
|
|
14
|
+
sender: string;
|
|
15
|
+
}): Promise<TransactionBlock>;
|
|
11
16
|
/**
|
|
12
17
|
public fun set_airdrop<TOKEN>(
|
|
13
18
|
version: &Version,
|
|
@@ -19,4 +24,11 @@ export declare function getRemoveAirdropTx(gasBudget: number, packageId: string,
|
|
|
19
24
|
ctx: &mut TxContext,
|
|
20
25
|
)
|
|
21
26
|
*/
|
|
22
|
-
export declare function getSetAirdropTx(
|
|
27
|
+
export declare function getSetAirdropTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
28
|
+
typeArguments: string[];
|
|
29
|
+
key: string;
|
|
30
|
+
coins: string[];
|
|
31
|
+
amount: string;
|
|
32
|
+
users: string[];
|
|
33
|
+
values: string[];
|
|
34
|
+
}): Promise<TransactionBlock>;
|
|
@@ -54,7 +54,6 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.getRemoveAirdropTx = getRemoveAirdropTx;
|
|
56
56
|
exports.getSetAirdropTx = getSetAirdropTx;
|
|
57
|
-
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
58
57
|
/**
|
|
59
58
|
public fun remove_airdrop<TOKEN>(
|
|
60
59
|
version: &Version,
|
|
@@ -63,23 +62,21 @@ var transactions_1 = require("@mysten/sui.js/transactions");
|
|
|
63
62
|
ctx: &mut TxContext,
|
|
64
63
|
): Balance<TOKEN>
|
|
65
64
|
*/
|
|
66
|
-
function getRemoveAirdropTx(
|
|
65
|
+
function getRemoveAirdropTx(config, tx, input) {
|
|
67
66
|
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
var
|
|
67
|
+
var balance, coin;
|
|
69
68
|
return __generator(this, function (_a) {
|
|
70
|
-
tx = new transactions_1.TransactionBlock();
|
|
71
69
|
balance = tx.moveCall({
|
|
72
|
-
target: "".concat(
|
|
73
|
-
typeArguments: typeArguments,
|
|
74
|
-
arguments: [tx.object(version), tx.object(
|
|
70
|
+
target: "".concat(config.package.typus, "::airdrop::remove_airdrop"),
|
|
71
|
+
typeArguments: input.typeArguments,
|
|
72
|
+
arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.airdrop), tx.object(input.key)],
|
|
75
73
|
});
|
|
76
74
|
coin = tx.moveCall({
|
|
77
75
|
target: "0x2::coin::from_balance",
|
|
78
|
-
typeArguments: typeArguments,
|
|
76
|
+
typeArguments: input.typeArguments,
|
|
79
77
|
arguments: [balance],
|
|
80
78
|
});
|
|
81
|
-
tx.transferObjects([coin], sender);
|
|
82
|
-
tx.setGasBudget(gasBudget);
|
|
79
|
+
tx.transferObjects([coin], input.sender);
|
|
83
80
|
return [2 /*return*/, tx];
|
|
84
81
|
});
|
|
85
82
|
});
|
|
@@ -95,42 +92,40 @@ function getRemoveAirdropTx(gasBudget, packageId, version, typusLeaderboardRegis
|
|
|
95
92
|
ctx: &mut TxContext,
|
|
96
93
|
)
|
|
97
94
|
*/
|
|
98
|
-
function getSetAirdropTx(
|
|
95
|
+
function getSetAirdropTx(config, tx, input) {
|
|
99
96
|
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
var
|
|
97
|
+
var _a, coin;
|
|
101
98
|
return __generator(this, function (_b) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
_a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
|
|
99
|
+
if (input.typeArguments[0] == "0x2::sui::SUI" ||
|
|
100
|
+
input.typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI") {
|
|
101
|
+
_a = __read(tx.splitCoins(tx.gas, [tx.pure(input.amount)]), 1), coin = _a[0];
|
|
106
102
|
tx.moveCall({
|
|
107
|
-
target: "".concat(
|
|
108
|
-
typeArguments: typeArguments,
|
|
103
|
+
target: "".concat(config.package.typus, "::airdrop::set_airdrop"),
|
|
104
|
+
typeArguments: input.typeArguments,
|
|
109
105
|
arguments: [
|
|
110
|
-
tx.object(version),
|
|
111
|
-
tx.object(
|
|
112
|
-
tx.object(key),
|
|
106
|
+
tx.object(config.version.typus),
|
|
107
|
+
tx.object(config.registry.typus.airdrop),
|
|
108
|
+
tx.object(input.key),
|
|
113
109
|
tx.makeMoveVec({ objects: [coin] }),
|
|
114
|
-
tx.pure(users),
|
|
115
|
-
tx.pure(values),
|
|
110
|
+
tx.pure(input.users),
|
|
111
|
+
tx.pure(input.values),
|
|
116
112
|
],
|
|
117
113
|
});
|
|
118
114
|
}
|
|
119
115
|
else {
|
|
120
116
|
tx.moveCall({
|
|
121
|
-
target: "".concat(
|
|
122
|
-
typeArguments: typeArguments,
|
|
117
|
+
target: "".concat(config.package.typus, "::airdrop::set_airdrop"),
|
|
118
|
+
typeArguments: input.typeArguments,
|
|
123
119
|
arguments: [
|
|
124
|
-
tx.object(version),
|
|
125
|
-
tx.object(
|
|
126
|
-
tx.object(key),
|
|
127
|
-
tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
|
|
128
|
-
tx.pure(users),
|
|
129
|
-
tx.pure(values),
|
|
120
|
+
tx.object(config.version.typus),
|
|
121
|
+
tx.object(config.registry.typus.airdrop),
|
|
122
|
+
tx.object(input.key),
|
|
123
|
+
tx.makeMoveVec({ objects: input.coins.map(function (id) { return tx.object(id); }) }),
|
|
124
|
+
tx.pure(input.users),
|
|
125
|
+
tx.pure(input.values),
|
|
130
126
|
],
|
|
131
127
|
});
|
|
132
128
|
}
|
|
133
|
-
tx.setGasBudget(gasBudget);
|
|
134
129
|
return [2 /*return*/, tx];
|
|
135
130
|
});
|
|
136
131
|
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
typusPackageId: string;
|
|
5
|
-
typusEcosystemVersion: string;
|
|
6
|
-
typusAirdropRegistry: string;
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
3
|
+
export declare function getClaimAirdropTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
7
4
|
typeArguments: string[];
|
|
8
5
|
key: string;
|
|
9
6
|
user: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getClaimAirdropTx = getClaimAirdropTx;
|
|
4
|
-
function getClaimAirdropTx(input) {
|
|
5
|
-
var result =
|
|
6
|
-
target: "".concat(
|
|
4
|
+
function getClaimAirdropTx(config, tx, input) {
|
|
5
|
+
var result = tx.moveCall({
|
|
6
|
+
target: "".concat(config.package.typus, "::airdrop::claim_airdrop"),
|
|
7
7
|
typeArguments: input.typeArguments,
|
|
8
|
-
arguments: [
|
|
8
|
+
arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.airdrop), tx.pure(input.key)],
|
|
9
9
|
});
|
|
10
|
-
|
|
11
|
-
target: "".concat(
|
|
10
|
+
tx.moveCall({
|
|
11
|
+
target: "".concat(config.package.typus, "::utility::transfer_balance_opt"),
|
|
12
12
|
typeArguments: [input.typeArguments[0]],
|
|
13
|
-
arguments: [
|
|
13
|
+
arguments: [tx.object(result[0]), tx.pure(input.user)],
|
|
14
14
|
});
|
|
15
|
-
return
|
|
15
|
+
return tx;
|
|
16
16
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
typusPackageId: string;
|
|
5
|
-
typusEcosystemVersion: string;
|
|
6
|
-
typusAirdropRegistry: string;
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
3
|
+
export declare function getAirdrop(config: TypusConfig, provider: SuiClient, input: {
|
|
7
4
|
key: string;
|
|
8
5
|
user: string;
|
|
9
6
|
}): Promise<string[]>;
|
|
@@ -39,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.getAirdrop = getAirdrop;
|
|
40
40
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
41
41
|
var bcs_1 = require("@mysten/bcs");
|
|
42
|
-
function getAirdrop(input) {
|
|
42
|
+
function getAirdrop(config, provider, input) {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function () {
|
|
44
44
|
var transactionBlock, results, bytes, reader;
|
|
45
45
|
return __generator(this, function (_a) {
|
|
@@ -47,16 +47,16 @@ function getAirdrop(input) {
|
|
|
47
47
|
case 0:
|
|
48
48
|
transactionBlock = new transactions_1.TransactionBlock();
|
|
49
49
|
transactionBlock.moveCall({
|
|
50
|
-
target: "".concat(
|
|
50
|
+
target: "".concat(config.package.typus, "::airdrop::get_airdrop"),
|
|
51
51
|
typeArguments: [],
|
|
52
52
|
arguments: [
|
|
53
|
-
transactionBlock.pure(
|
|
54
|
-
transactionBlock.pure(
|
|
53
|
+
transactionBlock.pure(config.version.typus),
|
|
54
|
+
transactionBlock.pure(config.registry.typus.airdrop),
|
|
55
55
|
transactionBlock.pure(input.key),
|
|
56
56
|
transactionBlock.pure(input.user),
|
|
57
57
|
],
|
|
58
58
|
});
|
|
59
|
-
return [4 /*yield*/,
|
|
59
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({
|
|
60
60
|
sender: "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
|
61
61
|
transactionBlock: transactionBlock,
|
|
62
62
|
})];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
2
3
|
/**
|
|
3
4
|
public fun activate_leaderboard(
|
|
4
5
|
version: &Version,
|
|
@@ -9,7 +10,11 @@ import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
|
9
10
|
ctx: &mut TxContext,
|
|
10
11
|
)
|
|
11
12
|
*/
|
|
12
|
-
export declare function getActivateLeaderboardTx(
|
|
13
|
+
export declare function getActivateLeaderboardTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
14
|
+
key: string;
|
|
15
|
+
start_ts_ms: string;
|
|
16
|
+
end_ts_ms: string;
|
|
17
|
+
}): Promise<TransactionBlock>;
|
|
13
18
|
/**
|
|
14
19
|
public fun deactivate_leaderboard(
|
|
15
20
|
version: &Version,
|
|
@@ -19,4 +24,7 @@ export declare function getActivateLeaderboardTx(gasBudget: number, packageId: s
|
|
|
19
24
|
ctx: &mut TxContext,
|
|
20
25
|
)
|
|
21
26
|
*/
|
|
22
|
-
export declare function getDeactivateLeaderboardTx(
|
|
27
|
+
export declare function getDeactivateLeaderboardTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
28
|
+
key: string;
|
|
29
|
+
id: string;
|
|
30
|
+
}): Promise<TransactionBlock>;
|
|
@@ -38,7 +38,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getActivateLeaderboardTx = getActivateLeaderboardTx;
|
|
40
40
|
exports.getDeactivateLeaderboardTx = getDeactivateLeaderboardTx;
|
|
41
|
-
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
42
41
|
/**
|
|
43
42
|
public fun activate_leaderboard(
|
|
44
43
|
version: &Version,
|
|
@@ -49,17 +48,20 @@ var transactions_1 = require("@mysten/sui.js/transactions");
|
|
|
49
48
|
ctx: &mut TxContext,
|
|
50
49
|
)
|
|
51
50
|
*/
|
|
52
|
-
function getActivateLeaderboardTx(
|
|
51
|
+
function getActivateLeaderboardTx(config, tx, input) {
|
|
53
52
|
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
-
var tx;
|
|
55
53
|
return __generator(this, function (_a) {
|
|
56
|
-
tx = new transactions_1.TransactionBlock();
|
|
57
54
|
tx.moveCall({
|
|
58
|
-
target: "".concat(
|
|
55
|
+
target: "".concat(config.package.typus, "::leaderboard::activate_leaderboard"),
|
|
59
56
|
typeArguments: [],
|
|
60
|
-
arguments: [
|
|
57
|
+
arguments: [
|
|
58
|
+
tx.object(config.version.typus),
|
|
59
|
+
tx.object(config.registry.typus.leaderboard),
|
|
60
|
+
tx.pure(input.key),
|
|
61
|
+
tx.pure(input.start_ts_ms),
|
|
62
|
+
tx.pure(input.end_ts_ms),
|
|
63
|
+
],
|
|
61
64
|
});
|
|
62
|
-
tx.setGasBudget(gasBudget);
|
|
63
65
|
return [2 /*return*/, tx];
|
|
64
66
|
});
|
|
65
67
|
});
|
|
@@ -73,17 +75,14 @@ function getActivateLeaderboardTx(gasBudget, packageId, version, typusLeaderboar
|
|
|
73
75
|
ctx: &mut TxContext,
|
|
74
76
|
)
|
|
75
77
|
*/
|
|
76
|
-
function getDeactivateLeaderboardTx(
|
|
78
|
+
function getDeactivateLeaderboardTx(config, tx, input) {
|
|
77
79
|
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
-
var tx;
|
|
79
80
|
return __generator(this, function (_a) {
|
|
80
|
-
tx = new transactions_1.TransactionBlock();
|
|
81
81
|
tx.moveCall({
|
|
82
|
-
target: "".concat(
|
|
82
|
+
target: "".concat(config.package.typus, "::leaderboard::deactivate_leaderboard"),
|
|
83
83
|
typeArguments: [],
|
|
84
|
-
arguments: [tx.object(version), tx.object(
|
|
84
|
+
arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.leaderboard), tx.pure(input.key), tx.pure(input.id)],
|
|
85
85
|
});
|
|
86
|
-
tx.setGasBudget(gasBudget);
|
|
87
86
|
return [2 /*return*/, tx];
|
|
88
87
|
});
|
|
89
88
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
2
3
|
export interface Rankings {
|
|
3
4
|
user_score: string;
|
|
4
5
|
leaderboard: Ranks[];
|
|
@@ -7,11 +8,7 @@ export interface Ranks {
|
|
|
7
8
|
score: string;
|
|
8
9
|
users: string[];
|
|
9
10
|
}
|
|
10
|
-
export declare function getRankings(input: {
|
|
11
|
-
provider: SuiClient;
|
|
12
|
-
typusPackageId: string;
|
|
13
|
-
typusEcosystemVersion: string;
|
|
14
|
-
typusLeaderboardRegistry: string;
|
|
11
|
+
export declare function getRankings(config: TypusConfig, provider: SuiClient, input: {
|
|
15
12
|
key: string;
|
|
16
13
|
id: string;
|
|
17
14
|
ranks: number;
|
|
@@ -39,8 +39,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.getRankings = getRankings;
|
|
40
40
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
41
41
|
var bcs_1 = require("@mysten/bcs");
|
|
42
|
-
var utils_1 = require("
|
|
43
|
-
function getRankings(input) {
|
|
42
|
+
var utils_1 = require("src/utils");
|
|
43
|
+
function getRankings(config, provider, input) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function () {
|
|
45
45
|
var transactionBlock, results, bytes, reader, result;
|
|
46
46
|
return __generator(this, function (_a) {
|
|
@@ -48,11 +48,11 @@ function getRankings(input) {
|
|
|
48
48
|
case 0:
|
|
49
49
|
transactionBlock = new transactions_1.TransactionBlock();
|
|
50
50
|
transactionBlock.moveCall({
|
|
51
|
-
target: "".concat(
|
|
51
|
+
target: "".concat(config.package.typus, "::leaderboard::get_rankings"),
|
|
52
52
|
typeArguments: [],
|
|
53
53
|
arguments: [
|
|
54
|
-
transactionBlock.pure(
|
|
55
|
-
transactionBlock.pure(
|
|
54
|
+
transactionBlock.pure(config.version.typus),
|
|
55
|
+
transactionBlock.pure(config.registry.typus.leaderboard),
|
|
56
56
|
transactionBlock.pure(input.key),
|
|
57
57
|
transactionBlock.pure(input.id),
|
|
58
58
|
transactionBlock.pure(input.ranks),
|
|
@@ -60,7 +60,7 @@ function getRankings(input) {
|
|
|
60
60
|
transactionBlock.pure(input.active),
|
|
61
61
|
],
|
|
62
62
|
});
|
|
63
|
-
return [4 /*yield*/,
|
|
63
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({
|
|
64
64
|
sender: "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
|
65
65
|
transactionBlock: transactionBlock,
|
|
66
66
|
})];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TransactionBlock, TransactionObjectInput } from "@mysten/sui.js/transactions";
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
2
3
|
/**
|
|
3
4
|
entry fun upload_ids(
|
|
4
5
|
version: &Version,
|
|
@@ -7,11 +8,7 @@ import { TransactionBlock, TransactionObjectInput } from "@mysten/sui.js/transac
|
|
|
7
8
|
ctx: &TxContext,
|
|
8
9
|
) {
|
|
9
10
|
*/
|
|
10
|
-
export declare function getUploadIdsTx(input: {
|
|
11
|
-
tx: TransactionBlock;
|
|
12
|
-
typusPackageId: string;
|
|
13
|
-
typusEcosystemVersion: string;
|
|
14
|
-
typusTailsStakingRegistry: string;
|
|
11
|
+
export declare function getUploadIdsTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
15
12
|
ids: string[];
|
|
16
13
|
}): TransactionBlock;
|
|
17
14
|
/**
|
|
@@ -22,11 +19,7 @@ export declare function getUploadIdsTx(input: {
|
|
|
22
19
|
ctx: &TxContext,
|
|
23
20
|
) {
|
|
24
21
|
*/
|
|
25
|
-
export declare function getRemoveIdsTx(input: {
|
|
26
|
-
tx: TransactionBlock;
|
|
27
|
-
typusPackageId: string;
|
|
28
|
-
typusEcosystemVersion: string;
|
|
29
|
-
typusTailsStakingRegistry: string;
|
|
22
|
+
export declare function getRemoveIdsTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
30
23
|
count: string;
|
|
31
24
|
}): TransactionBlock;
|
|
32
25
|
/**
|
|
@@ -37,11 +30,7 @@ export declare function getRemoveIdsTx(input: {
|
|
|
37
30
|
ctx: &TxContext,
|
|
38
31
|
) {
|
|
39
32
|
*/
|
|
40
|
-
export declare function getUploadLevelsTx(input: {
|
|
41
|
-
tx: TransactionBlock;
|
|
42
|
-
typusPackageId: string;
|
|
43
|
-
typusEcosystemVersion: string;
|
|
44
|
-
typusTailsStakingRegistry: string;
|
|
33
|
+
export declare function getUploadLevelsTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
45
34
|
count: string;
|
|
46
35
|
}): TransactionBlock;
|
|
47
36
|
/**
|
|
@@ -52,11 +41,7 @@ export declare function getUploadLevelsTx(input: {
|
|
|
52
41
|
ctx: &TxContext,
|
|
53
42
|
) {
|
|
54
43
|
*/
|
|
55
|
-
export declare function getRemoveLevelsTx(input: {
|
|
56
|
-
tx: TransactionBlock;
|
|
57
|
-
typusPackageId: string;
|
|
58
|
-
typusEcosystemVersion: string;
|
|
59
|
-
typusTailsStakingRegistry: string;
|
|
44
|
+
export declare function getRemoveLevelsTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
60
45
|
count: string;
|
|
61
46
|
}): TransactionBlock;
|
|
62
47
|
/**
|
|
@@ -68,11 +53,7 @@ export declare function getRemoveLevelsTx(input: {
|
|
|
68
53
|
ctx: &TxContext,
|
|
69
54
|
) {
|
|
70
55
|
*/
|
|
71
|
-
export declare function getUploadIpfsUrlsTx(input: {
|
|
72
|
-
tx: TransactionBlock;
|
|
73
|
-
typusPackageId: string;
|
|
74
|
-
typusEcosystemVersion: string;
|
|
75
|
-
typusTailsStakingRegistry: string;
|
|
56
|
+
export declare function getUploadIpfsUrlsTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
76
57
|
level: string;
|
|
77
58
|
urls: string[][];
|
|
78
59
|
}): TransactionBlock;
|
|
@@ -84,11 +65,7 @@ export declare function getUploadIpfsUrlsTx(input: {
|
|
|
84
65
|
ctx: &mut TxContext,
|
|
85
66
|
) {
|
|
86
67
|
*/
|
|
87
|
-
export declare function getRemoveIpfsUrlsTx(input: {
|
|
88
|
-
tx: TransactionBlock;
|
|
89
|
-
typusPackageId: string;
|
|
90
|
-
typusEcosystemVersion: string;
|
|
91
|
-
typusTailsStakingRegistry: string;
|
|
68
|
+
export declare function getRemoveIpfsUrlsTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
92
69
|
level: string;
|
|
93
70
|
}): TransactionBlock;
|
|
94
71
|
/**
|
|
@@ -101,11 +78,7 @@ export declare function getRemoveIpfsUrlsTx(input: {
|
|
|
101
78
|
ctx: &TxContext,
|
|
102
79
|
) {
|
|
103
80
|
*/
|
|
104
|
-
export declare function getUploadWebpBytesTx(input: {
|
|
105
|
-
tx: TransactionBlock;
|
|
106
|
-
typusPackageId: string;
|
|
107
|
-
typusEcosystemVersion: string;
|
|
108
|
-
typusTailsStakingRegistry: string;
|
|
81
|
+
export declare function getUploadWebpBytesTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
109
82
|
number: string;
|
|
110
83
|
level: string;
|
|
111
84
|
bytes: string[];
|
|
@@ -119,11 +92,7 @@ export declare function getUploadWebpBytesTx(input: {
|
|
|
119
92
|
ctx: &TxContext,
|
|
120
93
|
) {
|
|
121
94
|
*/
|
|
122
|
-
export declare function getRemoveWebpBytesTx(input: {
|
|
123
|
-
tx: TransactionBlock;
|
|
124
|
-
typusPackageId: string;
|
|
125
|
-
typusEcosystemVersion: string;
|
|
126
|
-
typusTailsStakingRegistry: string;
|
|
95
|
+
export declare function getRemoveWebpBytesTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
127
96
|
number: string;
|
|
128
97
|
level: string;
|
|
129
98
|
}): TransactionBlock;
|
|
@@ -136,11 +105,7 @@ export declare function getRemoveWebpBytesTx(input: {
|
|
|
136
105
|
ctx: &TxContext,
|
|
137
106
|
) {
|
|
138
107
|
*/
|
|
139
|
-
export declare function getUpdateTailsStakingRegistryConfigTx(input: {
|
|
140
|
-
tx: TransactionBlock;
|
|
141
|
-
typusPackageId: string;
|
|
142
|
-
typusEcosystemVersion: string;
|
|
143
|
-
typusTailsStakingRegistry: string;
|
|
108
|
+
export declare function getUpdateTailsStakingRegistryConfigTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
144
109
|
index: string;
|
|
145
110
|
value: string;
|
|
146
111
|
}): TransactionBlock;
|
|
@@ -153,11 +118,7 @@ export declare function getUpdateTailsStakingRegistryConfigTx(input: {
|
|
|
153
118
|
ctx: &TxContext,
|
|
154
119
|
) {
|
|
155
120
|
*/
|
|
156
|
-
export declare function getSetProfitSharingTx(input: {
|
|
157
|
-
tx: TransactionBlock;
|
|
158
|
-
typusPackageId: string;
|
|
159
|
-
typusEcosystemVersion: string;
|
|
160
|
-
typusTailsStakingRegistry: string;
|
|
121
|
+
export declare function getSetProfitSharingTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
161
122
|
typeArguments: string[];
|
|
162
123
|
levelProfits: string[];
|
|
163
124
|
coin: TransactionObjectInput;
|
|
@@ -172,11 +133,7 @@ export declare function getSetProfitSharingTx(input: {
|
|
|
172
133
|
ctx: &mut TxContext,
|
|
173
134
|
) {
|
|
174
135
|
*/
|
|
175
|
-
export declare function getRemoveProfitSharingTx(input: {
|
|
176
|
-
tx: TransactionBlock;
|
|
177
|
-
typusPackageId: string;
|
|
178
|
-
typusEcosystemVersion: string;
|
|
179
|
-
typusTailsStakingRegistry: string;
|
|
136
|
+
export declare function getRemoveProfitSharingTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
180
137
|
typeArguments: string[];
|
|
181
138
|
recipient: string;
|
|
182
139
|
}): TransactionBlock;
|