@typus/typus-sdk 0.1.3 → 0.1.5
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/constants.d.ts +9 -11
- package/lib/constants.js +19 -15
- package/lib/scripts/coveredCall/{getCoveredCallDepositTx.d.ts → getDeliveryTx.d.ts} +0 -0
- package/lib/scripts/coveredCall/{getCoveredCallUnsubscribeTx.js → getDeliveryTx.js} +6 -6
- package/lib/scripts/{getDepositTx.d.ts → coveredCall/getDepositTx.d.ts} +0 -0
- package/lib/scripts/{getDepositTx.js → coveredCall/getDepositTx.js} +7 -8
- package/lib/scripts/coveredCall/{getCoveredCallUnsubscribeTx.d.ts → getNewAuctionTx.d.ts} +0 -0
- package/lib/scripts/{getNewSharkFinVaultTx.js → coveredCall/getNewAuctionTx.js} +13 -11
- package/lib/scripts/{getNewSharkFinVaultTx.d.ts → coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts} +0 -0
- package/lib/scripts/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +65 -0
- package/lib/scripts/coveredCall/getNewBidTx.d.ts +1 -0
- package/lib/scripts/coveredCall/getNewBidTx.js +59 -0
- package/lib/scripts/coveredCall/getNewCoveredCallVaultTx.js +4 -2
- package/lib/scripts/coveredCall/getRemoveBidTx.d.ts +1 -0
- package/lib/scripts/coveredCall/getRemoveBidTx.js +56 -0
- package/lib/scripts/coveredCall/getSubscribeTx.d.ts +1 -0
- package/lib/scripts/coveredCall/getSubscribeTx.js +55 -0
- package/lib/scripts/coveredCall/getUnsubscribeTx.d.ts +1 -0
- package/lib/scripts/coveredCall/getUnsubscribeTx.js +55 -0
- package/lib/scripts/coveredCall/getWithdrawTx.d.ts +1 -0
- package/lib/scripts/coveredCall/{getCoveredCallDepositTx.js → getWithdrawTx.js} +6 -7
- package/lib/scripts/getNewOracleTx.js +3 -3
- package/lib/scripts/getUpdateOracleTx.js +1 -1
- package/lib/test/getUserShareFromRegistry.d.ts +1 -0
- package/lib/test/getUserShareFromRegistry.js +172 -0
- package/lib/test/testCrypto.d.ts +1 -0
- package/lib/test/testCrypto.js +54 -0
- package/lib/test/testDeposit.js +16 -43
- package/lib/test/testDepositV2.d.ts +0 -1
- package/lib/test/testDepositV2.js +61 -168
- package/lib/test/testMint.js +70 -30
- package/lib/test/testNewVault.d.ts +1 -0
- package/lib/test/testNewVault.js +171 -0
- package/lib/test/testOracle.js +4 -3
- package/lib/test/testSubscribeEvent.d.ts +1 -0
- package/lib/test/testSubscribeEvent.js +97 -0
- package/lib/test/testUnsubscribe.d.ts +1 -0
- package/lib/test/testUnsubscribe.js +86 -0
- package/lib/utils/auction/sealedAuction.d.ts +33 -0
- package/lib/utils/auction/sealedAuction.js +64 -0
- package/lib/utils/coveredCall/getDeliveryTx.d.ts +1 -0
- package/lib/utils/coveredCall/{getCoveredCallDepositTx.js → getDeliveryTx.js} +5 -10
- package/lib/utils/{getDepositTx.d.ts → coveredCall/getDepositTx.d.ts} +0 -0
- package/lib/utils/{getDepositTx.js → coveredCall/getDepositTx.js} +3 -3
- package/lib/utils/coveredCall/getNewAuctionTx.d.ts +1 -0
- package/lib/utils/{getNewSharkFinVaultTx.js → coveredCall/getNewAuctionTx.js} +15 -13
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +1 -0
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +69 -0
- package/lib/utils/coveredCall/getNewBidTx.d.ts +1 -0
- package/lib/utils/coveredCall/getNewBidTx.js +62 -0
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +3 -2
- package/lib/utils/coveredCall/getRemoveBidTx.d.ts +1 -0
- package/lib/utils/coveredCall/getRemoveBidTx.js +60 -0
- package/lib/utils/coveredCall/getSubscribeTx.d.ts +1 -0
- package/lib/utils/coveredCall/getSubscribeTx.js +59 -0
- package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +1 -0
- package/lib/utils/coveredCall/{getCoveredCallUnsubscribeTx.js → getUnsubscribeTx.js} +3 -3
- package/lib/utils/coveredCall/getWithdrawTx.d.ts +1 -0
- package/lib/utils/coveredCall/getWithdrawTx.js +61 -0
- package/lib/utils/fetchData.d.ts +11 -0
- package/lib/utils/fetchData.js +191 -0
- package/lib/utils/getNewOracleTx.d.ts +1 -1
- package/lib/utils/getNewOracleTx.js +2 -2
- package/lib/utils/getSubVault.js +1 -1
- package/lib/utils/getTypeArgumentFromToken.d.ts +1 -0
- package/lib/utils/getTypeArgumentFromToken.js +67 -0
- package/package.json +6 -2
- package/lib/utils/coveredCall/getCoveredCallDepositTx.d.ts +0 -1
- package/lib/utils/coveredCall/getCoveredCallUnsubscribeTx.d.ts +0 -1
- package/lib/utils/getNewSharkFinVaultTx.d.ts +0 -1
|
@@ -43,15 +43,15 @@ function getDepositTx(packageId, registry, typeArgument, vaultIndex, isRolling,
|
|
|
43
43
|
return __generator(this, function (_a) {
|
|
44
44
|
tx = {
|
|
45
45
|
packageObjectId: packageId,
|
|
46
|
-
module: '
|
|
46
|
+
module: 'covered_call',
|
|
47
47
|
function: 'deposit',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
49
|
arguments: [
|
|
50
50
|
registry,
|
|
51
51
|
vaultIndex,
|
|
52
|
-
isRolling,
|
|
53
52
|
coin,
|
|
54
53
|
amount,
|
|
54
|
+
isRolling,
|
|
55
55
|
],
|
|
56
56
|
gasBudget: 1000,
|
|
57
57
|
};
|
|
@@ -61,6 +61,6 @@ function getDepositTx(packageId, registry, typeArgument, vaultIndex, isRolling,
|
|
|
61
61
|
}
|
|
62
62
|
exports.getDepositTx = getDepositTx;
|
|
63
63
|
/*
|
|
64
|
-
sui client call --gas-budget 1000 --package $PACKAGE --module "
|
|
64
|
+
sui client call --gas-budget 1000 --package $PACKAGE --module "covered_call" --function "deposit"
|
|
65
65
|
--type-args 0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC --args $VAULT_REGISTRY 1 true $TOKENAID 9999
|
|
66
66
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNewAuctionTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index: number, start: number, end: number, decay: number, initialPrice: number, finalPrice: number): Promise<any>;
|
|
@@ -36,32 +36,34 @@ 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.getNewAuctionTx = void 0;
|
|
40
|
+
function getNewAuctionTx(packageId, registry, typeArgument, managerCap, index, start, end, decay, initialPrice, finalPrice) {
|
|
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: '
|
|
46
|
+
module: 'covered_call',
|
|
47
|
+
function: 'new_auction',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
49
|
arguments: [
|
|
50
|
+
managerCap,
|
|
50
51
|
registry,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
index,
|
|
53
|
+
start,
|
|
54
|
+
end,
|
|
55
|
+
decay,
|
|
56
|
+
initialPrice,
|
|
57
|
+
finalPrice,
|
|
55
58
|
],
|
|
56
|
-
gasBudget:
|
|
59
|
+
gasBudget: 1000,
|
|
57
60
|
};
|
|
58
61
|
return [2 /*return*/, tx];
|
|
59
62
|
});
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
exports.
|
|
65
|
+
exports.getNewAuctionTx = getNewAuctionTx;
|
|
63
66
|
/*
|
|
64
|
-
sui client call --gas-budget 1000 --package $PACKAGE --module "
|
|
65
|
-
--type-args 0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC
|
|
66
|
-
--args $VAULT_REGISTRY 1671344789 true 1 10
|
|
67
|
+
sui client call --gas-budget 1000 --package $PACKAGE --module "covered_call" --function "deposit"
|
|
68
|
+
--type-args 0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC --args $VAULT_REGISTRY 1 true $TOKENAID 9999
|
|
67
69
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNewAuctionWithNextCoveredCallVaultTx(packageId: string, managerCap: string, registry: string, typeArgument: string, index: number, start: number, end: number, decay: number, initialPrice: number, finalPrice: number, expiration: number, assetName: string, strikeOtmPct: number, price_oracle: string): Promise<any>;
|
|
@@ -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 (_) 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.getNewAuctionWithNextCoveredCallVaultTx = void 0;
|
|
40
|
+
function getNewAuctionWithNextCoveredCallVaultTx(packageId, managerCap, registry, typeArgument, index, start, end, decay, initialPrice, finalPrice, expiration, assetName, strikeOtmPct, price_oracle) {
|
|
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: 'covered_call',
|
|
47
|
+
function: 'new_auction_with_next_covered_call_vault',
|
|
48
|
+
typeArguments: [typeArgument],
|
|
49
|
+
arguments: [
|
|
50
|
+
managerCap,
|
|
51
|
+
registry,
|
|
52
|
+
index,
|
|
53
|
+
start,
|
|
54
|
+
end,
|
|
55
|
+
decay,
|
|
56
|
+
initialPrice,
|
|
57
|
+
finalPrice,
|
|
58
|
+
expiration,
|
|
59
|
+
assetName,
|
|
60
|
+
strikeOtmPct,
|
|
61
|
+
price_oracle,
|
|
62
|
+
],
|
|
63
|
+
gasBudget: 10000,
|
|
64
|
+
};
|
|
65
|
+
return [2 /*return*/, tx];
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
exports.getNewAuctionWithNextCoveredCallVaultTx = getNewAuctionWithNextCoveredCallVaultTx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNewBidTx(packageId: string, registry: string, typeArgument: string, vaultIndex: number, size: number, coin: string, time: string): Promise<any>;
|
|
@@ -0,0 +1,62 @@
|
|
|
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 (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getNewBidTx = void 0;
|
|
40
|
+
function getNewBidTx(packageId, registry, typeArgument, vaultIndex, size, coin, time) {
|
|
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: 'covered_call',
|
|
47
|
+
function: 'new_bid',
|
|
48
|
+
typeArguments: [typeArgument],
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
vaultIndex,
|
|
52
|
+
size,
|
|
53
|
+
coin,
|
|
54
|
+
time,
|
|
55
|
+
],
|
|
56
|
+
gasBudget: 1000,
|
|
57
|
+
};
|
|
58
|
+
return [2 /*return*/, tx];
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
exports.getNewBidTx = getNewBidTx;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewCoveredCallVaultTx(packageId: string, registry: string, typeArgument: string, managerCap: string, expiration: number, assetName: string, strike: number): Promise<any>;
|
|
1
|
+
export declare function getNewCoveredCallVaultTx(packageId: string, registry: string, typeArgument: string, managerCap: string, expiration: number, assetName: string, strike: number, priceOracle: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getNewCoveredCallVaultTx = void 0;
|
|
40
|
-
function getNewCoveredCallVaultTx(packageId, registry, typeArgument, managerCap, expiration, assetName, strike) {
|
|
40
|
+
function getNewCoveredCallVaultTx(packageId, registry, typeArgument, managerCap, expiration, assetName, strike, priceOracle) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -51,7 +51,8 @@ function getNewCoveredCallVaultTx(packageId, registry, typeArgument, managerCap,
|
|
|
51
51
|
registry,
|
|
52
52
|
expiration,
|
|
53
53
|
assetName,
|
|
54
|
-
strike
|
|
54
|
+
strike,
|
|
55
|
+
priceOracle,
|
|
55
56
|
],
|
|
56
57
|
gasBudget: 10000,
|
|
57
58
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getRemoveBidTx(packageId: string, registry: string, typeArgument: string, index: number, bidIndex: number): Promise<any>;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 (_) 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.getRemoveBidTx = void 0;
|
|
40
|
+
function getRemoveBidTx(packageId, registry, typeArgument, index, bidIndex) {
|
|
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: 'covered_call',
|
|
47
|
+
function: 'remove_bid',
|
|
48
|
+
typeArguments: [typeArgument],
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
index,
|
|
52
|
+
bidIndex,
|
|
53
|
+
],
|
|
54
|
+
gasBudget: 1000,
|
|
55
|
+
};
|
|
56
|
+
return [2 /*return*/, tx];
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
exports.getRemoveBidTx = getRemoveBidTx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getSubscribeTx(packageId: string, registry: string, typeArgument: string, index: number): Promise<any>;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 (_) 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.getSubscribeTx = void 0;
|
|
40
|
+
function getSubscribeTx(packageId, registry, typeArgument, index) {
|
|
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: 'covered_call',
|
|
47
|
+
function: 'subscribe',
|
|
48
|
+
typeArguments: [typeArgument],
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
index,
|
|
52
|
+
],
|
|
53
|
+
gasBudget: 10000,
|
|
54
|
+
};
|
|
55
|
+
return [2 /*return*/, tx];
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
exports.getSubscribeTx = getSubscribeTx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getUnsubscribeTx(packageId: string, registry: string, typeArgument: string, index: number): Promise<any>;
|
|
@@ -36,8 +36,8 @@ 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.getUnsubscribeTx = void 0;
|
|
40
|
+
function getUnsubscribeTx(packageId, registry, typeArgument, index) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -56,7 +56,7 @@ function getCoveredCallUnsubscribeTx(packageId, registry, typeArgument, index) {
|
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
exports.
|
|
59
|
+
exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
60
60
|
/*
|
|
61
61
|
sui client call --package 0x1543511bdce9ea3c401c4939126cea518adee965 --module covered_call --function unsubscribe --type-args 0x2::sui::SUI --args 0xb02452d0bbef3cbdc7840ea5bad27bcdd4031675 0 --gas-budget 100000
|
|
62
62
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getWithdrawTx(packageId: string, registry: string, typeArgument: string, vaultIndex: number, isRolling: Boolean, amount: number): 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 (_) 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.getWithdrawTx = void 0;
|
|
40
|
+
function getWithdrawTx(packageId, registry, typeArgument, vaultIndex, isRolling, amount) {
|
|
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: 'covered_call',
|
|
47
|
+
function: 'withdraw',
|
|
48
|
+
typeArguments: [typeArgument],
|
|
49
|
+
arguments: [
|
|
50
|
+
registry,
|
|
51
|
+
vaultIndex,
|
|
52
|
+
amount,
|
|
53
|
+
isRolling,
|
|
54
|
+
],
|
|
55
|
+
gasBudget: 1000,
|
|
56
|
+
};
|
|
57
|
+
return [2 /*return*/, tx];
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.getWithdrawTx = getWithdrawTx;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface subVaults {
|
|
2
|
+
rolling: string;
|
|
3
|
+
maker: string;
|
|
4
|
+
regular: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function getCoveredCallVaultsFromRegistry(registry: string): Promise<any>;
|
|
7
|
+
export declare function getTableFromCoveredCallVault(coveredCallVault: any): Promise<any>;
|
|
8
|
+
export declare function getSubVaultsFromTable(tableUnderCoveredCallVault: string): Promise<subVaults>;
|
|
9
|
+
export declare function getTableUnderSubVault(subVault: string): Promise<any>;
|
|
10
|
+
export declare function getLinkedListNodesFromTable(table: string): Promise<any[]>;
|
|
11
|
+
export declare function getUserDataFromLinkedListNode(linkedListNode: any): Promise<any[]>;
|