@typus/typus-sdk 1.0.114 → 1.0.115
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 +2 -2
- package/lib/utils/nft-staking/user-entry.d.ts +1 -0
- package/lib/utils/nft-staking/user-entry.js +17 -1
- package/lib/utils/typus-dov-single/user-entry.d.ts +7 -0
- package/lib/utils/typus-dov-single/user-entry.js +26 -1
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +15 -3
- package/lib/utils/typus-dov-single-v2/user-entry.js +42 -36
- package/package.json +1 -1
package/lib/config.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"VERSION": "3.1.
|
|
2
|
+
"VERSION": "3.1.2",
|
|
3
3
|
"DB_NAME": "testnet_3_0_0",
|
|
4
4
|
"RPC_ENDPOINT": "https://api.shinami.com:443/node/v1/sui_testnet_c702de54dad05016124f2cfabc1de7e8",
|
|
5
5
|
"sponsorApi": "https://northamerica-northeast1-aqueous-freedom-378103.cloudfunctions.net/sponsor-testnet",
|
|
6
|
-
"SINGLE_COLLATERAL_PACKAGE": "
|
|
6
|
+
"SINGLE_COLLATERAL_PACKAGE": "0x207c93e1b13f1dfbca196f5756a6d413c487c04b35f69c29efe2981809c42258",
|
|
7
7
|
"SINGLE_COLLATERAL_PACKAGE_ORIGIN": "0x0334a2ae4b0c5cd007d3bf44925975726b94c1061eb45d660e8b79ec91c0599e",
|
|
8
8
|
"SINGLE_COLLATERAL_MANAGER_CAP": "0xdc092ced3f08dc31cbbdaa584a937d4e54555cb47a1dca1d756560809d92c0ba",
|
|
9
9
|
"SINGLE_COLLATERAL_REGISTRY": "0xcb757bd17a8daa75c2b12a5c5f19bd88e7e2e96b8a220bbe4cf0605affea7475",
|
|
@@ -52,6 +52,7 @@ export declare function getSnapshotTx(gasBudget: number, nftPackageId: string, r
|
|
|
52
52
|
export declare function getNewBidTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, priceOracle: string, coins: string[], size: string, premium_required: string, // fe float * b_token_decimal
|
|
53
53
|
usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
54
54
|
export declare function getDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, coins: string[], amount: string, usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
55
|
+
export declare function getCompoundTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
55
56
|
export declare function getWithdrawTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, share?: string): Promise<TransactionBlock>;
|
|
56
57
|
export declare function getUnsubscribeTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, share?: string): Promise<TransactionBlock>;
|
|
57
58
|
/**
|
|
@@ -52,7 +52,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.getLevelUpTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = exports.getNewBidTx = exports.getSnapshotTx = exports.getDailyAttendTx = exports.getUnstakeNftTx = exports.getCreateKioskAndLockNftTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
|
|
55
|
+
exports.getLevelUpTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getCompoundTx = exports.getDepositTx = exports.getNewBidTx = exports.getSnapshotTx = exports.getDailyAttendTx = exports.getUnstakeNftTx = exports.getCreateKioskAndLockNftTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
|
|
56
56
|
var sui_js_1 = require("@mysten/sui.js");
|
|
57
57
|
var constants_1 = require("../../constants");
|
|
58
58
|
var kiosk_1 = require("@mysten/kiosk");
|
|
@@ -316,6 +316,22 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, additional_
|
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
318
|
exports.getDepositTx = getDepositTx;
|
|
319
|
+
function getCompoundTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
320
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
321
|
+
var tx;
|
|
322
|
+
return __generator(this, function (_a) {
|
|
323
|
+
tx = new sui_js_1.TransactionBlock();
|
|
324
|
+
tx.moveCall({
|
|
325
|
+
target: "".concat(packageId, "::tails_staking::compound"),
|
|
326
|
+
typeArguments: typeArguments,
|
|
327
|
+
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index), tx.object(constants_1.CLOCK)],
|
|
328
|
+
});
|
|
329
|
+
tx.setGasBudget(gasBudget);
|
|
330
|
+
return [2 /*return*/, tx];
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
exports.getCompoundTx = getCompoundTx;
|
|
319
335
|
function getWithdrawTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, share) {
|
|
320
336
|
return __awaiter(this, void 0, void 0, function () {
|
|
321
337
|
var tx;
|
|
@@ -33,6 +33,13 @@ export declare function getBatchClaimTx(gasBudget: number, packageId: string, re
|
|
|
33
33
|
typeArguments: string[];
|
|
34
34
|
index: string;
|
|
35
35
|
}]): Promise<TransactionBlock>;
|
|
36
|
+
export declare function getBatchClaimHarvestTx(gasBudget: number, packageId: string, registry: string, additional_config_registry: string, claimRequests: [{
|
|
37
|
+
typeArguments: string[];
|
|
38
|
+
index: string;
|
|
39
|
+
}], harvestRequests: [{
|
|
40
|
+
typeArguments: string[];
|
|
41
|
+
index: string;
|
|
42
|
+
}]): Promise<TransactionBlock>;
|
|
36
43
|
/**
|
|
37
44
|
public(friend) entry fun harvest<TOKEN>(
|
|
38
45
|
registry: &mut Registry,
|
|
@@ -52,7 +52,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.getNewBidTx = exports.getUnsubscribeTx = exports.getCompoundTx = exports.getClaimAndHarvestTx = exports.getHarvestTx = exports.getBatchClaimTx = exports.getClaimTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
55
|
+
exports.getNewBidTx = exports.getUnsubscribeTx = exports.getCompoundTx = exports.getClaimAndHarvestTx = exports.getHarvestTx = exports.getBatchClaimHarvestTx = exports.getBatchClaimTx = exports.getClaimTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
56
56
|
var sui_js_1 = require("@mysten/sui.js");
|
|
57
57
|
/**
|
|
58
58
|
public(friend) entry fun deposit<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
@@ -172,6 +172,31 @@ function getBatchClaimTx(gasBudget, packageId, registry, additional_config_regis
|
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
exports.getBatchClaimTx = getBatchClaimTx;
|
|
175
|
+
function getBatchClaimHarvestTx(gasBudget, packageId, registry, additional_config_registry, claimRequests, harvestRequests) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
177
|
+
var tx;
|
|
178
|
+
return __generator(this, function (_a) {
|
|
179
|
+
tx = new sui_js_1.TransactionBlock();
|
|
180
|
+
claimRequests.forEach(function (request) {
|
|
181
|
+
tx.moveCall({
|
|
182
|
+
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
183
|
+
typeArguments: request.typeArguments,
|
|
184
|
+
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(request.index)],
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
harvestRequests.forEach(function (request) {
|
|
188
|
+
tx.moveCall({
|
|
189
|
+
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
190
|
+
typeArguments: request.typeArguments,
|
|
191
|
+
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(request.index)],
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
tx.setGasBudget(gasBudget);
|
|
195
|
+
return [2 /*return*/, tx];
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
exports.getBatchClaimHarvestTx = getBatchClaimHarvestTx;
|
|
175
200
|
/**
|
|
176
201
|
public(friend) entry fun harvest<TOKEN>(
|
|
177
202
|
registry: &mut Registry,
|
|
@@ -38,7 +38,11 @@ export declare function getUnsubscribeTx(gasBudget: number, typusFrameworkPackag
|
|
|
38
38
|
ctx: &mut TxContext,
|
|
39
39
|
)
|
|
40
40
|
*/
|
|
41
|
-
export declare function getClaimTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string,
|
|
41
|
+
export declare function getClaimTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, registry: string, requests: [{
|
|
42
|
+
typeArguments: string[];
|
|
43
|
+
index: string;
|
|
44
|
+
receipts: string[];
|
|
45
|
+
}]): Promise<TransactionBlock>;
|
|
42
46
|
/**
|
|
43
47
|
public(friend) entry fun harvest<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
44
48
|
registry: &mut Registry,
|
|
@@ -47,7 +51,11 @@ export declare function getClaimTx(gasBudget: number, typusFrameworkPackageId: s
|
|
|
47
51
|
ctx: &mut TxContext,
|
|
48
52
|
)
|
|
49
53
|
*/
|
|
50
|
-
export declare function getHarvestTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string,
|
|
54
|
+
export declare function getHarvestTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, registry: string, requests: [{
|
|
55
|
+
typeArguments: string[];
|
|
56
|
+
index: string;
|
|
57
|
+
receipts: string[];
|
|
58
|
+
}]): Promise<TransactionBlock>;
|
|
51
59
|
/**
|
|
52
60
|
public(friend) entry fun compound<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
53
61
|
registry: &mut Registry,
|
|
@@ -56,7 +64,11 @@ export declare function getHarvestTx(gasBudget: number, typusFrameworkPackageId:
|
|
|
56
64
|
ctx: &mut TxContext,
|
|
57
65
|
)
|
|
58
66
|
*/
|
|
59
|
-
export declare function getCompoundTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string,
|
|
67
|
+
export declare function getCompoundTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, registry: string, requests: [{
|
|
68
|
+
typeArguments: string[];
|
|
69
|
+
index: string;
|
|
70
|
+
receipts: string[];
|
|
71
|
+
}]): Promise<TransactionBlock>;
|
|
60
72
|
/**
|
|
61
73
|
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
62
74
|
registry: &mut Registry,
|
|
@@ -185,22 +185,24 @@ exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
|
185
185
|
ctx: &mut TxContext,
|
|
186
186
|
)
|
|
187
187
|
*/
|
|
188
|
-
function getClaimTx(gasBudget, typusFrameworkPackageId, packageId,
|
|
188
|
+
function getClaimTx(gasBudget, typusFrameworkPackageId, packageId, registry, requests) {
|
|
189
189
|
return __awaiter(this, void 0, void 0, function () {
|
|
190
190
|
var tx;
|
|
191
191
|
return __generator(this, function (_a) {
|
|
192
192
|
tx = new sui_js_1.TransactionBlock();
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
193
|
+
requests.forEach(function (request) {
|
|
194
|
+
tx.moveCall({
|
|
195
|
+
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
196
|
+
typeArguments: request.typeArguments,
|
|
197
|
+
arguments: [
|
|
198
|
+
tx.pure(registry),
|
|
199
|
+
tx.pure(request.index),
|
|
200
|
+
tx.makeMoveVec({
|
|
201
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
202
|
+
objects: request.receipts.map(function (id) { return tx.object(id); }),
|
|
203
|
+
}),
|
|
204
|
+
],
|
|
205
|
+
});
|
|
204
206
|
});
|
|
205
207
|
tx.setGasBudget(gasBudget);
|
|
206
208
|
return [2 /*return*/, tx];
|
|
@@ -216,22 +218,24 @@ exports.getClaimTx = getClaimTx;
|
|
|
216
218
|
ctx: &mut TxContext,
|
|
217
219
|
)
|
|
218
220
|
*/
|
|
219
|
-
function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId,
|
|
221
|
+
function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId, registry, requests) {
|
|
220
222
|
return __awaiter(this, void 0, void 0, function () {
|
|
221
223
|
var tx;
|
|
222
224
|
return __generator(this, function (_a) {
|
|
223
225
|
tx = new sui_js_1.TransactionBlock();
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
226
|
+
requests.forEach(function (request) {
|
|
227
|
+
tx.moveCall({
|
|
228
|
+
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
229
|
+
typeArguments: request.typeArguments,
|
|
230
|
+
arguments: [
|
|
231
|
+
tx.pure(registry),
|
|
232
|
+
tx.pure(request.index),
|
|
233
|
+
tx.makeMoveVec({
|
|
234
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
235
|
+
objects: request.receipts.map(function (id) { return tx.object(id); }),
|
|
236
|
+
}),
|
|
237
|
+
],
|
|
238
|
+
});
|
|
235
239
|
});
|
|
236
240
|
tx.setGasBudget(gasBudget);
|
|
237
241
|
return [2 /*return*/, tx];
|
|
@@ -247,22 +251,24 @@ exports.getHarvestTx = getHarvestTx;
|
|
|
247
251
|
ctx: &mut TxContext,
|
|
248
252
|
)
|
|
249
253
|
*/
|
|
250
|
-
function getCompoundTx(gasBudget, typusFrameworkPackageId, packageId,
|
|
254
|
+
function getCompoundTx(gasBudget, typusFrameworkPackageId, packageId, registry, requests) {
|
|
251
255
|
return __awaiter(this, void 0, void 0, function () {
|
|
252
256
|
var tx;
|
|
253
257
|
return __generator(this, function (_a) {
|
|
254
258
|
tx = new sui_js_1.TransactionBlock();
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
259
|
+
requests.forEach(function (request) {
|
|
260
|
+
tx.moveCall({
|
|
261
|
+
target: "".concat(packageId, "::typus_dov_single::compound"),
|
|
262
|
+
typeArguments: request.typeArguments,
|
|
263
|
+
arguments: [
|
|
264
|
+
tx.pure(registry),
|
|
265
|
+
tx.pure(request.index),
|
|
266
|
+
tx.makeMoveVec({
|
|
267
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
268
|
+
objects: request.receipts.map(function (id) { return tx.object(id); }),
|
|
269
|
+
}),
|
|
270
|
+
],
|
|
271
|
+
});
|
|
266
272
|
});
|
|
267
273
|
tx.setGasBudget(gasBudget);
|
|
268
274
|
return [2 /*return*/, tx];
|