@typus/typus-sdk 1.0.22 → 1.0.24
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/utils/portfolio/{single-collateral/getMintTx.js → mint.js} +3 -5
- package/lib/utils/portfolio/multiple-collateral/user-entry.d.ts +13 -4
- package/lib/utils/portfolio/multiple-collateral/user-entry.js +13 -4
- package/lib/utils/portfolio/single-collateral/user-entry.d.ts +81 -0
- package/lib/utils/portfolio/single-collateral/user-entry.js +247 -0
- package/package.json +1 -1
- package/lib/scripts/sui.d.ts +0 -1
- package/lib/scripts/sui.js +0 -174
- package/lib/test/faucet.d.ts +0 -1
- package/lib/test/faucet.js +0 -53
- package/lib/test/getUserInfo.d.ts +0 -1
- package/lib/test/getUserInfo.js +0 -46
- package/lib/test/mergeCoins.d.ts +0 -1
- package/lib/test/mergeCoins.js +0 -75
- package/lib/test/multiple-collateral/getAuctionMaxSize.d.ts +0 -1
- package/lib/test/multiple-collateral/getAuctionMaxSize.js +0 -63
- package/lib/test/multiple-collateral/getBids.d.ts +0 -1
- package/lib/test/multiple-collateral/getBids.js +0 -63
- package/lib/test/multiple-collateral/getMaxLossPerUnit.d.ts +0 -1
- package/lib/test/multiple-collateral/getMaxLossPerUnit.js +0 -63
- package/lib/test/multiple-collateral/getPortfolioVaults.d.ts +0 -1
- package/lib/test/multiple-collateral/getPortfolioVaults.js +0 -62
- package/lib/test/multiple-collateral/getUserShares.d.ts +0 -1
- package/lib/test/multiple-collateral/getUserShares.js +0 -60
- package/lib/test/single-collateral/authorized/testAuthorizedNewPortfolioVault.d.ts +0 -1
- package/lib/test/single-collateral/authorized/testAuthorizedNewPortfolioVault.js +0 -88
- package/lib/test/single-collateral/authorized/testAuthorizedUpdateUpcomingVaultConfig.d.ts +0 -1
- package/lib/test/single-collateral/authorized/testAuthorizedUpdateUpcomingVaultConfig.js +0 -77
- package/lib/test/single-collateral/authorized/testAuthorizedUpdateWarmupVaultConfig.d.ts +0 -1
- package/lib/test/single-collateral/authorized/testAuthorizedUpdateWarmupVaultConfig.js +0 -74
- package/lib/test/single-collateral/getAuctionMaxSize.d.ts +0 -1
- package/lib/test/single-collateral/getAuctionMaxSize.js +0 -63
- package/lib/test/single-collateral/getBidData.d.ts +0 -1
- package/lib/test/single-collateral/getBidData.js +0 -62
- package/lib/test/single-collateral/getBids.d.ts +0 -1
- package/lib/test/single-collateral/getBids.js +0 -63
- package/lib/test/single-collateral/getMaxLossPerUnit.d.ts +0 -1
- package/lib/test/single-collateral/getMaxLossPerUnit.js +0 -63
- package/lib/test/single-collateral/getPortfolioVaults.d.ts +0 -1
- package/lib/test/single-collateral/getPortfolioVaults.js +0 -57
- package/lib/test/single-collateral/getUserShares.d.ts +0 -1
- package/lib/test/single-collateral/getUserShares.js +0 -60
- package/lib/test/single-collateral/getVaultData.d.ts +0 -1
- package/lib/test/single-collateral/getVaultData.js +0 -56
- package/lib/test/single-collateral/getWhiteListFromRegistry.d.ts +0 -1
- package/lib/test/single-collateral/getWhiteListFromRegistry.js +0 -55
- package/lib/test/single-collateral/testCrypto.d.ts +0 -1
- package/lib/test/single-collateral/testCrypto.js +0 -54
- package/lib/test/single-collateral/testMint.d.ts +0 -1
- package/lib/test/single-collateral/testMint.js +0 -145
- package/lib/test/single-collateral/testSDK.d.ts +0 -1
- package/lib/test/single-collateral/testSDK.js +0 -73
- package/lib/test/single-collateral/testSubscribeEvent.d.ts +0 -1
- package/lib/test/single-collateral/testSubscribeEvent.js +0 -82
- package/lib/test/single-collateral/user/testClaim.d.ts +0 -1
- package/lib/test/single-collateral/user/testClaim.js +0 -68
- package/lib/test/single-collateral/user/testCompound.d.ts +0 -1
- package/lib/test/single-collateral/user/testCompound.js +0 -68
- package/lib/test/single-collateral/user/testDeposit.d.ts +0 -1
- package/lib/test/single-collateral/user/testDeposit.js +0 -85
- package/lib/test/single-collateral/user/testHarvest.d.ts +0 -1
- package/lib/test/single-collateral/user/testHarvest.js +0 -68
- package/lib/test/single-collateral/user/testNewBid.d.ts +0 -1
- package/lib/test/single-collateral/user/testNewBid.js +0 -83
- package/lib/test/single-collateral/user/testUnsubscribe.d.ts +0 -1
- package/lib/test/single-collateral/user/testUnsubscribe.js +0 -72
- package/lib/test/single-collateral/user/testWithdraw.d.ts +0 -1
- package/lib/test/single-collateral/user/testWithdraw.js +0 -71
- package/lib/test/sponsorTransaction.d.ts +0 -1
- package/lib/test/sponsorTransaction.js +0 -130
- package/lib/utils/auction/getBid.d.ts +0 -3
- package/lib/utils/auction/getBid.js +0 -75
- package/lib/utils/portfolio/single-collateral/fetchData.d.ts +0 -97
- package/lib/utils/portfolio/single-collateral/fetchData.js +0 -34
- package/lib/utils/portfolio/single-collateral/getTypeArgumentFromToken.d.ts +0 -2
- package/lib/utils/portfolio/single-collateral/getTypeArgumentFromToken.js +0 -74
- package/lib/utils/portfolio/single-collateral/getVaultData.d.ts +0 -15
- package/lib/utils/portfolio/single-collateral/getVaultData.js +0 -315
- package/lib/utils/portfolio/single-collateral/getWhiteListFromRegistry.d.ts +0 -2
- package/lib/utils/portfolio/single-collateral/getWhiteListFromRegistry.js +0 -73
- package/lib/utils/portfolio/single-collateral/user/getClaimAndHarvestTx.d.ts +0 -10
- package/lib/utils/portfolio/single-collateral/user/getClaimAndHarvestTx.js +0 -66
- package/lib/utils/portfolio/single-collateral/user/getClaimTx.d.ts +0 -10
- package/lib/utils/portfolio/single-collateral/user/getClaimTx.js +0 -66
- package/lib/utils/portfolio/single-collateral/user/getCompoundTx.d.ts +0 -10
- package/lib/utils/portfolio/single-collateral/user/getCompoundTx.js +0 -66
- package/lib/utils/portfolio/single-collateral/user/getDepositTx.d.ts +0 -12
- package/lib/utils/portfolio/single-collateral/user/getDepositTx.js +0 -69
- package/lib/utils/portfolio/single-collateral/user/getHarvestTx.d.ts +0 -10
- package/lib/utils/portfolio/single-collateral/user/getHarvestTx.js +0 -66
- package/lib/utils/portfolio/single-collateral/user/getNewBidTx.d.ts +0 -14
- package/lib/utils/portfolio/single-collateral/user/getNewBidTx.js +0 -78
- package/lib/utils/portfolio/single-collateral/user/getUnsubscribeTx.d.ts +0 -10
- package/lib/utils/portfolio/single-collateral/user/getUnsubscribeTx.js +0 -66
- package/lib/utils/portfolio/single-collateral/user/getWithdrawTx.d.ts +0 -11
- package/lib/utils/portfolio/single-collateral/user/getWithdrawTx.js +0 -67
- /package/lib/utils/portfolio/{single-collateral/getLeaderBoard.d.ts → leader-board.d.ts} +0 -0
- /package/lib/utils/portfolio/{single-collateral/getLeaderBoard.js → leader-board.js} +0 -0
- /package/lib/utils/portfolio/{single-collateral/getMintTx.d.ts → mint.d.ts} +0 -0
|
@@ -40,14 +40,12 @@ exports.getMintTx = void 0;
|
|
|
40
40
|
var sui_js_1 = require("@mysten/sui.js");
|
|
41
41
|
function getMintTx(gasBudget, packageId, registry, moduleName, amount) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function () {
|
|
43
|
-
var tx
|
|
43
|
+
var tx;
|
|
44
44
|
return __generator(this, function (_a) {
|
|
45
45
|
tx = new sui_js_1.TransactionBlock();
|
|
46
|
-
target = "".concat(packageId, "::").concat(moduleName, "::mint");
|
|
47
|
-
txArguments = [tx.pure(registry), tx.pure(amount)];
|
|
48
46
|
tx.moveCall({
|
|
49
|
-
target:
|
|
50
|
-
arguments:
|
|
47
|
+
target: "".concat(packageId, "::").concat(moduleName, "::mint"),
|
|
48
|
+
arguments: [tx.pure(registry), tx.pure(amount)],
|
|
51
49
|
});
|
|
52
50
|
tx.setGasBudget(gasBudget);
|
|
53
51
|
return [2 /*return*/, tx];
|
|
@@ -8,6 +8,7 @@ import { TransactionBlock } from "@mysten/sui.js";
|
|
|
8
8
|
token_amount: u64,
|
|
9
9
|
ctx: &mut TxContext
|
|
10
10
|
)
|
|
11
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
|
|
11
12
|
*/
|
|
12
13
|
export declare function getDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, o_coins: string[], u_coins: string[], amount: string): Promise<TransactionBlock>;
|
|
13
14
|
/**
|
|
@@ -17,22 +18,25 @@ export declare function getDepositTx(gasBudget: number, packageId: string, typeA
|
|
|
17
18
|
share: Option<u64>,
|
|
18
19
|
ctx: &mut TxContext
|
|
19
20
|
)
|
|
21
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
|
|
20
22
|
*/
|
|
21
23
|
export declare function getWithdrawTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, share?: string): Promise<TransactionBlock>;
|
|
22
24
|
/**
|
|
23
|
-
public(friend) entry fun claim<O_TOKEN, U_TOKEN
|
|
25
|
+
public(friend) entry fun claim<O_TOKEN, U_TOKEN>(
|
|
24
26
|
registry: &mut Registry,
|
|
25
27
|
index: u64,
|
|
26
28
|
ctx: &mut TxContext
|
|
27
29
|
)
|
|
30
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
|
|
28
31
|
*/
|
|
29
32
|
export declare function getClaimTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
30
33
|
/**
|
|
31
|
-
public(friend) entry fun harvest<
|
|
34
|
+
public(friend) entry fun harvest<TOKEN>(
|
|
32
35
|
registry: &mut Registry,
|
|
33
36
|
index: u64,
|
|
34
37
|
ctx: &mut TxContext
|
|
35
38
|
)
|
|
39
|
+
@param typeArguments [Bid Vault Token]
|
|
36
40
|
*/
|
|
37
41
|
export declare function getHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
38
42
|
/**
|
|
@@ -41,6 +45,7 @@ export declare function getHarvestTx(gasBudget: number, packageId: string, typeA
|
|
|
41
45
|
index: u64,
|
|
42
46
|
ctx: &mut TxContext
|
|
43
47
|
)
|
|
48
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
|
|
44
49
|
*/
|
|
45
50
|
export declare function getClaimAndHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
46
51
|
/**
|
|
@@ -50,24 +55,27 @@ export declare function getClaimAndHarvestTx(gasBudget: number, packageId: strin
|
|
|
50
55
|
usd_coins: vector<Coin<U_TOKEN>>,
|
|
51
56
|
ctx: &mut TxContext,
|
|
52
57
|
)
|
|
58
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
|
|
53
59
|
*/
|
|
54
60
|
export declare function getCompoundTokenTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, u_coins: string[]): Promise<TransactionBlock>;
|
|
55
61
|
/**
|
|
56
|
-
public(friend) entry fun compound_usd<
|
|
62
|
+
public(friend) entry fun compound_usd<O_TOKEN, TOKEN>(
|
|
57
63
|
registry: &mut Registry,
|
|
58
64
|
index: u64,
|
|
59
65
|
token_coins: vector<Coin<O_TOKEN>>,
|
|
60
66
|
ctx: &mut TxContext,
|
|
61
67
|
)
|
|
68
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
|
|
62
69
|
*/
|
|
63
70
|
export declare function getCompoundUsdTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, o_coins: string[]): Promise<TransactionBlock>;
|
|
64
71
|
/**
|
|
65
|
-
public(friend) entry fun unsubscribe<O_TOKEN, U_TOKEN
|
|
72
|
+
public(friend) entry fun unsubscribe<O_TOKEN, U_TOKEN>(
|
|
66
73
|
registry: &mut Registry,
|
|
67
74
|
index: u64,
|
|
68
75
|
share: Option<u64>,
|
|
69
76
|
ctx: &mut TxContext
|
|
70
77
|
)
|
|
78
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
|
|
71
79
|
*/
|
|
72
80
|
export declare function getUnsubscribeTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, share?: string): Promise<TransactionBlock>;
|
|
73
81
|
/**
|
|
@@ -80,5 +88,6 @@ export declare function getUnsubscribeTx(gasBudget: number, packageId: string, t
|
|
|
80
88
|
size: u64,
|
|
81
89
|
ctx: &mut TxContext,
|
|
82
90
|
)
|
|
91
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
|
|
83
92
|
*/
|
|
84
93
|
export declare function getNewBidTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, priceOracle: string, b_coins: string[], size: string): Promise<TransactionBlock>;
|
|
@@ -47,6 +47,7 @@ var sui_js_1 = require("@mysten/sui.js");
|
|
|
47
47
|
token_amount: u64,
|
|
48
48
|
ctx: &mut TxContext
|
|
49
49
|
)
|
|
50
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
|
|
50
51
|
*/
|
|
51
52
|
function getDepositTx(gasBudget, packageId, typeArguments, registry, index, o_coins, u_coins, amount) {
|
|
52
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -77,6 +78,7 @@ exports.getDepositTx = getDepositTx;
|
|
|
77
78
|
share: Option<u64>,
|
|
78
79
|
ctx: &mut TxContext
|
|
79
80
|
)
|
|
81
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
|
|
80
82
|
*/
|
|
81
83
|
function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, share) {
|
|
82
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -95,11 +97,12 @@ function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, sha
|
|
|
95
97
|
}
|
|
96
98
|
exports.getWithdrawTx = getWithdrawTx;
|
|
97
99
|
/**
|
|
98
|
-
public(friend) entry fun claim<O_TOKEN, U_TOKEN
|
|
100
|
+
public(friend) entry fun claim<O_TOKEN, U_TOKEN>(
|
|
99
101
|
registry: &mut Registry,
|
|
100
102
|
index: u64,
|
|
101
103
|
ctx: &mut TxContext
|
|
102
104
|
)
|
|
105
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
|
|
103
106
|
*/
|
|
104
107
|
function getClaimTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
105
108
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -118,11 +121,12 @@ function getClaimTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
|
118
121
|
}
|
|
119
122
|
exports.getClaimTx = getClaimTx;
|
|
120
123
|
/**
|
|
121
|
-
public(friend) entry fun harvest<
|
|
124
|
+
public(friend) entry fun harvest<TOKEN>(
|
|
122
125
|
registry: &mut Registry,
|
|
123
126
|
index: u64,
|
|
124
127
|
ctx: &mut TxContext
|
|
125
128
|
)
|
|
129
|
+
@param typeArguments [Bid Vault Token]
|
|
126
130
|
*/
|
|
127
131
|
function getHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
128
132
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -146,6 +150,7 @@ exports.getHarvestTx = getHarvestTx;
|
|
|
146
150
|
index: u64,
|
|
147
151
|
ctx: &mut TxContext
|
|
148
152
|
)
|
|
153
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
|
|
149
154
|
*/
|
|
150
155
|
function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
151
156
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -170,6 +175,7 @@ exports.getClaimAndHarvestTx = getClaimAndHarvestTx;
|
|
|
170
175
|
usd_coins: vector<Coin<U_TOKEN>>,
|
|
171
176
|
ctx: &mut TxContext,
|
|
172
177
|
)
|
|
178
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
|
|
173
179
|
*/
|
|
174
180
|
function getCompoundTokenTx(gasBudget, packageId, typeArguments, registry, index, u_coins) {
|
|
175
181
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -188,12 +194,13 @@ function getCompoundTokenTx(gasBudget, packageId, typeArguments, registry, index
|
|
|
188
194
|
}
|
|
189
195
|
exports.getCompoundTokenTx = getCompoundTokenTx;
|
|
190
196
|
/**
|
|
191
|
-
public(friend) entry fun compound_usd<
|
|
197
|
+
public(friend) entry fun compound_usd<O_TOKEN, TOKEN>(
|
|
192
198
|
registry: &mut Registry,
|
|
193
199
|
index: u64,
|
|
194
200
|
token_coins: vector<Coin<O_TOKEN>>,
|
|
195
201
|
ctx: &mut TxContext,
|
|
196
202
|
)
|
|
203
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
|
|
197
204
|
*/
|
|
198
205
|
function getCompoundUsdTx(gasBudget, packageId, typeArguments, registry, index, o_coins) {
|
|
199
206
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -212,12 +219,13 @@ function getCompoundUsdTx(gasBudget, packageId, typeArguments, registry, index,
|
|
|
212
219
|
}
|
|
213
220
|
exports.getCompoundUsdTx = getCompoundUsdTx;
|
|
214
221
|
/**
|
|
215
|
-
public(friend) entry fun unsubscribe<O_TOKEN, U_TOKEN
|
|
222
|
+
public(friend) entry fun unsubscribe<O_TOKEN, U_TOKEN>(
|
|
216
223
|
registry: &mut Registry,
|
|
217
224
|
index: u64,
|
|
218
225
|
share: Option<u64>,
|
|
219
226
|
ctx: &mut TxContext
|
|
220
227
|
)
|
|
228
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
|
|
221
229
|
*/
|
|
222
230
|
function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index, share) {
|
|
223
231
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -245,6 +253,7 @@ exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
|
245
253
|
size: u64,
|
|
246
254
|
ctx: &mut TxContext,
|
|
247
255
|
)
|
|
256
|
+
@param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
|
|
248
257
|
*/
|
|
249
258
|
function getNewBidTx(gasBudget, packageId, typeArguments, registry, index, priceOracle, b_coins, size) {
|
|
250
259
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js";
|
|
2
|
+
/**
|
|
3
|
+
public(friend) entry fun deposit<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
4
|
+
registry: &mut Registry,
|
|
5
|
+
index: u64,
|
|
6
|
+
coins: vector<Coin<D_TOKEN>>,
|
|
7
|
+
amount: u64,
|
|
8
|
+
ctx: &mut TxContext
|
|
9
|
+
)
|
|
10
|
+
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], amount: string): Promise<TransactionBlock>;
|
|
13
|
+
/**
|
|
14
|
+
public(friend) entry fun withdraw<TOKEN>(
|
|
15
|
+
registry: &mut Registry,
|
|
16
|
+
index: u64,
|
|
17
|
+
share: Option<u64>,
|
|
18
|
+
ctx: &mut TxContext
|
|
19
|
+
)
|
|
20
|
+
@param typeArguments [Deposit Vault Token]
|
|
21
|
+
*/
|
|
22
|
+
export declare function getWithdrawTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, share?: string): Promise<TransactionBlock>;
|
|
23
|
+
/**
|
|
24
|
+
public(friend) entry fun claim<TOKEN>(
|
|
25
|
+
registry: &mut Registry,
|
|
26
|
+
index: u64,
|
|
27
|
+
ctx: &mut TxContext
|
|
28
|
+
)
|
|
29
|
+
@param typeArguments [Deposit Vault Token]
|
|
30
|
+
*/
|
|
31
|
+
export declare function getClaimTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
32
|
+
/**
|
|
33
|
+
public(friend) entry fun harvest<TOKEN>(
|
|
34
|
+
registry: &mut Registry,
|
|
35
|
+
index: u64,
|
|
36
|
+
ctx: &mut TxContext
|
|
37
|
+
)
|
|
38
|
+
@param typeArguments [Bid Vault Token]
|
|
39
|
+
*/
|
|
40
|
+
export declare function getHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
41
|
+
/**
|
|
42
|
+
public(friend) entry fun claim_and_harvest<D_TOKEN, B_TOKEN>(
|
|
43
|
+
registry: &mut Registry,
|
|
44
|
+
index: u64,
|
|
45
|
+
ctx: &mut TxContext
|
|
46
|
+
)
|
|
47
|
+
@param typeArguments [Deposit Vault Token, Bid Vault Token]
|
|
48
|
+
*/
|
|
49
|
+
export declare function getClaimAndHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
50
|
+
/**
|
|
51
|
+
public(friend) entry fun compound<TOKEN, O_TOKEN>(
|
|
52
|
+
registry: &mut Registry,
|
|
53
|
+
index: u64,
|
|
54
|
+
ctx: &mut TxContext,
|
|
55
|
+
)
|
|
56
|
+
@param typeArguments [Deposit Vault Token, Oracle Token]
|
|
57
|
+
*/
|
|
58
|
+
export declare function getCompoundTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
59
|
+
/**
|
|
60
|
+
public(friend) entry fun unsubscribe<TOKEN>(
|
|
61
|
+
registry: &mut Registry,
|
|
62
|
+
index: u64,
|
|
63
|
+
share: Option<u64>,
|
|
64
|
+
ctx: &mut TxContext
|
|
65
|
+
)
|
|
66
|
+
@param typeArguments [Deposit Vault Token]
|
|
67
|
+
*/
|
|
68
|
+
export declare function getUnsubscribeTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, share?: string): Promise<TransactionBlock>;
|
|
69
|
+
/**
|
|
70
|
+
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
71
|
+
registry: &mut Registry,
|
|
72
|
+
index: u64,
|
|
73
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
74
|
+
clock: &Clock,
|
|
75
|
+
coins: vector<Coin<B_TOKEN>>,
|
|
76
|
+
size: u64,
|
|
77
|
+
ctx: &mut TxContext,
|
|
78
|
+
)
|
|
79
|
+
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
80
|
+
*/
|
|
81
|
+
export declare function getNewBidTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, priceOracle: string, coins: string[], size: string): Promise<TransactionBlock>;
|
|
@@ -0,0 +1,247 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getNewBidTx = exports.getUnsubscribeTx = exports.getCompoundTx = exports.getClaimAndHarvestTx = exports.getHarvestTx = exports.getClaimTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
/**
|
|
42
|
+
public(friend) entry fun deposit<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
43
|
+
registry: &mut Registry,
|
|
44
|
+
index: u64,
|
|
45
|
+
coins: vector<Coin<D_TOKEN>>,
|
|
46
|
+
amount: u64,
|
|
47
|
+
ctx: &mut TxContext
|
|
48
|
+
)
|
|
49
|
+
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
50
|
+
*/
|
|
51
|
+
function getDepositTx(gasBudget, packageId, typeArguments, registry, index, coins, amount) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
+
var tx;
|
|
54
|
+
return __generator(this, function (_a) {
|
|
55
|
+
tx = new sui_js_1.TransactionBlock();
|
|
56
|
+
tx.moveCall({
|
|
57
|
+
target: "".concat(packageId, "::single_collateral::deposit"),
|
|
58
|
+
typeArguments: typeArguments,
|
|
59
|
+
arguments: [tx.pure(registry), tx.pure(index), tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }), tx.pure(amount)],
|
|
60
|
+
});
|
|
61
|
+
tx.setGasBudget(gasBudget);
|
|
62
|
+
return [2 /*return*/, tx];
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.getDepositTx = getDepositTx;
|
|
67
|
+
/**
|
|
68
|
+
public(friend) entry fun withdraw<TOKEN>(
|
|
69
|
+
registry: &mut Registry,
|
|
70
|
+
index: u64,
|
|
71
|
+
share: Option<u64>,
|
|
72
|
+
ctx: &mut TxContext
|
|
73
|
+
)
|
|
74
|
+
@param typeArguments [Deposit Vault Token]
|
|
75
|
+
*/
|
|
76
|
+
function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, share) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
var tx;
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
tx = new sui_js_1.TransactionBlock();
|
|
81
|
+
tx.moveCall({
|
|
82
|
+
target: "".concat(packageId, "::single_collateral::withdraw"),
|
|
83
|
+
typeArguments: typeArguments,
|
|
84
|
+
arguments: [tx.pure(registry), tx.pure(index), tx.pure(share ? [share] : [])],
|
|
85
|
+
});
|
|
86
|
+
tx.setGasBudget(gasBudget);
|
|
87
|
+
return [2 /*return*/, tx];
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
exports.getWithdrawTx = getWithdrawTx;
|
|
92
|
+
/**
|
|
93
|
+
public(friend) entry fun claim<TOKEN>(
|
|
94
|
+
registry: &mut Registry,
|
|
95
|
+
index: u64,
|
|
96
|
+
ctx: &mut TxContext
|
|
97
|
+
)
|
|
98
|
+
@param typeArguments [Deposit Vault Token]
|
|
99
|
+
*/
|
|
100
|
+
function getClaimTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
+
var tx;
|
|
103
|
+
return __generator(this, function (_a) {
|
|
104
|
+
tx = new sui_js_1.TransactionBlock();
|
|
105
|
+
tx.moveCall({
|
|
106
|
+
target: "".concat(packageId, "::single_collateral::claim"),
|
|
107
|
+
typeArguments: typeArguments,
|
|
108
|
+
arguments: [tx.pure(registry), tx.pure(index)],
|
|
109
|
+
});
|
|
110
|
+
tx.setGasBudget(gasBudget);
|
|
111
|
+
return [2 /*return*/, tx];
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
exports.getClaimTx = getClaimTx;
|
|
116
|
+
/**
|
|
117
|
+
public(friend) entry fun harvest<TOKEN>(
|
|
118
|
+
registry: &mut Registry,
|
|
119
|
+
index: u64,
|
|
120
|
+
ctx: &mut TxContext
|
|
121
|
+
)
|
|
122
|
+
@param typeArguments [Bid Vault Token]
|
|
123
|
+
*/
|
|
124
|
+
function getHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
126
|
+
var tx;
|
|
127
|
+
return __generator(this, function (_a) {
|
|
128
|
+
tx = new sui_js_1.TransactionBlock();
|
|
129
|
+
tx.moveCall({
|
|
130
|
+
target: "".concat(packageId, "::single_collateral::harvest"),
|
|
131
|
+
typeArguments: typeArguments,
|
|
132
|
+
arguments: [tx.pure(registry), tx.pure(index)],
|
|
133
|
+
});
|
|
134
|
+
tx.setGasBudget(gasBudget);
|
|
135
|
+
return [2 /*return*/, tx];
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
exports.getHarvestTx = getHarvestTx;
|
|
140
|
+
/**
|
|
141
|
+
public(friend) entry fun claim_and_harvest<D_TOKEN, B_TOKEN>(
|
|
142
|
+
registry: &mut Registry,
|
|
143
|
+
index: u64,
|
|
144
|
+
ctx: &mut TxContext
|
|
145
|
+
)
|
|
146
|
+
@param typeArguments [Deposit Vault Token, Bid Vault Token]
|
|
147
|
+
*/
|
|
148
|
+
function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
150
|
+
var tx;
|
|
151
|
+
return __generator(this, function (_a) {
|
|
152
|
+
tx = new sui_js_1.TransactionBlock();
|
|
153
|
+
tx.moveCall({
|
|
154
|
+
target: "".concat(packageId, "::single_collateral::claim_and_harvest"),
|
|
155
|
+
typeArguments: typeArguments,
|
|
156
|
+
arguments: [tx.pure(registry), tx.pure(index)],
|
|
157
|
+
});
|
|
158
|
+
tx.setGasBudget(gasBudget);
|
|
159
|
+
return [2 /*return*/, tx];
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
exports.getClaimAndHarvestTx = getClaimAndHarvestTx;
|
|
164
|
+
/**
|
|
165
|
+
public(friend) entry fun compound<TOKEN, O_TOKEN>(
|
|
166
|
+
registry: &mut Registry,
|
|
167
|
+
index: u64,
|
|
168
|
+
ctx: &mut TxContext,
|
|
169
|
+
)
|
|
170
|
+
@param typeArguments [Deposit Vault Token, Oracle Token]
|
|
171
|
+
*/
|
|
172
|
+
function getCompoundTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
174
|
+
var tx;
|
|
175
|
+
return __generator(this, function (_a) {
|
|
176
|
+
tx = new sui_js_1.TransactionBlock();
|
|
177
|
+
tx.moveCall({
|
|
178
|
+
target: "".concat(packageId, "::single_collateral::compound"),
|
|
179
|
+
typeArguments: typeArguments,
|
|
180
|
+
arguments: [tx.pure(registry), tx.pure(index)],
|
|
181
|
+
});
|
|
182
|
+
tx.setGasBudget(gasBudget);
|
|
183
|
+
return [2 /*return*/, tx];
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
exports.getCompoundTx = getCompoundTx;
|
|
188
|
+
/**
|
|
189
|
+
public(friend) entry fun unsubscribe<TOKEN>(
|
|
190
|
+
registry: &mut Registry,
|
|
191
|
+
index: u64,
|
|
192
|
+
share: Option<u64>,
|
|
193
|
+
ctx: &mut TxContext
|
|
194
|
+
)
|
|
195
|
+
@param typeArguments [Deposit Vault Token]
|
|
196
|
+
*/
|
|
197
|
+
function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index, share) {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
199
|
+
var tx;
|
|
200
|
+
return __generator(this, function (_a) {
|
|
201
|
+
tx = new sui_js_1.TransactionBlock();
|
|
202
|
+
tx.moveCall({
|
|
203
|
+
target: "".concat(packageId, "::single_collateral::unsubscribe"),
|
|
204
|
+
typeArguments: typeArguments,
|
|
205
|
+
arguments: [tx.pure(registry), tx.pure(index), tx.pure(share ? [share] : [])],
|
|
206
|
+
});
|
|
207
|
+
tx.setGasBudget(gasBudget);
|
|
208
|
+
return [2 /*return*/, tx];
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
213
|
+
/**
|
|
214
|
+
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
215
|
+
registry: &mut Registry,
|
|
216
|
+
index: u64,
|
|
217
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
218
|
+
clock: &Clock,
|
|
219
|
+
coins: vector<Coin<B_TOKEN>>,
|
|
220
|
+
size: u64,
|
|
221
|
+
ctx: &mut TxContext,
|
|
222
|
+
)
|
|
223
|
+
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
224
|
+
*/
|
|
225
|
+
function getNewBidTx(gasBudget, packageId, typeArguments, registry, index, priceOracle, coins, size) {
|
|
226
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
227
|
+
var tx;
|
|
228
|
+
return __generator(this, function (_a) {
|
|
229
|
+
tx = new sui_js_1.TransactionBlock();
|
|
230
|
+
tx.moveCall({
|
|
231
|
+
target: "".concat(packageId, "::single_collateral::new_bid"),
|
|
232
|
+
typeArguments: typeArguments,
|
|
233
|
+
arguments: [
|
|
234
|
+
tx.pure(registry),
|
|
235
|
+
tx.pure(index),
|
|
236
|
+
tx.pure(priceOracle),
|
|
237
|
+
tx.pure("0x6"),
|
|
238
|
+
tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
|
|
239
|
+
tx.pure(size),
|
|
240
|
+
],
|
|
241
|
+
});
|
|
242
|
+
tx.setGasBudget(gasBudget);
|
|
243
|
+
return [2 /*return*/, tx];
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
exports.getNewBidTx = getNewBidTx;
|
package/package.json
CHANGED
package/lib/scripts/sui.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|