@typus/typus-sdk 1.0.104 → 1.0.105

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/config.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "VERSION": "3.0.0",
2
+ "VERSION": "3.0.2",
3
3
  "DB_NAME": "testnet_3_0_0",
4
4
  "RPC_ENDPOINT": "https://api.shinami.com:443/node/v1/sui_testnet_c702de54dad05016124f2cfabc1de7e8",
5
5
  "sponsorApi": "https://northamerica-northeast1-aqueous-freedom-378103.cloudfunctions.net/sponsor-testnet",
6
- "SINGLE_COLLATERAL_PACKAGE": "0x0334a2ae4b0c5cd007d3bf44925975726b94c1061eb45d660e8b79ec91c0599e",
6
+ "SINGLE_COLLATERAL_PACKAGE": "0x6529d0c44d89345b3b851f72acc16670e8e08ff30a46df145e23ab7526c35e02",
7
7
  "SINGLE_COLLATERAL_PACKAGE_ORIGIN": "0x0334a2ae4b0c5cd007d3bf44925975726b94c1061eb45d660e8b79ec91c0599e",
8
8
  "SINGLE_COLLATERAL_MANAGER_CAP": "0xdc092ced3f08dc31cbbdaa584a937d4e54555cb47a1dca1d756560809d92c0ba",
9
9
  "SINGLE_COLLATERAL_REGISTRY": "0xcb757bd17a8daa75c2b12a5c5f19bd88e7e2e96b8a220bbe4cf0605affea7475",
@@ -32,16 +32,16 @@ export declare function getStakeNftTx(gasBudget: number, nftPackageId: string, r
32
32
  */
33
33
  export declare function getUnstakeNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string): Promise<TransactionBlock>;
34
34
  /**
35
- public fun snapshot(
35
+ public fun daily_attend(
36
36
  registry: &mut Registry,
37
37
  clock: &Clock,
38
38
  ctx: &mut TxContext
39
39
  )
40
40
  */
41
- export declare function getSnapshotTx(gasBudget: number, nftPackageId: string, registry: string): Promise<TransactionBlock>;
42
- export declare function getFirstNewBidTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, priceOracle: string, coins: string[], size: string, premium_required: string, // fe float * b_token_decimal
41
+ export declare function getDailyAttendTx(gasBudget: number, nftPackageId: string, registry: string): Promise<TransactionBlock>;
42
+ export declare function getNewBidWithNftTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, priceOracle: string, coins: string[], size: string, premium_required: string, // fe float * b_token_decimal
43
43
  usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
44
- export declare function getFirstDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, coins: string[], amount: string, usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
44
+ export declare function getDepositWithNftTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, coins: string[], amount: string, usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
45
45
  /**
46
46
  public fun level_up(
47
47
  registry: &mut Registry,
@@ -52,7 +52,7 @@ var __read = (this && this.__read) || function (o, n) {
52
52
  return ar;
53
53
  };
54
54
  Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.getLevelUpTx = exports.getFirstDepositTx = exports.getFirstNewBidTx = exports.getSnapshotTx = exports.getUnstakeNftTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
55
+ exports.getLevelUpTx = exports.getDepositWithNftTx = exports.getNewBidWithNftTx = exports.getDailyAttendTx = exports.getUnstakeNftTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
56
56
  var sui_js_1 = require("@mysten/sui.js");
57
57
  var constants_1 = require("../../constants");
58
58
  /**
@@ -152,19 +152,19 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap) {
152
152
  }
153
153
  exports.getUnstakeNftTx = getUnstakeNftTx;
154
154
  /**
155
- public fun snapshot(
155
+ public fun daily_attend(
156
156
  registry: &mut Registry,
157
157
  clock: &Clock,
158
158
  ctx: &mut TxContext
159
159
  )
160
160
  */
161
- function getSnapshotTx(gasBudget, nftPackageId, registry) {
161
+ function getDailyAttendTx(gasBudget, nftPackageId, registry) {
162
162
  return __awaiter(this, void 0, void 0, function () {
163
163
  var tx;
164
164
  return __generator(this, function (_a) {
165
165
  tx = new sui_js_1.TransactionBlock();
166
166
  tx.moveCall({
167
- target: "".concat(nftPackageId, "::tails_staking::snapshot"),
167
+ target: "".concat(nftPackageId, "::tails_staking::daily_attend"),
168
168
  typeArguments: [],
169
169
  arguments: [tx.object(registry), tx.object(constants_1.CLOCK)],
170
170
  });
@@ -173,8 +173,8 @@ function getSnapshotTx(gasBudget, nftPackageId, registry) {
173
173
  });
174
174
  });
175
175
  }
176
- exports.getSnapshotTx = getSnapshotTx;
177
- function getFirstNewBidTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
176
+ exports.getDailyAttendTx = getDailyAttendTx;
177
+ function getNewBidWithNftTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
178
178
  usingSponsoredGasCoin) {
179
179
  if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
180
180
  return __awaiter(this, void 0, void 0, function () {
@@ -186,7 +186,7 @@ usingSponsoredGasCoin) {
186
186
  typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
187
187
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
188
188
  tx.moveCall({
189
- target: "".concat(packageId, "::tails_staking::first_new_bid"),
189
+ target: "".concat(packageId, "::tails_staking::new_bid_w_nft"),
190
190
  typeArguments: typeArguments,
191
191
  arguments: [
192
192
  tx.pure(registry),
@@ -201,7 +201,7 @@ usingSponsoredGasCoin) {
201
201
  }
202
202
  else {
203
203
  tx.moveCall({
204
- target: "".concat(packageId, "::tails_staking::first_new_bid"),
204
+ target: "".concat(packageId, "::tails_staking::new_bid_w_nft"),
205
205
  typeArguments: typeArguments,
206
206
  arguments: [
207
207
  tx.pure(registry),
@@ -219,8 +219,8 @@ usingSponsoredGasCoin) {
219
219
  });
220
220
  });
221
221
  }
222
- exports.getFirstNewBidTx = getFirstNewBidTx;
223
- function getFirstDepositTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, coins, amount, usingSponsoredGasCoin) {
222
+ exports.getNewBidWithNftTx = getNewBidWithNftTx;
223
+ function getDepositWithNftTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, coins, amount, usingSponsoredGasCoin) {
224
224
  if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
225
225
  return __awaiter(this, void 0, void 0, function () {
226
226
  var tx, _a, coin;
@@ -231,7 +231,7 @@ function getFirstDepositTx(gasBudget, packageId, typeArguments, registry, additi
231
231
  typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
232
232
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
233
233
  tx.moveCall({
234
- target: "".concat(packageId, "::tails_staking::first_deposit"),
234
+ target: "".concat(packageId, "::tails_staking::deposit_w_nft"),
235
235
  typeArguments: typeArguments,
236
236
  arguments: [
237
237
  tx.pure(registry),
@@ -244,7 +244,7 @@ function getFirstDepositTx(gasBudget, packageId, typeArguments, registry, additi
244
244
  }
245
245
  else {
246
246
  tx.moveCall({
247
- target: "".concat(packageId, "::tails_staking::first_deposit"),
247
+ target: "".concat(packageId, "::tails_staking::deposit_w_nft"),
248
248
  typeArguments: typeArguments,
249
249
  arguments: [
250
250
  tx.pure(registry),
@@ -260,7 +260,7 @@ function getFirstDepositTx(gasBudget, packageId, typeArguments, registry, additi
260
260
  });
261
261
  });
262
262
  }
263
- exports.getFirstDepositTx = getFirstDepositTx;
263
+ exports.getDepositWithNftTx = getDepositWithNftTx;
264
264
  /**
265
265
  public fun level_up(
266
266
  registry: &mut Registry,
@@ -9,7 +9,7 @@ import { TransactionBlock } from "@mysten/sui.js";
9
9
  ctx: &mut TxContext,
10
10
  )
11
11
  */
12
- export declare function getDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], amount: string, receipts: string[], usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
12
+ export declare function getDepositTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], amount: string, receipts: string[], usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
13
13
  /**
14
14
  public(friend) entry fun withdraw<D_TOKEN, B_TOKEN, O_TOKEN>(
15
15
  registry: &mut Registry,
@@ -19,7 +19,7 @@ export declare function getDepositTx(gasBudget: number, packageId: string, typeA
19
19
  ctx: &mut TxContext,
20
20
  )
21
21
  */
22
- export declare function getWithdrawTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
22
+ export declare function getWithdrawTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
23
23
  /**
24
24
  public(friend) entry fun unsubscribe<D_TOKEN, B_TOKEN, O_TOKEN>(
25
25
  registry: &mut Registry,
@@ -29,7 +29,7 @@ export declare function getWithdrawTx(gasBudget: number, packageId: string, type
29
29
  ctx: &mut TxContext,
30
30
  )
31
31
  */
32
- export declare function getUnsubscribeTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
32
+ export declare function getUnsubscribeTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
33
33
  /**
34
34
  public(friend) entry fun claim<D_TOKEN, B_TOKEN, O_TOKEN>(
35
35
  registry: &mut Registry,
@@ -38,7 +38,7 @@ export declare function getUnsubscribeTx(gasBudget: number, packageId: string, t
38
38
  ctx: &mut TxContext,
39
39
  )
40
40
  */
41
- export declare function getClaimTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
41
+ export declare function getClaimTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
42
42
  /**
43
43
  public(friend) entry fun harvest<D_TOKEN, B_TOKEN, O_TOKEN>(
44
44
  registry: &mut Registry,
@@ -47,7 +47,7 @@ export declare function getClaimTx(gasBudget: number, packageId: string, typeArg
47
47
  ctx: &mut TxContext,
48
48
  )
49
49
  */
50
- export declare function getHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
50
+ export declare function getHarvestTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
51
51
  /**
52
52
  public(friend) entry fun compound<D_TOKEN, B_TOKEN, O_TOKEN>(
53
53
  registry: &mut Registry,
@@ -56,7 +56,7 @@ export declare function getHarvestTx(gasBudget: number, packageId: string, typeA
56
56
  ctx: &mut TxContext,
57
57
  )
58
58
  */
59
- export declare function getCompoundTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
59
+ export declare function getCompoundTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[]): Promise<TransactionBlock>;
60
60
  /**
61
61
  public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
62
62
  registry: &mut Registry,
@@ -77,7 +77,7 @@ usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
77
77
  ctx: &mut TxContext,
78
78
  )
79
79
  */
80
- export declare function getExerciseTx(gasBudget: number, packageId: string, registry: string, requests: [{
80
+ export declare function getExerciseTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, registry: string, requests: [{
81
81
  typeArguments: string[];
82
82
  index: string;
83
83
  receipts: string[];
@@ -64,7 +64,7 @@ var sui_js_1 = require("@mysten/sui.js");
64
64
  ctx: &mut TxContext,
65
65
  )
66
66
  */
67
- function getDepositTx(gasBudget, packageId, typeArguments, registry, index, coins, amount, receipts, usingSponsoredGasCoin) {
67
+ function getDepositTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, coins, amount, receipts, usingSponsoredGasCoin) {
68
68
  if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
69
69
  return __awaiter(this, void 0, void 0, function () {
70
70
  var tx, _a, coin;
@@ -82,7 +82,10 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, index, coin
82
82
  tx.pure(index),
83
83
  tx.makeMoveVec({ objects: [coin] }),
84
84
  tx.pure(amount),
85
- tx.makeMoveVec({ objects: receipts.map(function (id) { return tx.object(id); }) }),
85
+ tx.makeMoveVec({
86
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
87
+ objects: receipts.map(function (id) { return tx.object(id); }),
88
+ }),
86
89
  ],
87
90
  });
88
91
  }
@@ -95,7 +98,10 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, index, coin
95
98
  tx.pure(index),
96
99
  tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
97
100
  tx.pure(amount),
98
- tx.makeMoveVec({ objects: receipts.map(function (id) { return tx.object(id); }) }),
101
+ tx.makeMoveVec({
102
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
103
+ objects: receipts.map(function (id) { return tx.object(id); }),
104
+ }),
99
105
  ],
100
106
  });
101
107
  }
@@ -114,7 +120,7 @@ exports.getDepositTx = getDepositTx;
114
120
  ctx: &mut TxContext,
115
121
  )
116
122
  */
117
- function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, receipts, share) {
123
+ function getWithdrawTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, share) {
118
124
  return __awaiter(this, void 0, void 0, function () {
119
125
  var tx;
120
126
  return __generator(this, function (_a) {
@@ -125,7 +131,10 @@ function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, rec
125
131
  arguments: [
126
132
  tx.pure(registry),
127
133
  tx.pure(index),
128
- tx.makeMoveVec({ objects: receipts.map(function (id) { return tx.object(id); }) }),
134
+ tx.makeMoveVec({
135
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
136
+ objects: receipts.map(function (id) { return tx.object(id); }),
137
+ }),
129
138
  tx.pure(share ? [share] : []),
130
139
  ],
131
140
  });
@@ -144,7 +153,7 @@ exports.getWithdrawTx = getWithdrawTx;
144
153
  ctx: &mut TxContext,
145
154
  )
146
155
  */
147
- function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index, receipts, share) {
156
+ function getUnsubscribeTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, share) {
148
157
  return __awaiter(this, void 0, void 0, function () {
149
158
  var tx;
150
159
  return __generator(this, function (_a) {
@@ -155,7 +164,10 @@ function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index,
155
164
  arguments: [
156
165
  tx.pure(registry),
157
166
  tx.pure(index),
158
- tx.makeMoveVec({ objects: receipts.map(function (id) { return tx.object(id); }) }),
167
+ tx.makeMoveVec({
168
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
169
+ objects: receipts.map(function (id) { return tx.object(id); }),
170
+ }),
159
171
  tx.pure(share ? [share] : []),
160
172
  ],
161
173
  });
@@ -173,7 +185,7 @@ exports.getUnsubscribeTx = getUnsubscribeTx;
173
185
  ctx: &mut TxContext,
174
186
  )
175
187
  */
176
- function getClaimTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
188
+ function getClaimTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
177
189
  return __awaiter(this, void 0, void 0, function () {
178
190
  var tx;
179
191
  return __generator(this, function (_a) {
@@ -181,7 +193,14 @@ function getClaimTx(gasBudget, packageId, typeArguments, registry, index, receip
181
193
  tx.moveCall({
182
194
  target: "".concat(packageId, "::typus_dov_single::claim"),
183
195
  typeArguments: typeArguments,
184
- arguments: [tx.pure(registry), tx.pure(index), tx.makeMoveVec({ objects: receipts.map(function (id) { return tx.object(id); }) })],
196
+ arguments: [
197
+ tx.pure(registry),
198
+ tx.pure(index),
199
+ tx.makeMoveVec({
200
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
201
+ objects: receipts.map(function (id) { return tx.object(id); }),
202
+ }),
203
+ ],
185
204
  });
186
205
  tx.setGasBudget(gasBudget);
187
206
  return [2 /*return*/, tx];
@@ -197,7 +216,7 @@ exports.getClaimTx = getClaimTx;
197
216
  ctx: &mut TxContext,
198
217
  )
199
218
  */
200
- function getHarvestTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
219
+ function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
201
220
  return __awaiter(this, void 0, void 0, function () {
202
221
  var tx;
203
222
  return __generator(this, function (_a) {
@@ -205,7 +224,14 @@ function getHarvestTx(gasBudget, packageId, typeArguments, registry, index, rece
205
224
  tx.moveCall({
206
225
  target: "".concat(packageId, "::typus_dov_single::harvest"),
207
226
  typeArguments: typeArguments,
208
- arguments: [tx.pure(registry), tx.pure(index), tx.makeMoveVec({ objects: receipts.map(function (id) { return tx.object(id); }) })],
227
+ arguments: [
228
+ tx.pure(registry),
229
+ tx.pure(index),
230
+ tx.makeMoveVec({
231
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
232
+ objects: receipts.map(function (id) { return tx.object(id); }),
233
+ }),
234
+ ],
209
235
  });
210
236
  tx.setGasBudget(gasBudget);
211
237
  return [2 /*return*/, tx];
@@ -221,7 +247,7 @@ exports.getHarvestTx = getHarvestTx;
221
247
  ctx: &mut TxContext,
222
248
  )
223
249
  */
224
- function getCompoundTx(gasBudget, packageId, typeArguments, registry, index, receipts) {
250
+ function getCompoundTx(gasBudget, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts) {
225
251
  return __awaiter(this, void 0, void 0, function () {
226
252
  var tx;
227
253
  return __generator(this, function (_a) {
@@ -229,7 +255,14 @@ function getCompoundTx(gasBudget, packageId, typeArguments, registry, index, rec
229
255
  tx.moveCall({
230
256
  target: "".concat(packageId, "::typus_dov_single::compound"),
231
257
  typeArguments: typeArguments,
232
- arguments: [tx.pure(registry), tx.pure(index), tx.makeMoveVec({ objects: receipts.map(function (id) { return tx.object(id); }) })],
258
+ arguments: [
259
+ tx.pure(registry),
260
+ tx.pure(index),
261
+ tx.makeMoveVec({
262
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
263
+ objects: receipts.map(function (id) { return tx.object(id); }),
264
+ }),
265
+ ],
233
266
  });
234
267
  tx.setGasBudget(gasBudget);
235
268
  return [2 /*return*/, tx];
@@ -291,7 +324,7 @@ exports.getNewBidTx = getNewBidTx;
291
324
  ctx: &mut TxContext,
292
325
  )
293
326
  */
294
- function getExerciseTx(gasBudget, packageId, registry, requests) {
327
+ function getExerciseTx(gasBudget, typusFrameworkPackageId, packageId, registry, requests) {
295
328
  return __awaiter(this, void 0, void 0, function () {
296
329
  var tx;
297
330
  return __generator(this, function (_a) {
@@ -303,7 +336,10 @@ function getExerciseTx(gasBudget, packageId, registry, requests) {
303
336
  arguments: [
304
337
  tx.pure(registry),
305
338
  tx.pure(request.index),
306
- tx.makeMoveVec({ objects: request.receipts.map(function (id) { return tx.object(id); }) }),
339
+ tx.makeMoveVec({
340
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusBidReceipt"),
341
+ objects: request.receipts.map(function (id) { return tx.object(id); }),
342
+ }),
307
343
  ],
308
344
  });
309
345
  });
@@ -0,0 +1,12 @@
1
+ import { JsonRpcProvider } from "@mysten/sui.js";
2
+ export declare const SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
3
+ export interface DepositShare {
4
+ index: string;
5
+ activeSubVaultUserShare: string;
6
+ deactivatingSubVaultUserShare: string;
7
+ inactiveSubVaultUserShare: string;
8
+ warmupSubVaultUserShare: string;
9
+ premiumSubVaultUserShare: string;
10
+ performanceFeeSubVaultUserShare: string;
11
+ }
12
+ export declare function getDepositShares(provider: JsonRpcProvider, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[]): Promise<Map<string, DepositShare>>;
@@ -0,0 +1,114 @@
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;
13
+ return g = { next: verb(0), "throw": verb(1), "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.getDepositShares = exports.SENDER = void 0;
56
+ var sui_js_1 = require("@mysten/sui.js");
57
+ var bcs_1 = require("@mysten/bcs");
58
+ exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
59
+ function getDepositShares(provider, typusFrameworkPackageId, packageId, registry, receipts) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
62
+ return __generator(this, function (_a) {
63
+ switch (_a.label) {
64
+ case 0:
65
+ transactionBlock = new sui_js_1.TransactionBlock();
66
+ target = "".concat(packageId, "::typus_dov_single::get_deposit_shares_bcs");
67
+ transactionBlockArguments = [
68
+ transactionBlock.pure(registry),
69
+ transactionBlock.makeMoveVec({
70
+ type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
71
+ objects: receipts.map(function (id) { return transactionBlock.object(id); }),
72
+ }),
73
+ ];
74
+ transactionBlock.moveCall({
75
+ target: target,
76
+ typeArguments: [],
77
+ arguments: transactionBlockArguments,
78
+ });
79
+ return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: exports.SENDER })];
80
+ case 1:
81
+ results = (_a.sent()).results;
82
+ bytes = results[results.length - 1].returnValues[0][0];
83
+ reader = new bcs_1.BcsReader(new Uint8Array(bytes));
84
+ result = Array.from(new Map()).reduce(function (map, _a) {
85
+ var _b = __read(_a, 2), key = _b[0], value = _b[1];
86
+ map[key] = value;
87
+ return map;
88
+ }, {});
89
+ reader.readVec(function (reader, i) {
90
+ reader.read8();
91
+ var index = reader.read64();
92
+ var activeSubVaultUserShare = reader.read64();
93
+ var deactivatingSubVaultUserShare = reader.read64();
94
+ var inactiveSubVaultUserShare = reader.read64();
95
+ var warmupSubVaultUserShare = reader.read64();
96
+ var premiumSubVaultUserShare = reader.read64();
97
+ var performanceFeeSubVaultUserShare = reader.read64();
98
+ result[index] = {
99
+ index: index,
100
+ activeSubVaultUserShare: activeSubVaultUserShare,
101
+ deactivatingSubVaultUserShare: deactivatingSubVaultUserShare,
102
+ inactiveSubVaultUserShare: inactiveSubVaultUserShare,
103
+ warmupSubVaultUserShare: warmupSubVaultUserShare,
104
+ premiumSubVaultUserShare: premiumSubVaultUserShare,
105
+ performanceFeeSubVaultUserShare: performanceFeeSubVaultUserShare,
106
+ };
107
+ });
108
+ // @ts-ignore
109
+ return [2 /*return*/, result];
110
+ }
111
+ });
112
+ });
113
+ }
114
+ exports.getDepositShares = getDepositShares;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.0.104",
5
+ "version": "1.0.105",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/kiosk": "^0.3.3",