@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.
Files changed (45) hide show
  1. package/lib/constants.d.ts +2 -2
  2. package/lib/constants.js +4 -3
  3. package/lib/utils/mint.d.ts +1 -1
  4. package/lib/utils/mint.js +2 -2
  5. package/lib/utils/nft-staking/authorized-entry.d.ts +1 -1
  6. package/lib/utils/nft-staking/authorized-entry.js +4 -4
  7. package/lib/utils/nft-staking/fetch.d.ts +2 -2
  8. package/lib/utils/nft-staking/user-entry.d.ts +4 -6
  9. package/lib/utils/nft-staking/user-entry.js +37 -45
  10. package/lib/utils/tails-exp-dice/fetch.d.ts +4 -4
  11. package/lib/utils/tails-exp-dice/user-entry.d.ts +1 -1
  12. package/lib/utils/tails-exp-dice/user-entry.js +4 -4
  13. package/lib/utils/token.js +2 -2
  14. package/lib/utils/typus-dov-double/authorized-entry.d.ts +1 -1
  15. package/lib/utils/typus-dov-double/authorized-entry.js +8 -8
  16. package/lib/utils/typus-dov-double/manager-entry.d.ts +1 -1
  17. package/lib/utils/typus-dov-double/manager-entry.js +19 -19
  18. package/lib/utils/typus-dov-double/portfolio-vault.d.ts +2 -2
  19. package/lib/utils/typus-dov-double/portfolio-vault.js +2 -6
  20. package/lib/utils/typus-dov-double/user-entry.d.ts +1 -1
  21. package/lib/utils/typus-dov-double/user-entry.js +10 -10
  22. package/lib/utils/typus-dov-double/view-function.d.ts +4 -4
  23. package/lib/utils/typus-dov-double/view-function.js +4 -4
  24. package/lib/utils/typus-dov-single/portfolio-vault.d.ts +3 -3
  25. package/lib/utils/typus-dov-single/registry.d.ts +3 -3
  26. package/lib/utils/typus-dov-single/user-entry.d.ts +1 -1
  27. package/lib/utils/typus-dov-single/user-entry.js +12 -12
  28. package/lib/utils/typus-dov-single/user-history.d.ts +2 -2
  29. package/lib/utils/typus-dov-single/view-function.d.ts +8 -8
  30. package/lib/utils/typus-dov-single/view-function.js +8 -8
  31. package/lib/utils/typus-dov-single-v2/authorized-entry.d.ts +1 -1
  32. package/lib/utils/typus-dov-single-v2/authorized-entry.js +3 -3
  33. package/lib/utils/typus-dov-single-v2/leaderboard.d.ts +16 -4
  34. package/lib/utils/typus-dov-single-v2/leaderboard.js +0 -12
  35. package/lib/utils/typus-dov-single-v2/user-entry.d.ts +1 -1
  36. package/lib/utils/typus-dov-single-v2/user-entry.js +11 -11
  37. package/lib/utils/typus-dov-single-v2/user-history.d.ts +2 -2
  38. package/lib/utils/typus-dov-single-v2/view-function.d.ts +7 -7
  39. package/lib/utils/typus-dov-single-v2/view-function.js +7 -7
  40. package/lib/utils/typus-framework/dutch.d.ts +2 -2
  41. package/lib/utils/typus-nft/fetch.d.ts +6 -6
  42. package/lib/utils/typus-nft/fetch.js +4 -8
  43. package/lib/utils/typus-nft/user-entry.d.ts +1 -1
  44. package/lib/utils/typus-nft/user-entry.js +3 -3
  45. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { SuiClient } from "@mysten/sui.js/client";
1
+ import { Connection } from "@mysten/sui.js";
2
2
  export declare const CLOCK = "0x6";
3
3
  export declare const SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
4
4
  export declare const PRICE_DECIMAL = 8;
@@ -12,7 +12,7 @@ export declare const TOKEN_NAME_TO_MODULE: {
12
12
  SUI: string;
13
13
  USDC: string;
14
14
  };
15
- export declare const testnetConnection: SuiClient;
15
+ export declare const testnetConnection: Connection;
16
16
  export declare const ACTIVE_SUB_VAULT_TAG: number;
17
17
  export declare const DEACTIVATING_SUB_VAULT_TAG: number;
18
18
  export declare const INACTIVE_SUB_VAULT_TAG: number;
package/lib/constants.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PERFORMANCE_FEE_SUB_VAULT_TAG = exports.PREMIUM_SUB_VAULT_TAG = exports.BIDDER_SUB_VAULT_TAG = exports.WARMUP_SUB_VAULT_TAG = exports.INACTIVE_SUB_VAULT_TAG = exports.DEACTIVATING_SUB_VAULT_TAG = exports.ACTIVE_SUB_VAULT_TAG = exports.testnetConnection = exports.TOKEN_NAME_TO_MODULE = exports.TOKEN_NAME = exports.FAKE_TOKEN_TYPE_ARGUMENT = exports.DEFAULT_TYPE_ARGUMENT = exports.TOKEN_DECIMAL = exports.PRICE_DECIMAL = exports.SENDER = exports.CLOCK = void 0;
4
- var client_1 = require("@mysten/sui.js/client");
4
+ var sui_js_1 = require("@mysten/sui.js");
5
5
  exports.CLOCK = "0x6";
6
6
  exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
7
7
  exports.PRICE_DECIMAL = 8;
@@ -15,8 +15,9 @@ exports.TOKEN_NAME_TO_MODULE = {
15
15
  SUI: "sui",
16
16
  USDC: "usdc",
17
17
  };
18
- exports.testnetConnection = new client_1.SuiClient({
19
- url: "https://fullnode.testnet.sui.io:443/",
18
+ exports.testnetConnection = new sui_js_1.Connection({
19
+ fullnode: "https://fullnode.testnet.sui.io:443/",
20
+ faucet: "https://faucet.testnet.sui.io/gas",
20
21
  });
21
22
  exports.ACTIVE_SUB_VAULT_TAG = 0;
22
23
  exports.DEACTIVATING_SUB_VAULT_TAG = 1;
@@ -1,2 +1,2 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { TransactionBlock } from "@mysten/sui.js";
2
2
  export declare function getMintTx(gasBudget: number, packageId: string, registry: string, moduleName: string, amount: number): Promise<TransactionBlock>;
package/lib/utils/mint.js CHANGED
@@ -37,12 +37,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getMintTx = void 0;
40
- var transactions_1 = require("@mysten/sui.js/transactions");
40
+ var sui_js_1 = require("@mysten/sui.js");
41
41
  function getMintTx(gasBudget, packageId, registry, moduleName, amount) {
42
42
  return __awaiter(this, void 0, void 0, function () {
43
43
  var tx;
44
44
  return __generator(this, function (_a) {
45
- tx = new transactions_1.TransactionBlock();
45
+ tx = new sui_js_1.TransactionBlock();
46
46
  tx.moveCall({
47
47
  target: "".concat(packageId, "::").concat(moduleName, "::mint"),
48
48
  arguments: [tx.pure(registry), tx.pure(amount)],
@@ -1,4 +1,4 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { TransactionBlock } from "@mysten/sui.js";
2
2
  export declare function getSetProfitSharingTx(gasBudget: number, packageId: string, registry: string, level_profits: number[], amount: number): Promise<TransactionBlock>;
3
3
  export declare function getAllocateProfitSharingTx(gasBudget: number, packageId: string, registry: string, users: string[]): Promise<TransactionBlock>;
4
4
  export declare function getClaimProfitSharingTx(gasBudget: number, packageId: string, registry: string): Promise<TransactionBlock>;
@@ -53,12 +53,12 @@ var __read = (this && this.__read) || function (o, n) {
53
53
  };
54
54
  Object.defineProperty(exports, "__esModule", { value: true });
55
55
  exports.getClaimProfitSharingTx = exports.getAllocateProfitSharingTx = exports.getSetProfitSharingTx = void 0;
56
- var transactions_1 = require("@mysten/sui.js/transactions");
56
+ var sui_js_1 = require("@mysten/sui.js");
57
57
  function getSetProfitSharingTx(gasBudget, packageId, registry, level_profits, amount) {
58
58
  return __awaiter(this, void 0, void 0, function () {
59
59
  var tx, _a, coin;
60
60
  return __generator(this, function (_b) {
61
- tx = new transactions_1.TransactionBlock();
61
+ tx = new sui_js_1.TransactionBlock();
62
62
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
63
63
  tx.moveCall({
64
64
  target: "".concat(packageId, "::tails_staking::set_profit_sharing"),
@@ -75,7 +75,7 @@ function getAllocateProfitSharingTx(gasBudget, packageId, registry, users) {
75
75
  return __awaiter(this, void 0, void 0, function () {
76
76
  var tx;
77
77
  return __generator(this, function (_a) {
78
- tx = new transactions_1.TransactionBlock();
78
+ tx = new sui_js_1.TransactionBlock();
79
79
  tx.moveCall({
80
80
  target: "".concat(packageId, "::tails_staking::allocate_profit_sharing"),
81
81
  typeArguments: ["0x2::sui::SUI"],
@@ -91,7 +91,7 @@ function getClaimProfitSharingTx(gasBudget, packageId, registry) {
91
91
  return __awaiter(this, void 0, void 0, function () {
92
92
  var tx;
93
93
  return __generator(this, function (_a) {
94
- tx = new transactions_1.TransactionBlock();
94
+ tx = new sui_js_1.TransactionBlock();
95
95
  tx.moveCall({
96
96
  target: "".concat(packageId, "::tails_staking::claim_profit_sharing"),
97
97
  typeArguments: ["0x2::sui::SUI"],
@@ -1,3 +1,3 @@
1
- import { SuiClient } from "@mysten/sui.js/client";
1
+ import { JsonRpcProvider } from "@mysten/sui.js";
2
2
  import { Tails } from "../typus-nft/fetch";
3
- export declare function getUserStake(provider: SuiClient, nft_table: string, user: string): Promise<Tails | null>;
3
+ export declare function getUserStake(provider: JsonRpcProvider, nft_table: string, user: string): Promise<Tails | null>;
@@ -1,6 +1,4 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
2
- import { Network } from "@mysten/kiosk";
3
- import { SuiClient } from "@mysten/sui.js/client";
1
+ import { TransactionBlock } from "@mysten/sui.js";
4
2
  /**
5
3
  entry fun transfer_nft(
6
4
  registry: &mut Registry,
@@ -24,7 +22,7 @@ export declare function getTransferNftsTx(gasBudget: number, nftPackageId: strin
24
22
  )
25
23
  */
26
24
  export declare function getStakeNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string, nft_id: string): Promise<TransactionBlock>;
27
- export declare function getCreateKioskAndLockNftTx(provider: SuiClient, network: Network, gasBudget: number, nftPackageId: string, policy: string, nft_id: string, singer: string): Promise<TransactionBlock>;
25
+ export declare function getCreateKioskAndLockNftTx(gasBudget: number, nftPackageId: string, policy: string, nft_id: string, singer: string): Promise<TransactionBlock>;
28
26
  /**
29
27
  public fun unstake_nft(
30
28
  registry: &mut Registry,
@@ -74,7 +72,7 @@ export declare function getLevelUpTx(gasBudget: number, nftPackageId: string, re
74
72
  ctx: &mut TxContext
75
73
  )
76
74
  */
77
- export declare function consumeExpCoinUnstakedTx(gasBudget: number, nftPackageId: string, typeArguments: string[], registry: string, kiosk: string, kiosk_cap: string, nft_id: string, exp_coins: string[]): Promise<TransactionBlock>;
75
+ export declare function consumeExpCoinUnstakedTx(gasBudget: number, nftPackageId: string, typeArguments: string[], registry: string, kiosk: string, kiosk_cap: string, nft_id: string, exp_coins: string[], amount: string): Promise<TransactionBlock>;
78
76
  /**
79
77
  entry fun consume_exp_coin_staked<EXP_COIN>(
80
78
  registry: &mut Registry,
@@ -82,4 +80,4 @@ export declare function consumeExpCoinUnstakedTx(gasBudget: number, nftPackageId
82
80
  ctx: &mut TxContext
83
81
  )
84
82
  */
85
- export declare function consumeExpCoinStakedTx(gasBudget: number, nftPackageId: string, typeArguments: string[], registry: string, exp_coins: string[]): Promise<TransactionBlock>;
83
+ export declare function consumeExpCoinStakedTx(gasBudget: number, nftPackageId: string, typeArguments: string[], registry: string, exp_coins: string[], amount: string): Promise<TransactionBlock>;
@@ -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.consumeExpCoinStakedTx = exports.consumeExpCoinUnstakedTx = 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
- var transactions_1 = require("@mysten/sui.js/transactions");
56
+ var sui_js_1 = require("@mysten/sui.js");
57
57
  var constants_1 = require("../../constants");
58
58
  var kiosk_1 = require("@mysten/kiosk");
59
59
  /**
@@ -70,7 +70,7 @@ function getTransferNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, n
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 transactions_1.TransactionBlock();
73
+ tx = new sui_js_1.TransactionBlock();
74
74
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(10000000)]), 1), coin = _a[0];
75
75
  tx.moveCall({
76
76
  target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
@@ -87,7 +87,7 @@ function getTransferNftsTx(gasBudget, nftPackageId, registry, kiosks, kiosk_caps
87
87
  return __awaiter(this, void 0, void 0, function () {
88
88
  var tx, i, _a, coin;
89
89
  return __generator(this, function (_b) {
90
- tx = new transactions_1.TransactionBlock();
90
+ tx = new sui_js_1.TransactionBlock();
91
91
  i = 0;
92
92
  while (i < kiosks.length) {
93
93
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(10000000)]), 1), coin = _a[0];
@@ -118,7 +118,7 @@ function getStakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft_
118
118
  return __awaiter(this, void 0, void 0, function () {
119
119
  var tx, _a, coin;
120
120
  return __generator(this, function (_b) {
121
- tx = new transactions_1.TransactionBlock();
121
+ tx = new sui_js_1.TransactionBlock();
122
122
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
123
123
  tx.moveCall({
124
124
  target: "".concat(nftPackageId, "::tails_staking::stake_nft"),
@@ -131,30 +131,20 @@ function getStakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft_
131
131
  });
132
132
  }
133
133
  exports.getStakeNftTx = getStakeNftTx;
134
- function getCreateKioskAndLockNftTx(provider, network, gasBudget, nftPackageId, policy, nft_id, singer) {
134
+ function getCreateKioskAndLockNftTx(gasBudget, nftPackageId, policy, nft_id, singer) {
135
135
  return __awaiter(this, void 0, void 0, function () {
136
- var tx, kioskClient, kioskTx, kiosk, kioskCap;
137
- return __generator(this, function (_a) {
138
- tx = new transactions_1.TransactionBlock();
139
- kioskClient = new kiosk_1.KioskClient({
140
- client: provider,
141
- network: network,
136
+ var tx, _a, kiosk, kiosk_cap;
137
+ return __generator(this, function (_b) {
138
+ tx = new sui_js_1.TransactionBlock();
139
+ _a = __read((0, kiosk_1.createKiosk)(tx), 2), kiosk = _a[0], kiosk_cap = _a[1];
140
+ (0, kiosk_1.lock)(tx, "".concat(nftPackageId, "::typus_nft::Tails"), kiosk, kiosk_cap, tx.object(policy), tx.pure(nft_id));
141
+ tx.moveCall({
142
+ target: "0x2::transfer::public_share_object",
143
+ typeArguments: [kiosk_1.KIOSK_TYPE],
144
+ arguments: [kiosk],
142
145
  });
143
- kioskTx = new kiosk_1.KioskTransaction({ transactionBlock: tx, kioskClient: kioskClient });
144
- kioskTx.lock({ itemType: "".concat(nftPackageId, "::typus_nft::Tails"), itemId: nft_id, policy: policy });
145
- kiosk = kioskTx.kiosk, kioskCap = kioskTx.kioskCap;
146
- if (kiosk && kioskCap) {
147
- tx.moveCall({
148
- target: "0x2::transfer::public_share_object",
149
- typeArguments: [kiosk_1.KIOSK_TYPE],
150
- arguments: [kiosk],
151
- });
152
- tx.transferObjects([kioskCap], tx.pure(singer));
153
- tx.setGasBudget(gasBudget);
154
- }
155
- else {
156
- console.error("Fail to Create Kiosk Tx!!");
157
- }
146
+ tx.transferObjects([kiosk_cap], tx.pure(singer));
147
+ tx.setGasBudget(gasBudget);
158
148
  return [2 /*return*/, tx];
159
149
  });
160
150
  });
@@ -173,7 +163,7 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap) {
173
163
  return __awaiter(this, void 0, void 0, function () {
174
164
  var tx;
175
165
  return __generator(this, function (_a) {
176
- tx = new transactions_1.TransactionBlock();
166
+ tx = new sui_js_1.TransactionBlock();
177
167
  tx.moveCall({
178
168
  target: "".concat(nftPackageId, "::tails_staking::snapshot"),
179
169
  typeArguments: [],
@@ -201,7 +191,7 @@ function getDailyAttendTx(gasBudget, nftPackageId, registry) {
201
191
  return __awaiter(this, void 0, void 0, function () {
202
192
  var tx;
203
193
  return __generator(this, function (_a) {
204
- tx = new transactions_1.TransactionBlock();
194
+ tx = new sui_js_1.TransactionBlock();
205
195
  tx.moveCall({
206
196
  target: "".concat(nftPackageId, "::tails_staking::daily_attend"),
207
197
  typeArguments: [],
@@ -224,7 +214,7 @@ function getSnapshotTx(gasBudget, nftPackageId, registry) {
224
214
  return __awaiter(this, void 0, void 0, function () {
225
215
  var tx;
226
216
  return __generator(this, function (_a) {
227
- tx = new transactions_1.TransactionBlock();
217
+ tx = new sui_js_1.TransactionBlock();
228
218
  tx.moveCall({
229
219
  target: "".concat(nftPackageId, "::tails_staking::snapshot"),
230
220
  typeArguments: [],
@@ -242,7 +232,7 @@ usingSponsoredGasCoin) {
242
232
  return __awaiter(this, void 0, void 0, function () {
243
233
  var tx, _a, coin;
244
234
  return __generator(this, function (_b) {
245
- tx = new transactions_1.TransactionBlock();
235
+ tx = new sui_js_1.TransactionBlock();
246
236
  if (!usingSponsoredGasCoin &&
247
237
  (typeArguments[1] == "0x2::sui::SUI" ||
248
238
  typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
@@ -287,7 +277,7 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, additional_
287
277
  return __awaiter(this, void 0, void 0, function () {
288
278
  var tx, _a, coin;
289
279
  return __generator(this, function (_b) {
290
- tx = new transactions_1.TransactionBlock();
280
+ tx = new sui_js_1.TransactionBlock();
291
281
  if (!usingSponsoredGasCoin &&
292
282
  (typeArguments[0] == "0x2::sui::SUI" ||
293
283
  typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
@@ -329,7 +319,7 @@ function getCompoundTx(gasBudget, packageId, typeArguments, registry, additional
329
319
  return __awaiter(this, void 0, void 0, function () {
330
320
  var tx;
331
321
  return __generator(this, function (_a) {
332
- tx = new transactions_1.TransactionBlock();
322
+ tx = new sui_js_1.TransactionBlock();
333
323
  tx.moveCall({
334
324
  target: "".concat(packageId, "::tails_staking::compound"),
335
325
  typeArguments: typeArguments,
@@ -345,7 +335,7 @@ function getWithdrawTx(gasBudget, packageId, typeArguments, registry, additional
345
335
  return __awaiter(this, void 0, void 0, function () {
346
336
  var tx;
347
337
  return __generator(this, function (_a) {
348
- tx = new transactions_1.TransactionBlock();
338
+ tx = new sui_js_1.TransactionBlock();
349
339
  tx.moveCall({
350
340
  target: "".concat(packageId, "::tails_staking::withdraw"),
351
341
  typeArguments: typeArguments,
@@ -367,7 +357,7 @@ function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, additio
367
357
  return __awaiter(this, void 0, void 0, function () {
368
358
  var tx;
369
359
  return __generator(this, function (_a) {
370
- tx = new transactions_1.TransactionBlock();
360
+ tx = new sui_js_1.TransactionBlock();
371
361
  tx.moveCall({
372
362
  target: "".concat(packageId, "::tails_staking::unsubscribe"),
373
363
  typeArguments: typeArguments,
@@ -395,7 +385,7 @@ function getLevelUpTx(gasBudget, nftPackageId, registry) {
395
385
  return __awaiter(this, void 0, void 0, function () {
396
386
  var tx;
397
387
  return __generator(this, function (_a) {
398
- tx = new transactions_1.TransactionBlock();
388
+ tx = new sui_js_1.TransactionBlock();
399
389
  tx.moveCall({
400
390
  target: "".concat(nftPackageId, "::tails_staking::level_up"),
401
391
  typeArguments: [],
@@ -417,19 +407,20 @@ exports.getLevelUpTx = getLevelUpTx;
417
407
  ctx: &mut TxContext
418
408
  )
419
409
  */
420
- function consumeExpCoinUnstakedTx(gasBudget, nftPackageId, typeArguments, registry, kiosk, kiosk_cap, nft_id, exp_coins) {
410
+ function consumeExpCoinUnstakedTx(gasBudget, nftPackageId, typeArguments, registry, kiosk, kiosk_cap, nft_id, exp_coins, amount) {
421
411
  return __awaiter(this, void 0, void 0, function () {
422
- var tx, coin;
423
- return __generator(this, function (_a) {
424
- tx = new transactions_1.TransactionBlock();
412
+ var tx, coin, _a, input_coin;
413
+ return __generator(this, function (_b) {
414
+ tx = new sui_js_1.TransactionBlock();
425
415
  coin = exp_coins.pop();
426
416
  if (exp_coins.length > 0) {
427
417
  tx.mergeCoins(tx.object(coin), exp_coins.map(function (id) { return tx.object(id); }));
428
418
  }
419
+ _a = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _a[0];
429
420
  tx.moveCall({
430
421
  target: "".concat(nftPackageId, "::tails_staking::consume_exp_coin_unstaked"),
431
422
  typeArguments: typeArguments,
432
- arguments: [tx.object(registry), tx.object(kiosk), tx.object(kiosk_cap), tx.pure(nft_id), tx.object(coin)],
423
+ arguments: [tx.object(registry), tx.object(kiosk), tx.object(kiosk_cap), tx.pure(nft_id), input_coin],
433
424
  });
434
425
  tx.setGasBudget(gasBudget);
435
426
  return [2 /*return*/, tx];
@@ -444,19 +435,20 @@ exports.consumeExpCoinUnstakedTx = consumeExpCoinUnstakedTx;
444
435
  ctx: &mut TxContext
445
436
  )
446
437
  */
447
- function consumeExpCoinStakedTx(gasBudget, nftPackageId, typeArguments, registry, exp_coins) {
438
+ function consumeExpCoinStakedTx(gasBudget, nftPackageId, typeArguments, registry, exp_coins, amount) {
448
439
  return __awaiter(this, void 0, void 0, function () {
449
- var tx, coin;
450
- return __generator(this, function (_a) {
451
- tx = new transactions_1.TransactionBlock();
440
+ var tx, coin, _a, input_coin;
441
+ return __generator(this, function (_b) {
442
+ tx = new sui_js_1.TransactionBlock();
452
443
  coin = exp_coins.pop();
453
444
  if (exp_coins.length > 0) {
454
445
  tx.mergeCoins(tx.object(coin), exp_coins.map(function (id) { return tx.object(id); }));
455
446
  }
447
+ _a = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _a[0];
456
448
  tx.moveCall({
457
449
  target: "".concat(nftPackageId, "::tails_staking::consume_exp_coin_staked"),
458
450
  typeArguments: typeArguments,
459
- arguments: [tx.object(registry), tx.object(coin)],
451
+ arguments: [tx.object(registry), input_coin],
460
452
  });
461
453
  tx.setGasBudget(gasBudget);
462
454
  return [2 /*return*/, tx];
@@ -1,5 +1,5 @@
1
- import { SuiClient } from "@mysten/sui.js/client";
2
- export declare function getPlaygrounds(provider: SuiClient, diceRegistry: string): Promise<Playground[]>;
1
+ import { JsonRpcProvider } from "@mysten/sui.js";
2
+ export declare function getPlaygrounds(provider: JsonRpcProvider, diceRegistry: string): Promise<Playground[]>;
3
3
  export interface Playground {
4
4
  id: string;
5
5
  house_whitelist: string[];
@@ -29,7 +29,7 @@ export interface Game {
29
29
  larger_than_2: boolean | null;
30
30
  vrf_input_2: number[] | null;
31
31
  }
32
- export declare function getHistory(provider: SuiClient, dicePackage: string, playgrounds: Playground[]): Promise<DrawDisplay[]>;
32
+ export declare function getHistory(provider: JsonRpcProvider, dicePackage: string, playgrounds: Playground[]): Promise<DrawDisplay[]>;
33
33
  interface DrawDisplay {
34
34
  game_id: string;
35
35
  player: string;
@@ -47,5 +47,5 @@ export interface ProfitSharing {
47
47
  remaining: string;
48
48
  total: string;
49
49
  }
50
- export declare function getProfitSharing(provider: SuiClient, diceProfitSharing: string): Promise<ProfitSharing>;
50
+ export declare function getProfitSharing(provider: JsonRpcProvider, diceProfitSharing: string): Promise<ProfitSharing>;
51
51
  export {};
@@ -1,4 +1,4 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { TransactionBlock } from "@mysten/sui.js";
2
2
  /**
3
3
  public(friend) entry fun new_game<TOKEN>(
4
4
  registry: &mut Registry,
@@ -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.newGamePlayGuessTx = exports.playGuessTx = exports.newGameTx = void 0;
56
- var transactions_1 = require("@mysten/sui.js/transactions");
56
+ var sui_js_1 = require("@mysten/sui.js");
57
57
  /**
58
58
  public(friend) entry fun new_game<TOKEN>(
59
59
  registry: &mut Registry,
@@ -68,7 +68,7 @@ registry, index, coins, amount) {
68
68
  return __awaiter(this, void 0, void 0, function () {
69
69
  var tx;
70
70
  return __generator(this, function (_a) {
71
- tx = new transactions_1.TransactionBlock();
71
+ tx = new sui_js_1.TransactionBlock();
72
72
  tx.moveCall({
73
73
  target: "".concat(packageId, "::tails_exp::new_game"),
74
74
  typeArguments: typeArguments,
@@ -96,7 +96,7 @@ function playGuessTx(gasBudget, packageId, registry, index, guess_1, larger_than
96
96
  return __awaiter(this, void 0, void 0, function () {
97
97
  var tx;
98
98
  return __generator(this, function (_a) {
99
- tx = new transactions_1.TransactionBlock();
99
+ tx = new sui_js_1.TransactionBlock();
100
100
  tx.moveCall({
101
101
  target: "".concat(packageId, "::tails_exp::play_guess"),
102
102
  typeArguments: [],
@@ -120,7 +120,7 @@ registry, index, coins, amount, guess_1, larger_than_1, guess_2, larger_than_2)
120
120
  return __awaiter(this, void 0, void 0, function () {
121
121
  var tx, _a, coin;
122
122
  return __generator(this, function (_b) {
123
- tx = new transactions_1.TransactionBlock();
123
+ tx = new sui_js_1.TransactionBlock();
124
124
  if (typeArguments[0] == "0x2::sui::SUI" ||
125
125
  typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI") {
126
126
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assetToDecimal = exports.typeArgToAsset = exports.typeArgsToAssets = void 0;
4
- var utils_1 = require("@mysten/sui.js/utils");
4
+ var sui_js_1 = require("@mysten/sui.js");
5
5
  function typeArgsToAssets(typeArgs) {
6
6
  var assets = typeArgs.map(function (x) { return typeArgToAsset(x); });
7
7
  return assets;
@@ -9,7 +9,7 @@ function typeArgsToAssets(typeArgs) {
9
9
  exports.typeArgsToAssets = typeArgsToAssets;
10
10
  function typeArgToAsset(typeArg) {
11
11
  var typeArgs = typeArg.split("::");
12
- switch ((0, utils_1.normalizeSuiAddress)(typeArgs[0])) {
12
+ switch ((0, sui_js_1.normalizeSuiAddress)(typeArgs[0])) {
13
13
  case "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881":
14
14
  return "WBTC";
15
15
  case "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5":
@@ -1,4 +1,4 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { TransactionBlock } from "@mysten/sui.js";
2
2
  /**
3
3
  public(friend) entry fun authorized_add_portfolio_vault_authorized_user<O_TOKEN, U_TOKEN, B_TOKEN>(
4
4
  registry: &mut Registry,
@@ -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.getAuthorizedDeliveryTx = exports.getAuthorizedUpdateUpcomingVaultConfigTx = exports.getAuthorizedUpdateWarmupVaultConfigTx = exports.getAuthorizedUpdateCapacityTx = exports.getAuthorizedNewPortfolioVaultTx = exports.getAuthorizedRemovePortfolioVaultAuthorizedUserTx = exports.getAuthorizedAddPortfolioVaultAuthorizedUserTx = void 0;
40
- var transactions_1 = require("@mysten/sui.js/transactions");
40
+ var sui_js_1 = require("@mysten/sui.js");
41
41
  /**
42
42
  public(friend) entry fun authorized_add_portfolio_vault_authorized_user<O_TOKEN, U_TOKEN, B_TOKEN>(
43
43
  registry: &mut Registry,
@@ -50,7 +50,7 @@ function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget, packageId, ty
50
50
  return __awaiter(this, void 0, void 0, function () {
51
51
  var tx;
52
52
  return __generator(this, function (_a) {
53
- tx = new transactions_1.TransactionBlock();
53
+ tx = new sui_js_1.TransactionBlock();
54
54
  tx.moveCall({
55
55
  target: "".concat(packageId, "::typus_dov_double::authorized_add_portfolio_vault_authorized_user"),
56
56
  typeArguments: typeArguments,
@@ -74,7 +74,7 @@ function getAuthorizedRemovePortfolioVaultAuthorizedUserTx(gasBudget, packageId,
74
74
  return __awaiter(this, void 0, void 0, function () {
75
75
  var tx;
76
76
  return __generator(this, function (_a) {
77
- tx = new transactions_1.TransactionBlock();
77
+ tx = new sui_js_1.TransactionBlock();
78
78
  tx.moveCall({
79
79
  target: "".concat(packageId, "::typus_dov_double::authorized_remove_portfolio_vault_authorized_user"),
80
80
  typeArguments: typeArguments,
@@ -121,7 +121,7 @@ function getAuthorizedNewPortfolioVaultTx(gasBudget, packageId, typeArguments, r
121
121
  return __awaiter(this, void 0, void 0, function () {
122
122
  var tx;
123
123
  return __generator(this, function (_a) {
124
- tx = new transactions_1.TransactionBlock();
124
+ tx = new sui_js_1.TransactionBlock();
125
125
  tx.moveCall({
126
126
  target: "".concat(packageId, "::typus_dov_double::authorized_new_portfolio_vault"),
127
127
  typeArguments: typeArguments,
@@ -172,7 +172,7 @@ function getAuthorizedUpdateCapacityTx(gasBudget, packageId, typeArguments, regi
172
172
  return __awaiter(this, void 0, void 0, function () {
173
173
  var tx;
174
174
  return __generator(this, function (_a) {
175
- tx = new transactions_1.TransactionBlock();
175
+ tx = new sui_js_1.TransactionBlock();
176
176
  tx.moveCall({
177
177
  target: "".concat(packageId, "::typus_dov_double::authorized_update_capacity"),
178
178
  typeArguments: typeArguments,
@@ -200,7 +200,7 @@ function getAuthorizedUpdateWarmupVaultConfigTx(gasBudget, packageId, typeArgume
200
200
  return __awaiter(this, void 0, void 0, function () {
201
201
  var tx;
202
202
  return __generator(this, function (_a) {
203
- tx = new transactions_1.TransactionBlock();
203
+ tx = new sui_js_1.TransactionBlock();
204
204
  tx.moveCall({
205
205
  target: "".concat(packageId, "::typus_dov_double::authorized_update_warmup_vault_config"),
206
206
  typeArguments: typeArguments,
@@ -242,7 +242,7 @@ function getAuthorizedUpdateUpcomingVaultConfigTx(gasBudget, packageId, typeArgu
242
242
  return __awaiter(this, void 0, void 0, function () {
243
243
  var tx;
244
244
  return __generator(this, function (_a) {
245
- tx = new transactions_1.TransactionBlock();
245
+ tx = new sui_js_1.TransactionBlock();
246
246
  tx.moveCall({
247
247
  target: "".concat(packageId, "::typus_dov_double::authorized_update_upcoming_vault_config"),
248
248
  typeArguments: typeArguments,
@@ -281,7 +281,7 @@ function getAuthorizedDeliveryTx(gasBudget, packageId, typeArguments, registry,
281
281
  return __awaiter(this, void 0, void 0, function () {
282
282
  var tx;
283
283
  return __generator(this, function (_a) {
284
- tx = new transactions_1.TransactionBlock();
284
+ tx = new sui_js_1.TransactionBlock();
285
285
  tx.moveCall({
286
286
  target: "".concat(packageId, "::typus_dov_double::authorized_delivery"),
287
287
  typeArguments: typeArguments,
@@ -1,4 +1,4 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { TransactionBlock } from "@mysten/sui.js";
2
2
  /**
3
3
  public(friend) entry fun new_manager(
4
4
  _manager_cap: &ManagerCap,