@typus/typus-sdk 1.0.2 → 1.0.4
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 +18 -0
- package/lib/constants.d.ts +26 -0
- package/lib/constants.js +37 -0
- package/lib/scripts/getSubVault.d.ts +0 -0
- package/lib/scripts/getSubVault.js +6 -0
- package/lib/scripts/sui.d.ts +1 -0
- package/lib/scripts/sui.js +174 -0
- package/lib/test/authorized/testAuthorizedNewPortfolioVault.d.ts +1 -0
- package/lib/test/authorized/testAuthorizedNewPortfolioVault.js +82 -0
- package/lib/test/authorized/testAuthorizedUpdateUpcomingVaultConfig.d.ts +1 -0
- package/lib/test/authorized/testAuthorizedUpdateUpcomingVaultConfig.js +71 -0
- package/lib/test/authorized/testAuthorizedUpdateWarmupVaultConfig.d.ts +1 -0
- package/lib/test/authorized/testAuthorizedUpdateWarmupVaultConfig.js +68 -0
- package/lib/test/getBidData.d.ts +1 -0
- package/lib/test/getBidData.js +55 -0
- package/lib/test/getVaultData.d.ts +1 -0
- package/lib/test/getVaultData.js +55 -0
- package/lib/test/getWhiteListFromRegistry.d.ts +1 -0
- package/lib/test/getWhiteListFromRegistry.js +55 -0
- package/lib/test/helper/getAuctionMaxSize.d.ts +1 -0
- package/lib/test/helper/getAuctionMaxSize.js +76 -0
- package/lib/test/helper/getUserStatus.d.ts +1 -0
- package/lib/test/helper/getUserStatus.js +83 -0
- package/lib/test/testCrypto.d.ts +1 -0
- package/lib/test/testCrypto.js +54 -0
- package/lib/test/testMint.d.ts +1 -0
- package/lib/test/testMint.js +137 -0
- package/lib/test/testSDK.d.ts +1 -0
- package/lib/test/testSDK.js +74 -0
- package/lib/test/testSubscribeEvent.d.ts +1 -0
- package/lib/test/testSubscribeEvent.js +97 -0
- package/lib/test/user/testClaim.d.ts +1 -0
- package/lib/test/user/testClaim.js +68 -0
- package/lib/test/user/testCompound.d.ts +1 -0
- package/lib/test/user/testCompound.js +68 -0
- package/lib/test/user/testDeposit.d.ts +1 -0
- package/lib/test/user/testDeposit.js +79 -0
- package/lib/test/user/testHarvest.d.ts +1 -0
- package/lib/test/user/testHarvest.js +68 -0
- package/lib/test/user/testNewBid.d.ts +1 -0
- 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/user/testWithdraw.js +70 -0
- package/lib/utils/auction/getBid.d.ts +3 -0
- package/lib/utils/auction/getBid.js +77 -0
- package/lib/utils/auction/sealedAuction.d.ts +33 -0
- package/lib/utils/auction/sealedAuction.js +64 -0
- package/lib/utils/fetchData.d.ts +95 -0
- package/lib/utils/fetchData.js +38 -0
- package/lib/utils/getMintTx.d.ts +2 -0
- package/lib/utils/getMintTx.js +60 -0
- package/lib/utils/getTypeArgumentFromToken.d.ts +2 -0
- package/lib/utils/getTypeArgumentFromToken.js +74 -0
- package/lib/utils/getVaultData.d.ts +4 -0
- package/lib/utils/getVaultData.js +229 -0
- package/lib/utils/getWhiteListFromRegistry.d.ts +2 -0
- package/lib/utils/getWhiteListFromRegistry.js +75 -0
- 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/getAuthorizedNewPortfolioVaultTx.d.ts +38 -0
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.js +116 -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/getAuthorizedUpdateUpcomingVaultConfigTx.d.ts +4 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.js +70 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.d.ts +1 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.js +64 -0
- package/lib/utils/portfolio/helper/getAuctionMaxSize.d.ts +8 -0
- package/lib/utils/portfolio/helper/getAuctionMaxSize.js +64 -0
- package/lib/utils/portfolio/helper/getUserStatus.d.ts +30 -0
- package/lib/utils/portfolio/helper/getUserStatus.js +100 -0
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.d.ts +8 -0
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.js +67 -0
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +10 -0
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.js +70 -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 +15 -0
- package/lib/utils/portfolio/manager/getEvolutionTx.js +78 -0
- package/lib/utils/portfolio/manager/getNewManagerTx.d.ts +8 -0
- package/lib/utils/portfolio/manager/getNewManagerTx.js +66 -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 +8 -0
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.js +67 -0
- package/lib/utils/portfolio/manager/getRemoveManagerTx.d.ts +6 -0
- package/lib/utils/portfolio/manager/getRemoveManagerTx.js +63 -0
- 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/portfolio/manager/getUpdateCapacityTx.js +61 -0
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.d.ts +10 -0
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.js +66 -0
- package/lib/utils/portfolio/user/getClaimTx.d.ts +10 -0
- package/lib/utils/portfolio/user/getClaimTx.js +66 -0
- package/lib/utils/portfolio/user/getCompoundTx.d.ts +9 -0
- package/lib/utils/portfolio/user/getCompoundTx.js +66 -0
- package/lib/utils/portfolio/user/getDepositTx.d.ts +12 -0
- package/lib/utils/portfolio/user/getDepositTx.js +73 -0
- package/lib/utils/portfolio/user/getHarvestTx.d.ts +10 -0
- package/lib/utils/portfolio/user/getHarvestTx.js +66 -0
- package/lib/utils/portfolio/user/getNewBidTx.d.ts +14 -0
- package/lib/utils/portfolio/user/getNewBidTx.js +77 -0
- package/lib/utils/portfolio/user/getUnsubscribeTx.d.ts +10 -0
- package/lib/utils/portfolio/user/getUnsubscribeTx.js +66 -0
- package/lib/utils/portfolio/user/getWithdrawTx.d.ts +10 -0
- package/lib/utils/portfolio/user/getWithdrawTx.js +67 -0
- package/package.json +2 -2
|
@@ -0,0 +1,66 @@
|
|
|
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.getClaimTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
/**
|
|
42
|
+
public(friend) entry fun claim<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
43
|
+
registry: &mut Registry,
|
|
44
|
+
index: u64,
|
|
45
|
+
ctx: &mut TxContext
|
|
46
|
+
)
|
|
47
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
48
|
+
*/
|
|
49
|
+
function getClaimTx(gasBudget, packageId, module, registry, typeArguments, index) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
var tx, target, txArguments;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
tx = new sui_js_1.TransactionBlock();
|
|
54
|
+
target = "".concat(packageId, "::").concat(module, "::claim");
|
|
55
|
+
txArguments = [tx.pure(registry), tx.pure(index)];
|
|
56
|
+
tx.moveCall({
|
|
57
|
+
target: target,
|
|
58
|
+
typeArguments: typeArguments,
|
|
59
|
+
arguments: txArguments,
|
|
60
|
+
});
|
|
61
|
+
tx.setGasBudget(gasBudget);
|
|
62
|
+
return [2 /*return*/, tx];
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.getClaimTx = getClaimTx;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
public entry fun compound<TOKEN, O_TOKEN>(
|
|
3
|
+
registry: &mut Registry,
|
|
4
|
+
index: u64,
|
|
5
|
+
ctx: &mut TxContext,
|
|
6
|
+
)
|
|
7
|
+
* @param typeArguments [TOKEN, O_TOKEN]
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCompoundTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], index: string): Promise<any>;
|
|
@@ -0,0 +1,66 @@
|
|
|
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.getCompoundTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
/**
|
|
42
|
+
public entry fun compound<TOKEN, O_TOKEN>(
|
|
43
|
+
registry: &mut Registry,
|
|
44
|
+
index: u64,
|
|
45
|
+
ctx: &mut TxContext,
|
|
46
|
+
)
|
|
47
|
+
* @param typeArguments [TOKEN, O_TOKEN]
|
|
48
|
+
*/
|
|
49
|
+
function getCompoundTx(gasBudget, packageId, module, registry, typeArguments, index) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
var tx, target, txArguments;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
tx = new sui_js_1.TransactionBlock();
|
|
54
|
+
target = "".concat(packageId, "::").concat(module, "::compound");
|
|
55
|
+
txArguments = [tx.pure(registry), tx.pure(index)];
|
|
56
|
+
tx.moveCall({
|
|
57
|
+
target: target,
|
|
58
|
+
typeArguments: typeArguments,
|
|
59
|
+
arguments: txArguments,
|
|
60
|
+
});
|
|
61
|
+
tx.setGasBudget(gasBudget);
|
|
62
|
+
return [2 /*return*/, tx];
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.getCompoundTx = getCompoundTx;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js";
|
|
2
|
+
/**
|
|
3
|
+
public(friend) entry fun deposit<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
4
|
+
registry: &mut Registry,
|
|
5
|
+
index: u64,
|
|
6
|
+
coins: vector<Coin<D_TOKEN>>,
|
|
7
|
+
amount: u64,
|
|
8
|
+
ctx: &mut TxContext
|
|
9
|
+
)
|
|
10
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDepositTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], vaultIndex: string, coins: string[], amount: string): Promise<TransactionBlock>;
|
|
@@ -0,0 +1,73 @@
|
|
|
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.getDepositTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
/**
|
|
42
|
+
public(friend) entry fun deposit<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
43
|
+
registry: &mut Registry,
|
|
44
|
+
index: u64,
|
|
45
|
+
coins: vector<Coin<D_TOKEN>>,
|
|
46
|
+
amount: u64,
|
|
47
|
+
ctx: &mut TxContext
|
|
48
|
+
)
|
|
49
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
50
|
+
*/
|
|
51
|
+
function getDepositTx(gasBudget, packageId, module, registry, typeArguments, vaultIndex, coins, amount) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
+
var tx, target, txArguments;
|
|
54
|
+
return __generator(this, function (_a) {
|
|
55
|
+
tx = new sui_js_1.TransactionBlock();
|
|
56
|
+
target = "".concat(packageId, "::").concat(module, "::deposit");
|
|
57
|
+
txArguments = [
|
|
58
|
+
tx.pure(registry),
|
|
59
|
+
tx.pure(vaultIndex),
|
|
60
|
+
tx.pure(coins),
|
|
61
|
+
tx.pure(amount),
|
|
62
|
+
];
|
|
63
|
+
tx.moveCall({
|
|
64
|
+
target: target,
|
|
65
|
+
typeArguments: typeArguments,
|
|
66
|
+
arguments: txArguments,
|
|
67
|
+
});
|
|
68
|
+
tx.setGasBudget(gasBudget);
|
|
69
|
+
return [2 /*return*/, tx];
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
exports.getDepositTx = getDepositTx;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js";
|
|
2
|
+
/**
|
|
3
|
+
public(friend) entry fun harvest<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
4
|
+
registry: &mut Registry,
|
|
5
|
+
index: u64,
|
|
6
|
+
ctx: &mut TxContext
|
|
7
|
+
)
|
|
8
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
9
|
+
*/
|
|
10
|
+
export declare function getHarvestTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], index: string): Promise<TransactionBlock>;
|
|
@@ -0,0 +1,66 @@
|
|
|
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.getHarvestTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
/**
|
|
42
|
+
public(friend) entry fun harvest<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
43
|
+
registry: &mut Registry,
|
|
44
|
+
index: u64,
|
|
45
|
+
ctx: &mut TxContext
|
|
46
|
+
)
|
|
47
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
48
|
+
*/
|
|
49
|
+
function getHarvestTx(gasBudget, packageId, module, registry, typeArguments, index) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
var tx, target, txArguments;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
tx = new sui_js_1.TransactionBlock();
|
|
54
|
+
target = "".concat(packageId, "::").concat(module, "::harvest");
|
|
55
|
+
txArguments = [tx.pure(registry), tx.pure(index)];
|
|
56
|
+
tx.moveCall({
|
|
57
|
+
target: target,
|
|
58
|
+
typeArguments: typeArguments,
|
|
59
|
+
arguments: txArguments,
|
|
60
|
+
});
|
|
61
|
+
tx.setGasBudget(gasBudget);
|
|
62
|
+
return [2 /*return*/, tx];
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.getHarvestTx = getHarvestTx;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js";
|
|
2
|
+
/**
|
|
3
|
+
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
4
|
+
registry: &mut Registry,
|
|
5
|
+
index: u64,
|
|
6
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
7
|
+
time: &Time,
|
|
8
|
+
coins: vector<Coin<B_TOKEN>>,
|
|
9
|
+
size: u64,
|
|
10
|
+
ctx: &mut TxContext,
|
|
11
|
+
)
|
|
12
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
13
|
+
*/
|
|
14
|
+
export declare function getNewBidTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], index: string, priceOracle: string, timeOracle: string, coins: string[], size: string): Promise<TransactionBlock>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getNewBidTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
/**
|
|
42
|
+
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
43
|
+
registry: &mut Registry,
|
|
44
|
+
index: u64,
|
|
45
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
46
|
+
time: &Time,
|
|
47
|
+
coins: vector<Coin<B_TOKEN>>,
|
|
48
|
+
size: u64,
|
|
49
|
+
ctx: &mut TxContext,
|
|
50
|
+
)
|
|
51
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
52
|
+
*/
|
|
53
|
+
function getNewBidTx(gasBudget, packageId, module, registry, typeArguments, index, priceOracle, timeOracle, coins, size) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
+
var tx, target, txArguments;
|
|
56
|
+
return __generator(this, function (_a) {
|
|
57
|
+
tx = new sui_js_1.TransactionBlock();
|
|
58
|
+
target = "".concat(packageId, "::").concat(module, "::new_bid");
|
|
59
|
+
txArguments = [
|
|
60
|
+
tx.pure(registry),
|
|
61
|
+
tx.pure(index),
|
|
62
|
+
tx.pure(priceOracle),
|
|
63
|
+
tx.pure(timeOracle),
|
|
64
|
+
tx.pure(coins),
|
|
65
|
+
tx.pure(size),
|
|
66
|
+
];
|
|
67
|
+
tx.moveCall({
|
|
68
|
+
target: target,
|
|
69
|
+
typeArguments: typeArguments,
|
|
70
|
+
arguments: txArguments,
|
|
71
|
+
});
|
|
72
|
+
tx.setGasBudget(gasBudget);
|
|
73
|
+
return [2 /*return*/, tx];
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
exports.getNewBidTx = getNewBidTx;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js"; /**
|
|
2
|
+
public(friend) entry fun unsubscribe<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
3
|
+
registry: &mut Registry,
|
|
4
|
+
index: u64,
|
|
5
|
+
share: Option<u64>,
|
|
6
|
+
ctx: &mut TxContext
|
|
7
|
+
)
|
|
8
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
9
|
+
*/
|
|
10
|
+
export declare function getUnsubscribeTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], index: string, share: string[]): Promise<TransactionBlock>;
|
|
@@ -0,0 +1,66 @@
|
|
|
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.getUnsubscribeTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js"); /**
|
|
41
|
+
public(friend) entry fun unsubscribe<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
42
|
+
registry: &mut Registry,
|
|
43
|
+
index: u64,
|
|
44
|
+
share: Option<u64>,
|
|
45
|
+
ctx: &mut TxContext
|
|
46
|
+
)
|
|
47
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
48
|
+
*/
|
|
49
|
+
function getUnsubscribeTx(gasBudget, packageId, module, registry, typeArguments, index, share) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
var tx, target, txArguments;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
tx = new sui_js_1.TransactionBlock();
|
|
54
|
+
target = "".concat(packageId, "::").concat(module, "::unsubscribe");
|
|
55
|
+
txArguments = [tx.pure(registry), tx.pure(index), tx.pure(share)];
|
|
56
|
+
tx.moveCall({
|
|
57
|
+
target: target,
|
|
58
|
+
typeArguments: typeArguments,
|
|
59
|
+
arguments: txArguments,
|
|
60
|
+
});
|
|
61
|
+
tx.setGasBudget(gasBudget);
|
|
62
|
+
return [2 /*return*/, tx];
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
public(friend) entry fun withdraw<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
3
|
+
registry: &mut Registry,
|
|
4
|
+
index: u64,
|
|
5
|
+
share: Option<u64>,
|
|
6
|
+
ctx: &mut TxContext
|
|
7
|
+
)
|
|
8
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
9
|
+
*/
|
|
10
|
+
export declare function getWithdrawTx(gasBudget: number, packageId: string, module: string, registry: string, typeArguments: string[], vaultIndex: string, share: string[]): Promise<any>;
|
|
@@ -0,0 +1,67 @@
|
|
|
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.getWithdrawTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
/**
|
|
42
|
+
public(friend) entry fun withdraw<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
43
|
+
registry: &mut Registry,
|
|
44
|
+
index: u64,
|
|
45
|
+
share: Option<u64>,
|
|
46
|
+
ctx: &mut TxContext
|
|
47
|
+
)
|
|
48
|
+
* @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
|
|
49
|
+
*/
|
|
50
|
+
function getWithdrawTx(gasBudget, packageId, module, registry, typeArguments, vaultIndex, share) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
+
var tx, target, txArguments;
|
|
53
|
+
return __generator(this, function (_a) {
|
|
54
|
+
tx = new sui_js_1.TransactionBlock();
|
|
55
|
+
target = "".concat(packageId, "::").concat(module, "::withdraw");
|
|
56
|
+
txArguments = [tx.pure(registry), tx.pure(vaultIndex), tx.pure(share)];
|
|
57
|
+
tx.moveCall({
|
|
58
|
+
target: target,
|
|
59
|
+
typeArguments: typeArguments,
|
|
60
|
+
arguments: txArguments,
|
|
61
|
+
});
|
|
62
|
+
tx.setGasBudget(gasBudget);
|
|
63
|
+
return [2 /*return*/, tx];
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
exports.getWithdrawTx = getWithdrawTx;
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@typus/typus-sdk",
|
|
3
3
|
"author": "Typus",
|
|
4
4
|
"description": "typus sdk",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.4",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@mysten/sui.js": "^0.
|
|
7
|
+
"@mysten/sui.js": "^0.30.0",
|
|
8
8
|
"@types/node": "^17.0.0",
|
|
9
9
|
"bignumber.js": "^9.1.1",
|
|
10
10
|
"bs58": "^4.0.1",
|