@typus/typus-sdk 1.0.87 → 1.0.89

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.
@@ -20,3 +20,5 @@ export declare const sponsorTransactionE2E: (gaslessTxb: any, sponsor: any, prov
20
20
  export declare function getSponsoredDeposit(sponsorApi: string, packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], amount: string, signerAddress: string): Promise<[SponsoredTransaction, Uint8Array]>;
21
21
  export declare function getSponsoredCompound(sponsorApi: string, packageId: string, typeArguments: string[], registry: string, index: string, signerAddress: string): Promise<[SponsoredTransaction, Uint8Array]>;
22
22
  export declare function getSponsoredNewBid(sponsorApi: string, packageId: string, typeArguments: string[], registry: string, acRegistry: string, index: string, priceOracle: string, coins: string[], size: string, signerAddress: string): Promise<[SponsoredTransaction, Uint8Array]>;
23
+ export declare function getSponsoredMint(sponsorApi: string, nftPackageId: string, pool: string, whitelist_token: string, signerAddress: string): Promise<[SponsoredTransaction, Uint8Array]>;
24
+ export declare function getSponsoredMintToKiosk(sponsorApi: string, nftPackageId: string, pool: string, whitelist_token: string, kiosk: string, kiosk_cap: string, signerAddress: string): Promise<[SponsoredTransaction, Uint8Array]>;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getSponsoredNewBid = exports.getSponsoredCompound = exports.getSponsoredDeposit = exports.sponsorTransactionE2E = exports.executeSponsorTransactionBlock = exports.sponsorTransactionBlock = exports.sponsorRpcClient = void 0;
39
+ exports.getSponsoredMintToKiosk = exports.getSponsoredMint = exports.getSponsoredNewBid = exports.getSponsoredCompound = exports.getSponsoredDeposit = exports.sponsorTransactionE2E = exports.executeSponsorTransactionBlock = exports.sponsorTransactionBlock = exports.sponsorRpcClient = void 0;
40
40
  var typed_rpc_1 = require("typed-rpc");
41
41
  var sponsorRpcClient = function (sponserRpcUrl) { return (0, typed_rpc_1.rpcClient)(sponserRpcUrl); };
42
42
  exports.sponsorRpcClient = sponsorRpcClient;
@@ -224,3 +224,69 @@ function getSponsoredNewBid(sponsorApi, packageId, typeArguments, registry, acRe
224
224
  });
225
225
  }
226
226
  exports.getSponsoredNewBid = getSponsoredNewBid;
227
+ function getSponsoredMint(sponsorApi, nftPackageId, pool, whitelist_token, signerAddress) {
228
+ return __awaiter(this, void 0, void 0, function () {
229
+ var jsonData, response, data, sponsoredResponse, transactionBlock;
230
+ return __generator(this, function (_a) {
231
+ switch (_a.label) {
232
+ case 0:
233
+ jsonData = JSON.stringify({
234
+ functionName: "mint",
235
+ nftPackageId: nftPackageId,
236
+ pool: pool,
237
+ whitelist_token: whitelist_token,
238
+ signerAddress: signerAddress,
239
+ });
240
+ return [4 /*yield*/, fetch(sponsorApi, {
241
+ method: "POST",
242
+ headers: { "Content-Type": "application/json" },
243
+ body: jsonData,
244
+ })];
245
+ case 1:
246
+ response = _a.sent();
247
+ return [4 /*yield*/, response.json()];
248
+ case 2:
249
+ data = _a.sent();
250
+ console.log(data);
251
+ sponsoredResponse = data[0];
252
+ transactionBlock = Buffer.from(data[1].data);
253
+ return [2 /*return*/, [sponsoredResponse, transactionBlock]];
254
+ }
255
+ });
256
+ });
257
+ }
258
+ exports.getSponsoredMint = getSponsoredMint;
259
+ function getSponsoredMintToKiosk(sponsorApi, nftPackageId, pool, whitelist_token, kiosk, kiosk_cap, signerAddress) {
260
+ return __awaiter(this, void 0, void 0, function () {
261
+ var jsonData, response, data, sponsoredResponse, transactionBlock;
262
+ return __generator(this, function (_a) {
263
+ switch (_a.label) {
264
+ case 0:
265
+ jsonData = JSON.stringify({
266
+ functionName: "mintToKiosk",
267
+ nftPackageId: nftPackageId,
268
+ pool: pool,
269
+ whitelist_token: whitelist_token,
270
+ kiosk: kiosk,
271
+ kiosk_cap: kiosk_cap,
272
+ signerAddress: signerAddress,
273
+ });
274
+ return [4 /*yield*/, fetch(sponsorApi, {
275
+ method: "POST",
276
+ headers: { "Content-Type": "application/json" },
277
+ body: jsonData,
278
+ })];
279
+ case 1:
280
+ response = _a.sent();
281
+ return [4 /*yield*/, response.json()];
282
+ case 2:
283
+ data = _a.sent();
284
+ console.log(data);
285
+ sponsoredResponse = data[0];
286
+ transactionBlock = Buffer.from(data[1].data);
287
+ return [2 /*return*/, [sponsoredResponse, transactionBlock]];
288
+ }
289
+ });
290
+ });
291
+ }
292
+ exports.getSponsoredMintToKiosk = getSponsoredMintToKiosk;
@@ -1,5 +1,5 @@
1
- import { SuiClient } from "@mysten/sui.js/dist/cjs/client";
2
- export declare function getPool(client: SuiClient, pool: string): Promise<PoolData>;
1
+ import { JsonRpcProvider } from "@mysten/sui.js";
2
+ export declare function getPool(provider: JsonRpcProvider, pool: string): Promise<PoolData>;
3
3
  interface PoolData {
4
4
  is_live: boolean;
5
5
  num: number;
@@ -37,14 +37,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getPool = void 0;
40
- // import { JsonRpcProvider } from "@mysten/sui.js/dist/cjs/providers/json-rpc-provider";
41
- function getPool(client, pool) {
40
+ function getPool(provider, pool) {
42
41
  var _a;
43
42
  return __awaiter(this, void 0, void 0, function () {
44
43
  var res, fields, poolData;
45
44
  return __generator(this, function (_b) {
46
45
  switch (_b.label) {
47
- case 0: return [4 /*yield*/, client.getObject({ id: pool, options: { showContent: true } })];
46
+ case 0: return [4 /*yield*/, provider.getObject({ id: pool, options: { showContent: true } })];
48
47
  case 1:
49
48
  res = _b.sent();
50
49
  fields = (_a = res.data) === null || _a === void 0 ? void 0 : _a.content.fields;
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.0.87",
5
+ "version": "1.0.89",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
- "@mysten/kiosk": "^0.5.1",
9
- "@mysten/sui.js": "^0.41.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",
@@ -50,7 +50,7 @@
50
50
  "ts-mocha": "^10.0.0",
51
51
  "tslib": "^2.6.0",
52
52
  "tsutils": "^3.21.0",
53
- "typed-rpc": "^3.0.0",
53
+ "typed-rpc": "^4.1.0",
54
54
  "wrappy": "^1.0.2",
55
55
  "ws": "^8.11.0",
56
56
  "xmlhttprequest": "^1.8.0"