@typus/typus-sdk 1.1.38-beta → 1.1.39
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 +4 -3
- 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 +4 -6
- package/lib/utils/nft-staking/user-entry.js +37 -45
- 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 +2 -6
- 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 +16 -4
- package/lib/utils/typus-dov-single-v2/leaderboard.js +0 -12
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +1 -1
- package/lib/utils/typus-dov-single-v2/user-entry.js +11 -11
- 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 +4 -8
- 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,7 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonRpcProvider } from "@mysten/sui.js";
|
|
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:
|
|
4
|
+
export declare function getUsersBidEvents(provider: JsonRpcProvider, originPackage: string, startTs?: number): Promise<{
|
|
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
|
+
}[]>;
|
|
5
17
|
export declare function sumUsersBidPremium(datas: any, vaultIndexes?: string[], startTs?: number, endTs?: number): Promise<Map<string, number>>;
|
|
6
|
-
export declare function getSuiNS(provider:
|
|
7
|
-
export declare function getUsersHarvestCompound(provider:
|
|
18
|
+
export declare function getSuiNS(provider: JsonRpcProvider, address: string): Promise<string>;
|
|
19
|
+
export declare function getUsersHarvestCompound(provider: JsonRpcProvider, originPackage: string, startTs?: number, endTs?: number): Promise<Map<string, number>>;
|
|
@@ -223,23 +223,17 @@ 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
|
|
227
226
|
var amount = Number(parsedJson.amount) / Math.pow(10, Number(parsedJson.decimal));
|
|
228
|
-
// @ts-ignore
|
|
229
227
|
var price = Number(parsedJson.oracle_info.price) / Math.pow(10, Number(parsedJson.oracle_info.decimal));
|
|
230
|
-
// @ts-ignore
|
|
231
228
|
var asset = (0, token_1.typeArgToAsset)("0x" + parsedJson.token.name);
|
|
232
229
|
if (asset.startsWith("USD")) {
|
|
233
230
|
price = 1;
|
|
234
231
|
}
|
|
235
232
|
var acc = 0;
|
|
236
|
-
// @ts-ignore
|
|
237
233
|
if (usersHarvestCompound.has(parsedJson.signer)) {
|
|
238
|
-
// @ts-ignore
|
|
239
234
|
acc = usersHarvestCompound.get(parsedJson.signer);
|
|
240
235
|
}
|
|
241
236
|
acc += amount * price;
|
|
242
|
-
// @ts-ignore
|
|
243
237
|
usersHarvestCompound.set(parsedJson.signer, acc);
|
|
244
238
|
}
|
|
245
239
|
});
|
|
@@ -266,23 +260,17 @@ function getUsersHarvestCompound(provider, originPackage, startTs, endTs) {
|
|
|
266
260
|
result.data.forEach(function (data) {
|
|
267
261
|
if (Number(data.timestampMs) / 1000 < endTs) {
|
|
268
262
|
var parsedJson = data.parsedJson;
|
|
269
|
-
// @ts-ignore
|
|
270
263
|
var amount = Number(parsedJson.amount) / Math.pow(10, Number(parsedJson.decimal));
|
|
271
|
-
// @ts-ignore
|
|
272
264
|
var price = Number(parsedJson.oracle_info.price) / Math.pow(10, Number(parsedJson.oracle_info.decimal));
|
|
273
|
-
// @ts-ignore
|
|
274
265
|
var asset = (0, token_1.typeArgToAsset)("0x" + parsedJson.token.name);
|
|
275
266
|
if (asset.startsWith("USD")) {
|
|
276
267
|
price = 1;
|
|
277
268
|
}
|
|
278
269
|
var acc = 0;
|
|
279
|
-
// @ts-ignore
|
|
280
270
|
if (usersHarvestCompound.has(parsedJson.signer)) {
|
|
281
|
-
// @ts-ignore
|
|
282
271
|
acc = usersHarvestCompound.get(parsedJson.signer);
|
|
283
272
|
}
|
|
284
273
|
acc += amount * price;
|
|
285
|
-
// @ts-ignore
|
|
286
274
|
usersHarvestCompound.set(parsedJson.signer, acc);
|
|
287
275
|
}
|
|
288
276
|
});
|
|
@@ -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.getRebateTx = exports.getExerciseTx = exports.getTransferBidReceiptTx = exports.getNewBidTx = exports.getCompoundTx = exports.getHarvestTx = exports.getClaimTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
56
|
-
var
|
|
56
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
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 sui_js_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 sui_js_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 sui_js_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 sui_js_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 sui_js_1.TransactionBlock();
|
|
231
231
|
requests.forEach(function (request) {
|
|
232
232
|
tx.moveCall({
|
|
233
233
|
target: "".concat(packageId, "::tds_user_entry::harvest"),
|
|
@@ -260,7 +260,7 @@ function getCompoundTx(gasBudget, typusFrameworkPackageId, packageId, registry,
|
|
|
260
260
|
return __awaiter(this, void 0, void 0, function () {
|
|
261
261
|
var tx;
|
|
262
262
|
return __generator(this, function (_a) {
|
|
263
|
-
tx = new
|
|
263
|
+
tx = new sui_js_1.TransactionBlock();
|
|
264
264
|
requests.forEach(function (request) {
|
|
265
265
|
tx.moveCall({
|
|
266
266
|
target: "".concat(packageId, "::tails_staking::compound"),
|
|
@@ -298,7 +298,7 @@ usingSponsoredGasCoin) {
|
|
|
298
298
|
return __awaiter(this, void 0, void 0, function () {
|
|
299
299
|
var tx, _a, coin;
|
|
300
300
|
return __generator(this, function (_b) {
|
|
301
|
-
tx = new
|
|
301
|
+
tx = new sui_js_1.TransactionBlock();
|
|
302
302
|
if (!usingSponsoredGasCoin &&
|
|
303
303
|
(typeArguments[1] == "0x2::sui::SUI" ||
|
|
304
304
|
typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
@@ -342,7 +342,7 @@ function getTransferBidReceiptTx(input) {
|
|
|
342
342
|
return __awaiter(this, void 0, void 0, function () {
|
|
343
343
|
var tx;
|
|
344
344
|
return __generator(this, function (_a) {
|
|
345
|
-
tx = new
|
|
345
|
+
tx = new sui_js_1.TransactionBlock();
|
|
346
346
|
tx.moveCall({
|
|
347
347
|
target: "".concat(input.packageId, "::tds_user_entry::transfer_bid_receipt"),
|
|
348
348
|
typeArguments: input.typeArguments,
|
|
@@ -375,7 +375,7 @@ function getExerciseTx(gasBudget, typusFrameworkPackageId, packageId, registry,
|
|
|
375
375
|
return __awaiter(this, void 0, void 0, function () {
|
|
376
376
|
var tx;
|
|
377
377
|
return __generator(this, function (_a) {
|
|
378
|
-
tx = new
|
|
378
|
+
tx = new sui_js_1.TransactionBlock();
|
|
379
379
|
requests.forEach(function (request) {
|
|
380
380
|
tx.moveCall({
|
|
381
381
|
target: "".concat(packageId, "::tds_user_entry::exercise"),
|
|
@@ -406,7 +406,7 @@ function getRebateTx(gasBudget, packageId, typeArguments, registry) {
|
|
|
406
406
|
return __awaiter(this, void 0, void 0, function () {
|
|
407
407
|
var tx;
|
|
408
408
|
return __generator(this, function (_a) {
|
|
409
|
-
tx = new
|
|
409
|
+
tx = new sui_js_1.TransactionBlock();
|
|
410
410
|
typeArguments.forEach(function (typeArgument) {
|
|
411
411
|
tx.moveCall({
|
|
412
412
|
target: "".concat(packageId, "::tds_user_entry::rebate"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonRpcProvider } from "@mysten/sui.js";
|
|
2
2
|
import { Vault } from "./view-function";
|
|
3
|
-
export declare function getUserHistory(provider:
|
|
3
|
+
export declare function getUserHistory(provider: JsonRpcProvider, 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 { JsonRpcProvider } from "@mysten/sui.js";
|
|
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: JsonRpcProvider, 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: JsonRpcProvider, 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: JsonRpcProvider, 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: JsonRpcProvider, 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: JsonRpcProvider, 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: JsonRpcProvider, 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 sui_js_1 = require("@mysten/sui.js");
|
|
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 sui_js_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 sui_js_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 sui_js_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 sui_js_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 sui_js_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 sui_js_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 { JsonRpcProvider } from "@mysten/sui.js";
|
|
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: JsonRpcProvider, auction: Auction): Promise<Bid[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OwnedKiosks
|
|
3
|
-
export declare function getPool(provider:
|
|
1
|
+
import { JsonRpcProvider } from "@mysten/sui.js";
|
|
2
|
+
import { OwnedKiosks } from "@mysten/kiosk";
|
|
3
|
+
export declare function getPool(provider: JsonRpcProvider, 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: JsonRpcProvider, 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: JsonRpcProvider, nftConfig: any, kiosks: OwnedKiosks): Promise<TailsId[]>;
|
|
20
|
+
export declare function getTails(provider: JsonRpcProvider, tailsIds: string[]): Promise<Tails[]>;
|
|
21
21
|
export declare function fieldsToTails(fields: any): Tails;
|
|
22
22
|
export interface Tails {
|
|
23
23
|
id: string;
|
|
@@ -145,26 +145,22 @@ function getWhitelistMap(nftConfig, wlTokens) {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
exports.getWhitelistMap = getWhitelistMap;
|
|
148
|
-
function getTailsIds(provider,
|
|
148
|
+
function getTailsIds(provider, nftConfig, kiosks) {
|
|
149
149
|
return __awaiter(this, void 0, void 0, function () {
|
|
150
|
-
var Tails,
|
|
150
|
+
var Tails, _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
|
-
});
|
|
160
156
|
_loop_1 = function (kioskOwnerCap) {
|
|
161
157
|
var res, tails;
|
|
162
158
|
return __generator(this, function (_e) {
|
|
163
159
|
switch (_e.label) {
|
|
164
|
-
case 0: return [4 /*yield*/,
|
|
160
|
+
case 0: return [4 /*yield*/, (0, kiosk_1.fetchKiosk)(provider, kioskOwnerCap.kioskId, {}, {})];
|
|
165
161
|
case 1:
|
|
166
162
|
res = _e.sent();
|
|
167
|
-
tails = res.items
|
|
163
|
+
tails = res.data.items
|
|
168
164
|
.filter(function (item) { return item.type == "".concat(nftConfig.NFT_PACKAGE, "::typus_nft::Tails"); })
|
|
169
165
|
.map(function (item) {
|
|
170
166
|
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 sui_js_1 = require("@mysten/sui.js");
|
|
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 sui_js_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 sui_js_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.39",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mysten/bcs": "^0.7.3",
|
|
8
|
-
"@mysten/kiosk": "0.
|
|
9
|
-
"@mysten/sui.js": "0.
|
|
8
|
+
"@mysten/kiosk": "^0.3.3",
|
|
9
|
+
"@mysten/sui.js": "^0.37.1",
|
|
10
10
|
"@types/node": "^20.5.7",
|
|
11
11
|
"bignumber.js": "^9.1.1",
|
|
12
12
|
"bs58": "^5.0.0",
|