@typus/typus-sdk 1.0.103 → 1.0.105
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 +33 -32
- package/lib/utils/nft-staking/fetch.d.ts +1 -6
- package/lib/utils/nft-staking/fetch.js +4 -7
- package/lib/utils/nft-staking/user-entry.d.ts +5 -4
- package/lib/utils/nft-staking/user-entry.js +99 -28
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +9 -8
- package/lib/utils/typus-dov-single-v2/user-entry.js +55 -17
- package/lib/utils/typus-dov-single-v2/view-function.d.ts +12 -0
- package/lib/utils/typus-dov-single-v2/view-function.js +114 -0
- package/lib/utils/typus-nft/fetch.d.ts +3 -0
- package/lib/utils/typus-nft/fetch.js +24 -12
- package/package.json +1 -1
package/lib/config.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"VERSION": "
|
|
3
|
-
"DB_NAME": "
|
|
2
|
+
"VERSION": "3.0.2",
|
|
3
|
+
"DB_NAME": "testnet_3_0_0",
|
|
4
4
|
"RPC_ENDPOINT": "https://api.shinami.com:443/node/v1/sui_testnet_c702de54dad05016124f2cfabc1de7e8",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
5
|
+
"sponsorApi": "https://northamerica-northeast1-aqueous-freedom-378103.cloudfunctions.net/sponsor-testnet",
|
|
6
|
+
"SINGLE_COLLATERAL_PACKAGE": "0x6529d0c44d89345b3b851f72acc16670e8e08ff30a46df145e23ab7526c35e02",
|
|
7
|
+
"SINGLE_COLLATERAL_PACKAGE_ORIGIN": "0x0334a2ae4b0c5cd007d3bf44925975726b94c1061eb45d660e8b79ec91c0599e",
|
|
8
|
+
"SINGLE_COLLATERAL_MANAGER_CAP": "0xdc092ced3f08dc31cbbdaa584a937d4e54555cb47a1dca1d756560809d92c0ba",
|
|
9
|
+
"SINGLE_COLLATERAL_REGISTRY": "0xcb757bd17a8daa75c2b12a5c5f19bd88e7e2e96b8a220bbe4cf0605affea7475",
|
|
10
|
+
"SINGLE_COLLATERAL_AC_REGISTRY": "0xe6a7ec7f1cfffc85434a2dcc55306bc8c2c8f70672019e393f3e8facd7b7556f",
|
|
11
|
+
"SINGLE_COLLATERAL_DEPOSIT_VAULT_REGISTRY": "0x1b5d729933a1135820de7bbb3512134c8f92c665e7c9fd35168febc92c25a3a4",
|
|
12
|
+
"SINGLE_COLLATERAL_BID_VAULT_REGISTRY": "0x7fb5d3785c779f80f7c320a2454bf053209d6671ee7080bf85dd917ef508ef02",
|
|
13
|
+
"SINGLE_COLLATERAL_DEPOSIT_VAULT_USER_SHARE_REGISTRY": "0x25a4ba9d2ca02f9676ba4f4b152e742c8821f6731ecb8ee2230b90b8c37c9f03",
|
|
14
|
+
"SINGLE_COLLATERAL_BID_VAULT_USER_SHARE_REGISTRY": "0x8a26073f92baf3c3991669c34a0cc9202767465a9599f21ea5dd425956957c83",
|
|
14
15
|
"TOKEN_PACKAGE": "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519",
|
|
15
16
|
"BTC_TOKEN_REGISTRY": "0xcf5184b85f47cb1ffe421249e48b2cd34807534e1a4b4ad384009295bbbd3bf4",
|
|
16
17
|
"ETH_TOKEN_REGISTRY": "0x5cd3726a1d1ef32bffaaeb2ec4964f0ffac56cfb919f7d13d4672aed5059bfa1",
|
|
@@ -45,25 +46,25 @@
|
|
|
45
46
|
"keystore": "0.keystore",
|
|
46
47
|
"GAS_BUDGET": 1000000000,
|
|
47
48
|
"FOLDER": "/Users/waynekuo/Documents/GitHub/tails-by-typus-renderer-private/tails_by_typus_renderer/data",
|
|
48
|
-
"NFT_PACKAGE": "
|
|
49
|
-
"NFT_PACKAGE_UPGRADE": "
|
|
50
|
-
"NFT_MANAGER_CAP": "
|
|
51
|
-
"NFT_TRANSFER_POLICY": "
|
|
52
|
-
"NFT_ROYALTY": "
|
|
53
|
-
"NFT_TABLE": "
|
|
54
|
-
"bucket_protocol": "
|
|
55
|
-
"kriya_dex": "
|
|
56
|
-
"cetus_protocol": "
|
|
57
|
-
"ethos_wallet": "
|
|
58
|
-
"typus": "
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"none": "
|
|
49
|
+
"NFT_PACKAGE": "0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828",
|
|
50
|
+
"NFT_PACKAGE_UPGRADE": "0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828",
|
|
51
|
+
"NFT_MANAGER_CAP": "0xf02cfb741434e40e861f038c05f0c3cadae69ed07b089284afbd70870d145ddd",
|
|
52
|
+
"NFT_TRANSFER_POLICY": "0x1c62271ecc443c3d92a8fe8f5662e877856d26b971d967f66937a65f55160831",
|
|
53
|
+
"NFT_ROYALTY": "0xdca4c28f5c8d3654c99ad7cfad69bfa6ec457e6af6626a515537ff0c4b9c998d",
|
|
54
|
+
"NFT_TABLE": "0xc8df921e7403215c09228f2c32e7d16ffe0fb1c9f30c687ae9c228e1a6aa5498",
|
|
55
|
+
"bucket_protocol": "0xf9b2ba7d285e8313c24ea8038c74cffbe9e88075ea101e0338223917eb1fd5f5",
|
|
56
|
+
"kriya_dex": "0x0d3a59ff4c960eb0ba5ed80cebb49ed60d015a6237b55c9c472ff374599b9cf5",
|
|
57
|
+
"cetus_protocol": "0x656a7c12072692deefe3bc4e55109264111b0983d87d56e6f29f08aea18b00fa",
|
|
58
|
+
"ethos_wallet": "0x85c9caa7b180234beab21c128d48826d841ab1f117dfae21ec269848e6ec6b32",
|
|
59
|
+
"typus": "0x86a8505adbda8052b72ed48eba74e7cc2927849356207cf7c264c1819ab75cae",
|
|
60
|
+
"navi_protocol": "0xa60ebb20eb2cc0453b4b1aa8af852e07e825ff5f65247ebd7159d4d72ea94818",
|
|
61
|
+
"scallop_sui": "0x87e2eb4b10073c3174b0aafb1590e31b15a41fb4b63e2ca85984723cf5a5eb82",
|
|
62
|
+
"shinami_corp": "0x5d006db7f4d2129a68fa0d6002f5a1c36905651392acfcbb9787e26732bd0645",
|
|
63
|
+
"studio_mirai": "0xae2361fccbc3a8bf25a4d42bf8fdf7bdf36896f43075f256148a2c03d8bd9387",
|
|
64
|
+
"blockvision": "0x1b82e65fd7d4c4bca7a33ab2ef34ed33a3046c61a8c73234ec6b8b512c0c89ec",
|
|
65
|
+
"team": "0x2eaa09f247b9eb1e3ed60f42910402bfde43cb622cf7881e8a9c8c92cca88faf",
|
|
66
|
+
"nft_vault": "0x452744db33daa95567e5a98d1aa442c60aea40ed49ccf7ac7e633abf304a5ebe",
|
|
67
|
+
"sui_network": "0x1bef7b18be7d240f4370579236f64d4ac9685edc59df8ffda576cfc36c17d30c",
|
|
68
|
+
"mysten_labs": "0xf235242d2506bdb187033966e6f874d10b83a0cfaf11c0b0f574576c555c0ee7",
|
|
69
|
+
"none": "0x1af80eea9cc8c0de7b3aa547a39a78c95db5fc4efa2b21cb9c26d16463e873da"
|
|
69
70
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { JsonRpcProvider } from "@mysten/sui.js";
|
|
2
2
|
import { Tails } from "../typus-nft/fetch";
|
|
3
|
-
export declare function getUserStake(provider: JsonRpcProvider, nft_table: string, user: string): Promise<
|
|
4
|
-
export interface StakedTails {
|
|
5
|
-
nft: Tails;
|
|
6
|
-
snapshot_ms: string;
|
|
7
|
-
updating_url: boolean;
|
|
8
|
-
}
|
|
3
|
+
export declare function getUserStake(provider: JsonRpcProvider, nft_table: string, user: string): Promise<Tails | null>;
|
|
@@ -37,10 +37,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getUserStake = void 0;
|
|
40
|
+
var fetch_1 = require("../typus-nft/fetch");
|
|
40
41
|
function getUserStake(provider, nft_table, user) {
|
|
41
42
|
var _a;
|
|
42
43
|
return __awaiter(this, void 0, void 0, function () {
|
|
43
|
-
var res, fields,
|
|
44
|
+
var res, fields, tails;
|
|
44
45
|
return __generator(this, function (_b) {
|
|
45
46
|
switch (_b.label) {
|
|
46
47
|
case 0: return [4 /*yield*/, provider.getDynamicFieldObject({
|
|
@@ -56,12 +57,8 @@ function getUserStake(provider, nft_table, user) {
|
|
|
56
57
|
return [2 /*return*/, null];
|
|
57
58
|
}
|
|
58
59
|
fields = (_a = res.data) === null || _a === void 0 ? void 0 : _a.content.fields;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
snapshot_ms: fields.value.fields.snapshot_ms,
|
|
62
|
-
updating_url: fields.value.fields.updating_url,
|
|
63
|
-
};
|
|
64
|
-
return [2 /*return*/, staked_tails];
|
|
60
|
+
tails = (0, fetch_1.fieldsToTails)(fields);
|
|
61
|
+
return [2 /*return*/, tails];
|
|
65
62
|
}
|
|
66
63
|
});
|
|
67
64
|
});
|
|
@@ -32,15 +32,16 @@ export declare function getStakeNftTx(gasBudget: number, nftPackageId: string, r
|
|
|
32
32
|
*/
|
|
33
33
|
export declare function getUnstakeNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string): Promise<TransactionBlock>;
|
|
34
34
|
/**
|
|
35
|
-
public fun
|
|
35
|
+
public fun daily_attend(
|
|
36
36
|
registry: &mut Registry,
|
|
37
37
|
clock: &Clock,
|
|
38
38
|
ctx: &mut TxContext
|
|
39
39
|
)
|
|
40
40
|
*/
|
|
41
|
-
export declare function
|
|
42
|
-
export declare function
|
|
43
|
-
|
|
41
|
+
export declare function getDailyAttendTx(gasBudget: number, nftPackageId: string, registry: string): Promise<TransactionBlock>;
|
|
42
|
+
export declare function getNewBidWithNftTx(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
|
|
43
|
+
usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
44
|
+
export declare function getDepositWithNftTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, coins: string[], amount: string, usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
44
45
|
/**
|
|
45
46
|
public fun level_up(
|
|
46
47
|
registry: &mut Registry,
|
|
@@ -35,8 +35,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
38
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getLevelUpTx = exports.
|
|
55
|
+
exports.getLevelUpTx = exports.getDepositWithNftTx = exports.getNewBidWithNftTx = exports.getDailyAttendTx = exports.getUnstakeNftTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
|
|
40
56
|
var sui_js_1 = require("@mysten/sui.js");
|
|
41
57
|
var constants_1 = require("../../constants");
|
|
42
58
|
/**
|
|
@@ -55,7 +71,7 @@ function getTransferNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, n
|
|
|
55
71
|
return __generator(this, function (_a) {
|
|
56
72
|
tx = new sui_js_1.TransactionBlock();
|
|
57
73
|
tx.moveCall({
|
|
58
|
-
target: "".concat(nftPackageId, "::
|
|
74
|
+
target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
|
|
59
75
|
typeArguments: [],
|
|
60
76
|
arguments: [tx.object(registry), tx.object(kiosk), tx.object(kiosk_cap), tx.object(nft_id), tx.pure(receiver)],
|
|
61
77
|
});
|
|
@@ -73,7 +89,7 @@ function getTransferNftsTx(gasBudget, nftPackageId, registry, kiosks, kiosk_caps
|
|
|
73
89
|
i = 0;
|
|
74
90
|
while (i < kiosks.length) {
|
|
75
91
|
tx.moveCall({
|
|
76
|
-
target: "".concat(nftPackageId, "::
|
|
92
|
+
target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
|
|
77
93
|
typeArguments: [],
|
|
78
94
|
arguments: [tx.object(registry), tx.object(kiosks[i]), tx.object(kiosk_caps[i]), tx.object(nft_ids[i]), tx.pure(receiver)],
|
|
79
95
|
});
|
|
@@ -101,7 +117,7 @@ function getStakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft_
|
|
|
101
117
|
return __generator(this, function (_a) {
|
|
102
118
|
tx = new sui_js_1.TransactionBlock();
|
|
103
119
|
tx.moveCall({
|
|
104
|
-
target: "".concat(nftPackageId, "::
|
|
120
|
+
target: "".concat(nftPackageId, "::tails_staking::stake_nft"),
|
|
105
121
|
typeArguments: [],
|
|
106
122
|
arguments: [tx.object(registry), tx.object(kiosk), tx.object(kiosk_cap), tx.object(nft_id), tx.object(constants_1.CLOCK)],
|
|
107
123
|
});
|
|
@@ -125,7 +141,7 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap) {
|
|
|
125
141
|
return __generator(this, function (_a) {
|
|
126
142
|
tx = new sui_js_1.TransactionBlock();
|
|
127
143
|
tx.moveCall({
|
|
128
|
-
target: "".concat(nftPackageId, "::
|
|
144
|
+
target: "".concat(nftPackageId, "::tails_staking::unstake_nft"),
|
|
129
145
|
typeArguments: [],
|
|
130
146
|
arguments: [tx.object(registry), tx.object(kiosk), tx.object(kiosk_cap)],
|
|
131
147
|
});
|
|
@@ -136,19 +152,19 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap) {
|
|
|
136
152
|
}
|
|
137
153
|
exports.getUnstakeNftTx = getUnstakeNftTx;
|
|
138
154
|
/**
|
|
139
|
-
public fun
|
|
155
|
+
public fun daily_attend(
|
|
140
156
|
registry: &mut Registry,
|
|
141
157
|
clock: &Clock,
|
|
142
158
|
ctx: &mut TxContext
|
|
143
159
|
)
|
|
144
160
|
*/
|
|
145
|
-
function
|
|
161
|
+
function getDailyAttendTx(gasBudget, nftPackageId, registry) {
|
|
146
162
|
return __awaiter(this, void 0, void 0, function () {
|
|
147
163
|
var tx;
|
|
148
164
|
return __generator(this, function (_a) {
|
|
149
165
|
tx = new sui_js_1.TransactionBlock();
|
|
150
166
|
tx.moveCall({
|
|
151
|
-
target: "".concat(nftPackageId, "::
|
|
167
|
+
target: "".concat(nftPackageId, "::tails_staking::daily_attend"),
|
|
152
168
|
typeArguments: [],
|
|
153
169
|
arguments: [tx.object(registry), tx.object(constants_1.CLOCK)],
|
|
154
170
|
});
|
|
@@ -157,39 +173,94 @@ function getSnapshotTx(gasBudget, nftPackageId, registry) {
|
|
|
157
173
|
});
|
|
158
174
|
});
|
|
159
175
|
}
|
|
160
|
-
exports.
|
|
161
|
-
function
|
|
176
|
+
exports.getDailyAttendTx = getDailyAttendTx;
|
|
177
|
+
function getNewBidWithNftTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
|
|
178
|
+
usingSponsoredGasCoin) {
|
|
179
|
+
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
162
180
|
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
-
var tx;
|
|
164
|
-
return __generator(this, function (
|
|
181
|
+
var tx, _a, coin;
|
|
182
|
+
return __generator(this, function (_b) {
|
|
165
183
|
tx = new sui_js_1.TransactionBlock();
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
184
|
+
if (!usingSponsoredGasCoin &&
|
|
185
|
+
(typeArguments[1] == "0x2::sui::SUI" ||
|
|
186
|
+
typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
187
|
+
_a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
|
|
188
|
+
tx.moveCall({
|
|
189
|
+
target: "".concat(packageId, "::tails_staking::new_bid_w_nft"),
|
|
190
|
+
typeArguments: typeArguments,
|
|
191
|
+
arguments: [
|
|
192
|
+
tx.pure(registry),
|
|
193
|
+
tx.pure(additional_config_registry),
|
|
194
|
+
tx.pure(index),
|
|
195
|
+
tx.pure(priceOracle),
|
|
196
|
+
tx.pure("0x6"),
|
|
197
|
+
tx.makeMoveVec({ objects: [coin] }),
|
|
198
|
+
tx.pure(size),
|
|
199
|
+
],
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
tx.moveCall({
|
|
204
|
+
target: "".concat(packageId, "::tails_staking::new_bid_w_nft"),
|
|
205
|
+
typeArguments: typeArguments,
|
|
206
|
+
arguments: [
|
|
207
|
+
tx.pure(registry),
|
|
208
|
+
tx.pure(additional_config_registry),
|
|
209
|
+
tx.pure(index),
|
|
210
|
+
tx.pure(priceOracle),
|
|
211
|
+
tx.pure("0x6"),
|
|
212
|
+
tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
|
|
213
|
+
tx.pure(size),
|
|
214
|
+
],
|
|
215
|
+
});
|
|
216
|
+
}
|
|
171
217
|
tx.setGasBudget(gasBudget);
|
|
172
218
|
return [2 /*return*/, tx];
|
|
173
219
|
});
|
|
174
220
|
});
|
|
175
221
|
}
|
|
176
|
-
exports.
|
|
177
|
-
function
|
|
222
|
+
exports.getNewBidWithNftTx = getNewBidWithNftTx;
|
|
223
|
+
function getDepositWithNftTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, coins, amount, usingSponsoredGasCoin) {
|
|
224
|
+
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
178
225
|
return __awaiter(this, void 0, void 0, function () {
|
|
179
|
-
var tx;
|
|
180
|
-
return __generator(this, function (
|
|
226
|
+
var tx, _a, coin;
|
|
227
|
+
return __generator(this, function (_b) {
|
|
181
228
|
tx = new sui_js_1.TransactionBlock();
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
229
|
+
if (!usingSponsoredGasCoin &&
|
|
230
|
+
(typeArguments[0] == "0x2::sui::SUI" ||
|
|
231
|
+
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
232
|
+
_a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
|
|
233
|
+
tx.moveCall({
|
|
234
|
+
target: "".concat(packageId, "::tails_staking::deposit_w_nft"),
|
|
235
|
+
typeArguments: typeArguments,
|
|
236
|
+
arguments: [
|
|
237
|
+
tx.pure(registry),
|
|
238
|
+
tx.pure(additional_config_registry),
|
|
239
|
+
tx.pure(index),
|
|
240
|
+
tx.makeMoveVec({ objects: [coin] }),
|
|
241
|
+
tx.pure(amount),
|
|
242
|
+
],
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
tx.moveCall({
|
|
247
|
+
target: "".concat(packageId, "::tails_staking::deposit_w_nft"),
|
|
248
|
+
typeArguments: typeArguments,
|
|
249
|
+
arguments: [
|
|
250
|
+
tx.pure(registry),
|
|
251
|
+
tx.pure(additional_config_registry),
|
|
252
|
+
tx.pure(index),
|
|
253
|
+
tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
|
|
254
|
+
tx.pure(amount),
|
|
255
|
+
],
|
|
256
|
+
});
|
|
257
|
+
}
|
|
187
258
|
tx.setGasBudget(gasBudget);
|
|
188
259
|
return [2 /*return*/, tx];
|
|
189
260
|
});
|
|
190
261
|
});
|
|
191
262
|
}
|
|
192
|
-
exports.
|
|
263
|
+
exports.getDepositWithNftTx = getDepositWithNftTx;
|
|
193
264
|
/**
|
|
194
265
|
public fun level_up(
|
|
195
266
|
registry: &mut Registry,
|
|
@@ -202,7 +273,7 @@ function getLevelUpTx(gasBudget, nftPackageId, registry) {
|
|
|
202
273
|
return __generator(this, function (_a) {
|
|
203
274
|
tx = new sui_js_1.TransactionBlock();
|
|
204
275
|
tx.moveCall({
|
|
205
|
-
target: "".concat(nftPackageId, "::
|
|
276
|
+
target: "".concat(nftPackageId, "::tails_staking::level_up"),
|
|
206
277
|
typeArguments: [],
|
|
207
278
|
arguments: [tx.object(registry)],
|
|
208
279
|
});
|
|
@@ -9,7 +9,7 @@ import { TransactionBlock } from "@mysten/sui.js";
|
|
|
9
9
|
ctx: &mut TxContext,
|
|
10
10
|
)
|
|
11
11
|
*/
|
|
12
|
-
export declare function getDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string,
|
|
12
|
+
export declare function getDepositTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], amount: string, receipts: string[], usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
13
13
|
/**
|
|
14
14
|
public(friend) entry fun withdraw<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
15
15
|
registry: &mut Registry,
|
|
@@ -19,7 +19,7 @@ export declare function getDepositTx(gasBudget: number, packageId: string, typeA
|
|
|
19
19
|
ctx: &mut TxContext,
|
|
20
20
|
)
|
|
21
21
|
*/
|
|
22
|
-
export declare function getWithdrawTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
|
|
22
|
+
export declare function getWithdrawTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
|
|
23
23
|
/**
|
|
24
24
|
public(friend) entry fun unsubscribe<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
25
25
|
registry: &mut Registry,
|
|
@@ -29,7 +29,7 @@ export declare function getWithdrawTx(gasBudget: number, packageId: string, type
|
|
|
29
29
|
ctx: &mut TxContext,
|
|
30
30
|
)
|
|
31
31
|
*/
|
|
32
|
-
export declare function getUnsubscribeTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
|
|
32
|
+
export declare function getUnsubscribeTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
|
|
33
33
|
/**
|
|
34
34
|
public(friend) entry fun claim<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
35
35
|
registry: &mut Registry,
|
|
@@ -38,7 +38,7 @@ export declare function getUnsubscribeTx(gasBudget: number, packageId: string, t
|
|
|
38
38
|
ctx: &mut TxContext,
|
|
39
39
|
)
|
|
40
40
|
*/
|
|
41
|
-
export declare function getClaimTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
|
|
41
|
+
export declare function getClaimTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
|
|
42
42
|
/**
|
|
43
43
|
public(friend) entry fun harvest<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
44
44
|
registry: &mut Registry,
|
|
@@ -47,7 +47,7 @@ export declare function getClaimTx(gasBudget: number, packageId: string, typeArg
|
|
|
47
47
|
ctx: &mut TxContext,
|
|
48
48
|
)
|
|
49
49
|
*/
|
|
50
|
-
export declare function getHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
|
|
50
|
+
export declare function getHarvestTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
|
|
51
51
|
/**
|
|
52
52
|
public(friend) entry fun compound<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
53
53
|
registry: &mut Registry,
|
|
@@ -56,7 +56,7 @@ export declare function getHarvestTx(gasBudget: number, packageId: string, typeA
|
|
|
56
56
|
ctx: &mut TxContext,
|
|
57
57
|
)
|
|
58
58
|
*/
|
|
59
|
-
export declare function getCompoundTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
|
|
59
|
+
export declare function getCompoundTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
|
|
60
60
|
/**
|
|
61
61
|
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
62
62
|
registry: &mut Registry,
|
|
@@ -77,10 +77,11 @@ usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
|
77
77
|
ctx: &mut TxContext,
|
|
78
78
|
)
|
|
79
79
|
*/
|
|
80
|
-
export declare function getExerciseTx(gasBudget: number, packageId: string, registry: string, requests: [{
|
|
80
|
+
export declare function getExerciseTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, registry: string, requests: [{
|
|
81
81
|
typeArguments: string[];
|
|
82
82
|
index: string;
|
|
83
|
-
|
|
83
|
+
receipts: string[];
|
|
84
|
+
}]): Promise<TransactionBlock>;
|
|
84
85
|
/**
|
|
85
86
|
public(friend) entry fun refund<TOKEN>(
|
|
86
87
|
registry: &mut Registry,
|
|
@@ -64,7 +64,7 @@ var sui_js_1 = require("@mysten/sui.js");
|
|
|
64
64
|
ctx: &mut TxContext,
|
|
65
65
|
)
|
|
66
66
|
*/
|
|
67
|
-
function getDepositTx(gasBudget, packageId, typeArguments, registry,
|
|
67
|
+
function getDepositTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, coins, amount, receipts, usingSponsoredGasCoin) {
|
|
68
68
|
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
69
69
|
return __awaiter(this, void 0, void 0, function () {
|
|
70
70
|
var tx, _a, coin;
|
|
@@ -79,11 +79,13 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, additional_
|
|
|
79
79
|
typeArguments: typeArguments,
|
|
80
80
|
arguments: [
|
|
81
81
|
tx.pure(registry),
|
|
82
|
-
tx.pure(additional_config_registry),
|
|
83
82
|
tx.pure(index),
|
|
84
83
|
tx.makeMoveVec({ objects: [coin] }),
|
|
85
84
|
tx.pure(amount),
|
|
86
|
-
tx.makeMoveVec({
|
|
85
|
+
tx.makeMoveVec({
|
|
86
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
87
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
88
|
+
}),
|
|
87
89
|
],
|
|
88
90
|
});
|
|
89
91
|
}
|
|
@@ -93,11 +95,13 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, additional_
|
|
|
93
95
|
typeArguments: typeArguments,
|
|
94
96
|
arguments: [
|
|
95
97
|
tx.pure(registry),
|
|
96
|
-
tx.pure(additional_config_registry),
|
|
97
98
|
tx.pure(index),
|
|
98
99
|
tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
|
|
99
100
|
tx.pure(amount),
|
|
100
|
-
tx.makeMoveVec({
|
|
101
|
+
tx.makeMoveVec({
|
|
102
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
103
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
104
|
+
}),
|
|
101
105
|
],
|
|
102
106
|
});
|
|
103
107
|
}
|
|
@@ -116,7 +120,7 @@ exports.getDepositTx = getDepositTx;
|
|
|
116
120
|
ctx: &mut TxContext,
|
|
117
121
|
)
|
|
118
122
|
*/
|
|
119
|
-
function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, receipts, share) {
|
|
123
|
+
function getWithdrawTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, share) {
|
|
120
124
|
return __awaiter(this, void 0, void 0, function () {
|
|
121
125
|
var tx;
|
|
122
126
|
return __generator(this, function (_a) {
|
|
@@ -127,7 +131,10 @@ function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, rec
|
|
|
127
131
|
arguments: [
|
|
128
132
|
tx.pure(registry),
|
|
129
133
|
tx.pure(index),
|
|
130
|
-
tx.makeMoveVec({
|
|
134
|
+
tx.makeMoveVec({
|
|
135
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
136
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
137
|
+
}),
|
|
131
138
|
tx.pure(share ? [share] : []),
|
|
132
139
|
],
|
|
133
140
|
});
|
|
@@ -146,7 +153,7 @@ exports.getWithdrawTx = getWithdrawTx;
|
|
|
146
153
|
ctx: &mut TxContext,
|
|
147
154
|
)
|
|
148
155
|
*/
|
|
149
|
-
function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index, receipts, share) {
|
|
156
|
+
function getUnsubscribeTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, share) {
|
|
150
157
|
return __awaiter(this, void 0, void 0, function () {
|
|
151
158
|
var tx;
|
|
152
159
|
return __generator(this, function (_a) {
|
|
@@ -157,7 +164,10 @@ function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index,
|
|
|
157
164
|
arguments: [
|
|
158
165
|
tx.pure(registry),
|
|
159
166
|
tx.pure(index),
|
|
160
|
-
tx.makeMoveVec({
|
|
167
|
+
tx.makeMoveVec({
|
|
168
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
169
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
170
|
+
}),
|
|
161
171
|
tx.pure(share ? [share] : []),
|
|
162
172
|
],
|
|
163
173
|
});
|
|
@@ -175,7 +185,7 @@ exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
|
175
185
|
ctx: &mut TxContext,
|
|
176
186
|
)
|
|
177
187
|
*/
|
|
178
|
-
function getClaimTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
|
|
188
|
+
function getClaimTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
|
|
179
189
|
return __awaiter(this, void 0, void 0, function () {
|
|
180
190
|
var tx;
|
|
181
191
|
return __generator(this, function (_a) {
|
|
@@ -183,7 +193,14 @@ function getClaimTx(gasBudget, packageId, typeArguments, registry, index, receip
|
|
|
183
193
|
tx.moveCall({
|
|
184
194
|
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
185
195
|
typeArguments: typeArguments,
|
|
186
|
-
arguments: [
|
|
196
|
+
arguments: [
|
|
197
|
+
tx.pure(registry),
|
|
198
|
+
tx.pure(index),
|
|
199
|
+
tx.makeMoveVec({
|
|
200
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
201
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
202
|
+
}),
|
|
203
|
+
],
|
|
187
204
|
});
|
|
188
205
|
tx.setGasBudget(gasBudget);
|
|
189
206
|
return [2 /*return*/, tx];
|
|
@@ -199,7 +216,7 @@ exports.getClaimTx = getClaimTx;
|
|
|
199
216
|
ctx: &mut TxContext,
|
|
200
217
|
)
|
|
201
218
|
*/
|
|
202
|
-
function getHarvestTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
|
|
219
|
+
function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
|
|
203
220
|
return __awaiter(this, void 0, void 0, function () {
|
|
204
221
|
var tx;
|
|
205
222
|
return __generator(this, function (_a) {
|
|
@@ -207,7 +224,14 @@ function getHarvestTx(gasBudget, packageId, typeArguments, registry, index, rece
|
|
|
207
224
|
tx.moveCall({
|
|
208
225
|
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
209
226
|
typeArguments: typeArguments,
|
|
210
|
-
arguments: [
|
|
227
|
+
arguments: [
|
|
228
|
+
tx.pure(registry),
|
|
229
|
+
tx.pure(index),
|
|
230
|
+
tx.makeMoveVec({
|
|
231
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
232
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
233
|
+
}),
|
|
234
|
+
],
|
|
211
235
|
});
|
|
212
236
|
tx.setGasBudget(gasBudget);
|
|
213
237
|
return [2 /*return*/, tx];
|
|
@@ -223,7 +247,7 @@ exports.getHarvestTx = getHarvestTx;
|
|
|
223
247
|
ctx: &mut TxContext,
|
|
224
248
|
)
|
|
225
249
|
*/
|
|
226
|
-
function getCompoundTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
|
|
250
|
+
function getCompoundTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
|
|
227
251
|
return __awaiter(this, void 0, void 0, function () {
|
|
228
252
|
var tx;
|
|
229
253
|
return __generator(this, function (_a) {
|
|
@@ -231,7 +255,14 @@ function getCompoundTx(gasBudget, packageId, typeArguments, registry, index, rec
|
|
|
231
255
|
tx.moveCall({
|
|
232
256
|
target: "".concat(packageId, "::typus_dov_single::compound"),
|
|
233
257
|
typeArguments: typeArguments,
|
|
234
|
-
arguments: [
|
|
258
|
+
arguments: [
|
|
259
|
+
tx.pure(registry),
|
|
260
|
+
tx.pure(index),
|
|
261
|
+
tx.makeMoveVec({
|
|
262
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
263
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
264
|
+
}),
|
|
265
|
+
],
|
|
235
266
|
});
|
|
236
267
|
tx.setGasBudget(gasBudget);
|
|
237
268
|
return [2 /*return*/, tx];
|
|
@@ -293,7 +324,7 @@ exports.getNewBidTx = getNewBidTx;
|
|
|
293
324
|
ctx: &mut TxContext,
|
|
294
325
|
)
|
|
295
326
|
*/
|
|
296
|
-
function getExerciseTx(gasBudget, packageId, registry, requests
|
|
327
|
+
function getExerciseTx(gasBudget, typusFrameworkPackageId, packageId, registry, requests) {
|
|
297
328
|
return __awaiter(this, void 0, void 0, function () {
|
|
298
329
|
var tx;
|
|
299
330
|
return __generator(this, function (_a) {
|
|
@@ -302,7 +333,14 @@ function getExerciseTx(gasBudget, packageId, registry, requests, receipts) {
|
|
|
302
333
|
tx.moveCall({
|
|
303
334
|
target: "".concat(packageId, "::typus_dov_single::exercise"),
|
|
304
335
|
typeArguments: request.typeArguments,
|
|
305
|
-
arguments: [
|
|
336
|
+
arguments: [
|
|
337
|
+
tx.pure(registry),
|
|
338
|
+
tx.pure(request.index),
|
|
339
|
+
tx.makeMoveVec({
|
|
340
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusBidReceipt"),
|
|
341
|
+
objects: request.receipts.map(function (id) { return tx.object(id); }),
|
|
342
|
+
}),
|
|
343
|
+
],
|
|
306
344
|
});
|
|
307
345
|
});
|
|
308
346
|
tx.setGasBudget(gasBudget);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JsonRpcProvider } from "@mysten/sui.js";
|
|
2
|
+
export declare const SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
3
|
+
export interface DepositShare {
|
|
4
|
+
index: string;
|
|
5
|
+
activeSubVaultUserShare: string;
|
|
6
|
+
deactivatingSubVaultUserShare: string;
|
|
7
|
+
inactiveSubVaultUserShare: string;
|
|
8
|
+
warmupSubVaultUserShare: string;
|
|
9
|
+
premiumSubVaultUserShare: string;
|
|
10
|
+
performanceFeeSubVaultUserShare: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function getDepositShares(provider: JsonRpcProvider, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[]): Promise<Map<string, DepositShare>>;
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.getDepositShares = exports.SENDER = void 0;
|
|
56
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
57
|
+
var bcs_1 = require("@mysten/bcs");
|
|
58
|
+
exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
59
|
+
function getDepositShares(provider, typusFrameworkPackageId, packageId, registry, receipts) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
+
var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
switch (_a.label) {
|
|
64
|
+
case 0:
|
|
65
|
+
transactionBlock = new sui_js_1.TransactionBlock();
|
|
66
|
+
target = "".concat(packageId, "::typus_dov_single::get_deposit_shares_bcs");
|
|
67
|
+
transactionBlockArguments = [
|
|
68
|
+
transactionBlock.pure(registry),
|
|
69
|
+
transactionBlock.makeMoveVec({
|
|
70
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
71
|
+
objects: receipts.map(function (id) { return transactionBlock.object(id); }),
|
|
72
|
+
}),
|
|
73
|
+
];
|
|
74
|
+
transactionBlock.moveCall({
|
|
75
|
+
target: target,
|
|
76
|
+
typeArguments: [],
|
|
77
|
+
arguments: transactionBlockArguments,
|
|
78
|
+
});
|
|
79
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: exports.SENDER })];
|
|
80
|
+
case 1:
|
|
81
|
+
results = (_a.sent()).results;
|
|
82
|
+
bytes = results[results.length - 1].returnValues[0][0];
|
|
83
|
+
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
84
|
+
result = Array.from(new Map()).reduce(function (map, _a) {
|
|
85
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
86
|
+
map[key] = value;
|
|
87
|
+
return map;
|
|
88
|
+
}, {});
|
|
89
|
+
reader.readVec(function (reader, i) {
|
|
90
|
+
reader.read8();
|
|
91
|
+
var index = reader.read64();
|
|
92
|
+
var activeSubVaultUserShare = reader.read64();
|
|
93
|
+
var deactivatingSubVaultUserShare = reader.read64();
|
|
94
|
+
var inactiveSubVaultUserShare = reader.read64();
|
|
95
|
+
var warmupSubVaultUserShare = reader.read64();
|
|
96
|
+
var premiumSubVaultUserShare = reader.read64();
|
|
97
|
+
var performanceFeeSubVaultUserShare = reader.read64();
|
|
98
|
+
result[index] = {
|
|
99
|
+
index: index,
|
|
100
|
+
activeSubVaultUserShare: activeSubVaultUserShare,
|
|
101
|
+
deactivatingSubVaultUserShare: deactivatingSubVaultUserShare,
|
|
102
|
+
inactiveSubVaultUserShare: inactiveSubVaultUserShare,
|
|
103
|
+
warmupSubVaultUserShare: warmupSubVaultUserShare,
|
|
104
|
+
premiumSubVaultUserShare: premiumSubVaultUserShare,
|
|
105
|
+
performanceFeeSubVaultUserShare: performanceFeeSubVaultUserShare,
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
return [2 /*return*/, result];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
exports.getDepositShares = getDepositShares;
|
|
@@ -18,6 +18,7 @@ interface TailsId {
|
|
|
18
18
|
}
|
|
19
19
|
export declare function getTailsIds(provider: JsonRpcProvider, nftConfig: any, kiosks: OwnedKiosks): Promise<TailsId[]>;
|
|
20
20
|
export declare function getTails(provider: JsonRpcProvider, tailsIds: string[]): Promise<Tails[]>;
|
|
21
|
+
export declare function fieldsToTails(fields: any): Tails;
|
|
21
22
|
export interface Tails {
|
|
22
23
|
id: string;
|
|
23
24
|
name: string;
|
|
@@ -28,6 +29,8 @@ export interface Tails {
|
|
|
28
29
|
first_bid: string;
|
|
29
30
|
first_deposit: string;
|
|
30
31
|
first_deposit_nft: string;
|
|
32
|
+
attributes: Map<string, string>;
|
|
33
|
+
u64_padding: Map<string, string>;
|
|
31
34
|
}
|
|
32
35
|
export declare function getLevelExp(level: number): number | undefined;
|
|
33
36
|
export declare const LevelExpVec: number[];
|
|
@@ -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.LevelExpVec = exports.getLevelExp = exports.getTails = exports.getTailsIds = exports.getWhitelistMap = exports.getPoolMap = exports.necklaces = exports.getPool = void 0;
|
|
50
|
+
exports.LevelExpVec = exports.getLevelExp = exports.fieldsToTails = exports.getTails = exports.getTailsIds = exports.getWhitelistMap = exports.getPoolMap = exports.necklaces = exports.getPool = void 0;
|
|
51
51
|
var kiosk_1 = require("@mysten/kiosk");
|
|
52
52
|
function getPool(provider, pool) {
|
|
53
53
|
var _a;
|
|
@@ -228,17 +228,7 @@ function getTails(provider, tailsIds) {
|
|
|
228
228
|
for (results_1 = (e_2 = void 0, __values(results)), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {
|
|
229
229
|
result = results_1_1.value;
|
|
230
230
|
fields = (_a = result.data) === null || _a === void 0 ? void 0 : _a.content.fields;
|
|
231
|
-
tails =
|
|
232
|
-
id: fields.id.id,
|
|
233
|
-
name: fields.name,
|
|
234
|
-
number: fields.number,
|
|
235
|
-
url: fields.url,
|
|
236
|
-
level: fields.level,
|
|
237
|
-
exp: fields.exp,
|
|
238
|
-
first_bid: fields.first_bid,
|
|
239
|
-
first_deposit: fields.first_deposit,
|
|
240
|
-
first_deposit_nft: fields.first_deposit_nft,
|
|
241
|
-
};
|
|
231
|
+
tails = fieldsToTails(fields);
|
|
242
232
|
Tails.push(tails);
|
|
243
233
|
}
|
|
244
234
|
}
|
|
@@ -256,6 +246,28 @@ function getTails(provider, tailsIds) {
|
|
|
256
246
|
});
|
|
257
247
|
}
|
|
258
248
|
exports.getTails = getTails;
|
|
249
|
+
function fieldsToTails(fields) {
|
|
250
|
+
// console.log(fields.attributes.fields.contents);
|
|
251
|
+
var attributes = new Map();
|
|
252
|
+
fields.attributes.fields.contents.forEach(function (f) { return attributes.set(f.fields.key, f.fields.value); });
|
|
253
|
+
var u64_padding = new Map();
|
|
254
|
+
fields.u64_padding.fields.contents.forEach(function (f) { return u64_padding.set(f.fields.key, f.fields.value); });
|
|
255
|
+
var tails = {
|
|
256
|
+
id: fields.id.id,
|
|
257
|
+
name: fields.name,
|
|
258
|
+
number: fields.number,
|
|
259
|
+
url: fields.url,
|
|
260
|
+
level: fields.level,
|
|
261
|
+
exp: fields.exp,
|
|
262
|
+
first_bid: fields.first_bid,
|
|
263
|
+
first_deposit: fields.first_deposit,
|
|
264
|
+
first_deposit_nft: fields.first_deposit_nft,
|
|
265
|
+
attributes: attributes,
|
|
266
|
+
u64_padding: u64_padding,
|
|
267
|
+
};
|
|
268
|
+
return tails;
|
|
269
|
+
}
|
|
270
|
+
exports.fieldsToTails = fieldsToTails;
|
|
259
271
|
function getLevelExp(level) {
|
|
260
272
|
switch (level) {
|
|
261
273
|
case 1:
|