@typus/typus-sdk 0.6.2 → 0.6.3
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 +23 -0
- package/lib/constants.d.ts +9 -15
- package/lib/constants.js +14 -16
- package/lib/test/eventListener.js +25 -23
- package/lib/test/getBidData.js +1 -1
- package/lib/test/getMakersShares.js +1 -1
- package/lib/test/getUsersShares.js +2 -2
- package/lib/test/getVaultData.js +1 -1
- package/lib/test/getWhiteListFromRegistry.js +1 -1
- package/lib/test/testClaim.js +1 -1
- package/lib/test/testCrypto.js +1 -1
- package/lib/test/testDeposit.js +1 -1
- package/lib/test/testMint.js +2 -2
- package/lib/test/testNewAuction.js +1 -1
- package/lib/test/testNewVault.js +1 -1
- package/lib/test/testOracle.js +1 -1
- package/lib/test/testSettle.js +1 -1
- package/lib/test/testSubscribeEvent.js +1 -1
- package/lib/test/testUnsubscribe.js +1 -1
- package/lib/test/testWithdraw.js +1 -1
- package/lib/utils/auction/getBid.js +1 -1
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedDeliveryTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedEvolutionTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedSettleTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.js +1 -1
- package/lib/utils/coveredCall/createPriceOracle.js +1 -1
- package/lib/utils/coveredCall/createTimeOracle.js +1 -1
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js +1 -1
- package/lib/utils/coveredCall/getClaimAllTx.js +1 -1
- package/lib/utils/coveredCall/getClaimTx.js +1 -1
- package/lib/utils/coveredCall/getCloseAuctionTx.js +1 -1
- package/lib/utils/coveredCall/getCloseVaultTx.js +1 -1
- package/lib/utils/coveredCall/getDeliveryTx.js +1 -1
- package/lib/utils/coveredCall/getDepositTx.js +1 -1
- package/lib/utils/coveredCall/getEvolutionTx.js +1 -1
- package/lib/utils/coveredCall/getLastEvolutionTx.js +1 -1
- package/lib/utils/coveredCall/getMakerClaimAllTx.js +1 -1
- package/lib/utils/coveredCall/getMakerClaimTx.js +1 -1
- package/lib/utils/coveredCall/getNewAuctionTx.js +1 -1
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +1 -1
- package/lib/utils/coveredCall/getNewBidTx.js +1 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +1 -1
- package/lib/utils/coveredCall/getNewManagerTx.js +1 -1
- package/lib/utils/coveredCall/getRefundTx.js +1 -1
- package/lib/utils/coveredCall/getRemoveBidTx.js +1 -1
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js +1 -1
- package/lib/utils/coveredCall/getRemoveManagerTx.js +1 -1
- package/lib/utils/coveredCall/getRollOverTx.js +1 -1
- package/lib/utils/coveredCall/getSettleTx.js +1 -1
- package/lib/utils/coveredCall/getSettleWithRollOverTx.js +1 -1
- package/lib/utils/coveredCall/getSubscribeTx.js +1 -1
- package/lib/utils/coveredCall/getUnsubscribeTx.js +1 -1
- package/lib/utils/coveredCall/getUpdateCapacityTx.js +1 -1
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.js +1 -1
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.js +1 -1
- package/lib/utils/coveredCall/getUpdateVaultConfigTx.js +1 -1
- package/lib/utils/coveredCall/getWithdrawTx.js +1 -1
- package/lib/utils/fetchData.d.ts +1 -0
- package/lib/utils/fetchData.js +2 -3
- package/lib/utils/fetchPortfolioData.d.ts +93 -0
- package/lib/utils/fetchPortfolioData.js +205 -0
- package/lib/utils/getCreateTokenRegistryTx.js +1 -1
- package/lib/utils/getMakersShares.js +1 -1
- package/lib/utils/getMintTx.js +1 -1
- package/lib/utils/getNewOracleTx.js +1 -1
- package/lib/utils/getNewTimeOracleTx.js +1 -1
- package/lib/utils/getTypeArgumentFromToken.js +1 -1
- package/lib/utils/getUpdateOracleTx.js +1 -1
- package/lib/utils/getUpdateTimeOracleTx.js +1 -1
- package/lib/utils/getUsersShares.js +1 -1
- package/lib/utils/getVaultData.d.ts +1 -0
- package/lib/utils/getVaultData.js +21 -3
- package/lib/utils/getVaultIndexInRegistry.js +1 -1
- package/lib/utils/getWhiteListFromRegistry.js +1 -1
- package/lib/utils/loadUsersDepositData.js +31 -28
- 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/portfolio/authorized/getAuthorizedDeliveryTx.js +61 -0
- package/lib/utils/portfolio/authorized/getAuthorizedEvolutionTx.d.ts +1 -0
- package/lib/utils/portfolio/authorized/getAuthorizedEvolutionTx.js +63 -0
- package/lib/utils/portfolio/authorized/getAuthorizedLastEvolutionTx.d.ts +1 -0
- package/lib/utils/portfolio/authorized/getAuthorizedLastEvolutionTx.js +61 -0
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.d.ts +37 -0
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.js +114 -0
- 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/portfolio/authorized/getAuthorizedUpdateCapacityTx.js +60 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +4 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateNextVaultConfigTx.js +70 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +1 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateVaultConfigTx.js +64 -0
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.js +60 -0
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +4 -0
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.js +64 -0
- package/lib/utils/portfolio/manager/getCloseAuctionTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getCloseAuctionTx.js +62 -0
- package/lib/utils/portfolio/manager/getCloseVaultTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getCloseVaultTx.js +60 -0
- package/lib/utils/portfolio/manager/getDeliveryTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getDeliveryTx.js +62 -0
- package/lib/utils/portfolio/manager/getEvolutionTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getEvolutionTx.js +64 -0
- package/lib/utils/portfolio/manager/getLastEvolutionTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getLastEvolutionTx.js +62 -0
- package/lib/utils/portfolio/manager/getNewManagerTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getNewManagerTx.js +59 -0
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.d.ts +38 -0
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.js +116 -0
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.js +60 -0
- package/lib/utils/portfolio/manager/getRemoveManagerTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getRemoveManagerTx.js +58 -0
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.d.ts +4 -0
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.js +64 -0
- package/lib/utils/portfolio/manager/getUpdateCapacityTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getUpdateCapacityTx.js +61 -0
- package/lib/utils/portfolio/manager/getUpdateNextVaultConfigTx.d.ts +4 -0
- package/lib/utils/portfolio/manager/getUpdateNextVaultConfigTx.js +71 -0
- package/lib/utils/portfolio/manager/getUpdateVaultConfigTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getUpdateVaultConfigTx.js +65 -0
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.d.ts +1 -0
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.js +59 -0
- package/lib/utils/portfolio/user/getClaimTx.d.ts +1 -0
- package/lib/utils/portfolio/user/getClaimTx.js +59 -0
- package/lib/utils/portfolio/user/getCompoundPremiumTx.d.ts +1 -0
- package/lib/utils/portfolio/user/getCompoundPremiumTx.js +60 -0
- package/lib/utils/portfolio/user/getDepositTx.d.ts +1 -0
- package/lib/utils/portfolio/user/getDepositTx.js +61 -0
- package/lib/utils/portfolio/user/getHarvestTx.d.ts +1 -0
- package/lib/utils/portfolio/user/getHarvestTx.js +59 -0
- package/lib/utils/portfolio/user/getNewBidTx.d.ts +1 -0
- package/lib/utils/portfolio/user/getNewBidTx.js +63 -0
- package/lib/utils/portfolio/user/getUnsubscribeTx.d.ts +1 -0
- package/lib/utils/portfolio/user/getUnsubscribeTx.js +60 -0
- package/lib/utils/portfolio/user/getWithdrawTx.d.ts +1 -0
- package/lib/utils/portfolio/user/getWithdrawTx.js +60 -0
- package/package.json +2 -2
|
@@ -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]) {
|
package/lib/utils/getMintTx.js
CHANGED
|
@@ -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]) {
|
|
@@ -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]) {
|
|
@@ -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]) {
|
|
@@ -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]) {
|
|
@@ -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]) {
|
|
@@ -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]) {
|
|
@@ -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]) {
|
|
@@ -2,3 +2,4 @@ import { JsonRpcProvider } from '@mysten/sui.js';
|
|
|
2
2
|
import { CoveredCallVault, Auction } from "../utils/fetchData";
|
|
3
3
|
export declare function getVaultDataFromRegistry(registry: string, provider: JsonRpcProvider): Promise<CoveredCallVault[]>;
|
|
4
4
|
export declare function getVaultBidPrice(auction: Auction): Promise<number>;
|
|
5
|
+
export declare function getNodesKeyFromLinkedList(linkedList: string, provider: JsonRpcProvider): Promise<string[]>;
|
|
@@ -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]) {
|
|
@@ -47,7 +47,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
47
47
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.getVaultBidPrice = exports.getVaultDataFromRegistry = void 0;
|
|
50
|
+
exports.getNodesKeyFromLinkedList = exports.getVaultBidPrice = exports.getVaultDataFromRegistry = void 0;
|
|
51
51
|
var constants_1 = require("../constants");
|
|
52
52
|
// const provider = new JsonRpcProvider(TESTNET_RPC_ENDPOINT);//for read only operations
|
|
53
53
|
function getVaultDataFromRegistry(registry, provider) {
|
|
@@ -67,7 +67,7 @@ function getVaultDataFromRegistry(registry, provider) {
|
|
|
67
67
|
objsInfo = _b.sent();
|
|
68
68
|
vaults = [];
|
|
69
69
|
_loop_1 = function (objInfo) {
|
|
70
|
-
var vaultId, vaultIdx, type, asset, config, vault, prev, vaultConfig, vaultConfigRes, nextVaultConfig, nextVaultConfigRes, payoffConfig, payoffConfigRes, configRes, maker, regular, rolling, vaultRes, auctionRes, vaultBidPrice, auction, priceConfig, priceConfigRes, next, totalBidSize, deliveryInfo, owner, tvl, res;
|
|
70
|
+
var vaultId, vaultIdx, type, asset, config, vault, prev, vaultConfig, vaultConfigRes, nextVaultConfig, nextVaultConfigRes, payoffConfig, payoffConfigRes, configRes, maker, regular, rolling, vaultRes, auctionRes, vaultBidPrice, auction, priceConfig, priceConfigRes, next, totalBidSize, deliveryInfo, owner, tvl, authority, res;
|
|
71
71
|
return __generator(this, function (_c) {
|
|
72
72
|
switch (_c.label) {
|
|
73
73
|
case 0:
|
|
@@ -187,6 +187,9 @@ function getVaultDataFromRegistry(registry, provider) {
|
|
|
187
187
|
}
|
|
188
188
|
owner = objInfo.details.data.fields.value.fields.owner;
|
|
189
189
|
tvl = Number(vault.regular_sub_vault.fields.balance) + Number(vault.rolling_sub_vault.fields.balance);
|
|
190
|
+
return [4 /*yield*/, getNodesKeyFromLinkedList(objInfo.details.data.fields.value.fields.authority, provider)];
|
|
191
|
+
case 4:
|
|
192
|
+
authority = _c.sent();
|
|
190
193
|
res = {
|
|
191
194
|
vaultId: vaultId,
|
|
192
195
|
vaultIdx: vaultIdx.toString(),
|
|
@@ -199,6 +202,7 @@ function getVaultDataFromRegistry(registry, provider) {
|
|
|
199
202
|
totalBidSize: totalBidSize,
|
|
200
203
|
deliveryInfo: deliveryInfo,
|
|
201
204
|
owner: owner,
|
|
205
|
+
authority: authority,
|
|
202
206
|
tvl: tvl.toString(),
|
|
203
207
|
vaultBidPrice: vaultBidPrice.toString(),
|
|
204
208
|
};
|
|
@@ -261,3 +265,17 @@ function getVaultBidPrice(auction) {
|
|
|
261
265
|
});
|
|
262
266
|
}
|
|
263
267
|
exports.getVaultBidPrice = getVaultBidPrice;
|
|
268
|
+
function getNodesKeyFromLinkedList(linkedList, provider) {
|
|
269
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
270
|
+
var linkedListNodes;
|
|
271
|
+
return __generator(this, function (_a) {
|
|
272
|
+
switch (_a.label) {
|
|
273
|
+
case 0: return [4 /*yield*/, provider.getDynamicFields(linkedList.fields.whitelist.fields.nodes.fields.id.id)];
|
|
274
|
+
case 1:
|
|
275
|
+
linkedListNodes = (_a.sent()).data.map(function (d) { return d.name; });
|
|
276
|
+
return [2 /*return*/, linkedListNodes];
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
exports.getNodesKeyFromLinkedList = getNodesKeyFromLinkedList;
|
|
@@ -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]) {
|
|
@@ -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]) {
|
|
@@ -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]) {
|
|
@@ -51,20 +51,20 @@ exports.loadUsersDepositData = void 0;
|
|
|
51
51
|
var fetchData_1 = require("./fetchData");
|
|
52
52
|
function loadUsersDepositData(registry) {
|
|
53
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
-
var usersDepositData, coveredCallVaults, coveredCallVaults_1, coveredCallVaults_1_1, coveredCallVault, tableUnderCoveredCallVault, subVaults, _a, _b, _i, subVaultType, tableUnderSubVault, linkedListNodes, linkedListNodes_1, linkedListNodes_1_1, linkedListNode, userData, userDepositData, userDepositDatas, e_1_1, e_2_1;
|
|
55
|
-
var e_2,
|
|
56
|
-
return __generator(this, function (
|
|
57
|
-
switch (
|
|
54
|
+
var usersDepositData, coveredCallVaults, coveredCallVaults_1, coveredCallVaults_1_1, coveredCallVault, tableUnderCoveredCallVault, subVaults, _a, _b, _c, _i, subVaultType, tableUnderSubVault, linkedListNodes, linkedListNodes_1, linkedListNodes_1_1, linkedListNode, userData, userDepositData, userDepositDatas, e_1_1, e_2_1;
|
|
55
|
+
var e_2, _d, e_1, _e;
|
|
56
|
+
return __generator(this, function (_f) {
|
|
57
|
+
switch (_f.label) {
|
|
58
58
|
case 0:
|
|
59
59
|
usersDepositData = new Map();
|
|
60
60
|
return [4 /*yield*/, (0, fetchData_1.getCoveredCallVaultsFromRegistry)(registry)];
|
|
61
61
|
case 1:
|
|
62
|
-
coveredCallVaults =
|
|
63
|
-
|
|
62
|
+
coveredCallVaults = _f.sent();
|
|
63
|
+
_f.label = 2;
|
|
64
64
|
case 2:
|
|
65
|
-
|
|
65
|
+
_f.trys.push([2, 19, 20, 21]);
|
|
66
66
|
coveredCallVaults_1 = __values(coveredCallVaults), coveredCallVaults_1_1 = coveredCallVaults_1.next();
|
|
67
|
-
|
|
67
|
+
_f.label = 3;
|
|
68
68
|
case 3:
|
|
69
69
|
if (!!coveredCallVaults_1_1.done) return [3 /*break*/, 18];
|
|
70
70
|
coveredCallVault = coveredCallVaults_1_1.value;
|
|
@@ -72,41 +72,44 @@ function loadUsersDepositData(registry) {
|
|
|
72
72
|
//from table find sub vault
|
|
73
73
|
];
|
|
74
74
|
case 4:
|
|
75
|
-
tableUnderCoveredCallVault =
|
|
75
|
+
tableUnderCoveredCallVault = _f.sent();
|
|
76
76
|
return [4 /*yield*/, (0, fetchData_1.getSubVaultsFromTable)(tableUnderCoveredCallVault)
|
|
77
77
|
//from sub vault find table
|
|
78
78
|
];
|
|
79
79
|
case 5:
|
|
80
|
-
subVaults =
|
|
81
|
-
_a =
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
subVaults = _f.sent();
|
|
81
|
+
_a = subVaults;
|
|
82
|
+
_b = [];
|
|
83
|
+
for (_c in _a)
|
|
84
|
+
_b.push(_c);
|
|
84
85
|
_i = 0;
|
|
85
|
-
|
|
86
|
+
_f.label = 6;
|
|
86
87
|
case 6:
|
|
87
|
-
if (!(_i <
|
|
88
|
-
|
|
88
|
+
if (!(_i < _b.length)) return [3 /*break*/, 17];
|
|
89
|
+
_c = _b[_i];
|
|
90
|
+
if (!(_c in _a)) return [3 /*break*/, 16];
|
|
91
|
+
subVaultType = _c;
|
|
89
92
|
return [4 /*yield*/, (0, fetchData_1.getTableUnderSubVault)(subVaults[subVaultType])
|
|
90
93
|
//from table find linked list node
|
|
91
94
|
];
|
|
92
95
|
case 7:
|
|
93
|
-
tableUnderSubVault =
|
|
96
|
+
tableUnderSubVault = _f.sent();
|
|
94
97
|
return [4 /*yield*/, (0, fetchData_1.getLinkedListNodesFromTable)(tableUnderSubVault)
|
|
95
98
|
//from linkedListNode find user data
|
|
96
99
|
];
|
|
97
100
|
case 8:
|
|
98
|
-
linkedListNodes =
|
|
99
|
-
|
|
101
|
+
linkedListNodes = _f.sent();
|
|
102
|
+
_f.label = 9;
|
|
100
103
|
case 9:
|
|
101
|
-
|
|
104
|
+
_f.trys.push([9, 14, 15, 16]);
|
|
102
105
|
linkedListNodes_1 = (e_1 = void 0, __values(linkedListNodes)), linkedListNodes_1_1 = linkedListNodes_1.next();
|
|
103
|
-
|
|
106
|
+
_f.label = 10;
|
|
104
107
|
case 10:
|
|
105
108
|
if (!!linkedListNodes_1_1.done) return [3 /*break*/, 13];
|
|
106
109
|
linkedListNode = linkedListNodes_1_1.value;
|
|
107
110
|
return [4 /*yield*/, (0, fetchData_1.getUserDataFromLinkedListNode)(linkedListNode.objectId)];
|
|
108
111
|
case 11:
|
|
109
|
-
userData =
|
|
112
|
+
userData = _f.sent();
|
|
110
113
|
userDepositData = {
|
|
111
114
|
coveredCallVault: coveredCallVault.objectId,
|
|
112
115
|
subVault: subVaults[subVaultType],
|
|
@@ -117,18 +120,18 @@ function loadUsersDepositData(registry) {
|
|
|
117
120
|
userDepositDatas = (usersDepositData.get(userData.name) == undefined) ? [] : usersDepositData.get(userData.name);
|
|
118
121
|
userDepositDatas.push(userDepositData);
|
|
119
122
|
usersDepositData.set(userData.name, userDepositDatas);
|
|
120
|
-
|
|
123
|
+
_f.label = 12;
|
|
121
124
|
case 12:
|
|
122
125
|
linkedListNodes_1_1 = linkedListNodes_1.next();
|
|
123
126
|
return [3 /*break*/, 10];
|
|
124
127
|
case 13: return [3 /*break*/, 16];
|
|
125
128
|
case 14:
|
|
126
|
-
e_1_1 =
|
|
129
|
+
e_1_1 = _f.sent();
|
|
127
130
|
e_1 = { error: e_1_1 };
|
|
128
131
|
return [3 /*break*/, 16];
|
|
129
132
|
case 15:
|
|
130
133
|
try {
|
|
131
|
-
if (linkedListNodes_1_1 && !linkedListNodes_1_1.done && (
|
|
134
|
+
if (linkedListNodes_1_1 && !linkedListNodes_1_1.done && (_e = linkedListNodes_1.return)) _e.call(linkedListNodes_1);
|
|
132
135
|
}
|
|
133
136
|
finally { if (e_1) throw e_1.error; }
|
|
134
137
|
return [7 /*endfinally*/];
|
|
@@ -140,12 +143,12 @@ function loadUsersDepositData(registry) {
|
|
|
140
143
|
return [3 /*break*/, 3];
|
|
141
144
|
case 18: return [3 /*break*/, 21];
|
|
142
145
|
case 19:
|
|
143
|
-
e_2_1 =
|
|
146
|
+
e_2_1 = _f.sent();
|
|
144
147
|
e_2 = { error: e_2_1 };
|
|
145
148
|
return [3 /*break*/, 21];
|
|
146
149
|
case 20:
|
|
147
150
|
try {
|
|
148
|
-
if (coveredCallVaults_1_1 && !coveredCallVaults_1_1.done && (
|
|
151
|
+
if (coveredCallVaults_1_1 && !coveredCallVaults_1_1.done && (_d = coveredCallVaults_1.return)) _d.call(coveredCallVaults_1);
|
|
149
152
|
}
|
|
150
153
|
finally { if (e_2) throw e_2.error; }
|
|
151
154
|
return [7 /*endfinally*/];
|
|
@@ -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, address) {
|
|
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
|
+
address,
|
|
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>;
|
|
@@ -0,0 +1,61 @@
|
|
|
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.getAuthorizedDeliveryTx = void 0;
|
|
40
|
+
function getAuthorizedDeliveryTx(gasBudget, packageId, registry, typeArguments, index, priceOracle, timeOracle) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
+
var tx;
|
|
43
|
+
return __generator(this, function (_a) {
|
|
44
|
+
tx = {
|
|
45
|
+
packageObjectId: packageId,
|
|
46
|
+
module: 'portfolio',
|
|
47
|
+
function: 'authorized_delivery',
|
|
48
|
+
typeArguments: typeArguments,
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
index,
|
|
52
|
+
priceOracle,
|
|
53
|
+
timeOracle,
|
|
54
|
+
],
|
|
55
|
+
gasBudget: gasBudget,
|
|
56
|
+
};
|
|
57
|
+
return [2 /*return*/, tx];
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.getAuthorizedDeliveryTx = getAuthorizedDeliveryTx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAuthorizedEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, priceOracle: string, timeOracle: string, activationTsMs: string, expirationTsMs: string): Promise<any>;
|
|
@@ -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.getAuthorizedEvolutionTx = void 0;
|
|
40
|
+
function getAuthorizedEvolutionTx(gasBudget, packageId, registry, typeArguments, index, priceOracle, timeOracle, activationTsMs, expirationTsMs) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
+
var tx;
|
|
43
|
+
return __generator(this, function (_a) {
|
|
44
|
+
tx = {
|
|
45
|
+
packageObjectId: packageId,
|
|
46
|
+
module: 'portfolio',
|
|
47
|
+
function: 'authorized_evolution',
|
|
48
|
+
typeArguments: typeArguments,
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
index,
|
|
52
|
+
priceOracle,
|
|
53
|
+
timeOracle,
|
|
54
|
+
activationTsMs,
|
|
55
|
+
expirationTsMs,
|
|
56
|
+
],
|
|
57
|
+
gasBudget: gasBudget,
|
|
58
|
+
};
|
|
59
|
+
return [2 /*return*/, tx];
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.getAuthorizedEvolutionTx = getAuthorizedEvolutionTx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAuthorizedLastEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -0,0 +1,61 @@
|
|
|
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.getAuthorizedLastEvolutionTx = void 0;
|
|
40
|
+
function getAuthorizedLastEvolutionTx(gasBudget, packageId, registry, typeArguments, index, priceOracle, timeOracle) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
+
var tx;
|
|
43
|
+
return __generator(this, function (_a) {
|
|
44
|
+
tx = {
|
|
45
|
+
packageObjectId: packageId,
|
|
46
|
+
module: 'portfolio',
|
|
47
|
+
function: 'authorized_last_evolution',
|
|
48
|
+
typeArguments: typeArguments,
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
index,
|
|
52
|
+
priceOracle,
|
|
53
|
+
timeOracle,
|
|
54
|
+
],
|
|
55
|
+
gasBudget: gasBudget,
|
|
56
|
+
};
|
|
57
|
+
return [2 /*return*/, tx];
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.getAuthorizedLastEvolutionTx = getAuthorizedLastEvolutionTx;
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
whitelist: vector<address>,
|
|
23
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAuthorizedNewPortfolioVaultTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], timeOracle: string, optionType: string, // u64
|
|
26
|
+
period: string, // u8
|
|
27
|
+
activationTsMs: string, // u64
|
|
28
|
+
expirationTsMs: string, // u64
|
|
29
|
+
dTokenDecimal: string, // u64
|
|
30
|
+
bTokenDecimal: string, // u64
|
|
31
|
+
oTokenDecimal: string, // u64
|
|
32
|
+
capacity: string, // u64
|
|
33
|
+
strikeOtmPct: string[], // vector<u64>
|
|
34
|
+
weight: string[], // vector<u64>
|
|
35
|
+
isBuyer: string[], // vector<bool>
|
|
36
|
+
strikeIncrement: string, // u64
|
|
37
|
+
lotSize: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string, whitelist: string[], leverage: string): Promise<any>;
|