@typus/typus-sdk 1.0.108 → 1.0.110

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.
@@ -4,29 +4,29 @@ export interface Vault {
4
4
  id: string;
5
5
  info: Info;
6
6
  config: Config;
7
- deposit_vault: DepositVault;
7
+ depositVault: DepositVault;
8
8
  }
9
9
  export interface Info {
10
10
  index: string;
11
- option_type: string;
11
+ optionType: string;
12
12
  period: string;
13
- activation_ts_ms: string;
14
- expiration_ts_ms: string;
15
- deposit_token: string;
16
- bid_token: string;
17
- oracle_token: string;
18
- d_token_decimal: string;
19
- b_token_decimal: string;
20
- o_token_decimal: string;
13
+ activationTsMs: string;
14
+ expirationTsMs: string;
15
+ depositToken: string;
16
+ bidToken: string;
17
+ oracleToken: string;
18
+ dTokenDecimal: string;
19
+ bTokenDecimal: string;
20
+ oTokenDecimal: string;
21
21
  creator: string;
22
- create_ts_ms: string;
22
+ createTsMs: string;
23
23
  round: string;
24
24
  status: string;
25
- oracle_info: OracleInfo;
26
- delivery_infos: DeliveryInfos;
27
- settlement_info: SettlementInfo | undefined;
28
- u64_padding: string[];
29
- bcs_padding: string[];
25
+ oracleInfo: OracleInfo;
26
+ deliveryInfos: DeliveryInfos;
27
+ settlementInfo: SettlementInfo | undefined;
28
+ u64Padding: string[];
29
+ bcsPadding: string[];
30
30
  }
31
31
  export interface OracleInfo {
32
32
  price: string;
@@ -34,98 +34,121 @@ export interface OracleInfo {
34
34
  }
35
35
  export interface DeliveryInfos {
36
36
  round: string;
37
- max_size: string;
38
- total_delivery_size: string;
39
- total_bidder_bid_value: string;
40
- total_bidder_fee: string;
41
- total_incentive_bid_value: string;
42
- total_incentive_fee: string;
43
- delivery_info: DeliveryInfo[];
37
+ maxSize: string;
38
+ totalDeliverySize: string;
39
+ totalBidderBidValue: string;
40
+ totalBidderFee: string;
41
+ totalIncentiveBidValue: string;
42
+ totalIncentiveFee: string;
43
+ deliveryInfo: DeliveryInfo[];
44
44
  }
45
45
  export interface DeliveryInfo {
46
- delivery_price: string;
47
- delivery_size: string;
48
- bidder_bid_value: string;
49
- bidder_fee: string;
50
- incentive_bid_value: string;
51
- incentive_fee: string;
52
- ts_ms: string;
46
+ deliveryPrice: string;
47
+ deliverySize: string;
48
+ bidderBidValue: string;
49
+ bidderFee: string;
50
+ incentiveBidValue: string;
51
+ incentiveFee: string;
52
+ tsMs: string;
53
53
  }
54
54
  export interface SettlementInfo {
55
55
  round: string;
56
- oracle_price: string;
57
- oracle_price_decimal: string;
58
- settle_balance: string;
59
- settled_balance: string;
60
- share_price: string;
61
- share_price_decimal: string;
62
- ts_ms: string;
56
+ oraclePrice: string;
57
+ oraclePriceDecimal: string;
58
+ settleBalance: string;
59
+ settledBalance: string;
60
+ sharePrice: string;
61
+ sharePriceDecimal: string;
62
+ tsMs: string;
63
63
  }
64
64
  export interface Config {
65
- oracle_id: string;
66
- deposit_lot_size: string;
67
- bid_lot_size: string;
68
- min_deposit_size: string;
69
- min_bid_size: string;
70
- deposit_fee_bp: string;
71
- deposit_fee_share_bp: string;
72
- deposit_shared_fee_pool: string | undefined;
73
- bid_fee_bp: string;
74
- deposit_incentive_bp: string;
75
- bid_incentive_bp: string;
76
- auction_delay_ts_ms: string;
77
- auction_duration_ts_ms: string;
65
+ oracleId: string;
66
+ depositLotSize: string;
67
+ bidLotSize: string;
68
+ minDepositSize: string;
69
+ minBidSize: string;
70
+ depositFeeBp: string;
71
+ depositFeeShareBp: string;
72
+ depositSharedFeePool: string | undefined;
73
+ bidFeeBp: string;
74
+ depositIncentiveBp: string;
75
+ bidIncentiveBp: string;
76
+ auctionDelayTsMs: string;
77
+ auctionDurationTsMs: string;
78
78
  capacity: string;
79
79
  leverage: string;
80
- risk_level: string;
81
- has_next: boolean;
82
- active_vault_config: VaultConfig;
83
- warmup_vault_config: VaultConfig;
84
- deposit_receipt_display_name: string;
85
- deposit_receipt_display_description: string;
86
- deposit_receipt_display_image_url: string;
87
- bid_receipt_display_name: string;
88
- bid_receipt_display_description: string;
89
- bid_receipt_display_image_url: string;
90
- u64_padding: string[];
91
- bcs_padding: string[];
80
+ riskLevel: string;
81
+ hasNext: boolean;
82
+ activeVaultConfig: VaultConfig;
83
+ warmupVaultConfig: VaultConfig;
84
+ depositReceiptDisplayName: string;
85
+ depositReceiptDisplayDescription: string;
86
+ depositReceiptDisplayImageUrl: string;
87
+ bidReceiptDisplayName: string;
88
+ bidReceiptDisplayDescription: string;
89
+ bidReceiptDisplayImageUrl: string;
90
+ u64Padding: string[];
91
+ bcsPadding: string[];
92
92
  }
93
93
  export interface VaultConfig {
94
- payoff_configs: PayoffConfig[];
95
- strike_increment: string;
96
- decay_speed: string;
97
- initial_price: string;
98
- final_price: string;
94
+ payoffConfigs: PayoffConfig[];
95
+ strikeIncrement: string;
96
+ decaySpeed: string;
97
+ initialPrice: string;
98
+ finalPrice: string;
99
99
  }
100
100
  export interface PayoffConfig {
101
- strike_bp: string;
101
+ strikeBp: string;
102
102
  weight: string;
103
- is_buyer: boolean;
103
+ isBuyer: boolean;
104
104
  strike: string | undefined;
105
105
  }
106
106
  export interface DepositVault {
107
107
  id: string;
108
- deposit_token: string;
109
- bid_token: string;
110
- incentive_token: string | undefined;
108
+ depositToken: string;
109
+ bidToken: string;
110
+ incentiveToken: string | undefined;
111
111
  index: string;
112
- fee_bp: string;
113
- fee_share_bp: string;
114
- shared_fee_pool: string | undefined;
115
- active_share_supply: string;
116
- deactivating_share_supply: string;
117
- inactive_share_supply: string;
118
- warmup_share_supply: string;
119
- premium_share_supply: string;
120
- incentive_share_supply: string;
121
- has_next: boolean;
112
+ feeBp: string;
113
+ feeShareBp: string;
114
+ sharedFeePool: string | undefined;
115
+ activeShareSupply: string;
116
+ deactivatingShareSupply: string;
117
+ inactiveShareSupply: string;
118
+ warmupShareSupply: string;
119
+ premiumShareSupply: string;
120
+ incentiveShareSupply: string;
121
+ hasNext: boolean;
122
122
  name: string;
123
123
  description: string;
124
- image_url: string;
125
- u64_padding: string[];
126
- bcs_padding: string[];
124
+ imageUrl: string;
125
+ u64Padding: string[];
126
+ bcsPadding: string[];
127
127
  }
128
- export declare function getVaults(provider: JsonRpcProvider, typusFrameworkPackageId: string, packageId: string, registry: string, indexes: string[]): Promise<Map<string, DepositShare>>;
128
+ export declare function getVaults(provider: JsonRpcProvider, packageId: string, registry: string, indexes: string[]): Promise<{
129
+ [key: string]: Vault;
130
+ }>;
131
+ export interface Auction {
132
+ id: string;
133
+ index: string;
134
+ token: string;
135
+ startTsMs: string;
136
+ endTsMs: string;
137
+ size: string;
138
+ decaySpeed: string;
139
+ initialPrice: string;
140
+ finalPrice: string;
141
+ feeBp: string;
142
+ incentiveBp: string;
143
+ tokenDecimal: string;
144
+ sizeDecimal: string;
145
+ totalBidSize: string;
146
+ ableToRemoveBid: boolean;
147
+ bidIndex: string;
148
+ }
149
+ export declare function getAuctions(provider: JsonRpcProvider, packageId: string, registry: string, indexes: string[]): Promise<{
150
+ [key: string]: Auction;
151
+ }>;
129
152
  export interface DepositShare {
130
153
  index: string;
131
154
  activeSubVaultUserShare: string;
@@ -52,12 +52,12 @@ var __read = (this && this.__read) || function (o, n) {
52
52
  return ar;
53
53
  };
54
54
  Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.getDepositShares = exports.getVaults = exports.SENDER = void 0;
55
+ exports.getDepositShares = exports.getAuctions = exports.getVaults = exports.SENDER = void 0;
56
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";
60
- function getVaults(provider, typusFrameworkPackageId, packageId, registry, indexes) {
60
+ function getVaults(provider, packageId, registry, indexes) {
61
61
  return __awaiter(this, void 0, void 0, function () {
62
62
  var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
63
63
  return __generator(this, function (_a) {
@@ -75,105 +75,100 @@ function getVaults(provider, typusFrameworkPackageId, packageId, registry, index
75
75
  case 1:
76
76
  results = (_a.sent()).results;
77
77
  bytes = results[results.length - 1].returnValues[0][0];
78
- console.log(JSON.stringify(bytes));
79
78
  reader = new bcs_1.BcsReader(new Uint8Array(bytes));
80
- result = Array.from(new Map()).reduce(function (map, _a) {
81
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
82
- map[key] = value;
83
- return map;
84
- }, {});
79
+ result = {};
85
80
  reader.readVec(function (reader) {
86
81
  reader.read16();
87
82
  var id = (0, tools_1.AddressFromBytes)(reader.readBytes(32));
88
83
  var info = {
89
84
  index: reader.read64(),
90
- option_type: reader.read64(),
85
+ optionType: reader.read64(),
91
86
  period: reader.read8() + "",
92
- activation_ts_ms: reader.read64(),
93
- expiration_ts_ms: reader.read64(),
94
- deposit_token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
95
- bid_token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
96
- oracle_token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
97
- d_token_decimal: reader.read64(),
98
- b_token_decimal: reader.read64(),
99
- o_token_decimal: reader.read64(),
87
+ activationTsMs: reader.read64(),
88
+ expirationTsMs: reader.read64(),
89
+ depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
90
+ bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
91
+ oracleToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
92
+ dTokenDecimal: reader.read64(),
93
+ bTokenDecimal: reader.read64(),
94
+ oTokenDecimal: reader.read64(),
100
95
  creator: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
101
- create_ts_ms: reader.read64(),
96
+ createTsMs: reader.read64(),
102
97
  round: reader.read64(),
103
98
  status: reader.read64(),
104
- oracle_info: {
99
+ oracleInfo: {
105
100
  price: reader.read64(),
106
101
  decimal: reader.read64(),
107
102
  },
108
- delivery_infos: {
103
+ deliveryInfos: {
109
104
  round: reader.read64(),
110
- max_size: reader.read64(),
111
- total_delivery_size: reader.read64(),
112
- total_bidder_bid_value: reader.read64(),
113
- total_bidder_fee: reader.read64(),
114
- total_incentive_bid_value: reader.read64(),
115
- total_incentive_fee: reader.read64(),
116
- delivery_info: reader.readVec(function (reader) {
105
+ maxSize: reader.read64(),
106
+ totalDeliverySize: reader.read64(),
107
+ totalBidderBidValue: reader.read64(),
108
+ totalBidderFee: reader.read64(),
109
+ totalIncentiveBidValue: reader.read64(),
110
+ totalIncentiveFee: reader.read64(),
111
+ deliveryInfo: reader.readVec(function (reader) {
117
112
  return {
118
- delivery_price: reader.read64(),
119
- delivery_size: reader.read64(),
120
- bidder_bid_value: reader.read64(),
121
- bidder_fee: reader.read64(),
122
- incentive_bid_value: reader.read64(),
123
- incentive_fee: reader.read64(),
124
- ts_ms: reader.read64(),
113
+ deliveryPrice: reader.read64(),
114
+ deliverySize: reader.read64(),
115
+ bidderBidValue: reader.read64(),
116
+ bidderFee: reader.read64(),
117
+ incentiveBidValue: reader.read64(),
118
+ incentiveFee: reader.read64(),
119
+ tsMs: reader.read64(),
125
120
  };
126
121
  }),
127
122
  },
128
- settlement_info: reader
123
+ settlementInfo: reader
129
124
  .readVec(function (reader) {
130
125
  return {
131
126
  round: reader.read64(),
132
- oracle_price: reader.read64(),
133
- oracle_price_decimal: reader.read64(),
134
- settle_balance: reader.read64(),
135
- settled_balance: reader.read64(),
136
- share_price: reader.read64(),
137
- share_price_decimal: reader.read64(),
138
- ts_ms: reader.read64(),
127
+ oraclePrice: reader.read64(),
128
+ oraclePriceDecimal: reader.read64(),
129
+ settleBalance: reader.read64(),
130
+ settledBalance: reader.read64(),
131
+ sharePrice: reader.read64(),
132
+ sharePriceDecimal: reader.read64(),
133
+ tsMs: reader.read64(),
139
134
  };
140
135
  })
141
136
  .at(0),
142
- u64_padding: reader.readVec(function (reader) {
137
+ u64Padding: reader.readVec(function (reader) {
143
138
  return reader.read64();
144
139
  }),
145
- bcs_padding: reader.readVec(function (reader) {
140
+ bcsPadding: reader.readVec(function (reader) {
146
141
  return reader.read8();
147
142
  }),
148
143
  };
149
144
  var config = {
150
- oracle_id: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
151
- deposit_lot_size: reader.read64(),
152
- bid_lot_size: reader.read64(),
153
- min_deposit_size: reader.read64(),
154
- min_bid_size: reader.read64(),
155
- deposit_fee_bp: reader.read64(),
156
- deposit_fee_share_bp: reader.read64(),
157
- deposit_shared_fee_pool: reader
145
+ oracleId: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
146
+ depositLotSize: reader.read64(),
147
+ bidLotSize: reader.read64(),
148
+ minDepositSize: reader.read64(),
149
+ minBidSize: reader.read64(),
150
+ depositFeeBp: reader.read64(),
151
+ depositFeeShareBp: reader.read64(),
152
+ depositSharedFeePool: reader
158
153
  .readVec(function (reader) {
159
154
  return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8())));
160
155
  })
161
156
  .at(0),
162
- bid_fee_bp: reader.read64(),
163
- deposit_incentive_bp: reader.read64(),
164
- bid_incentive_bp: reader.read64(),
165
- auction_delay_ts_ms: reader.read64(),
166
- auction_duration_ts_ms: reader.read64(),
157
+ bidFeeBp: reader.read64(),
158
+ depositIncentiveBp: reader.read64(),
159
+ bidIncentiveBp: reader.read64(),
160
+ auctionDelayTsMs: reader.read64(),
161
+ auctionDurationTsMs: reader.read64(),
167
162
  capacity: reader.read64(),
168
163
  leverage: reader.read64(),
169
- risk_level: reader.read64(),
170
- has_next: reader.read8() > 0,
171
- active_vault_config: {
172
- payoff_configs: reader.readVec(function (reader) {
164
+ riskLevel: reader.read64(),
165
+ hasNext: reader.read8() > 0,
166
+ activeVaultConfig: {
167
+ payoffConfigs: reader.readVec(function (reader) {
173
168
  return {
174
- strike_bp: reader.read64(),
169
+ strikeBp: reader.read64(),
175
170
  weight: reader.read64(),
176
- is_buyer: reader.read8() > 0,
171
+ isBuyer: reader.read8() > 0,
177
172
  strike: reader
178
173
  .readVec(function (reader) {
179
174
  return reader.read64();
@@ -181,17 +176,17 @@ function getVaults(provider, typusFrameworkPackageId, packageId, registry, index
181
176
  .at(0),
182
177
  };
183
178
  }),
184
- strike_increment: reader.read64(),
185
- decay_speed: reader.read64(),
186
- initial_price: reader.read64(),
187
- final_price: reader.read64(),
179
+ strikeIncrement: reader.read64(),
180
+ decaySpeed: reader.read64(),
181
+ initialPrice: reader.read64(),
182
+ finalPrice: reader.read64(),
188
183
  },
189
- warmup_vault_config: {
190
- payoff_configs: reader.readVec(function (reader) {
184
+ warmupVaultConfig: {
185
+ payoffConfigs: reader.readVec(function (reader) {
191
186
  return {
192
- strike_bp: reader.read64(),
187
+ strikeBp: reader.read64(),
193
188
  weight: reader.read64(),
194
- is_buyer: reader.read8() > 0,
189
+ isBuyer: reader.read8() > 0,
195
190
  strike: reader
196
191
  .readVec(function (reader) {
197
192
  return reader.read64();
@@ -199,21 +194,21 @@ function getVaults(provider, typusFrameworkPackageId, packageId, registry, index
199
194
  .at(0),
200
195
  };
201
196
  }),
202
- strike_increment: reader.read64(),
203
- decay_speed: reader.read64(),
204
- initial_price: reader.read64(),
205
- final_price: reader.read64(),
197
+ strikeIncrement: reader.read64(),
198
+ decaySpeed: reader.read64(),
199
+ initialPrice: reader.read64(),
200
+ finalPrice: reader.read64(),
206
201
  },
207
- deposit_receipt_display_name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
208
- deposit_receipt_display_description: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
209
- deposit_receipt_display_image_url: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
210
- bid_receipt_display_name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
211
- bid_receipt_display_description: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
212
- bid_receipt_display_image_url: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
213
- u64_padding: reader.readVec(function (reader) {
202
+ depositReceiptDisplayName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
203
+ depositReceiptDisplayDescription: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
204
+ depositReceiptDisplayImageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
205
+ bidReceiptDisplayName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
206
+ bidReceiptDisplayDescription: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
207
+ bidReceiptDisplayImageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
208
+ u64Padding: reader.readVec(function (reader) {
214
209
  return reader.read64();
215
210
  }),
216
- bcs_padding: reader.readVec(function (reader) {
211
+ bcsPadding: reader.readVec(function (reader) {
217
212
  return reader.read8();
218
213
  }),
219
214
  };
@@ -226,37 +221,37 @@ function getVaults(provider, typusFrameworkPackageId, packageId, registry, index
226
221
  reader.readVec(function (reader) {
227
222
  return reader.readBytes(32);
228
223
  }); // tail
229
- var deposit_vault = {
224
+ var depositVault = {
230
225
  id: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
231
- deposit_token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
232
- bid_token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
233
- incentive_token: reader
226
+ depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
227
+ bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
228
+ incentiveToken: reader
234
229
  .readVec(function (reader) {
235
230
  return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8())));
236
231
  })
237
232
  .at(0),
238
233
  index: reader.read64(),
239
- fee_bp: reader.read64(),
240
- fee_share_bp: reader.read64(),
241
- shared_fee_pool: reader
234
+ feeBp: reader.read64(),
235
+ feeShareBp: reader.read64(),
236
+ sharedFeePool: reader
242
237
  .readVec(function (reader) {
243
238
  return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8())));
244
239
  })
245
240
  .at(0),
246
- active_share_supply: reader.read64(),
247
- deactivating_share_supply: reader.read64(),
248
- inactive_share_supply: reader.read64(),
249
- warmup_share_supply: reader.read64(),
250
- premium_share_supply: reader.read64(),
251
- incentive_share_supply: reader.read64(),
252
- has_next: reader.read8() > 0,
241
+ activeShareSupply: reader.read64(),
242
+ deactivatingShareSupply: reader.read64(),
243
+ inactiveShareSupply: reader.read64(),
244
+ warmupShareSupply: reader.read64(),
245
+ premiumShareSupply: reader.read64(),
246
+ incentiveShareSupply: reader.read64(),
247
+ hasNext: reader.read8() > 0,
253
248
  name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
254
249
  description: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
255
- image_url: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
256
- u64_padding: reader.readVec(function (reader) {
250
+ imageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
251
+ u64Padding: reader.readVec(function (reader) {
257
252
  return reader.read64();
258
253
  }),
259
- bcs_padding: reader.readVec(function (reader) {
254
+ bcsPadding: reader.readVec(function (reader) {
260
255
  return reader.read8();
261
256
  }),
262
257
  };
@@ -264,16 +259,86 @@ function getVaults(provider, typusFrameworkPackageId, packageId, registry, index
264
259
  id: id,
265
260
  info: info,
266
261
  config: config,
267
- deposit_vault: deposit_vault,
262
+ depositVault: depositVault,
268
263
  };
269
264
  });
270
- // @ts-ignore
271
265
  return [2 /*return*/, result];
272
266
  }
273
267
  });
274
268
  });
275
269
  }
276
270
  exports.getVaults = getVaults;
271
+ function getAuctions(provider, packageId, registry, indexes) {
272
+ return __awaiter(this, void 0, void 0, function () {
273
+ var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
274
+ return __generator(this, function (_a) {
275
+ switch (_a.label) {
276
+ case 0:
277
+ transactionBlock = new sui_js_1.TransactionBlock();
278
+ target = "".concat(packageId, "::typus_dov_single::get_auction_bcs");
279
+ transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes)];
280
+ transactionBlock.moveCall({
281
+ target: target,
282
+ typeArguments: [],
283
+ arguments: transactionBlockArguments,
284
+ });
285
+ return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: exports.SENDER })];
286
+ case 1:
287
+ results = (_a.sent()).results;
288
+ bytes = results[results.length - 1].returnValues[0][0];
289
+ console.log(JSON.stringify(bytes));
290
+ reader = new bcs_1.BcsReader(new Uint8Array(bytes));
291
+ result = {};
292
+ reader.readVec(function (reader) {
293
+ reader.read16();
294
+ reader.readVec(function (reader) {
295
+ var id = (0, tools_1.AddressFromBytes)(reader.readBytes(32));
296
+ var index = reader.read64();
297
+ var token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8())));
298
+ var startTsMs = reader.read64();
299
+ var endTsMs = reader.read64();
300
+ var size = reader.read64();
301
+ var decaySpeed = reader.read64();
302
+ var initialPrice = reader.read64();
303
+ var finalPrice = reader.read64();
304
+ var feeBp = reader.read64();
305
+ var incentiveBp = reader.read64();
306
+ var tokenDecimal = reader.read64();
307
+ var sizeDecimal = reader.read64();
308
+ var totalBidSize = reader.read64();
309
+ var ableToRemoveBid = reader.read8() > 0;
310
+ // skip bids bytes
311
+ reader.readBytes(32); // id
312
+ reader.read64(); // slice_count
313
+ reader.read64(); // slice_size
314
+ reader.read64(); // length
315
+ var bidIndex = reader.read64();
316
+ result[index] = {
317
+ id: id,
318
+ index: index,
319
+ token: token,
320
+ startTsMs: startTsMs,
321
+ endTsMs: endTsMs,
322
+ size: size,
323
+ decaySpeed: decaySpeed,
324
+ initialPrice: initialPrice,
325
+ finalPrice: finalPrice,
326
+ feeBp: feeBp,
327
+ incentiveBp: incentiveBp,
328
+ tokenDecimal: tokenDecimal,
329
+ sizeDecimal: sizeDecimal,
330
+ totalBidSize: totalBidSize,
331
+ ableToRemoveBid: ableToRemoveBid,
332
+ bidIndex: bidIndex,
333
+ };
334
+ });
335
+ });
336
+ return [2 /*return*/, result];
337
+ }
338
+ });
339
+ });
340
+ }
341
+ exports.getAuctions = getAuctions;
277
342
  function getDepositShares(provider, typusFrameworkPackageId, packageId, registry, receipts) {
278
343
  return __awaiter(this, void 0, void 0, function () {
279
344
  var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
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.108",
5
+ "version": "1.0.110",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/kiosk": "^0.3.3",