@typus/typus-sdk 1.0.4 → 1.0.6
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 +16 -16
- package/lib/constants.d.ts +4 -2
- package/lib/constants.js +13 -7
- package/lib/mnemonic.json +3 -0
- package/lib/scripts/sui.js +4 -4
- package/lib/test/authorized/testAuthorizedNewPortfolioVault.js +8 -2
- package/lib/test/authorized/testAuthorizedUpdateUpcomingVaultConfig.js +8 -2
- package/lib/test/authorized/testAuthorizedUpdateWarmupVaultConfig.js +8 -2
- package/lib/test/getVaultData.js +2 -1
- package/lib/test/helper/getAuctionMaxSize.js +14 -18
- package/lib/test/helper/getUserStatus.js +58 -39
- package/lib/test/testMint.js +22 -12
- package/lib/test/testSubscribeEvent.js +6 -21
- package/lib/test/user/testClaim.js +4 -4
- package/lib/test/user/testCompound.js +4 -4
- package/lib/test/user/testDeposit.js +19 -17
- package/lib/test/user/testHarvest.js +4 -4
- package/lib/test/user/testNewBid.js +14 -12
- package/lib/test/user/testUnsubscribe.js +4 -4
- package/lib/test/user/testWithdraw.js +8 -7
- package/lib/utils/auction/getBid.d.ts +1 -1
- package/lib/utils/auction/getBid.js +14 -9
- package/lib/utils/fetchData.js +2 -6
- package/lib/utils/getTypeArgumentFromToken.d.ts +1 -1
- package/lib/utils/getTypeArgumentFromToken.js +1 -1
- package/lib/utils/getVaultData.d.ts +1 -1
- package/lib/utils/getVaultData.js +8 -7
- package/lib/utils/getWhiteListFromRegistry.d.ts +1 -1
- package/lib/utils/getWhiteListFromRegistry.js +5 -7
- package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.d.ts +3 -2
- package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.js +12 -14
- package/lib/utils/portfolio/authorized/getAuthorizedDeliveryTx.d.ts +2 -1
- package/lib/utils/portfolio/authorized/getAuthorizedDeliveryTx.js +15 -13
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.d.ts +2 -1
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.js +34 -32
- package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.d.ts +3 -2
- package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.js +12 -14
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateCapacityTx.d.ts +2 -1
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateCapacityTx.js +11 -13
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.d.ts +2 -1
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.js +21 -19
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.d.ts +2 -1
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.js +18 -16
- package/lib/utils/portfolio/helper/getAuctionMaxSize.d.ts +2 -1
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.js +11 -13
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +3 -2
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.js +12 -15
- package/lib/utils/portfolio/manager/getCloseAuctionTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getCloseAuctionTx.js +16 -14
- package/lib/utils/portfolio/manager/getCloseVaultTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getCloseVaultTx.js +10 -12
- package/lib/utils/portfolio/manager/getDeliveryTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getDeliveryTx.js +16 -14
- package/lib/utils/portfolio/manager/getEvolutionTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getEvolutionTx.js +18 -16
- package/lib/utils/portfolio/manager/getNewManagerTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getNewManagerTx.js +10 -11
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.js +33 -31
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.js +10 -12
- package/lib/utils/portfolio/manager/getRemoveManagerTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getRemoveManagerTx.js +10 -10
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.d.ts +3 -2
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.js +12 -15
- package/lib/utils/portfolio/manager/getUpdateCapacityTx.d.ts +2 -1
- package/lib/utils/portfolio/manager/getUpdateCapacityTx.js +11 -14
- package/lib/utils/portfolio/user/getCompoundTx.d.ts +2 -1
- package/lib/utils/portfolio/user/getDepositTx.js +3 -7
- package/lib/utils/portfolio/user/getNewBidTx.js +3 -2
- package/lib/utils/portfolio/user/getUnsubscribeTx.js +3 -2
- package/lib/utils/portfolio/user/getWithdrawTx.d.ts +2 -1
- package/package.json +2 -2
|
@@ -37,32 +37,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getRemovePortfolioVaultAuthorizedUserTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
40
41
|
/**
|
|
41
42
|
public(friend) entry fun remove_portfolio_vault_authorized_user<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
42
43
|
manager_cap: &ManagerCap,
|
|
43
44
|
registry: &mut Registry,
|
|
44
45
|
index: u64,
|
|
45
|
-
|
|
46
|
+
users: vector<address>,
|
|
46
47
|
)
|
|
47
48
|
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
48
49
|
*/
|
|
49
|
-
function getRemovePortfolioVaultAuthorizedUserTx(gasBudget, packageId, managerCap, registry, typeArguments, index,
|
|
50
|
+
function getRemovePortfolioVaultAuthorizedUserTx(gasBudget, packageId, managerCap, registry, typeArguments, index, users) {
|
|
50
51
|
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
-
var tx;
|
|
52
|
+
var tx, target, txArguments;
|
|
52
53
|
return __generator(this, function (_a) {
|
|
53
|
-
tx =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
tx = new sui_js_1.TransactionBlock();
|
|
55
|
+
target = "".concat(packageId, "::").concat(module, "::remove_portfolio_vault_authorized_user");
|
|
56
|
+
txArguments = [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure(users)];
|
|
57
|
+
tx.moveCall({
|
|
58
|
+
target: target,
|
|
57
59
|
typeArguments: typeArguments,
|
|
58
|
-
arguments:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
index,
|
|
62
|
-
address,
|
|
63
|
-
],
|
|
64
|
-
gasBudget: gasBudget,
|
|
65
|
-
};
|
|
60
|
+
arguments: txArguments,
|
|
61
|
+
});
|
|
62
|
+
tx.setGasBudget(gasBudget);
|
|
66
63
|
return [2 /*return*/, tx];
|
|
67
64
|
});
|
|
68
65
|
});
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js";
|
|
2
|
+
export declare function getUpdateCapacityTx(gasBudget: number, packageId: string, managerCap: string, typeArguments: string[], registry: string, index: string, capacity: string): Promise<TransactionBlock>;
|
|
@@ -37,23 +37,20 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getUpdateCapacityTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
40
41
|
function getUpdateCapacityTx(gasBudget, packageId, managerCap, typeArguments, registry, index, capacity) {
|
|
41
42
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
-
var tx;
|
|
43
|
+
var tx, target, txArguments;
|
|
43
44
|
return __generator(this, function (_a) {
|
|
44
|
-
tx =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
capacity
|
|
54
|
-
],
|
|
55
|
-
gasBudget: gasBudget,
|
|
56
|
-
};
|
|
45
|
+
tx = new sui_js_1.TransactionBlock();
|
|
46
|
+
target = "".concat(packageId, "::").concat(module, "::update_capacity");
|
|
47
|
+
txArguments = [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure(capacity)];
|
|
48
|
+
tx.moveCall({
|
|
49
|
+
target: target,
|
|
50
|
+
typeArguments: [],
|
|
51
|
+
arguments: txArguments,
|
|
52
|
+
});
|
|
53
|
+
tx.setGasBudget(gasBudget);
|
|
57
54
|
return [2 /*return*/, tx];
|
|
58
55
|
});
|
|
59
56
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js";
|
|
1
2
|
/**
|
|
2
3
|
public entry fun compound<TOKEN, O_TOKEN>(
|
|
3
4
|
registry: &mut Registry,
|
|
@@ -6,4 +7,4 @@
|
|
|
6
7
|
)
|
|
7
8
|
* @param typeArguments [TOKEN, O_TOKEN]
|
|
8
9
|
*/
|
|
9
|
-
export declare function getCompoundTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], index: string): Promise<
|
|
10
|
+
export declare function getCompoundTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], index: string): Promise<TransactionBlock>;
|
|
@@ -50,16 +50,12 @@ var sui_js_1 = require("@mysten/sui.js");
|
|
|
50
50
|
*/
|
|
51
51
|
function getDepositTx(gasBudget, packageId, module, registry, typeArguments, vaultIndex, coins, amount) {
|
|
52
52
|
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
-
var tx, target, txArguments;
|
|
53
|
+
var tx, target, vec, txArguments;
|
|
54
54
|
return __generator(this, function (_a) {
|
|
55
55
|
tx = new sui_js_1.TransactionBlock();
|
|
56
56
|
target = "".concat(packageId, "::").concat(module, "::deposit");
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
tx.pure(vaultIndex),
|
|
60
|
-
tx.pure(coins),
|
|
61
|
-
tx.pure(amount),
|
|
62
|
-
];
|
|
57
|
+
vec = tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) });
|
|
58
|
+
txArguments = [tx.pure(registry), tx.pure(vaultIndex), vec, tx.pure(amount)];
|
|
63
59
|
tx.moveCall({
|
|
64
60
|
target: target,
|
|
65
61
|
typeArguments: typeArguments,
|
|
@@ -52,16 +52,17 @@ var sui_js_1 = require("@mysten/sui.js");
|
|
|
52
52
|
*/
|
|
53
53
|
function getNewBidTx(gasBudget, packageId, module, registry, typeArguments, index, priceOracle, timeOracle, coins, size) {
|
|
54
54
|
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
-
var tx, target, txArguments;
|
|
55
|
+
var tx, target, vec, txArguments;
|
|
56
56
|
return __generator(this, function (_a) {
|
|
57
57
|
tx = new sui_js_1.TransactionBlock();
|
|
58
58
|
target = "".concat(packageId, "::").concat(module, "::new_bid");
|
|
59
|
+
vec = tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) });
|
|
59
60
|
txArguments = [
|
|
60
61
|
tx.pure(registry),
|
|
61
62
|
tx.pure(index),
|
|
62
63
|
tx.pure(priceOracle),
|
|
63
64
|
tx.pure(timeOracle),
|
|
64
|
-
|
|
65
|
+
vec,
|
|
65
66
|
tx.pure(size),
|
|
66
67
|
];
|
|
67
68
|
tx.moveCall({
|
|
@@ -48,11 +48,12 @@ var sui_js_1 = require("@mysten/sui.js"); /**
|
|
|
48
48
|
*/
|
|
49
49
|
function getUnsubscribeTx(gasBudget, packageId, module, registry, typeArguments, index, share) {
|
|
50
50
|
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
-
var tx, target, txArguments;
|
|
51
|
+
var tx, target, vec, txArguments;
|
|
52
52
|
return __generator(this, function (_a) {
|
|
53
53
|
tx = new sui_js_1.TransactionBlock();
|
|
54
54
|
target = "".concat(packageId, "::").concat(module, "::unsubscribe");
|
|
55
|
-
|
|
55
|
+
vec = tx.makeMoveVec({ objects: share.map(function (id) { return tx.object(id); }) });
|
|
56
|
+
txArguments = [tx.pure(registry), tx.pure(index), vec];
|
|
56
57
|
tx.moveCall({
|
|
57
58
|
target: target,
|
|
58
59
|
typeArguments: typeArguments,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js";
|
|
1
2
|
/**
|
|
2
3
|
public(friend) entry fun withdraw<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
3
4
|
registry: &mut Registry,
|
|
@@ -7,4 +8,4 @@
|
|
|
7
8
|
)
|
|
8
9
|
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
9
10
|
*/
|
|
10
|
-
export declare function getWithdrawTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], vaultIndex: string, share: string[]): Promise<
|
|
11
|
+
export declare function getWithdrawTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], vaultIndex: string, share: string[]): Promise<TransactionBlock>;
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@typus/typus-sdk",
|
|
3
3
|
"author": "Typus",
|
|
4
4
|
"description": "typus sdk",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.6",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@mysten/sui.js": "^0.
|
|
7
|
+
"@mysten/sui.js": "^0.31.0",
|
|
8
8
|
"@types/node": "^17.0.0",
|
|
9
9
|
"bignumber.js": "^9.1.1",
|
|
10
10
|
"bs58": "^4.0.1",
|