@typus/typus-sdk 1.8.41 → 1.8.43-upgrade

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.
Files changed (50) hide show
  1. package/dist/src/auto-bid/view-function.d.ts +0 -2
  2. package/dist/src/auto-bid/view-function.js +7 -76
  3. package/dist/src/constants/constant.d.ts +0 -3
  4. package/dist/src/constants/constant.js +1 -8
  5. package/dist/src/constants/token.d.ts +1 -1
  6. package/dist/src/constants/token.js +12 -0
  7. package/dist/src/dice/fetch.d.ts +0 -4
  8. package/dist/src/dice/fetch.js +59 -116
  9. package/dist/src/typus/airdrop/view-function.js +5 -8
  10. package/dist/src/typus/leaderboard/view-function.js +5 -8
  11. package/dist/src/typus/tails-staking/view-function.js +10 -14
  12. package/dist/src/typus/user/view-function.js +5 -6
  13. package/dist/src/typus-dov-single-v2/function/bidding.d.ts +4 -3
  14. package/dist/src/typus-dov-single-v2/function/bidding.js +10 -11
  15. package/dist/src/typus-dov-single-v2/function/token.js +1 -1
  16. package/dist/src/typus-dov-single-v2/history/index.d.ts +0 -1
  17. package/dist/src/typus-dov-single-v2/history/index.js +0 -1
  18. package/dist/src/typus-dov-single-v2/history/user-history.d.ts +2 -3
  19. package/dist/src/typus-dov-single-v2/history/user-history.js +122 -184
  20. package/dist/src/typus-dov-single-v2/otc-entry.js +5 -6
  21. package/dist/src/typus-dov-single-v2/user-entry.d.ts +1 -1
  22. package/dist/src/typus-dov-single-v2/view-function.js +29 -27
  23. package/dist/src/typus-hedge/view-function.js +10 -10
  24. package/dist/src/typus-launch/airdrop/view-function.js +3 -5
  25. package/dist/src/typus-launch/auction/view-function.js +17 -16
  26. package/dist/src/typus-launch/funding-vault/view-function.js +20 -18
  27. package/dist/src/typus-launch/improvement-proposal/view-function.js +17 -18
  28. package/dist/src/typus-launch/ve-typus/view-function.js +15 -15
  29. package/dist/src/typus-safu/view-function.js +13 -13
  30. package/dist/src/utils/api/price.js +1 -1
  31. package/dist/src/utils/graphQl.d.ts +24 -0
  32. package/dist/src/utils/graphQl.js +129 -0
  33. package/dist/src/utils/index.d.ts +1 -0
  34. package/dist/src/utils/index.js +1 -0
  35. package/dist/src/utils/oracle.js +13 -14
  36. package/dist/src/utils/pyth/constant.js +4 -0
  37. package/dist/src/utils/sponsoredTx.d.ts +2 -2
  38. package/dist/src/utils/typusConfig.d.ts +4 -0
  39. package/dist/src/utils/typusConfig.js +33 -31
  40. package/package.json +9 -10
  41. package/dist/src/dice/view-function.d.ts +0 -1
  42. package/dist/src/dice/view-function.js +0 -20
  43. package/dist/src/typus-dov-single-v2/history/vault-history.d.ts +0 -123
  44. package/dist/src/typus-dov-single-v2/history/vault-history.js +0 -307
  45. package/dist/src/typus-nft/fetch.d.ts +0 -70
  46. package/dist/src/typus-nft/fetch.js +0 -631
  47. package/dist/src/typus-nft/index.d.ts +0 -2
  48. package/dist/src/typus-nft/index.js +0 -18
  49. package/dist/src/typus-nft/user-entry.d.ts +0 -57
  50. package/dist/src/typus-nft/user-entry.js +0 -161
@@ -1,57 +0,0 @@
1
- import { TransactionArgument, Transaction } from "@mysten/sui/transactions";
2
- import { TypusConfig } from "../../src/utils";
3
- /**
4
- entry fun free_mint(
5
- pool: &mut Pool,
6
- whitelist_token: Whitelist,
7
- ctx: &mut TxContext,
8
- )
9
- */
10
- export declare function getMintTx(config: TypusConfig, tx: Transaction, input: {
11
- pool: string;
12
- whitelist_token: string;
13
- }): Promise<Transaction>;
14
- /**
15
- entry fun free_mint_into_kiosk(
16
- pool: &mut Pool,
17
- whitelist_token: Whitelist,
18
- kiosk: &mut Kiosk,
19
- kiosk_cap: &KioskOwnerCap,
20
- ctx: &mut TxContext,
21
- )
22
- */
23
- export declare function getMintToKioskTx(config: TypusConfig, tx: Transaction, input: {
24
- pool: string;
25
- whitelist_token: string;
26
- kiosk: string;
27
- kiosk_cap: string;
28
- }): Promise<Transaction>;
29
- /**
30
- public fun pay<T>(
31
- config.object.nftTransferPolicy: &mut TransferPolicy<T>,
32
- request: &mut TransferRequest<T>,
33
- payment: Coin<SUI>
34
- )
35
- */
36
- export declare function getPayRoyaltyTx(config: TypusConfig, tx: Transaction, input: {
37
- request: TransactionArgument;
38
- coin: string;
39
- }): Promise<Transaction>;
40
- /**
41
- entry fun request_mint(
42
- pool: &mut Pool,
43
- seed: u64, // 0, 1, 2
44
- coin: Coin<SUI>,
45
- clock: &Clock,
46
- ctx: & TxContext
47
- )
48
- */
49
- export declare function getRequestMintTx(config: TypusConfig, tx: Transaction, input: {
50
- pool: string;
51
- seed: string;
52
- price: string;
53
- }): Promise<Transaction>;
54
- export declare function getIsWhitelistTx(config: TypusConfig, tx: Transaction, input: {
55
- pool: string;
56
- user: string;
57
- }): Promise<Transaction>;
@@ -1,161 +0,0 @@
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 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["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
- var __read = (this && this.__read) || function (o, n) {
39
- var m = typeof Symbol === "function" && o[Symbol.iterator];
40
- if (!m) return o;
41
- var i = m.call(o), r, ar = [], e;
42
- try {
43
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
- }
45
- catch (error) { e = { error: error }; }
46
- finally {
47
- try {
48
- if (r && !r.done && (m = i["return"])) m.call(i);
49
- }
50
- finally { if (e) throw e.error; }
51
- }
52
- return ar;
53
- };
54
- Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.getMintTx = getMintTx;
56
- exports.getMintToKioskTx = getMintToKioskTx;
57
- exports.getPayRoyaltyTx = getPayRoyaltyTx;
58
- exports.getRequestMintTx = getRequestMintTx;
59
- exports.getIsWhitelistTx = getIsWhitelistTx;
60
- var constants_1 = require("../../src/constants");
61
- /**
62
- entry fun free_mint(
63
- pool: &mut Pool,
64
- whitelist_token: Whitelist,
65
- ctx: &mut TxContext,
66
- )
67
- */
68
- function getMintTx(config, tx, input) {
69
- return __awaiter(this, void 0, void 0, function () {
70
- return __generator(this, function (_a) {
71
- tx.moveCall({
72
- target: "".concat(config.package.nft, "::typus_nft::free_mint"),
73
- typeArguments: [],
74
- arguments: [tx.object(input.pool), tx.object(config.object.nftTransferPolicy), tx.object(input.whitelist_token), tx.object(constants_1.CLOCK)],
75
- });
76
- return [2 /*return*/, tx];
77
- });
78
- });
79
- }
80
- /**
81
- entry fun free_mint_into_kiosk(
82
- pool: &mut Pool,
83
- whitelist_token: Whitelist,
84
- kiosk: &mut Kiosk,
85
- kiosk_cap: &KioskOwnerCap,
86
- ctx: &mut TxContext,
87
- )
88
- */
89
- function getMintToKioskTx(config, tx, input) {
90
- return __awaiter(this, void 0, void 0, function () {
91
- return __generator(this, function (_a) {
92
- tx.moveCall({
93
- target: "".concat(config.package.nft, "::typus_nft::free_mint_into_kiosk"),
94
- typeArguments: [],
95
- arguments: [
96
- tx.object(input.pool),
97
- tx.object(config.object.nftTransferPolicy),
98
- tx.object(input.whitelist_token),
99
- tx.object(input.kiosk),
100
- tx.object(input.kiosk_cap),
101
- tx.object(constants_1.CLOCK),
102
- ],
103
- });
104
- return [2 /*return*/, tx];
105
- });
106
- });
107
- }
108
- /**
109
- public fun pay<T>(
110
- config.object.nftTransferPolicy: &mut TransferPolicy<T>,
111
- request: &mut TransferRequest<T>,
112
- payment: Coin<SUI>
113
- )
114
- */
115
- function getPayRoyaltyTx(config, tx, input) {
116
- return __awaiter(this, void 0, void 0, function () {
117
- return __generator(this, function (_a) {
118
- tx.moveCall({
119
- target: "".concat(config.package.nft, "::royalty_rule::pay"),
120
- typeArguments: ["".concat(config.package.nft, "::typus_nft::Tails")],
121
- arguments: [tx.object(config.object.nftTransferPolicy), input.request, tx.object(input.coin)],
122
- });
123
- return [2 /*return*/, tx];
124
- });
125
- });
126
- }
127
- /**
128
- entry fun request_mint(
129
- pool: &mut Pool,
130
- seed: u64, // 0, 1, 2
131
- coin: Coin<SUI>,
132
- clock: &Clock,
133
- ctx: & TxContext
134
- )
135
- */
136
- function getRequestMintTx(config, tx, input) {
137
- return __awaiter(this, void 0, void 0, function () {
138
- var _a, coin;
139
- return __generator(this, function (_b) {
140
- _a = __read(tx.splitCoins(tx.gas, [tx.pure.u64(input.price)]), 1), coin = _a[0];
141
- tx.moveCall({
142
- target: "".concat(config.package.nft, "::discount_mint::request_mint"),
143
- typeArguments: [],
144
- arguments: [tx.object(input.pool), tx.pure.u64(input.seed), coin, tx.object(constants_1.CLOCK)],
145
- });
146
- return [2 /*return*/, tx];
147
- });
148
- });
149
- }
150
- function getIsWhitelistTx(config, tx, input) {
151
- return __awaiter(this, void 0, void 0, function () {
152
- return __generator(this, function (_a) {
153
- tx.moveCall({
154
- target: "".concat(config.package.nft, "::discount_mint::is_whitelist"),
155
- typeArguments: [],
156
- arguments: [tx.object(input.pool), tx.pure.address(input.user)],
157
- });
158
- return [2 /*return*/, tx];
159
- });
160
- });
161
- }