@typus/typus-sdk 0.6.3 → 1.0.1
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 +17 -20
- package/lib/constants.d.ts +8 -6
- package/lib/constants.js +9 -7
- package/lib/scripts/sui.js +1 -2
- package/lib/test/authorized/testAuthorizedNewPortfolioVault.js +82 -0
- package/lib/test/{testClaim.js → authorized/testAuthorizedUpdateUpcomingVaultConfig.js} +19 -30
- package/lib/test/authorized/testAuthorizedUpdateWarmupVaultConfig.js +68 -0
- package/lib/test/getBidData.js +1 -1
- package/lib/test/getVaultData.js +2 -2
- package/lib/test/getWhiteListFromRegistry.js +2 -2
- package/lib/test/helper/getAuctionMaxSize.js +76 -0
- package/lib/test/helper/getUserStatus.js +75 -0
- package/lib/test/testMint.js +1 -1
- package/lib/test/testSubscribeEvent.js +1 -1
- package/lib/test/{testWithdraw.js → user/testClaim.js} +14 -17
- package/lib/test/{getMakersShares.js → user/testCompound.js} +21 -7
- package/lib/test/{testUnsubscribe.js → user/testDeposit.js} +28 -37
- package/lib/test/{getUsersShares.js → user/testHarvest.js} +21 -7
- package/lib/test/user/testNewBid.js +77 -0
- package/lib/test/user/testUnsubscribe.d.ts +1 -0
- package/lib/test/user/testUnsubscribe.js +69 -0
- package/lib/test/user/testWithdraw.d.ts +1 -0
- package/lib/test/{testDeposit.js → user/testWithdraw.js} +15 -19
- package/lib/utils/auction/getBid.js +0 -1
- package/lib/utils/fetchData.d.ts +72 -61
- package/lib/utils/fetchData.js +27 -198
- package/lib/utils/getTypeArgumentFromToken.js +0 -1
- package/lib/utils/getVaultData.d.ts +2 -2
- package/lib/utils/getVaultData.js +123 -162
- package/lib/utils/getWhiteListFromRegistry.js +0 -1
- package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.js +2 -2
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.d.ts +4 -3
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.js +5 -3
- package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.js +2 -2
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.d.ts +4 -0
- package/lib/utils/portfolio/authorized/{getAuthorizedUpdateNextVaultConfigTx.js → getAuthorizedUpdateUpcomingVaultConfigTx.js} +5 -5
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.d.ts +1 -0
- package/lib/utils/portfolio/{manager/getUpdateVaultConfigTx.js → authorized/getAuthorizedUpdateWarmupVaultConfigTx.js} +4 -5
- package/lib/utils/portfolio/helper/getAuctionMaxSize.d.ts +8 -0
- package/lib/utils/portfolio/{manager/getLastEvolutionTx.js → helper/getAuctionMaxSize.js} +11 -7
- package/lib/utils/portfolio/helper/getUserStatus.d.ts +29 -0
- package/lib/utils/portfolio/{authorized/getAuthorizedEvolutionTx.js → helper/getUserStatus.js} +50 -9
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.d.ts +8 -1
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.js +9 -2
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +6 -0
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.js +6 -0
- package/lib/utils/portfolio/manager/getEvolutionTx.d.ts +15 -1
- package/lib/utils/portfolio/manager/getEvolutionTx.js +14 -0
- package/lib/utils/portfolio/manager/getNewManagerTx.d.ts +8 -1
- package/lib/utils/portfolio/manager/getNewManagerTx.js +9 -2
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.d.ts +5 -5
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.js +5 -5
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.d.ts +7 -0
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.js +7 -0
- package/lib/utils/portfolio/manager/getRemoveManagerTx.d.ts +5 -0
- package/lib/utils/portfolio/manager/getRemoveManagerTx.js +5 -0
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.d.ts +7 -1
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.js +7 -1
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.d.ts +9 -1
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.js +11 -3
- package/lib/utils/portfolio/user/getClaimTx.d.ts +9 -1
- package/lib/utils/portfolio/user/getClaimTx.js +8 -0
- package/lib/utils/portfolio/user/getCompoundTx.d.ts +9 -0
- package/lib/utils/portfolio/{authorized/getAuthorizedLastEvolutionTx.js → user/getCompoundTx.js} +12 -6
- package/lib/utils/portfolio/user/getDepositTx.d.ts +10 -0
- package/lib/utils/portfolio/user/getDepositTx.js +10 -0
- package/lib/utils/portfolio/user/getHarvestTx.d.ts +9 -1
- package/lib/utils/portfolio/user/getHarvestTx.js +8 -0
- package/lib/utils/portfolio/user/getNewBidTx.d.ts +13 -1
- package/lib/utils/portfolio/user/getNewBidTx.js +12 -0
- package/lib/utils/portfolio/user/getUnsubscribeTx.d.ts +10 -1
- package/lib/utils/portfolio/user/getUnsubscribeTx.js +9 -0
- package/lib/utils/portfolio/user/getWithdrawTx.d.ts +10 -1
- package/lib/utils/portfolio/user/getWithdrawTx.js +9 -0
- package/package.json +2 -2
- package/lib/test/eventListener.d.ts +0 -5
- package/lib/test/eventListener.js +0 -397
- package/lib/test/testDepositV2.d.ts +0 -0
- package/lib/test/testDepositV2.js +0 -64
- package/lib/test/testNewAuction.js +0 -94
- package/lib/test/testNewVault.js +0 -153
- package/lib/test/testOracle.js +0 -94
- package/lib/test/testSettle.js +0 -590
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedDeliveryTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedDeliveryTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedEvolutionTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedEvolutionTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.js +0 -76
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedSettleTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedSettleTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.js +0 -56
- package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.js +0 -65
- package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.js +0 -64
- package/lib/utils/coveredCall/createPriceOracle.d.ts +0 -1
- package/lib/utils/coveredCall/createPriceOracle.js +0 -93
- package/lib/utils/coveredCall/createTimeOracle.d.ts +0 -1
- package/lib/utils/coveredCall/createTimeOracle.js +0 -92
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js +0 -61
- package/lib/utils/coveredCall/getClaimAllTx.d.ts +0 -1
- package/lib/utils/coveredCall/getClaimAllTx.js +0 -59
- package/lib/utils/coveredCall/getClaimTx.d.ts +0 -1
- package/lib/utils/coveredCall/getClaimTx.js +0 -59
- package/lib/utils/coveredCall/getCloseAuctionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getCloseAuctionTx.js +0 -61
- package/lib/utils/coveredCall/getCloseVaultTx.d.ts +0 -1
- package/lib/utils/coveredCall/getCloseVaultTx.js +0 -60
- package/lib/utils/coveredCall/getDeliveryTx.d.ts +0 -1
- package/lib/utils/coveredCall/getDeliveryTx.js +0 -61
- package/lib/utils/coveredCall/getDepositTx.d.ts +0 -1
- package/lib/utils/coveredCall/getDepositTx.js +0 -65
- package/lib/utils/coveredCall/getEvolutionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getEvolutionTx.js +0 -64
- package/lib/utils/coveredCall/getLastEvolutionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getLastEvolutionTx.js +0 -63
- package/lib/utils/coveredCall/getMakerClaimAllTx.d.ts +0 -1
- package/lib/utils/coveredCall/getMakerClaimAllTx.js +0 -59
- package/lib/utils/coveredCall/getMakerClaimTx.d.ts +0 -1
- package/lib/utils/coveredCall/getMakerClaimTx.js +0 -59
- package/lib/utils/coveredCall/getNewAuctionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewAuctionTx.js +0 -66
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +0 -64
- package/lib/utils/coveredCall/getNewBidTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewBidTx.js +0 -62
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +0 -77
- package/lib/utils/coveredCall/getNewManagerTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewManagerTx.js +0 -59
- package/lib/utils/coveredCall/getRefundTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRefundTx.js +0 -59
- package/lib/utils/coveredCall/getRemoveBidTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRemoveBidTx.js +0 -60
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js +0 -61
- package/lib/utils/coveredCall/getRemoveManagerTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRemoveManagerTx.js +0 -58
- package/lib/utils/coveredCall/getRollOverTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRollOverTx.js +0 -60
- package/lib/utils/coveredCall/getSettleTx.d.ts +0 -1
- package/lib/utils/coveredCall/getSettleTx.js +0 -62
- package/lib/utils/coveredCall/getSettleWithRollOverTx.d.ts +0 -1
- package/lib/utils/coveredCall/getSettleWithRollOverTx.js +0 -62
- package/lib/utils/coveredCall/getSubscribeTx.d.ts +0 -1
- package/lib/utils/coveredCall/getSubscribeTx.js +0 -60
- package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUnsubscribeTx.js +0 -63
- package/lib/utils/coveredCall/getUpdateCapacityTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUpdateCapacityTx.js +0 -61
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.js +0 -66
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.js +0 -62
- package/lib/utils/coveredCall/getUpdateVaultConfigTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUpdateVaultConfigTx.js +0 -65
- package/lib/utils/coveredCall/getWithdrawTx.d.ts +0 -1
- package/lib/utils/coveredCall/getWithdrawTx.js +0 -60
- package/lib/utils/fetchPortfolioData.d.ts +0 -93
- package/lib/utils/fetchPortfolioData.js +0 -205
- package/lib/utils/getCreateTokenRegistryTx.d.ts +0 -1
- package/lib/utils/getCreateTokenRegistryTx.js +0 -59
- package/lib/utils/getMakersShares.d.ts +0 -8
- package/lib/utils/getMakersShares.js +0 -145
- package/lib/utils/getNewOracleTx.d.ts +0 -1
- package/lib/utils/getNewOracleTx.js +0 -59
- package/lib/utils/getNewTimeOracleTx.d.ts +0 -1
- package/lib/utils/getNewTimeOracleTx.js +0 -56
- package/lib/utils/getUpdateOracleTx.d.ts +0 -1
- package/lib/utils/getUpdateOracleTx.js +0 -64
- package/lib/utils/getUpdateTimeOracleTx.d.ts +0 -1
- package/lib/utils/getUpdateTimeOracleTx.js +0 -60
- package/lib/utils/getUsersShares.d.ts +0 -9
- package/lib/utils/getUsersShares.js +0 -148
- package/lib/utils/getVaultIndexInRegistry.d.ts +0 -1
- package/lib/utils/getVaultIndexInRegistry.js +0 -61
- package/lib/utils/isObjAvailable.d.ts +0 -0
- package/lib/utils/isObjAvailable.js +0 -14
- package/lib/utils/loadUsersDepositData.d.ts +0 -8
- package/lib/utils/loadUsersDepositData.js +0 -160
- package/lib/utils/portfolio/authorized/getAuthorizedEvolutionTx.d.ts +0 -1
- package/lib/utils/portfolio/authorized/getAuthorizedLastEvolutionTx.d.ts +0 -1
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +0 -4
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +0 -1
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateVaultConfigTx.js +0 -64
- package/lib/utils/portfolio/manager/getLastEvolutionTx.d.ts +0 -1
- package/lib/utils/portfolio/manager/getUpdateNextVaultConfigTx.d.ts +0 -4
- package/lib/utils/portfolio/manager/getUpdateNextVaultConfigTx.js +0 -71
- package/lib/utils/portfolio/manager/getUpdateVaultConfigTx.d.ts +0 -1
- package/lib/utils/portfolio/user/getCompoundPremiumTx.d.ts +0 -1
- package/lib/utils/portfolio/user/getCompoundPremiumTx.js +0 -60
- /package/lib/test/{getMakersShares.d.ts → authorized/testAuthorizedNewPortfolioVault.d.ts} +0 -0
- /package/lib/test/{getUsersShares.d.ts → authorized/testAuthorizedUpdateUpcomingVaultConfig.d.ts} +0 -0
- /package/lib/test/{testClaim.d.ts → authorized/testAuthorizedUpdateWarmupVaultConfig.d.ts} +0 -0
- /package/lib/test/{testDeposit.d.ts → helper/getAuctionMaxSize.d.ts} +0 -0
- /package/lib/test/{testNewAuction.d.ts → helper/getUserStatus.d.ts} +0 -0
- /package/lib/test/{testNewVault.d.ts → user/testClaim.d.ts} +0 -0
- /package/lib/test/{testOracle.d.ts → user/testCompound.d.ts} +0 -0
- /package/lib/test/{testSettle.d.ts → user/testDeposit.d.ts} +0 -0
- /package/lib/test/{testUnsubscribe.d.ts → user/testHarvest.d.ts} +0 -0
- /package/lib/test/{testWithdraw.d.ts → user/testNewBid.d.ts} +0 -0
|
@@ -36,18 +36,32 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var constants_1 = require("
|
|
39
|
+
var constants_1 = require("../../constants");
|
|
40
40
|
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
-
var
|
|
42
|
-
var
|
|
41
|
+
var getVaultData_1 = require("../../utils/getVaultData");
|
|
42
|
+
var getCompoundTx_1 = require("../../utils/portfolio/user/getCompoundTx");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
44
|
+
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
45
|
+
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
43
46
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
-
var
|
|
47
|
+
var index, portfolioVaults, portfolioVault, typeArguments, gasBudget, claimTx;
|
|
45
48
|
return __generator(this, function (_a) {
|
|
46
49
|
switch (_a.label) {
|
|
47
|
-
case 0:
|
|
50
|
+
case 0:
|
|
51
|
+
index = "0";
|
|
52
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.REGISTRY, provider)];
|
|
48
53
|
case 1:
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
portfolioVaults = _a.sent();
|
|
55
|
+
portfolioVault = portfolioVaults.find(function (portfolioVault) { return portfolioVault.info.index == index; });
|
|
56
|
+
typeArguments = portfolioVault.typeArgs;
|
|
57
|
+
console.log(portfolioVault);
|
|
58
|
+
gasBudget = 100000;
|
|
59
|
+
return [4 /*yield*/, (0, getCompoundTx_1.getCompoundTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, constants_1.REGISTRY, typeArguments, index)];
|
|
60
|
+
case 2:
|
|
61
|
+
claimTx = _a.sent();
|
|
62
|
+
return [4 /*yield*/, signer.executeMoveCall(claimTx)];
|
|
63
|
+
case 3:
|
|
64
|
+
_a.sent();
|
|
51
65
|
return [2 /*return*/];
|
|
52
66
|
}
|
|
53
67
|
});
|
|
@@ -36,52 +36,43 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var
|
|
40
|
-
var constants_1 = require("../constants");
|
|
39
|
+
var constants_1 = require("../../constants");
|
|
41
40
|
var sui_js_1 = require("@mysten/sui.js");
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var provider = new sui_js_1.JsonRpcProvider(
|
|
41
|
+
var getDepositTx_1 = require("../../utils/portfolio/user/getDepositTx");
|
|
42
|
+
var getVaultData_1 = require("../../utils/getVaultData");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
45
44
|
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
46
45
|
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
47
|
-
var gasBudget = 100000;
|
|
48
|
-
/*
|
|
49
|
-
after unsubscribe, the subvault (is deposited) "balance" in fields will be 0,
|
|
50
|
-
and a regular linked list node will be created if not exist, and the value increase.
|
|
51
|
-
|
|
52
|
-
EX:
|
|
53
|
-
subvault balance:1234, regular linked list node value:1000
|
|
54
|
-
after unsubscribe
|
|
55
|
-
subvault balance:0, regular linked list node value:2234
|
|
56
|
-
*/
|
|
57
46
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var depositAmount,
|
|
59
|
-
return __generator(this, function (
|
|
60
|
-
switch (
|
|
47
|
+
var depositAmount, index, portfolioVaults, portfolioVault, dToken, typeArguments, vaultIndex, coinObjs, _a, _b, coins, gasBudget, depositTx, res;
|
|
48
|
+
return __generator(this, function (_c) {
|
|
49
|
+
switch (_c.label) {
|
|
61
50
|
case 0:
|
|
62
|
-
depositAmount = "
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
;
|
|
66
|
-
vaultIndex = "3";
|
|
67
|
-
share = "0";
|
|
68
|
-
return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token, provider)];
|
|
51
|
+
depositAmount = "100000000";
|
|
52
|
+
index = "0";
|
|
53
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.REGISTRY, provider)];
|
|
69
54
|
case 1:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
55
|
+
portfolioVaults = _c.sent();
|
|
56
|
+
portfolioVault = portfolioVaults.find(function (portfolioVault) { return portfolioVault.info.index == index; });
|
|
57
|
+
console.log(portfolioVault);
|
|
58
|
+
dToken = portfolioVault.typeArgs[0];
|
|
59
|
+
typeArguments = portfolioVault.typeArgs;
|
|
60
|
+
vaultIndex = portfolioVault.info.index;
|
|
61
|
+
_b = (_a = provider).selectCoinSetWithCombinedBalanceGreaterThanOrEqual;
|
|
62
|
+
return [4 /*yield*/, signer.getAddress()];
|
|
63
|
+
case 2: return [4 /*yield*/, _b.apply(_a, [_c.sent(), BigInt(depositAmount), dToken])];
|
|
75
64
|
case 3:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
coinObjs = _c.sent();
|
|
66
|
+
coins = coinObjs.map(function (coin) { return coin.details.reference.objectId.toString(); });
|
|
67
|
+
console.log("test for deposit, try to deposit " + coins + " for " + depositAmount + " ...");
|
|
68
|
+
gasBudget = 100000;
|
|
69
|
+
return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, constants_1.REGISTRY, typeArguments, vaultIndex, coins, depositAmount)];
|
|
79
70
|
case 4:
|
|
80
|
-
|
|
81
|
-
return [4 /*yield*/, signer.executeMoveCall(
|
|
71
|
+
depositTx = _c.sent();
|
|
72
|
+
return [4 /*yield*/, signer.executeMoveCall(depositTx)];
|
|
82
73
|
case 5:
|
|
83
|
-
|
|
84
|
-
console.log(
|
|
74
|
+
res = _c.sent();
|
|
75
|
+
console.log(res);
|
|
85
76
|
return [2 /*return*/];
|
|
86
77
|
}
|
|
87
78
|
});
|
|
@@ -36,18 +36,32 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var constants_1 = require("
|
|
40
|
-
var getUsersShares_1 = require("../utils/getUsersShares");
|
|
39
|
+
var constants_1 = require("../../constants");
|
|
41
40
|
var sui_js_1 = require("@mysten/sui.js");
|
|
42
|
-
var
|
|
41
|
+
var getVaultData_1 = require("../../utils/getVaultData");
|
|
42
|
+
var getHarvestTx_1 = require("../../utils/portfolio/user/getHarvestTx");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
44
|
+
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
45
|
+
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
43
46
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
-
var
|
|
47
|
+
var index, portfolioVaults, portfolioVault, typeArguments, gasBudget, claimTx;
|
|
45
48
|
return __generator(this, function (_a) {
|
|
46
49
|
switch (_a.label) {
|
|
47
|
-
case 0:
|
|
50
|
+
case 0:
|
|
51
|
+
index = "0";
|
|
52
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.REGISTRY, provider)];
|
|
48
53
|
case 1:
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
portfolioVaults = _a.sent();
|
|
55
|
+
portfolioVault = portfolioVaults.find(function (portfolioVault) { return portfolioVault.info.index == index; });
|
|
56
|
+
typeArguments = portfolioVault.typeArgs;
|
|
57
|
+
console.log(portfolioVault);
|
|
58
|
+
gasBudget = 100000;
|
|
59
|
+
return [4 /*yield*/, (0, getHarvestTx_1.getHarvestTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, constants_1.REGISTRY, typeArguments, index)];
|
|
60
|
+
case 2:
|
|
61
|
+
claimTx = _a.sent();
|
|
62
|
+
return [4 /*yield*/, signer.executeMoveCall(claimTx)];
|
|
63
|
+
case 3:
|
|
64
|
+
_a.sent();
|
|
51
65
|
return [2 /*return*/];
|
|
52
66
|
}
|
|
53
67
|
});
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
var constants_1 = require("../../constants");
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
var getVaultData_1 = require("../../utils/getVaultData");
|
|
42
|
+
var getNewBidTx_1 = require("../../utils/portfolio/user/getNewBidTx");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
44
|
+
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
45
|
+
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
46
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
+
var size, index, portfolioVaults, portfolioVault, bToken, typeArguments, coinObjs, _a, _b, coins, gasBudget, tx, res;
|
|
48
|
+
return __generator(this, function (_c) {
|
|
49
|
+
switch (_c.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
size = "100000000";
|
|
52
|
+
index = "0";
|
|
53
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.REGISTRY, provider)];
|
|
54
|
+
case 1:
|
|
55
|
+
portfolioVaults = _c.sent();
|
|
56
|
+
portfolioVault = portfolioVaults.find(function (portfolioVault) { return portfolioVault.info.index == index; });
|
|
57
|
+
console.log(portfolioVault);
|
|
58
|
+
bToken = portfolioVault.typeArgs[1];
|
|
59
|
+
typeArguments = portfolioVault.typeArgs;
|
|
60
|
+
_b = (_a = provider).selectCoinSetWithCombinedBalanceGreaterThanOrEqual;
|
|
61
|
+
return [4 /*yield*/, signer.getAddress()];
|
|
62
|
+
case 2: return [4 /*yield*/, _b.apply(_a, [_c.sent(), BigInt(size), bToken])];
|
|
63
|
+
case 3:
|
|
64
|
+
coinObjs = _c.sent();
|
|
65
|
+
coins = coinObjs.map(function (coin) { return coin.details.reference.objectId.toString(); });
|
|
66
|
+
gasBudget = 100000;
|
|
67
|
+
return [4 /*yield*/, (0, getNewBidTx_1.getNewBidTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, constants_1.REGISTRY, typeArguments, index, constants_1.DOGE_ORACLE, constants_1.TIME_ORACLE, coins, size)];
|
|
68
|
+
case 4:
|
|
69
|
+
tx = _c.sent();
|
|
70
|
+
return [4 /*yield*/, signer.executeMoveCall(tx)];
|
|
71
|
+
case 5:
|
|
72
|
+
res = _c.sent();
|
|
73
|
+
console.log(res);
|
|
74
|
+
return [2 /*return*/];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}); })();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
var constants_1 = require("../../constants");
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
var getVaultData_1 = require("../../utils/getVaultData");
|
|
42
|
+
var getUnsubscribeTx_1 = require("../../utils/portfolio/user/getUnsubscribeTx");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
44
|
+
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
45
|
+
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
46
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
+
var index, share, portfolioVaults, portfolioVault, typeArguments, gasBudget, claimTx;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
index = "0";
|
|
52
|
+
share = "100000000";
|
|
53
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.REGISTRY, provider)];
|
|
54
|
+
case 1:
|
|
55
|
+
portfolioVaults = _a.sent();
|
|
56
|
+
portfolioVault = portfolioVaults.find(function (portfolioVault) { return portfolioVault.info.index == index; });
|
|
57
|
+
typeArguments = portfolioVault.typeArgs;
|
|
58
|
+
console.log(portfolioVault);
|
|
59
|
+
gasBudget = 100000;
|
|
60
|
+
return [4 /*yield*/, (0, getUnsubscribeTx_1.getUnsubscribeTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, constants_1.REGISTRY, typeArguments, index, [share])];
|
|
61
|
+
case 2:
|
|
62
|
+
claimTx = _a.sent();
|
|
63
|
+
return [4 /*yield*/, signer.executeMoveCall(claimTx)];
|
|
64
|
+
case 3:
|
|
65
|
+
_a.sent();
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); })();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -36,38 +36,34 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var
|
|
40
|
-
var constants_1 = require("../constants");
|
|
39
|
+
var constants_1 = require("../../constants");
|
|
41
40
|
var sui_js_1 = require("@mysten/sui.js");
|
|
42
|
-
var
|
|
43
|
-
var
|
|
41
|
+
var getVaultData_1 = require("../../utils/getVaultData");
|
|
42
|
+
var getWithdrawTx_1 = require("../../utils/portfolio/user/getWithdrawTx");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
44
44
|
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
45
45
|
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
46
|
-
/*
|
|
47
|
-
after deposit, token object (minted token) balance will decrease,
|
|
48
|
-
and subVault "rolling_sub_vault" will increase
|
|
49
|
-
*/
|
|
50
46
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
-
var
|
|
47
|
+
var share, portfolioVaults, portfolioVault, typeArguments, vaultIndex, gasBudget, depositTx, res;
|
|
52
48
|
return __generator(this, function (_a) {
|
|
53
49
|
switch (_a.label) {
|
|
54
50
|
case 0:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
token = constants_1.TEST_MINT_TOKEN;
|
|
58
|
-
vaultIndex = "0";
|
|
59
|
-
return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token, provider)];
|
|
51
|
+
share = "100000000";
|
|
52
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.REGISTRY, provider)];
|
|
60
53
|
case 1:
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
portfolioVaults = _a.sent();
|
|
55
|
+
portfolioVault = portfolioVaults[0];
|
|
56
|
+
console.log(portfolioVault);
|
|
57
|
+
typeArguments = portfolioVault.typeArgs;
|
|
58
|
+
vaultIndex = portfolioVault.info.index;
|
|
63
59
|
gasBudget = 100000;
|
|
64
|
-
return [4 /*yield*/, (0,
|
|
60
|
+
return [4 /*yield*/, (0, getWithdrawTx_1.getWithdrawTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, constants_1.REGISTRY, typeArguments, vaultIndex, [share])];
|
|
65
61
|
case 2:
|
|
66
62
|
depositTx = _a.sent();
|
|
67
63
|
return [4 /*yield*/, signer.executeMoveCall(depositTx)];
|
|
68
64
|
case 3:
|
|
69
|
-
_a.sent();
|
|
70
|
-
console.log(
|
|
65
|
+
res = _a.sent();
|
|
66
|
+
console.log(res);
|
|
71
67
|
return [2 /*return*/];
|
|
72
68
|
}
|
|
73
69
|
});
|
|
@@ -38,7 +38,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getBid = void 0;
|
|
40
40
|
var constants_1 = require("../../constants");
|
|
41
|
-
// const provider = new JsonRpcProvider(TESTNET_RPC_ENDPOINT);//for read only operations
|
|
42
41
|
function getBid(vault, provider) {
|
|
43
42
|
return __awaiter(this, void 0, void 0, function () {
|
|
44
43
|
var obj, bidTable, obj2, ids, tmp, bids;
|
package/lib/utils/fetchData.d.ts
CHANGED
|
@@ -1,85 +1,96 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export interface PortfolioVault {
|
|
2
|
+
vaultId: string;
|
|
3
|
+
typeArgs: string[];
|
|
4
|
+
assets: string[];
|
|
5
|
+
info: Info;
|
|
6
|
+
config: Config;
|
|
7
|
+
depositVault: DepositVault;
|
|
8
|
+
bidVault: BidVault;
|
|
9
|
+
auction: Auction;
|
|
10
|
+
authority: string[];
|
|
11
|
+
tvl: string;
|
|
12
|
+
vaultBidPrice: string;
|
|
5
13
|
}
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
auctionDurationInMs: string;
|
|
14
|
+
export interface Info {
|
|
15
|
+
index: string;
|
|
16
|
+
creator: string;
|
|
17
|
+
createTsMs: string;
|
|
18
|
+
round: string;
|
|
19
|
+
deliveryInfo: DeliveryInfo;
|
|
13
20
|
}
|
|
14
21
|
export interface Config {
|
|
22
|
+
optionType: string;
|
|
15
23
|
period: string;
|
|
16
24
|
activationTsMs: string;
|
|
17
25
|
expirationTsMs: string;
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
dTokenDecimal: string;
|
|
27
|
+
bTokenDecimal: string;
|
|
28
|
+
oTokenDecimal: string;
|
|
29
|
+
lotSize: string;
|
|
20
30
|
capacity: string;
|
|
21
31
|
leverage: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
hasNext: boolean;
|
|
33
|
+
activeVaultConfig: VaultConfig;
|
|
34
|
+
warmupVaultConfig: VaultConfig;
|
|
35
|
+
upcomingVaultConfig: VaultConfig;
|
|
25
36
|
}
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
export declare function parseVaultConfig(vaultConfigF: any): VaultConfig;
|
|
38
|
+
export declare function parsePayoffConfig(payoffConfigF: any): PayoffConfig;
|
|
39
|
+
export interface PayoffConfig {
|
|
40
|
+
strikePct: string;
|
|
41
|
+
weight: string;
|
|
42
|
+
isBuyer: boolean;
|
|
43
|
+
strike: string;
|
|
29
44
|
}
|
|
30
|
-
export interface
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
export interface VaultConfig {
|
|
46
|
+
payoffConfigs: PayoffConfig[];
|
|
47
|
+
strikeIncrement: string;
|
|
48
|
+
decaySpeed: string;
|
|
49
|
+
initialPrice: string;
|
|
50
|
+
finalPrice: string;
|
|
51
|
+
auctionDurationInMs: string;
|
|
36
52
|
}
|
|
37
|
-
export interface
|
|
53
|
+
export interface DeliveryInfo {
|
|
54
|
+
round: string;
|
|
38
55
|
price: string;
|
|
39
56
|
size: string;
|
|
57
|
+
premium: string;
|
|
40
58
|
tsMs: string;
|
|
41
|
-
tokenBalance: string;
|
|
42
|
-
ownerAddress: string;
|
|
43
59
|
}
|
|
44
|
-
export interface
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
export interface DepositVault {
|
|
61
|
+
activeSubVault: SubVault;
|
|
62
|
+
deactivatingSubVault: SubVault;
|
|
63
|
+
inactiveSubVault: SubVault;
|
|
64
|
+
warmupSubVault: SubVault;
|
|
65
|
+
hasNext: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface BidVault {
|
|
68
|
+
bidderSubVault: SubVault;
|
|
69
|
+
premiumSubVault: SubVault;
|
|
70
|
+
performanceFeeSubVault: SubVault;
|
|
71
|
+
}
|
|
72
|
+
export interface SubVault {
|
|
73
|
+
balance: string;
|
|
74
|
+
shareSupply: string;
|
|
48
75
|
}
|
|
76
|
+
export declare function parseSubVault(subVaultF: any): SubVault;
|
|
49
77
|
export interface Auction {
|
|
50
78
|
startTsMs: string;
|
|
51
79
|
endTsMs: string;
|
|
52
80
|
priceConfig: PriceConfig;
|
|
53
81
|
index: string;
|
|
54
|
-
}
|
|
55
|
-
export interface DeliveryInfo {
|
|
56
|
-
deliveryPrice: string;
|
|
57
|
-
deliverySize: string;
|
|
58
|
-
}
|
|
59
|
-
export interface CoveredCallVault {
|
|
60
|
-
vaultId: string;
|
|
61
|
-
vaultIdx: string;
|
|
62
|
-
asset: string;
|
|
63
|
-
config: Config;
|
|
64
|
-
vault: Vault;
|
|
65
|
-
auction: Auction;
|
|
66
|
-
prev: string;
|
|
67
|
-
next: string;
|
|
68
82
|
totalBidSize: string;
|
|
69
|
-
|
|
70
|
-
owner: string;
|
|
71
|
-
authority: string[];
|
|
72
|
-
tvl: string;
|
|
73
|
-
vaultBidPrice: string;
|
|
83
|
+
ableToRemoveBid: boolean;
|
|
74
84
|
}
|
|
75
|
-
export interface
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
export interface PriceConfig {
|
|
86
|
+
decaySpeed: string;
|
|
87
|
+
initialPrice: string;
|
|
88
|
+
finalPrice: string;
|
|
89
|
+
}
|
|
90
|
+
export interface Bid {
|
|
91
|
+
price: string;
|
|
92
|
+
size: string;
|
|
93
|
+
tsMs: string;
|
|
94
|
+
tokenBalance: string;
|
|
95
|
+
ownerAddress: string;
|
|
79
96
|
}
|
|
80
|
-
export declare function getCoveredCallVaultsFromRegistry(registry: string): Promise<any>;
|
|
81
|
-
export declare function getTableFromCoveredCallVault(coveredCallVault: string): Promise<any>;
|
|
82
|
-
export declare function getSubVaultsFromTable(tableUnderCoveredCallVault: string): Promise<SubVaults>;
|
|
83
|
-
export declare function getTableUnderSubVault(subVault: string): Promise<string>;
|
|
84
|
-
export declare function getLinkedListNodesFromTable(table: string): Promise<any[]>;
|
|
85
|
-
export declare function getUserDataFromLinkedListNode(linkedListNode: string): Promise<any>;
|