@typus/typus-sdk 0.6.2 → 1.0.0
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 +20 -0
- package/lib/constants.d.ts +12 -16
- package/lib/constants.js +17 -17
- package/lib/test/authorized/testAuthorizedNewPortfolioVault.js +82 -0
- package/lib/test/{testClaim.js → authorized/testAuthorizedUpdateUpcomingVaultConfig.js} +20 -31
- 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/testCrypto.js +1 -1
- package/lib/test/testMint.js +2 -2
- package/lib/test/testSubscribeEvent.js +1 -1
- package/lib/test/{testWithdraw.js → user/testClaim.js} +15 -18
- package/lib/test/{getMakersShares.js → user/testCompound.js} +21 -7
- package/lib/test/{testUnsubscribe.js → user/testDeposit.js} +29 -38
- 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} +16 -20
- package/lib/utils/auction/getBid.js +1 -1
- package/lib/utils/fetchData.d.ts +72 -60
- package/lib/utils/fetchData.js +27 -199
- package/lib/utils/getMintTx.js +1 -1
- package/lib/utils/getTypeArgumentFromToken.js +1 -1
- package/lib/utils/getVaultData.d.ts +3 -2
- package/lib/utils/getVaultData.js +139 -159
- package/lib/utils/getWhiteListFromRegistry.js +1 -2
- package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.d.ts +4 -0
- package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.js +63 -0
- package/lib/utils/portfolio/authorized/getAuthorizedDeliveryTx.d.ts +1 -0
- package/lib/utils/{authorized → portfolio/authorized}/getAuthorizedDeliveryTx.js +10 -5
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.d.ts +38 -0
- package/lib/utils/{authorized/getAuthorizedNewCoveredCallVaultTx.js → portfolio/authorized/getAuthorizedNewPortfolioVaultTx.js} +53 -13
- package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.d.ts +4 -0
- package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.js +63 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateCapacityTx.d.ts +1 -0
- package/lib/utils/{authorized → portfolio/authorized}/getAuthorizedUpdateCapacityTx.js +9 -5
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.d.ts +4 -0
- package/lib/utils/{authorized/getAuthorizedUpdateVaultConfigTx.js → portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.js} +13 -7
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.d.ts +1 -0
- package/lib/utils/{authorized/getAuthorizedUpdateNextVaultConfigTx.js → portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.js} +7 -8
- package/lib/utils/portfolio/helper/getAuctionMaxSize.d.ts +8 -0
- package/lib/utils/{coveredCall/getLastEvolutionTx.js → portfolio/helper/getAuctionMaxSize.js} +14 -11
- package/lib/utils/portfolio/helper/getUserStatus.d.ts +29 -0
- package/lib/utils/portfolio/helper/getUserStatus.js +104 -0
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.d.ts +8 -0
- package/lib/utils/{getUpdateTimeOracleTx.js → portfolio/manager/getAddAuthorizedUserTx.js} +15 -8
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +10 -0
- package/lib/utils/{coveredCall/getUpdateNextVaultConfigTx.js → portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.js} +17 -13
- package/lib/utils/portfolio/manager/getCloseAuctionTx.d.ts +1 -0
- package/lib/utils/{coveredCall → portfolio/manager}/getCloseAuctionTx.js +6 -5
- package/lib/utils/portfolio/manager/getCloseVaultTx.d.ts +1 -0
- package/lib/utils/{coveredCall → portfolio/manager}/getCloseVaultTx.js +4 -4
- package/lib/utils/portfolio/manager/getDeliveryTx.d.ts +1 -0
- package/lib/utils/{coveredCall → portfolio/manager}/getDeliveryTx.js +5 -4
- package/lib/utils/portfolio/manager/getEvolutionTx.d.ts +15 -0
- package/lib/utils/{coveredCall → portfolio/manager}/getEvolutionTx.js +18 -4
- package/lib/utils/portfolio/manager/getNewManagerTx.d.ts +8 -0
- package/lib/utils/{coveredCall → portfolio/manager}/getNewManagerTx.js +11 -4
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.d.ts +38 -0
- package/lib/utils/{coveredCall/getNewCoveredCallVaultTx.js → portfolio/manager/getNewPortfolioVaultTx.js} +52 -13
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.d.ts +8 -0
- package/lib/utils/{coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js → portfolio/manager/getRemoveAuthorizedUserTx.js} +14 -8
- package/lib/utils/{coveredCall → portfolio/manager}/getRemoveManagerTx.d.ts +5 -0
- package/lib/utils/{coveredCall → portfolio/manager}/getRemoveManagerTx.js +7 -2
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.d.ts +10 -0
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.js +70 -0
- package/lib/utils/portfolio/manager/getUpdateCapacityTx.d.ts +1 -0
- package/lib/utils/{coveredCall → portfolio/manager}/getUpdateCapacityTx.js +4 -4
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.d.ts +9 -0
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.js +67 -0
- package/lib/utils/portfolio/user/getClaimTx.d.ts +9 -0
- package/lib/utils/{coveredCall → portfolio/user}/getClaimTx.js +12 -4
- package/lib/utils/portfolio/user/getCompoundTx.d.ts +9 -0
- package/lib/utils/{coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js → portfolio/user/getCompoundTx.js} +15 -9
- package/lib/utils/portfolio/user/getDepositTx.d.ts +11 -0
- package/lib/utils/{coveredCall → portfolio/user}/getDepositTx.js +15 -9
- package/lib/utils/portfolio/user/getHarvestTx.d.ts +9 -0
- package/lib/utils/{coveredCall/getClaimAllTx.js → portfolio/user/getHarvestTx.js} +15 -7
- package/lib/utils/portfolio/user/getNewBidTx.d.ts +13 -0
- package/lib/utils/{coveredCall → portfolio/user}/getNewBidTx.js +21 -8
- package/lib/utils/portfolio/user/getUnsubscribeTx.d.ts +10 -0
- package/lib/utils/{coveredCall → portfolio/user}/getUnsubscribeTx.js +14 -8
- package/lib/utils/portfolio/user/getWithdrawTx.d.ts +10 -0
- package/lib/utils/{coveredCall → portfolio/user}/getWithdrawTx.js +13 -4
- package/package.json +2 -2
- package/lib/test/eventListener.d.ts +0 -5
- package/lib/test/eventListener.js +0 -395
- 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/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/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/getAuthorizedUpdateNextVaultConfigTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +0 -1
- 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/getClaimAllTx.d.ts +0 -1
- package/lib/utils/coveredCall/getClaimTx.d.ts +0 -1
- package/lib/utils/coveredCall/getCloseAuctionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getCloseVaultTx.d.ts +0 -1
- package/lib/utils/coveredCall/getDeliveryTx.d.ts +0 -1
- package/lib/utils/coveredCall/getDepositTx.d.ts +0 -1
- package/lib/utils/coveredCall/getEvolutionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getLastEvolutionTx.d.ts +0 -1
- 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/getNewCoveredCallVaultTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewManagerTx.d.ts +0 -1
- 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/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/getUpdateCapacityTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.d.ts +0 -1
- 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/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/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 -157
- /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
|
@@ -0,0 +1,63 @@
|
|
|
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.getAuthorizedAddPortfolioVaultAuthorizedUserTx = void 0;
|
|
40
|
+
/**
|
|
41
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
42
|
+
*/
|
|
43
|
+
function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArguments, index, addresses) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45
|
+
var tx;
|
|
46
|
+
return __generator(this, function (_a) {
|
|
47
|
+
tx = {
|
|
48
|
+
packageObjectId: packageId,
|
|
49
|
+
module: 'portfolio',
|
|
50
|
+
function: 'authorized_add_portfolio_vault_authorized_user',
|
|
51
|
+
typeArguments: typeArguments,
|
|
52
|
+
arguments: [
|
|
53
|
+
registry,
|
|
54
|
+
index,
|
|
55
|
+
addresses,
|
|
56
|
+
],
|
|
57
|
+
gasBudget: gasBudget,
|
|
58
|
+
};
|
|
59
|
+
return [2 /*return*/, tx];
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.getAuthorizedAddPortfolioVaultAuthorizedUserTx = getAuthorizedAddPortfolioVaultAuthorizedUserTx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAuthorizedDeliveryTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
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
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -37,16 +37,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedDeliveryTx = void 0;
|
|
40
|
-
function getAuthorizedDeliveryTx(gasBudget, packageId, registry,
|
|
40
|
+
function getAuthorizedDeliveryTx(gasBudget, packageId, registry, typeArguments, index, priceOracle, timeOracle) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
44
44
|
tx = {
|
|
45
45
|
packageObjectId: packageId,
|
|
46
|
-
module: '
|
|
46
|
+
module: 'portfolio',
|
|
47
47
|
function: 'authorized_delivery',
|
|
48
|
-
typeArguments:
|
|
49
|
-
arguments: [
|
|
48
|
+
typeArguments: typeArguments,
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
index,
|
|
52
|
+
priceOracle,
|
|
53
|
+
timeOracle,
|
|
54
|
+
],
|
|
50
55
|
gasBudget: gasBudget,
|
|
51
56
|
};
|
|
52
57
|
return [2 /*return*/, tx];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* registry: & mut Registry,
|
|
3
|
+
time_oracle: & Time,
|
|
4
|
+
option_type: u64,
|
|
5
|
+
period: u8,
|
|
6
|
+
activation_ts_ms: u64,
|
|
7
|
+
expiration_ts_ms: u64,
|
|
8
|
+
d_token_decimal: u64,
|
|
9
|
+
b_token_decimal: u64,
|
|
10
|
+
o_token_decimal: u64,
|
|
11
|
+
capacity: u64,
|
|
12
|
+
strike_pct: vector<u64>,
|
|
13
|
+
weight: vector<u64>,
|
|
14
|
+
is_buyer: vector<bool>,
|
|
15
|
+
strike_increment: u64,
|
|
16
|
+
lot_size: u64,
|
|
17
|
+
decay_speed: u64,
|
|
18
|
+
initial_price: u64,
|
|
19
|
+
final_price: u64,
|
|
20
|
+
auction_duration_in_ms: u64,
|
|
21
|
+
leverage: u64,
|
|
22
|
+
has_next: bool,
|
|
23
|
+
whitelist: vector<address>,
|
|
24
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
25
|
+
*/
|
|
26
|
+
export declare function getAuthorizedNewPortfolioVaultTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], timeOracle: string, optionType: string, // u64
|
|
27
|
+
period: string, // u8
|
|
28
|
+
activationTsMs: string, // u64
|
|
29
|
+
expirationTsMs: string, // u64
|
|
30
|
+
dTokenDecimal: string, // u64
|
|
31
|
+
bTokenDecimal: string, // u64
|
|
32
|
+
oTokenDecimal: string, // u64
|
|
33
|
+
capacity: string, // u64
|
|
34
|
+
strikePct: string[], // vector<u64>
|
|
35
|
+
weight: string[], // vector<u64>
|
|
36
|
+
isBuyer: boolean[], // vector<bool>
|
|
37
|
+
strikeIncrement: string, // u64
|
|
38
|
+
lotSize: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string, whitelist: string[], leverage: string, hasNext: boolean): Promise<any>;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
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
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -36,32 +36,75 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
|
|
39
|
+
exports.getAuthorizedNewPortfolioVaultTx = void 0;
|
|
40
|
+
/**
|
|
41
|
+
* registry: & mut Registry,
|
|
42
|
+
time_oracle: & Time,
|
|
43
|
+
option_type: u64,
|
|
44
|
+
period: u8,
|
|
45
|
+
activation_ts_ms: u64,
|
|
46
|
+
expiration_ts_ms: u64,
|
|
47
|
+
d_token_decimal: u64,
|
|
48
|
+
b_token_decimal: u64,
|
|
49
|
+
o_token_decimal: u64,
|
|
50
|
+
capacity: u64,
|
|
51
|
+
strike_pct: vector<u64>,
|
|
52
|
+
weight: vector<u64>,
|
|
53
|
+
is_buyer: vector<bool>,
|
|
54
|
+
strike_increment: u64,
|
|
55
|
+
lot_size: u64,
|
|
56
|
+
decay_speed: u64,
|
|
57
|
+
initial_price: u64,
|
|
58
|
+
final_price: u64,
|
|
59
|
+
auction_duration_in_ms: u64,
|
|
60
|
+
leverage: u64,
|
|
61
|
+
has_next: bool,
|
|
62
|
+
whitelist: vector<address>,
|
|
63
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
64
|
+
*/
|
|
65
|
+
function getAuthorizedNewPortfolioVaultTx(gasBudget, packageId, registry, typeArguments, timeOracle, optionType, // u64
|
|
66
|
+
period, // u8
|
|
67
|
+
activationTsMs, // u64
|
|
68
|
+
expirationTsMs, // u64
|
|
69
|
+
dTokenDecimal, // u64
|
|
70
|
+
bTokenDecimal, // u64
|
|
71
|
+
oTokenDecimal, // u64
|
|
72
|
+
capacity, // u64
|
|
73
|
+
strikePct, // vector<u64>
|
|
74
|
+
weight, // vector<u64>
|
|
75
|
+
isBuyer, // vector<bool>
|
|
76
|
+
strikeIncrement, // u64
|
|
77
|
+
lotSize, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, whitelist, leverage, hasNext) {
|
|
41
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
79
|
var tx;
|
|
43
80
|
return __generator(this, function (_a) {
|
|
44
81
|
tx = {
|
|
45
82
|
packageObjectId: packageId,
|
|
46
|
-
module: '
|
|
47
|
-
function: '
|
|
48
|
-
typeArguments:
|
|
83
|
+
module: 'portfolio',
|
|
84
|
+
function: 'authorized_new_portfolio_vault',
|
|
85
|
+
typeArguments: typeArguments,
|
|
49
86
|
arguments: [
|
|
50
87
|
registry,
|
|
51
88
|
timeOracle,
|
|
89
|
+
optionType,
|
|
52
90
|
period,
|
|
53
91
|
activationTsMs,
|
|
54
92
|
expirationTsMs,
|
|
55
|
-
|
|
56
|
-
|
|
93
|
+
dTokenDecimal,
|
|
94
|
+
bTokenDecimal,
|
|
95
|
+
oTokenDecimal,
|
|
57
96
|
capacity,
|
|
58
|
-
|
|
97
|
+
strikePct,
|
|
98
|
+
weight,
|
|
99
|
+
isBuyer,
|
|
59
100
|
strikeIncrement,
|
|
101
|
+
lotSize,
|
|
60
102
|
decaySpeed,
|
|
61
103
|
initialPrice,
|
|
62
104
|
finalPrice,
|
|
63
105
|
auctionDurationInMs,
|
|
64
106
|
leverage,
|
|
107
|
+
hasNext,
|
|
65
108
|
whitelist,
|
|
66
109
|
],
|
|
67
110
|
gasBudget: gasBudget,
|
|
@@ -70,7 +113,4 @@ function getAuthorizedNewCoveredCallVaultTx(gasBudget, packageId, registry, type
|
|
|
70
113
|
});
|
|
71
114
|
});
|
|
72
115
|
}
|
|
73
|
-
exports.
|
|
74
|
-
/*
|
|
75
|
-
sui client call --package 0x1543511bdce9ea3c401c4939126cea518adee965 --module covered_call --function new_covered_call_vault --type-args 0x2::sui::SUI --args 0x8517b2dbaae56eeb84352e4869b289459c68965b 0xb02452d0bbef3cbdc7840ea5bad27bcdd4031675 123 leoAsset 456 --gas-budget 100000
|
|
76
|
-
*/
|
|
116
|
+
exports.getAuthorizedNewPortfolioVaultTx = getAuthorizedNewPortfolioVaultTx;
|
|
@@ -0,0 +1,63 @@
|
|
|
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.getAuthorizedRemovePortfolioVaultAuthorizedUserTx = void 0;
|
|
40
|
+
/**
|
|
41
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
42
|
+
*/
|
|
43
|
+
function getAuthorizedRemovePortfolioVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArguments, index, addresses) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45
|
+
var tx;
|
|
46
|
+
return __generator(this, function (_a) {
|
|
47
|
+
tx = {
|
|
48
|
+
packageObjectId: packageId,
|
|
49
|
+
module: 'portfolio',
|
|
50
|
+
function: 'authorized_remove_portfolio_vault_authorized_user',
|
|
51
|
+
typeArguments: typeArguments,
|
|
52
|
+
arguments: [
|
|
53
|
+
registry,
|
|
54
|
+
index,
|
|
55
|
+
addresses,
|
|
56
|
+
],
|
|
57
|
+
gasBudget: gasBudget,
|
|
58
|
+
};
|
|
59
|
+
return [2 /*return*/, tx];
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.getAuthorizedRemovePortfolioVaultAuthorizedUserTx = getAuthorizedRemovePortfolioVaultAuthorizedUserTx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAuthorizedUpdateCapacityTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, capacity: string): Promise<any>;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
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
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -37,16 +37,20 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedUpdateCapacityTx = void 0;
|
|
40
|
-
function getAuthorizedUpdateCapacityTx(gasBudget, packageId,
|
|
40
|
+
function getAuthorizedUpdateCapacityTx(gasBudget, packageId, typeArguments, registry, index, capacity) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
44
44
|
tx = {
|
|
45
45
|
packageObjectId: packageId,
|
|
46
|
-
module: '
|
|
46
|
+
module: 'portfolio',
|
|
47
47
|
function: 'authorized_update_capacity',
|
|
48
|
-
typeArguments:
|
|
49
|
-
arguments: [
|
|
48
|
+
typeArguments: typeArguments,
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
index,
|
|
52
|
+
capacity
|
|
53
|
+
],
|
|
50
54
|
gasBudget: gasBudget,
|
|
51
55
|
};
|
|
52
56
|
return [2 /*return*/, tx];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function getAuthorizedUpdateUpcomingVaultConfigTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, strikePct: string[], // vector<u64>
|
|
2
|
+
weight: string[], // vector<u64>
|
|
3
|
+
isBuyer: boolean[], // vector<bool>
|
|
4
|
+
strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
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
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -36,19 +36,25 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
function
|
|
39
|
+
exports.getAuthorizedUpdateUpcomingVaultConfigTx = void 0;
|
|
40
|
+
function getAuthorizedUpdateUpcomingVaultConfigTx(gasBudget, packageId, registry, typeArguments, index, strikePct, // vector<u64>
|
|
41
|
+
weight, // vector<u64>
|
|
42
|
+
isBuyer, // vector<bool>
|
|
43
|
+
strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs) {
|
|
41
44
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
45
|
var tx;
|
|
43
46
|
return __generator(this, function (_a) {
|
|
44
47
|
tx = {
|
|
45
48
|
packageObjectId: packageId,
|
|
46
|
-
module: '
|
|
47
|
-
function: '
|
|
48
|
-
typeArguments:
|
|
49
|
+
module: 'portfolio',
|
|
50
|
+
function: 'authorized_update_upcoming_vault_config',
|
|
51
|
+
typeArguments: typeArguments,
|
|
49
52
|
arguments: [
|
|
50
53
|
registry,
|
|
51
54
|
index,
|
|
55
|
+
strikePct,
|
|
56
|
+
weight,
|
|
57
|
+
isBuyer,
|
|
52
58
|
strikeIncrement,
|
|
53
59
|
decaySpeed,
|
|
54
60
|
initialPrice,
|
|
@@ -61,4 +67,4 @@ function getAuthorizedUpdateVaultConfigTx(gasBudget, packageId, typeArgument, re
|
|
|
61
67
|
});
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
|
-
exports.
|
|
70
|
+
exports.getAuthorizedUpdateUpcomingVaultConfigTx = getAuthorizedUpdateUpcomingVaultConfigTx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAuthorizedUpdateWarmupVaultConfigTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
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
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -36,20 +36,19 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
function
|
|
39
|
+
exports.getAuthorizedUpdateWarmupVaultConfigTx = void 0;
|
|
40
|
+
function getAuthorizedUpdateWarmupVaultConfigTx(gasBudget, packageId, typeArguments, registry, index, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
44
44
|
tx = {
|
|
45
45
|
packageObjectId: packageId,
|
|
46
|
-
module: '
|
|
47
|
-
function: '
|
|
48
|
-
typeArguments:
|
|
46
|
+
module: 'portfolio',
|
|
47
|
+
function: 'authorized_update_warmup_vault_config',
|
|
48
|
+
typeArguments: typeArguments,
|
|
49
49
|
arguments: [
|
|
50
50
|
registry,
|
|
51
51
|
index,
|
|
52
|
-
strikeOtmPct,
|
|
53
52
|
strikeIncrement,
|
|
54
53
|
decaySpeed,
|
|
55
54
|
initialPrice,
|
|
@@ -62,4 +61,4 @@ function getUpdateNextVaultConfigTx(gasBudget, packageId, registry, typeArgument
|
|
|
62
61
|
});
|
|
63
62
|
});
|
|
64
63
|
}
|
|
65
|
-
exports.
|
|
64
|
+
exports.getAuthorizedUpdateWarmupVaultConfigTx = getAuthorizedUpdateWarmupVaultConfigTx;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
public fun get_auction_max_size<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
3
|
+
registry: &Registry,
|
|
4
|
+
index: u64,
|
|
5
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
6
|
+
): u64
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAuctionMaxSize(packageId: string, typeArguments: string[], registry: string, index: string, priceOracle: string): Promise<any>;
|
package/lib/utils/{coveredCall/getLastEvolutionTx.js → portfolio/helper/getAuctionMaxSize.js}
RENAMED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
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
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -36,28 +36,31 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
|
|
39
|
+
exports.getAuctionMaxSize = void 0;
|
|
40
|
+
/**
|
|
41
|
+
public fun get_auction_max_size<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
42
|
+
registry: &Registry,
|
|
43
|
+
index: u64,
|
|
44
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
45
|
+
): u64
|
|
46
|
+
*/
|
|
47
|
+
function getAuctionMaxSize(packageId, typeArguments, registry, index, priceOracle) {
|
|
41
48
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
49
|
var tx;
|
|
43
50
|
return __generator(this, function (_a) {
|
|
44
51
|
tx = {
|
|
45
52
|
packageObjectId: packageId,
|
|
46
|
-
module: '
|
|
47
|
-
function: '
|
|
48
|
-
typeArguments:
|
|
53
|
+
module: 'portfolio',
|
|
54
|
+
function: 'get_auction_max_size',
|
|
55
|
+
typeArguments: typeArguments,
|
|
49
56
|
arguments: [
|
|
50
|
-
managerCap,
|
|
51
57
|
registry,
|
|
52
58
|
index,
|
|
53
59
|
priceOracle,
|
|
54
|
-
timeOracle,
|
|
55
|
-
expirationTsMs,
|
|
56
60
|
],
|
|
57
|
-
gasBudget: gasBudget,
|
|
58
61
|
};
|
|
59
62
|
return [2 /*return*/, tx];
|
|
60
63
|
});
|
|
61
64
|
});
|
|
62
65
|
}
|
|
63
|
-
exports.
|
|
66
|
+
exports.getAuctionMaxSize = getAuctionMaxSize;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
struct GetUserStatusResult has copy, drop {
|
|
3
|
+
active: u64,
|
|
4
|
+
deactivating: u64,
|
|
5
|
+
inactive: u64,
|
|
6
|
+
warmup: u64,
|
|
7
|
+
bidder: u64,
|
|
8
|
+
premium: u64,
|
|
9
|
+
performance_fee: u64,
|
|
10
|
+
}
|
|
11
|
+
public fun get_user_status<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
12
|
+
registry: &Registry,
|
|
13
|
+
index: u64,
|
|
14
|
+
user: address,
|
|
15
|
+
): GetUserStatusResult
|
|
16
|
+
*/
|
|
17
|
+
export declare function getUserStatus(packageId: string, typeArguments: string[], registry: string, index: string, userAddress: string): Promise<any>;
|
|
18
|
+
interface GetUserStatusResult {
|
|
19
|
+
active: number;
|
|
20
|
+
deactivating: number;
|
|
21
|
+
inactive: number;
|
|
22
|
+
warmup: number;
|
|
23
|
+
bidder: number;
|
|
24
|
+
premium: number;
|
|
25
|
+
performance_fee: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function parseUserStatusResult(rawData: Uint8Array): GetUserStatusResult;
|
|
28
|
+
export declare function intFromBytes(x: any): number;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
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.intFromBytes = exports.parseUserStatusResult = exports.getUserStatus = void 0;
|
|
40
|
+
/**
|
|
41
|
+
struct GetUserStatusResult has copy, drop {
|
|
42
|
+
active: u64,
|
|
43
|
+
deactivating: u64,
|
|
44
|
+
inactive: u64,
|
|
45
|
+
warmup: u64,
|
|
46
|
+
bidder: u64,
|
|
47
|
+
premium: u64,
|
|
48
|
+
performance_fee: u64,
|
|
49
|
+
}
|
|
50
|
+
public fun get_user_status<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
51
|
+
registry: &Registry,
|
|
52
|
+
index: u64,
|
|
53
|
+
user: address,
|
|
54
|
+
): GetUserStatusResult
|
|
55
|
+
*/
|
|
56
|
+
function getUserStatus(packageId, typeArguments, registry, index, userAddress) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
+
var tx;
|
|
59
|
+
return __generator(this, function (_a) {
|
|
60
|
+
tx = {
|
|
61
|
+
packageObjectId: packageId,
|
|
62
|
+
module: 'portfolio',
|
|
63
|
+
function: 'get_user_status',
|
|
64
|
+
typeArguments: typeArguments,
|
|
65
|
+
arguments: [
|
|
66
|
+
registry,
|
|
67
|
+
index,
|
|
68
|
+
userAddress,
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
return [2 /*return*/, tx];
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
exports.getUserStatus = getUserStatus;
|
|
76
|
+
function parseUserStatusResult(rawData) {
|
|
77
|
+
var temp = [];
|
|
78
|
+
for (var i = 0; i < rawData.length / 8; ++i) {
|
|
79
|
+
// console.log(i)
|
|
80
|
+
temp.push(intFromBytes(rawData.slice(i * 8, (i + 1) * 8).reverse()));
|
|
81
|
+
}
|
|
82
|
+
var userStatusResult = {
|
|
83
|
+
active: temp[0],
|
|
84
|
+
deactivating: temp[1],
|
|
85
|
+
inactive: temp[2],
|
|
86
|
+
warmup: temp[3],
|
|
87
|
+
bidder: temp[4],
|
|
88
|
+
premium: temp[5],
|
|
89
|
+
performance_fee: temp[6],
|
|
90
|
+
};
|
|
91
|
+
return userStatusResult;
|
|
92
|
+
}
|
|
93
|
+
exports.parseUserStatusResult = parseUserStatusResult;
|
|
94
|
+
function intFromBytes(x) {
|
|
95
|
+
var val = 0;
|
|
96
|
+
for (var i = 0; i < x.length; ++i) {
|
|
97
|
+
val += x[i];
|
|
98
|
+
if (i < x.length - 1) {
|
|
99
|
+
val = val << 8;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return val;
|
|
103
|
+
}
|
|
104
|
+
exports.intFromBytes = intFromBytes;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
public(friend) entry fun add_authorized_user(
|
|
3
|
+
manager_cap: & ManagerCap,
|
|
4
|
+
registry: & mut Registry,
|
|
5
|
+
user_addresses: vector<address>,
|
|
6
|
+
)
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAddAuthorizedUserTx(gasBudget: number, packageId: string, managerCap: string, registry: string, userAddresses: string[]): Promise<any>;
|