@typus/typus-sdk 1.1.38 → 1.1.40
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 +2 -2
- package/lib/constants.js +3 -4
- package/lib/utils/mint.d.ts +1 -1
- package/lib/utils/mint.js +2 -2
- package/lib/utils/nft-staking/authorized-entry.d.ts +1 -1
- package/lib/utils/nft-staking/authorized-entry.js +4 -4
- package/lib/utils/nft-staking/fetch.d.ts +2 -2
- package/lib/utils/nft-staking/user-entry.d.ts +6 -4
- package/lib/utils/nft-staking/user-entry.js +47 -35
- package/lib/utils/tails-exp-dice/fetch.d.ts +4 -4
- package/lib/utils/tails-exp-dice/user-entry.d.ts +1 -1
- package/lib/utils/tails-exp-dice/user-entry.js +4 -4
- package/lib/utils/token.js +2 -2
- package/lib/utils/typus-dov-double/authorized-entry.d.ts +1 -1
- package/lib/utils/typus-dov-double/authorized-entry.js +8 -8
- package/lib/utils/typus-dov-double/manager-entry.d.ts +1 -1
- package/lib/utils/typus-dov-double/manager-entry.js +19 -19
- package/lib/utils/typus-dov-double/portfolio-vault.d.ts +2 -2
- package/lib/utils/typus-dov-double/portfolio-vault.js +6 -2
- package/lib/utils/typus-dov-double/user-entry.d.ts +1 -1
- package/lib/utils/typus-dov-double/user-entry.js +10 -10
- package/lib/utils/typus-dov-double/view-function.d.ts +4 -4
- package/lib/utils/typus-dov-double/view-function.js +4 -4
- package/lib/utils/typus-dov-single/portfolio-vault.d.ts +3 -3
- package/lib/utils/typus-dov-single/registry.d.ts +3 -3
- package/lib/utils/typus-dov-single/user-entry.d.ts +1 -1
- package/lib/utils/typus-dov-single/user-entry.js +12 -12
- package/lib/utils/typus-dov-single/user-history.d.ts +2 -2
- package/lib/utils/typus-dov-single/view-function.d.ts +8 -8
- package/lib/utils/typus-dov-single/view-function.js +8 -8
- package/lib/utils/typus-dov-single-v2/authorized-entry.d.ts +1 -1
- package/lib/utils/typus-dov-single-v2/authorized-entry.js +3 -3
- package/lib/utils/typus-dov-single-v2/leaderboard.d.ts +4 -16
- package/lib/utils/typus-dov-single-v2/leaderboard.js +12 -0
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +14 -1
- package/lib/utils/typus-dov-single-v2/user-entry.js +67 -12
- package/lib/utils/typus-dov-single-v2/user-history.d.ts +2 -2
- package/lib/utils/typus-dov-single-v2/view-function.d.ts +7 -7
- package/lib/utils/typus-dov-single-v2/view-function.js +7 -7
- package/lib/utils/typus-framework/dutch.d.ts +2 -2
- package/lib/utils/typus-nft/fetch.d.ts +6 -6
- package/lib/utils/typus-nft/fetch.js +8 -4
- package/lib/utils/typus-nft/user-entry.d.ts +1 -1
- package/lib/utils/typus-nft/user-entry.js +3 -3
- package/package.json +3 -3
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
export declare function getDb(startTs: any, endTs: any): Promise<any>;
|
|
3
3
|
export declare function getUsersTvl(startTs: any, endTs: any): Promise<Map<string, number>>;
|
|
4
|
-
export declare function getUsersBidEvents(provider:
|
|
5
|
-
id: {
|
|
6
|
-
txDigest: string;
|
|
7
|
-
eventSeq: string;
|
|
8
|
-
};
|
|
9
|
-
packageId: string;
|
|
10
|
-
transactionModule: string;
|
|
11
|
-
sender: string;
|
|
12
|
-
type: string;
|
|
13
|
-
parsedJson?: Record<string, any> | undefined;
|
|
14
|
-
bcs?: string | undefined;
|
|
15
|
-
timestampMs?: string | undefined;
|
|
16
|
-
}[]>;
|
|
4
|
+
export declare function getUsersBidEvents(provider: SuiClient, originPackage: string, startTs?: number): Promise<import("@mysten/sui.js/client").SuiEvent[]>;
|
|
17
5
|
export declare function sumUsersBidPremium(datas: any, vaultIndexes?: string[], startTs?: number, endTs?: number): Promise<Map<string, number>>;
|
|
18
|
-
export declare function getSuiNS(provider:
|
|
19
|
-
export declare function getUsersHarvestCompound(provider:
|
|
6
|
+
export declare function getSuiNS(provider: SuiClient, address: string): Promise<string>;
|
|
7
|
+
export declare function getUsersHarvestCompound(provider: SuiClient, originPackage: string, startTs?: number, endTs?: number): Promise<Map<string, number>>;
|
|
@@ -223,17 +223,23 @@ function getUsersHarvestCompound(provider, originPackage, startTs, endTs) {
|
|
|
223
223
|
result.data.forEach(function (data) {
|
|
224
224
|
if (Number(data.timestampMs) / 1000 < endTs) {
|
|
225
225
|
var parsedJson = data.parsedJson;
|
|
226
|
+
// @ts-ignore
|
|
226
227
|
var amount = Number(parsedJson.amount) / Math.pow(10, Number(parsedJson.decimal));
|
|
228
|
+
// @ts-ignore
|
|
227
229
|
var price = Number(parsedJson.oracle_info.price) / Math.pow(10, Number(parsedJson.oracle_info.decimal));
|
|
230
|
+
// @ts-ignore
|
|
228
231
|
var asset = (0, token_1.typeArgToAsset)("0x" + parsedJson.token.name);
|
|
229
232
|
if (asset.startsWith("USD")) {
|
|
230
233
|
price = 1;
|
|
231
234
|
}
|
|
232
235
|
var acc = 0;
|
|
236
|
+
// @ts-ignore
|
|
233
237
|
if (usersHarvestCompound.has(parsedJson.signer)) {
|
|
238
|
+
// @ts-ignore
|
|
234
239
|
acc = usersHarvestCompound.get(parsedJson.signer);
|
|
235
240
|
}
|
|
236
241
|
acc += amount * price;
|
|
242
|
+
// @ts-ignore
|
|
237
243
|
usersHarvestCompound.set(parsedJson.signer, acc);
|
|
238
244
|
}
|
|
239
245
|
});
|
|
@@ -260,17 +266,23 @@ function getUsersHarvestCompound(provider, originPackage, startTs, endTs) {
|
|
|
260
266
|
result.data.forEach(function (data) {
|
|
261
267
|
if (Number(data.timestampMs) / 1000 < endTs) {
|
|
262
268
|
var parsedJson = data.parsedJson;
|
|
269
|
+
// @ts-ignore
|
|
263
270
|
var amount = Number(parsedJson.amount) / Math.pow(10, Number(parsedJson.decimal));
|
|
271
|
+
// @ts-ignore
|
|
264
272
|
var price = Number(parsedJson.oracle_info.price) / Math.pow(10, Number(parsedJson.oracle_info.decimal));
|
|
273
|
+
// @ts-ignore
|
|
265
274
|
var asset = (0, token_1.typeArgToAsset)("0x" + parsedJson.token.name);
|
|
266
275
|
if (asset.startsWith("USD")) {
|
|
267
276
|
price = 1;
|
|
268
277
|
}
|
|
269
278
|
var acc = 0;
|
|
279
|
+
// @ts-ignore
|
|
270
280
|
if (usersHarvestCompound.has(parsedJson.signer)) {
|
|
281
|
+
// @ts-ignore
|
|
271
282
|
acc = usersHarvestCompound.get(parsedJson.signer);
|
|
272
283
|
}
|
|
273
284
|
acc += amount * price;
|
|
285
|
+
// @ts-ignore
|
|
274
286
|
usersHarvestCompound.set(parsedJson.signer, acc);
|
|
275
287
|
}
|
|
276
288
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionBlock } from "@mysten/sui.js";
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
2
|
/**
|
|
3
3
|
public(friend) entry fun deposit<D_TOKEN, B_TOKEN>(
|
|
4
4
|
registry: &mut Registry,
|
|
@@ -56,6 +56,19 @@ export declare function getHarvestTx(gasBudget: number, typusFrameworkPackageId:
|
|
|
56
56
|
index: string;
|
|
57
57
|
receipts: string[];
|
|
58
58
|
}[]): Promise<TransactionBlock>;
|
|
59
|
+
export declare function getBatchClaimHarvestWithdrawTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, registry: string, claimRequests: {
|
|
60
|
+
typeArguments: string[];
|
|
61
|
+
index: string;
|
|
62
|
+
receipts: string[];
|
|
63
|
+
}[], harvestRequests: {
|
|
64
|
+
typeArguments: string[];
|
|
65
|
+
index: string;
|
|
66
|
+
receipts: string[];
|
|
67
|
+
}[], withdrawRequests: {
|
|
68
|
+
typeArguments: string[];
|
|
69
|
+
index: string;
|
|
70
|
+
receipts: string[];
|
|
71
|
+
}[]): Promise<TransactionBlock>;
|
|
59
72
|
/**
|
|
60
73
|
public(friend) entry fun compound<D_TOKEN, B_TOKEN>(
|
|
61
74
|
registry: &mut Registry,
|
|
@@ -52,8 +52,8 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.getRebateTx = exports.getExerciseTx = exports.getTransferBidReceiptTx = exports.getNewBidTx = exports.getCompoundTx = exports.getHarvestTx = exports.getClaimTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
56
|
-
var
|
|
55
|
+
exports.getRebateTx = exports.getExerciseTx = exports.getTransferBidReceiptTx = exports.getNewBidTx = exports.getCompoundTx = exports.getBatchClaimHarvestWithdrawTx = exports.getHarvestTx = exports.getClaimTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
56
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
57
|
var constants_1 = require("../../constants");
|
|
58
58
|
/**
|
|
59
59
|
public(friend) entry fun deposit<D_TOKEN, B_TOKEN>(
|
|
@@ -70,7 +70,7 @@ function getDepositTx(gasBudget, typusFrameworkPackageId, packageId, typeArgumen
|
|
|
70
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
71
71
|
var tx, _a, coin;
|
|
72
72
|
return __generator(this, function (_b) {
|
|
73
|
-
tx = new
|
|
73
|
+
tx = new transactions_1.TransactionBlock();
|
|
74
74
|
if (!usingSponsoredGasCoin &&
|
|
75
75
|
(typeArguments[0] == "0x2::sui::SUI" ||
|
|
76
76
|
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
@@ -127,7 +127,7 @@ function getWithdrawTx(gasBudget, typusFrameworkPackageId, packageId, typeArgume
|
|
|
127
127
|
return __awaiter(this, void 0, void 0, function () {
|
|
128
128
|
var tx;
|
|
129
129
|
return __generator(this, function (_a) {
|
|
130
|
-
tx = new
|
|
130
|
+
tx = new transactions_1.TransactionBlock();
|
|
131
131
|
tx.moveCall({
|
|
132
132
|
target: "".concat(packageId, "::tails_staking::withdraw"),
|
|
133
133
|
typeArguments: typeArguments,
|
|
@@ -161,7 +161,7 @@ function getUnsubscribeTx(gasBudget, typusFrameworkPackageId, packageId, typeArg
|
|
|
161
161
|
return __awaiter(this, void 0, void 0, function () {
|
|
162
162
|
var tx;
|
|
163
163
|
return __generator(this, function (_a) {
|
|
164
|
-
tx = new
|
|
164
|
+
tx = new transactions_1.TransactionBlock();
|
|
165
165
|
tx.moveCall({
|
|
166
166
|
target: "".concat(packageId, "::tails_staking::unsubscribe"),
|
|
167
167
|
typeArguments: typeArguments,
|
|
@@ -194,7 +194,7 @@ function getClaimTx(gasBudget, typusFrameworkPackageId, packageId, registry, req
|
|
|
194
194
|
return __awaiter(this, void 0, void 0, function () {
|
|
195
195
|
var tx;
|
|
196
196
|
return __generator(this, function (_a) {
|
|
197
|
-
tx = new
|
|
197
|
+
tx = new transactions_1.TransactionBlock();
|
|
198
198
|
requests.forEach(function (request) {
|
|
199
199
|
tx.moveCall({
|
|
200
200
|
target: "".concat(packageId, "::tds_user_entry::claim"),
|
|
@@ -227,7 +227,7 @@ function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId, registry, r
|
|
|
227
227
|
return __awaiter(this, void 0, void 0, function () {
|
|
228
228
|
var tx;
|
|
229
229
|
return __generator(this, function (_a) {
|
|
230
|
-
tx = new
|
|
230
|
+
tx = new transactions_1.TransactionBlock();
|
|
231
231
|
requests.forEach(function (request) {
|
|
232
232
|
tx.moveCall({
|
|
233
233
|
target: "".concat(packageId, "::tds_user_entry::harvest"),
|
|
@@ -248,6 +248,61 @@ function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId, registry, r
|
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
exports.getHarvestTx = getHarvestTx;
|
|
251
|
+
function getBatchClaimHarvestWithdrawTx(gasBudget, typusFrameworkPackageId, packageId, registry, claimRequests, harvestRequests, withdrawRequests) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
253
|
+
var tx;
|
|
254
|
+
return __generator(this, function (_a) {
|
|
255
|
+
tx = new transactions_1.TransactionBlock();
|
|
256
|
+
claimRequests.forEach(function (request) {
|
|
257
|
+
tx.moveCall({
|
|
258
|
+
target: "".concat(packageId, "::tds_user_entry::claim"),
|
|
259
|
+
typeArguments: request.typeArguments,
|
|
260
|
+
arguments: [
|
|
261
|
+
tx.object(registry),
|
|
262
|
+
tx.pure(request.index),
|
|
263
|
+
tx.makeMoveVec({
|
|
264
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
265
|
+
objects: request.receipts.map(function (id) { return tx.object(id); }),
|
|
266
|
+
}),
|
|
267
|
+
],
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
harvestRequests.forEach(function (request) {
|
|
271
|
+
tx.moveCall({
|
|
272
|
+
target: "".concat(packageId, "::tds_user_entry::harvest"),
|
|
273
|
+
typeArguments: request.typeArguments,
|
|
274
|
+
arguments: [
|
|
275
|
+
tx.object(registry),
|
|
276
|
+
tx.pure(request.index),
|
|
277
|
+
tx.makeMoveVec({
|
|
278
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
279
|
+
objects: request.receipts.map(function (id) { return tx.object(id); }),
|
|
280
|
+
}),
|
|
281
|
+
],
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
withdrawRequests.forEach(function (request) {
|
|
285
|
+
tx.moveCall({
|
|
286
|
+
target: "".concat(packageId, "::tails_staking::withdraw"),
|
|
287
|
+
typeArguments: request.typeArguments,
|
|
288
|
+
arguments: [
|
|
289
|
+
tx.object(registry),
|
|
290
|
+
tx.pure(request.index),
|
|
291
|
+
tx.makeMoveVec({
|
|
292
|
+
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
293
|
+
objects: request.receipts.map(function (id) { return tx.object(id); }),
|
|
294
|
+
}),
|
|
295
|
+
tx.pure([]),
|
|
296
|
+
tx.pure(constants_1.CLOCK),
|
|
297
|
+
],
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
tx.setGasBudget(gasBudget);
|
|
301
|
+
return [2 /*return*/, tx];
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
exports.getBatchClaimHarvestWithdrawTx = getBatchClaimHarvestWithdrawTx;
|
|
251
306
|
/**
|
|
252
307
|
public(friend) entry fun compound<D_TOKEN, B_TOKEN>(
|
|
253
308
|
registry: &mut Registry,
|
|
@@ -260,7 +315,7 @@ function getCompoundTx(gasBudget, typusFrameworkPackageId, packageId, registry,
|
|
|
260
315
|
return __awaiter(this, void 0, void 0, function () {
|
|
261
316
|
var tx;
|
|
262
317
|
return __generator(this, function (_a) {
|
|
263
|
-
tx = new
|
|
318
|
+
tx = new transactions_1.TransactionBlock();
|
|
264
319
|
requests.forEach(function (request) {
|
|
265
320
|
tx.moveCall({
|
|
266
321
|
target: "".concat(packageId, "::tails_staking::compound"),
|
|
@@ -298,7 +353,7 @@ usingSponsoredGasCoin) {
|
|
|
298
353
|
return __awaiter(this, void 0, void 0, function () {
|
|
299
354
|
var tx, _a, coin;
|
|
300
355
|
return __generator(this, function (_b) {
|
|
301
|
-
tx = new
|
|
356
|
+
tx = new transactions_1.TransactionBlock();
|
|
302
357
|
if (!usingSponsoredGasCoin &&
|
|
303
358
|
(typeArguments[1] == "0x2::sui::SUI" ||
|
|
304
359
|
typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
@@ -342,7 +397,7 @@ function getTransferBidReceiptTx(input) {
|
|
|
342
397
|
return __awaiter(this, void 0, void 0, function () {
|
|
343
398
|
var tx;
|
|
344
399
|
return __generator(this, function (_a) {
|
|
345
|
-
tx = new
|
|
400
|
+
tx = new transactions_1.TransactionBlock();
|
|
346
401
|
tx.moveCall({
|
|
347
402
|
target: "".concat(input.packageId, "::tds_user_entry::transfer_bid_receipt"),
|
|
348
403
|
typeArguments: input.typeArguments,
|
|
@@ -375,7 +430,7 @@ function getExerciseTx(gasBudget, typusFrameworkPackageId, packageId, registry,
|
|
|
375
430
|
return __awaiter(this, void 0, void 0, function () {
|
|
376
431
|
var tx;
|
|
377
432
|
return __generator(this, function (_a) {
|
|
378
|
-
tx = new
|
|
433
|
+
tx = new transactions_1.TransactionBlock();
|
|
379
434
|
requests.forEach(function (request) {
|
|
380
435
|
tx.moveCall({
|
|
381
436
|
target: "".concat(packageId, "::tds_user_entry::exercise"),
|
|
@@ -406,7 +461,7 @@ function getRebateTx(gasBudget, packageId, typeArguments, registry) {
|
|
|
406
461
|
return __awaiter(this, void 0, void 0, function () {
|
|
407
462
|
var tx;
|
|
408
463
|
return __generator(this, function (_a) {
|
|
409
|
-
tx = new
|
|
464
|
+
tx = new transactions_1.TransactionBlock();
|
|
410
465
|
typeArguments.forEach(function (typeArgument) {
|
|
411
466
|
tx.moveCall({
|
|
412
467
|
target: "".concat(packageId, "::tds_user_entry::rebate"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
import { Vault } from "./view-function";
|
|
3
|
-
export declare function getUserHistory(provider:
|
|
3
|
+
export declare function getUserHistory(provider: SuiClient, originPackage: string, vaults: {
|
|
4
4
|
[key: string]: Vault;
|
|
5
5
|
}, sender: string, startTimeMs: number): Promise<TxHistory[]>;
|
|
6
6
|
export interface TxHistory {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
export declare const SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
3
3
|
export interface Vault {
|
|
4
4
|
id: string;
|
|
@@ -129,7 +129,7 @@ export interface DepositVault {
|
|
|
129
129
|
u64Padding: string[];
|
|
130
130
|
bcsPadding: string[];
|
|
131
131
|
}
|
|
132
|
-
export declare function getVaults(provider:
|
|
132
|
+
export declare function getVaults(provider: SuiClient, packageId: string, registry: string, indexes: string[], sender?: string): Promise<{
|
|
133
133
|
[key: string]: Vault;
|
|
134
134
|
}>;
|
|
135
135
|
export interface Auction {
|
|
@@ -150,7 +150,7 @@ export interface Auction {
|
|
|
150
150
|
ableToRemoveBid: boolean;
|
|
151
151
|
bidIndex: string;
|
|
152
152
|
}
|
|
153
|
-
export declare function getAuctions(provider:
|
|
153
|
+
export declare function getAuctions(provider: SuiClient, packageId: string, registry: string, indexes: string[], sender?: string): Promise<{
|
|
154
154
|
[key: string]: Auction;
|
|
155
155
|
}>;
|
|
156
156
|
export interface Bid {
|
|
@@ -163,7 +163,7 @@ export interface Bid {
|
|
|
163
163
|
feeDiscount: string;
|
|
164
164
|
tsMs: string;
|
|
165
165
|
}
|
|
166
|
-
export declare function getAuctionBids(provider:
|
|
166
|
+
export declare function getAuctionBids(provider: SuiClient, packageId: string, registry: string, index: string, sender?: string): Promise<Bid[]>;
|
|
167
167
|
export interface DepositShare {
|
|
168
168
|
index: string;
|
|
169
169
|
activeSubVaultUserShare: string;
|
|
@@ -173,7 +173,7 @@ export interface DepositShare {
|
|
|
173
173
|
premiumSubVaultUserShare: string;
|
|
174
174
|
performanceFeeSubVaultUserShare: string;
|
|
175
175
|
}
|
|
176
|
-
export declare function getDepositShares(provider:
|
|
176
|
+
export declare function getDepositShares(provider: SuiClient, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[], sender?: string): Promise<{
|
|
177
177
|
[key: string]: DepositShare;
|
|
178
178
|
}>;
|
|
179
179
|
export interface BidVault {
|
|
@@ -191,9 +191,9 @@ export interface BidShare {
|
|
|
191
191
|
bidVault: BidVault;
|
|
192
192
|
share: string;
|
|
193
193
|
}
|
|
194
|
-
export declare function getMyBids(provider:
|
|
194
|
+
export declare function getMyBids(provider: SuiClient, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[], sender?: string): Promise<{
|
|
195
195
|
[key: string]: BidShare;
|
|
196
196
|
}>;
|
|
197
|
-
export declare function getRefundShares(provider:
|
|
197
|
+
export declare function getRefundShares(provider: SuiClient, packageId: string, registry: string, typeArguments: string[], sender?: string): Promise<{
|
|
198
198
|
[key: string]: string;
|
|
199
199
|
}>;
|
|
@@ -53,7 +53,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.getRefundShares = exports.getMyBids = exports.getDepositShares = exports.getAuctionBids = exports.getAuctions = exports.getVaults = exports.SENDER = void 0;
|
|
56
|
-
var
|
|
56
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
57
|
var bcs_1 = require("@mysten/bcs");
|
|
58
58
|
var tools_1 = require("../tools");
|
|
59
59
|
exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
@@ -64,7 +64,7 @@ function getVaults(provider, packageId, registry, indexes, sender) {
|
|
|
64
64
|
return __generator(this, function (_a) {
|
|
65
65
|
switch (_a.label) {
|
|
66
66
|
case 0:
|
|
67
|
-
transactionBlock = new
|
|
67
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
68
68
|
target = "".concat(packageId, "::tds_view_function::get_vault_data_bcs");
|
|
69
69
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes)];
|
|
70
70
|
transactionBlock.moveCall({
|
|
@@ -296,7 +296,7 @@ function getAuctions(provider, packageId, registry, indexes, sender) {
|
|
|
296
296
|
return __generator(this, function (_a) {
|
|
297
297
|
switch (_a.label) {
|
|
298
298
|
case 0:
|
|
299
|
-
transactionBlock = new
|
|
299
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
300
300
|
target = "".concat(packageId, "::tds_view_function::get_auction_bcs");
|
|
301
301
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes)];
|
|
302
302
|
transactionBlock.moveCall({
|
|
@@ -365,7 +365,7 @@ function getAuctionBids(provider, packageId, registry, index, sender) {
|
|
|
365
365
|
return __generator(this, function (_a) {
|
|
366
366
|
switch (_a.label) {
|
|
367
367
|
case 0:
|
|
368
|
-
transactionBlock = new
|
|
368
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
369
369
|
target = "".concat(packageId, "::tds_view_function::get_auction_bids_bcs");
|
|
370
370
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
|
|
371
371
|
transactionBlock.moveCall({
|
|
@@ -405,7 +405,7 @@ function getDepositShares(provider, typusFrameworkPackageId, packageId, registry
|
|
|
405
405
|
return __generator(this, function (_a) {
|
|
406
406
|
switch (_a.label) {
|
|
407
407
|
case 0:
|
|
408
|
-
transactionBlock = new
|
|
408
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
409
409
|
target = "".concat(packageId, "::tds_view_function::get_deposit_shares_bcs");
|
|
410
410
|
transactionBlockArguments = [
|
|
411
411
|
transactionBlock.pure(registry),
|
|
@@ -462,7 +462,7 @@ function getMyBids(provider, typusFrameworkPackageId, packageId, registry, recei
|
|
|
462
462
|
return __generator(this, function (_a) {
|
|
463
463
|
switch (_a.label) {
|
|
464
464
|
case 0:
|
|
465
|
-
transactionBlock = new
|
|
465
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
466
466
|
target = "".concat(packageId, "::tds_view_function::get_my_bids_bcs");
|
|
467
467
|
transactionBlockArguments = [
|
|
468
468
|
transactionBlock.pure(registry),
|
|
@@ -526,7 +526,7 @@ function getRefundShares(provider, packageId, registry, typeArguments, sender) {
|
|
|
526
526
|
return __generator(this, function (_a) {
|
|
527
527
|
switch (_a.label) {
|
|
528
528
|
case 0:
|
|
529
|
-
transactionBlock = new
|
|
529
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
530
530
|
target = "".concat(packageId, "::tds_view_function::get_refund_shares_bcs");
|
|
531
531
|
transactionBlockArguments = [transactionBlock.pure(registry)];
|
|
532
532
|
typeArguments.forEach(function (typeArgument) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
export interface Auction {
|
|
3
3
|
startTsMs: string;
|
|
4
4
|
endTsMs: string;
|
|
@@ -22,4 +22,4 @@ export interface Bid {
|
|
|
22
22
|
ownerAddress: string;
|
|
23
23
|
}
|
|
24
24
|
export declare function parseAuction(auction: any): Auction;
|
|
25
|
-
export declare function getBids(provider:
|
|
25
|
+
export declare function getBids(provider: SuiClient, auction: Auction): Promise<Bid[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OwnedKiosks } from "@mysten/kiosk";
|
|
3
|
-
export declare function getPool(provider:
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
|
+
import { OwnedKiosks, Network } from "@mysten/kiosk";
|
|
3
|
+
export declare function getPool(provider: SuiClient, pool: string): Promise<PoolData>;
|
|
4
4
|
export interface PoolData {
|
|
5
5
|
pool_id: string;
|
|
6
6
|
is_live: boolean;
|
|
@@ -9,15 +9,15 @@ export interface PoolData {
|
|
|
9
9
|
remaining: number;
|
|
10
10
|
}
|
|
11
11
|
export declare const necklaces: string[];
|
|
12
|
-
export declare function getPoolMap(provider:
|
|
12
|
+
export declare function getPoolMap(provider: SuiClient, nftConfig: any): Promise<Map<string, PoolData>>;
|
|
13
13
|
export declare function getWhitelistMap(nftConfig: any, wlTokens: any): Promise<Map<string, string[]>>;
|
|
14
14
|
interface TailsId {
|
|
15
15
|
nftId: string;
|
|
16
16
|
kiosk: string;
|
|
17
17
|
kioskCap: string;
|
|
18
18
|
}
|
|
19
|
-
export declare function getTailsIds(provider:
|
|
20
|
-
export declare function getTails(provider:
|
|
19
|
+
export declare function getTailsIds(provider: SuiClient, network: Network, nftConfig: any, kiosks: OwnedKiosks): Promise<TailsId[]>;
|
|
20
|
+
export declare function getTails(provider: SuiClient, tailsIds: string[]): Promise<Tails[]>;
|
|
21
21
|
export declare function fieldsToTails(fields: any): Tails;
|
|
22
22
|
export interface Tails {
|
|
23
23
|
id: string;
|
|
@@ -145,22 +145,26 @@ function getWhitelistMap(nftConfig, wlTokens) {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
exports.getWhitelistMap = getWhitelistMap;
|
|
148
|
-
function getTailsIds(provider, nftConfig, kiosks) {
|
|
148
|
+
function getTailsIds(provider, network, nftConfig, kiosks) {
|
|
149
149
|
return __awaiter(this, void 0, void 0, function () {
|
|
150
|
-
var Tails, _loop_1, _a, _b, kioskOwnerCap, e_1_1;
|
|
150
|
+
var Tails, kioskClient, _loop_1, _a, _b, kioskOwnerCap, e_1_1;
|
|
151
151
|
var e_1, _c;
|
|
152
152
|
return __generator(this, function (_d) {
|
|
153
153
|
switch (_d.label) {
|
|
154
154
|
case 0:
|
|
155
155
|
Tails = [];
|
|
156
|
+
kioskClient = new kiosk_1.KioskClient({
|
|
157
|
+
client: provider,
|
|
158
|
+
network: network,
|
|
159
|
+
});
|
|
156
160
|
_loop_1 = function (kioskOwnerCap) {
|
|
157
161
|
var res, tails;
|
|
158
162
|
return __generator(this, function (_e) {
|
|
159
163
|
switch (_e.label) {
|
|
160
|
-
case 0: return [4 /*yield*/,
|
|
164
|
+
case 0: return [4 /*yield*/, kioskClient.getKiosk({ id: kioskOwnerCap.objectId })];
|
|
161
165
|
case 1:
|
|
162
166
|
res = _e.sent();
|
|
163
|
-
tails = res.
|
|
167
|
+
tails = res.items
|
|
164
168
|
.filter(function (item) { return item.type == "".concat(nftConfig.NFT_PACKAGE, "::typus_nft::Tails"); })
|
|
165
169
|
.map(function (item) {
|
|
166
170
|
var t = {
|
|
@@ -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.getPayRoyaltyTx = exports.getMintToKioskTx = exports.getMintTx = void 0;
|
|
40
|
-
var
|
|
40
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
41
41
|
var constants_1 = require("../../constants");
|
|
42
42
|
/**
|
|
43
43
|
entry fun free_mint(
|
|
@@ -50,7 +50,7 @@ function getMintTx(gasBudget, nftPackageId, policy, pool, whitelist_token) {
|
|
|
50
50
|
return __awaiter(this, void 0, void 0, function () {
|
|
51
51
|
var tx;
|
|
52
52
|
return __generator(this, function (_a) {
|
|
53
|
-
tx = new
|
|
53
|
+
tx = new transactions_1.TransactionBlock();
|
|
54
54
|
tx.moveCall({
|
|
55
55
|
target: "".concat(nftPackageId, "::typus_nft::free_mint"),
|
|
56
56
|
typeArguments: [],
|
|
@@ -75,7 +75,7 @@ function getMintToKioskTx(gasBudget, nftPackageId, pool, policy, whitelist_token
|
|
|
75
75
|
return __awaiter(this, void 0, void 0, function () {
|
|
76
76
|
var tx;
|
|
77
77
|
return __generator(this, function (_a) {
|
|
78
|
-
tx = new
|
|
78
|
+
tx = new transactions_1.TransactionBlock();
|
|
79
79
|
tx.moveCall({
|
|
80
80
|
target: "".concat(nftPackageId, "::typus_nft::free_mint_into_kiosk"),
|
|
81
81
|
typeArguments: [],
|
package/package.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "@typus/typus-sdk",
|
|
3
3
|
"author": "Typus",
|
|
4
4
|
"description": "typus sdk",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.40",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mysten/bcs": "^0.7.3",
|
|
8
|
-
"@mysten/kiosk": "
|
|
9
|
-
"@mysten/sui.js": "
|
|
8
|
+
"@mysten/kiosk": "0.7.11",
|
|
9
|
+
"@mysten/sui.js": "0.47.0",
|
|
10
10
|
"@types/node": "^20.5.7",
|
|
11
11
|
"bignumber.js": "^9.1.1",
|
|
12
12
|
"bs58": "^5.0.0",
|