@typus/typus-sdk 1.0.104 → 1.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.json +2 -2
- package/lib/utils/nft-staking/user-entry.d.ts +5 -4
- package/lib/utils/nft-staking/user-entry.js +18 -16
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +7 -7
- package/lib/utils/typus-dov-single-v2/user-entry.js +51 -15
- 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/package.json +1 -1
package/lib/config.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"VERSION": "3.0.
|
|
2
|
+
"VERSION": "3.0.3",
|
|
3
3
|
"DB_NAME": "testnet_3_0_0",
|
|
4
4
|
"RPC_ENDPOINT": "https://api.shinami.com:443/node/v1/sui_testnet_c702de54dad05016124f2cfabc1de7e8",
|
|
5
5
|
"sponsorApi": "https://northamerica-northeast1-aqueous-freedom-378103.cloudfunctions.net/sponsor-testnet",
|
|
6
|
-
"SINGLE_COLLATERAL_PACKAGE": "
|
|
6
|
+
"SINGLE_COLLATERAL_PACKAGE": "0x14be6404c3222346a001386b0eab940b3429a3c904f6a72dab77044ce67f5f60",
|
|
7
7
|
"SINGLE_COLLATERAL_PACKAGE_ORIGIN": "0x0334a2ae4b0c5cd007d3bf44925975726b94c1061eb45d660e8b79ec91c0599e",
|
|
8
8
|
"SINGLE_COLLATERAL_MANAGER_CAP": "0xdc092ced3f08dc31cbbdaa584a937d4e54555cb47a1dca1d756560809d92c0ba",
|
|
9
9
|
"SINGLE_COLLATERAL_REGISTRY": "0xcb757bd17a8daa75c2b12a5c5f19bd88e7e2e96b8a220bbe4cf0605affea7475",
|
|
@@ -27,21 +27,22 @@ export declare function getStakeNftTx(gasBudget: number, nftPackageId: string, r
|
|
|
27
27
|
registry: &mut Registry,
|
|
28
28
|
kiosk: &mut Kiosk,
|
|
29
29
|
kiosk_cap: &KioskOwnerCap,
|
|
30
|
+
coin: Coin<SUI>,
|
|
30
31
|
ctx: &mut TxContext
|
|
31
32
|
)
|
|
32
33
|
*/
|
|
33
34
|
export declare function getUnstakeNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string): Promise<TransactionBlock>;
|
|
34
35
|
/**
|
|
35
|
-
public fun
|
|
36
|
+
public fun daily_attend(
|
|
36
37
|
registry: &mut Registry,
|
|
37
38
|
clock: &Clock,
|
|
38
39
|
ctx: &mut TxContext
|
|
39
40
|
)
|
|
40
41
|
*/
|
|
41
|
-
export declare function
|
|
42
|
-
export declare function
|
|
42
|
+
export declare function getDailyAttendTx(gasBudget: number, nftPackageId: string, registry: string): Promise<TransactionBlock>;
|
|
43
|
+
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
44
|
usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
44
|
-
export declare function
|
|
45
|
+
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>;
|
|
45
46
|
/**
|
|
46
47
|
public fun level_up(
|
|
47
48
|
registry: &mut Registry,
|
|
@@ -52,7 +52,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.getLevelUpTx = exports.
|
|
55
|
+
exports.getLevelUpTx = exports.getDepositWithNftTx = exports.getNewBidWithNftTx = exports.getDailyAttendTx = exports.getUnstakeNftTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
|
|
56
56
|
var sui_js_1 = require("@mysten/sui.js");
|
|
57
57
|
var constants_1 = require("../../constants");
|
|
58
58
|
/**
|
|
@@ -132,18 +132,20 @@ exports.getStakeNftTx = getStakeNftTx;
|
|
|
132
132
|
registry: &mut Registry,
|
|
133
133
|
kiosk: &mut Kiosk,
|
|
134
134
|
kiosk_cap: &KioskOwnerCap,
|
|
135
|
+
coin: Coin<SUI>,
|
|
135
136
|
ctx: &mut TxContext
|
|
136
137
|
)
|
|
137
138
|
*/
|
|
138
139
|
function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap) {
|
|
139
140
|
return __awaiter(this, void 0, void 0, function () {
|
|
140
|
-
var tx;
|
|
141
|
-
return __generator(this, function (
|
|
141
|
+
var tx, _a, coin;
|
|
142
|
+
return __generator(this, function (_b) {
|
|
142
143
|
tx = new sui_js_1.TransactionBlock();
|
|
144
|
+
_a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
|
|
143
145
|
tx.moveCall({
|
|
144
146
|
target: "".concat(nftPackageId, "::tails_staking::unstake_nft"),
|
|
145
147
|
typeArguments: [],
|
|
146
|
-
arguments: [tx.object(registry), tx.object(kiosk), tx.object(kiosk_cap)],
|
|
148
|
+
arguments: [tx.object(registry), tx.object(kiosk), tx.object(kiosk_cap), coin],
|
|
147
149
|
});
|
|
148
150
|
tx.setGasBudget(gasBudget);
|
|
149
151
|
return [2 /*return*/, tx];
|
|
@@ -152,19 +154,19 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap) {
|
|
|
152
154
|
}
|
|
153
155
|
exports.getUnstakeNftTx = getUnstakeNftTx;
|
|
154
156
|
/**
|
|
155
|
-
public fun
|
|
157
|
+
public fun daily_attend(
|
|
156
158
|
registry: &mut Registry,
|
|
157
159
|
clock: &Clock,
|
|
158
160
|
ctx: &mut TxContext
|
|
159
161
|
)
|
|
160
162
|
*/
|
|
161
|
-
function
|
|
163
|
+
function getDailyAttendTx(gasBudget, nftPackageId, registry) {
|
|
162
164
|
return __awaiter(this, void 0, void 0, function () {
|
|
163
165
|
var tx;
|
|
164
166
|
return __generator(this, function (_a) {
|
|
165
167
|
tx = new sui_js_1.TransactionBlock();
|
|
166
168
|
tx.moveCall({
|
|
167
|
-
target: "".concat(nftPackageId, "::tails_staking::
|
|
169
|
+
target: "".concat(nftPackageId, "::tails_staking::daily_attend"),
|
|
168
170
|
typeArguments: [],
|
|
169
171
|
arguments: [tx.object(registry), tx.object(constants_1.CLOCK)],
|
|
170
172
|
});
|
|
@@ -173,8 +175,8 @@ function getSnapshotTx(gasBudget, nftPackageId, registry) {
|
|
|
173
175
|
});
|
|
174
176
|
});
|
|
175
177
|
}
|
|
176
|
-
exports.
|
|
177
|
-
function
|
|
178
|
+
exports.getDailyAttendTx = getDailyAttendTx;
|
|
179
|
+
function getNewBidWithNftTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
|
|
178
180
|
usingSponsoredGasCoin) {
|
|
179
181
|
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
180
182
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -186,7 +188,7 @@ usingSponsoredGasCoin) {
|
|
|
186
188
|
typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
187
189
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
|
|
188
190
|
tx.moveCall({
|
|
189
|
-
target: "".concat(packageId, "::tails_staking::
|
|
191
|
+
target: "".concat(packageId, "::tails_staking::new_bid_w_nft"),
|
|
190
192
|
typeArguments: typeArguments,
|
|
191
193
|
arguments: [
|
|
192
194
|
tx.pure(registry),
|
|
@@ -201,7 +203,7 @@ usingSponsoredGasCoin) {
|
|
|
201
203
|
}
|
|
202
204
|
else {
|
|
203
205
|
tx.moveCall({
|
|
204
|
-
target: "".concat(packageId, "::tails_staking::
|
|
206
|
+
target: "".concat(packageId, "::tails_staking::new_bid_w_nft"),
|
|
205
207
|
typeArguments: typeArguments,
|
|
206
208
|
arguments: [
|
|
207
209
|
tx.pure(registry),
|
|
@@ -219,8 +221,8 @@ usingSponsoredGasCoin) {
|
|
|
219
221
|
});
|
|
220
222
|
});
|
|
221
223
|
}
|
|
222
|
-
exports.
|
|
223
|
-
function
|
|
224
|
+
exports.getNewBidWithNftTx = getNewBidWithNftTx;
|
|
225
|
+
function getDepositWithNftTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, coins, amount, usingSponsoredGasCoin) {
|
|
224
226
|
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
225
227
|
return __awaiter(this, void 0, void 0, function () {
|
|
226
228
|
var tx, _a, coin;
|
|
@@ -231,7 +233,7 @@ function getFirstDepositTx(gasBudget, packageId, typeArguments, registry, additi
|
|
|
231
233
|
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
232
234
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
|
|
233
235
|
tx.moveCall({
|
|
234
|
-
target: "".concat(packageId, "::tails_staking::
|
|
236
|
+
target: "".concat(packageId, "::tails_staking::deposit_w_nft"),
|
|
235
237
|
typeArguments: typeArguments,
|
|
236
238
|
arguments: [
|
|
237
239
|
tx.pure(registry),
|
|
@@ -244,7 +246,7 @@ function getFirstDepositTx(gasBudget, packageId, typeArguments, registry, additi
|
|
|
244
246
|
}
|
|
245
247
|
else {
|
|
246
248
|
tx.moveCall({
|
|
247
|
-
target: "".concat(packageId, "::tails_staking::
|
|
249
|
+
target: "".concat(packageId, "::tails_staking::deposit_w_nft"),
|
|
248
250
|
typeArguments: typeArguments,
|
|
249
251
|
arguments: [
|
|
250
252
|
tx.pure(registry),
|
|
@@ -260,7 +262,7 @@ function getFirstDepositTx(gasBudget, packageId, typeArguments, registry, additi
|
|
|
260
262
|
});
|
|
261
263
|
});
|
|
262
264
|
}
|
|
263
|
-
exports.
|
|
265
|
+
exports.getDepositWithNftTx = getDepositWithNftTx;
|
|
264
266
|
/**
|
|
265
267
|
public fun level_up(
|
|
266
268
|
registry: &mut Registry,
|
|
@@ -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, index: string, coins: string[], amount: string, receipts: string[], usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
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,7 +77,7 @@ 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[];
|
|
@@ -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, index, coins, amount, receipts, usingSponsoredGasCoin) {
|
|
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;
|
|
@@ -82,7 +82,10 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, index, coin
|
|
|
82
82
|
tx.pure(index),
|
|
83
83
|
tx.makeMoveVec({ objects: [coin] }),
|
|
84
84
|
tx.pure(amount),
|
|
85
|
-
tx.makeMoveVec({
|
|
85
|
+
tx.makeMoveVec({
|
|
86
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
87
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
88
|
+
}),
|
|
86
89
|
],
|
|
87
90
|
});
|
|
88
91
|
}
|
|
@@ -95,7 +98,10 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, index, coin
|
|
|
95
98
|
tx.pure(index),
|
|
96
99
|
tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
|
|
97
100
|
tx.pure(amount),
|
|
98
|
-
tx.makeMoveVec({
|
|
101
|
+
tx.makeMoveVec({
|
|
102
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
103
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
104
|
+
}),
|
|
99
105
|
],
|
|
100
106
|
});
|
|
101
107
|
}
|
|
@@ -114,7 +120,7 @@ exports.getDepositTx = getDepositTx;
|
|
|
114
120
|
ctx: &mut TxContext,
|
|
115
121
|
)
|
|
116
122
|
*/
|
|
117
|
-
function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, receipts, share) {
|
|
123
|
+
function getWithdrawTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, share) {
|
|
118
124
|
return __awaiter(this, void 0, void 0, function () {
|
|
119
125
|
var tx;
|
|
120
126
|
return __generator(this, function (_a) {
|
|
@@ -125,7 +131,10 @@ function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, rec
|
|
|
125
131
|
arguments: [
|
|
126
132
|
tx.pure(registry),
|
|
127
133
|
tx.pure(index),
|
|
128
|
-
tx.makeMoveVec({
|
|
134
|
+
tx.makeMoveVec({
|
|
135
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
136
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
137
|
+
}),
|
|
129
138
|
tx.pure(share ? [share] : []),
|
|
130
139
|
],
|
|
131
140
|
});
|
|
@@ -144,7 +153,7 @@ exports.getWithdrawTx = getWithdrawTx;
|
|
|
144
153
|
ctx: &mut TxContext,
|
|
145
154
|
)
|
|
146
155
|
*/
|
|
147
|
-
function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index, receipts, share) {
|
|
156
|
+
function getUnsubscribeTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, share) {
|
|
148
157
|
return __awaiter(this, void 0, void 0, function () {
|
|
149
158
|
var tx;
|
|
150
159
|
return __generator(this, function (_a) {
|
|
@@ -155,7 +164,10 @@ function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index,
|
|
|
155
164
|
arguments: [
|
|
156
165
|
tx.pure(registry),
|
|
157
166
|
tx.pure(index),
|
|
158
|
-
tx.makeMoveVec({
|
|
167
|
+
tx.makeMoveVec({
|
|
168
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
169
|
+
objects: receipts.map(function (id) { return tx.object(id); }),
|
|
170
|
+
}),
|
|
159
171
|
tx.pure(share ? [share] : []),
|
|
160
172
|
],
|
|
161
173
|
});
|
|
@@ -173,7 +185,7 @@ exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
|
173
185
|
ctx: &mut TxContext,
|
|
174
186
|
)
|
|
175
187
|
*/
|
|
176
|
-
function getClaimTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
|
|
188
|
+
function getClaimTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
|
|
177
189
|
return __awaiter(this, void 0, void 0, function () {
|
|
178
190
|
var tx;
|
|
179
191
|
return __generator(this, function (_a) {
|
|
@@ -181,7 +193,14 @@ function getClaimTx(gasBudget, packageId, typeArguments, registry, index, receip
|
|
|
181
193
|
tx.moveCall({
|
|
182
194
|
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
183
195
|
typeArguments: typeArguments,
|
|
184
|
-
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
|
+
],
|
|
185
204
|
});
|
|
186
205
|
tx.setGasBudget(gasBudget);
|
|
187
206
|
return [2 /*return*/, tx];
|
|
@@ -197,7 +216,7 @@ exports.getClaimTx = getClaimTx;
|
|
|
197
216
|
ctx: &mut TxContext,
|
|
198
217
|
)
|
|
199
218
|
*/
|
|
200
|
-
function getHarvestTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
|
|
219
|
+
function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
|
|
201
220
|
return __awaiter(this, void 0, void 0, function () {
|
|
202
221
|
var tx;
|
|
203
222
|
return __generator(this, function (_a) {
|
|
@@ -205,7 +224,14 @@ function getHarvestTx(gasBudget, packageId, typeArguments, registry, index, rece
|
|
|
205
224
|
tx.moveCall({
|
|
206
225
|
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
207
226
|
typeArguments: typeArguments,
|
|
208
|
-
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
|
+
],
|
|
209
235
|
});
|
|
210
236
|
tx.setGasBudget(gasBudget);
|
|
211
237
|
return [2 /*return*/, tx];
|
|
@@ -221,7 +247,7 @@ exports.getHarvestTx = getHarvestTx;
|
|
|
221
247
|
ctx: &mut TxContext,
|
|
222
248
|
)
|
|
223
249
|
*/
|
|
224
|
-
function getCompoundTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
|
|
250
|
+
function getCompoundTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
|
|
225
251
|
return __awaiter(this, void 0, void 0, function () {
|
|
226
252
|
var tx;
|
|
227
253
|
return __generator(this, function (_a) {
|
|
@@ -229,7 +255,14 @@ function getCompoundTx(gasBudget, packageId, typeArguments, registry, index, rec
|
|
|
229
255
|
tx.moveCall({
|
|
230
256
|
target: "".concat(packageId, "::typus_dov_single::compound"),
|
|
231
257
|
typeArguments: typeArguments,
|
|
232
|
-
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
|
+
],
|
|
233
266
|
});
|
|
234
267
|
tx.setGasBudget(gasBudget);
|
|
235
268
|
return [2 /*return*/, tx];
|
|
@@ -291,7 +324,7 @@ exports.getNewBidTx = getNewBidTx;
|
|
|
291
324
|
ctx: &mut TxContext,
|
|
292
325
|
)
|
|
293
326
|
*/
|
|
294
|
-
function getExerciseTx(gasBudget, packageId, registry, requests) {
|
|
327
|
+
function getExerciseTx(gasBudget, typusFrameworkPackageId, packageId, registry, requests) {
|
|
295
328
|
return __awaiter(this, void 0, void 0, function () {
|
|
296
329
|
var tx;
|
|
297
330
|
return __generator(this, function (_a) {
|
|
@@ -303,7 +336,10 @@ function getExerciseTx(gasBudget, packageId, registry, requests) {
|
|
|
303
336
|
arguments: [
|
|
304
337
|
tx.pure(registry),
|
|
305
338
|
tx.pure(request.index),
|
|
306
|
-
tx.makeMoveVec({
|
|
339
|
+
tx.makeMoveVec({
|
|
340
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusBidReceipt"),
|
|
341
|
+
objects: request.receipts.map(function (id) { return tx.object(id); }),
|
|
342
|
+
}),
|
|
307
343
|
],
|
|
308
344
|
});
|
|
309
345
|
});
|
|
@@ -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;
|