@typus/typus-perp-sdk 1.0.54-feat-exp-c → 1.0.55

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.
@@ -1,10 +1,8 @@
1
1
  export declare function getFromSentio(event: string, userAddress: string, startTimestamp: string): Promise<any[]>;
2
+ export declare function getTlpAPRFromSentio(): Promise<number>;
2
3
  export declare function getVolumeFromSentio(): Promise<any[]>;
3
4
  export interface Volume {
4
5
  timestamp: string;
5
6
  value: number;
6
7
  }
7
8
  export declare function getTlpFeeFromSentio(): Promise<number>;
8
- export declare function getTotalVolumeFromSentio(): Promise<number>;
9
- /** Returns Accumulated Users */
10
- export declare function getAccumulatedUser(): Promise<number>;
@@ -37,10 +37,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getFromSentio = getFromSentio;
40
+ exports.getTlpAPRFromSentio = getTlpAPRFromSentio;
40
41
  exports.getVolumeFromSentio = getVolumeFromSentio;
41
42
  exports.getTlpFeeFromSentio = getTlpFeeFromSentio;
42
- exports.getTotalVolumeFromSentio = getTotalVolumeFromSentio;
43
- exports.getAccumulatedUser = getAccumulatedUser;
44
43
  var src_1 = require("../../src");
45
44
  var headers = {
46
45
  "api-key": "ffJa6FwxeJNrQP8NZ5doEMXqdSA7XM6mT",
@@ -84,69 +83,9 @@ function getFromSentio(event, userAddress, startTimestamp) {
84
83
  });
85
84
  });
86
85
  }
87
- function getVolumeFromSentio() {
86
+ function getTlpAPRFromSentio() {
88
87
  return __awaiter(this, void 0, void 0, function () {
89
- var apiUrl, requestData, jsonData, response, data, symbols, volume;
90
- return __generator(this, function (_a) {
91
- switch (_a.label) {
92
- case 0:
93
- apiUrl = src_1.NETWORK == "MAINNET"
94
- ? "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query"
95
- : "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
96
- requestData = {
97
- timeRange: {
98
- start: "now-3d",
99
- end: "now",
100
- step: 3600,
101
- },
102
- limit: 20,
103
- queries: [
104
- {
105
- eventsQuery: {
106
- resource: {
107
- name: "OrderFilled",
108
- type: "EVENTS",
109
- },
110
- alias: "",
111
- id: "a",
112
- aggregation: {
113
- total: {},
114
- },
115
- groupBy: ["base_token"],
116
- limit: 0,
117
- functions: [],
118
- color: "",
119
- disabled: false,
120
- },
121
- dataSource: "EVENTS",
122
- sourceName: "",
123
- },
124
- ],
125
- formulas: [],
126
- };
127
- jsonData = JSON.stringify(requestData);
128
- return [4 /*yield*/, fetch(apiUrl, {
129
- method: "POST",
130
- headers: headers,
131
- body: jsonData,
132
- })];
133
- case 1:
134
- response = _a.sent();
135
- return [4 /*yield*/, response.json()];
136
- case 2:
137
- data = _a.sent();
138
- symbols = data.results[0].matrix.samples.map(function (s) { return s.metric.labels.base_token; });
139
- console.log(symbols);
140
- volume = data.results[0].matrix.samples.map(function (s) { return s.values; });
141
- console.log(volume);
142
- return [2 /*return*/, data.results];
143
- }
144
- });
145
- });
146
- }
147
- function getTlpFeeFromSentio() {
148
- return __awaiter(this, void 0, void 0, function () {
149
- var apiUrl, requestData, jsonData, response, data, first, last, fee;
88
+ var apiUrl, requestData, jsonData, response, data, first, last, r, apr;
150
89
  return __generator(this, function (_a) {
151
90
  switch (_a.label) {
152
91
  case 0:
@@ -163,14 +102,11 @@ function getTlpFeeFromSentio() {
163
102
  queries: [
164
103
  {
165
104
  metricsQuery: {
166
- query: "tlp_fee_usd",
105
+ query: "tlp_price",
167
106
  alias: "",
168
107
  id: "a",
169
108
  labelSelector: {},
170
- aggregate: {
171
- op: "SUM",
172
- grouping: [],
173
- },
109
+ aggregate: null,
174
110
  functions: [],
175
111
  disabled: false,
176
112
  },
@@ -193,16 +129,17 @@ function getTlpFeeFromSentio() {
193
129
  data = _a.sent();
194
130
  first = data.results[0].matrix.samples[0].values[0];
195
131
  last = data.results[0].matrix.samples[0].values.at(-1);
196
- fee = last.value - first.value;
197
- // console.log(fee);
198
- return [2 /*return*/, fee];
132
+ r = last.value / first.value - 1;
133
+ apr = (365 / 7) * r;
134
+ // console.log(apr);
135
+ return [2 /*return*/, apr];
199
136
  }
200
137
  });
201
138
  });
202
139
  }
203
- function getTotalVolumeFromSentio() {
140
+ function getVolumeFromSentio() {
204
141
  return __awaiter(this, void 0, void 0, function () {
205
- var apiUrl, requestData, jsonData, response, data, result;
142
+ var apiUrl, requestData, jsonData, response, data, symbols, volume;
206
143
  return __generator(this, function (_a) {
207
144
  switch (_a.label) {
208
145
  case 0:
@@ -211,27 +148,30 @@ function getTotalVolumeFromSentio() {
211
148
  : "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
212
149
  requestData = {
213
150
  timeRange: {
214
- start: "now-1h",
151
+ start: "now-3d",
215
152
  end: "now",
216
153
  step: 3600,
217
154
  },
218
- limit: 1,
155
+ limit: 20,
219
156
  queries: [
220
157
  {
221
- metricsQuery: {
222
- query: "trading_volume_usd",
158
+ eventsQuery: {
159
+ resource: {
160
+ name: "OrderFilled",
161
+ type: "EVENTS",
162
+ },
223
163
  alias: "",
224
164
  id: "a",
225
- labelSelector: {},
226
- aggregate: {
227
- op: "SUM",
228
- grouping: [],
165
+ aggregation: {
166
+ total: {},
229
167
  },
168
+ groupBy: ["base_token"],
169
+ limit: 0,
230
170
  functions: [],
231
171
  color: "",
232
172
  disabled: false,
233
173
  },
234
- dataSource: "METRICS",
174
+ dataSource: "EVENTS",
235
175
  sourceName: "",
236
176
  },
237
177
  ],
@@ -248,17 +188,18 @@ function getTotalVolumeFromSentio() {
248
188
  return [4 /*yield*/, response.json()];
249
189
  case 2:
250
190
  data = _a.sent();
251
- result = data.results[0].matrix.samples[0].values.at(-1).value;
252
- // console.log(result);
253
- return [2 /*return*/, result];
191
+ symbols = data.results[0].matrix.samples.map(function (s) { return s.metric.labels.base_token; });
192
+ console.log(symbols);
193
+ volume = data.results[0].matrix.samples.map(function (s) { return s.values; });
194
+ console.log(volume);
195
+ return [2 /*return*/, data.results];
254
196
  }
255
197
  });
256
198
  });
257
199
  }
258
- /** Returns Accumulated Users */
259
- function getAccumulatedUser() {
200
+ function getTlpFeeFromSentio() {
260
201
  return __awaiter(this, void 0, void 0, function () {
261
- var apiUrl, requestData, jsonData, response, data, result;
202
+ var apiUrl, requestData, jsonData, response, data, first, last, fee;
262
203
  return __generator(this, function (_a) {
263
204
  switch (_a.label) {
264
205
  case 0:
@@ -267,35 +208,26 @@ function getAccumulatedUser() {
267
208
  : "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
268
209
  requestData = {
269
210
  timeRange: {
270
- start: "now-1h",
211
+ start: "now-7d",
271
212
  end: "now",
272
213
  step: 3600,
273
- timezone: "Asia/Taipei",
274
214
  },
275
- limit: 1,
215
+ limit: 20,
276
216
  queries: [
277
217
  {
278
- eventsQuery: {
279
- resource: {
280
- name: "",
281
- type: "EVENTS",
282
- },
218
+ metricsQuery: {
219
+ query: "tlp_fee_usd",
283
220
  alias: "",
284
221
  id: "a",
285
- aggregation: {
286
- countUnique: {
287
- duration: {
288
- value: 0,
289
- unit: "day",
290
- },
291
- },
222
+ labelSelector: {},
223
+ aggregate: {
224
+ op: "SUM",
225
+ grouping: [],
292
226
  },
293
- groupBy: [],
294
- limit: 1,
295
227
  functions: [],
296
228
  disabled: false,
297
229
  },
298
- dataSource: "EVENTS",
230
+ dataSource: "METRICS",
299
231
  sourceName: "",
300
232
  },
301
233
  ],
@@ -312,14 +244,15 @@ function getAccumulatedUser() {
312
244
  return [4 /*yield*/, response.json()];
313
245
  case 2:
314
246
  data = _a.sent();
315
- result = data.results[0].matrix.samples[0].values.at(-1).value;
316
- // console.log(result);
317
- return [2 /*return*/, result];
247
+ first = data.results[0].matrix.samples[0].values[0];
248
+ last = data.results[0].matrix.samples[0].values.at(-1);
249
+ fee = last.value - first.value;
250
+ // console.log(fee);
251
+ return [2 /*return*/, fee];
318
252
  }
319
253
  });
320
254
  });
321
255
  }
256
+ // getTlpAPRFromSentio();
322
257
  // getVolumeFromSentio();
323
258
  // getTlpFeeFromSentio();
324
- // getAccumulatedUser();
325
- // getTotalVolumeFromSentio();
package/dist/src/index.js CHANGED
@@ -39,8 +39,8 @@ exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
39
39
  ? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
40
40
  : "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
41
41
  exports.STAKE_PUBLISHED_AT = exports.NETWORK == "MAINNET"
42
- ? "0xd9965c09d5ad7d69306b7c550b3b135d94b34f98c3adc379a7333fff2f05808b"
43
- : "0x34ba6bf1893409b1a7494350189e060ee79cc2aba6f0c5e4045af9372d96fe85";
42
+ ? "0xd50ea488da2b586c3db4e8ad805e9f8aa4891d315d6fc53517d662c3f6fd1b4c"
43
+ : "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
44
44
  exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
45
45
  ? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
46
46
  : "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
@@ -122,16 +122,6 @@ export interface RemoveUserShareByIdArgs {
122
122
  userShareId: bigint | TransactionArgument;
123
123
  }
124
124
  export declare function removeUserShareById(tx: Transaction, args: RemoveUserShareByIdArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
125
- export interface SnapshotArgs {
126
- version: TransactionObjectInput;
127
- registry: TransactionObjectInput;
128
- typusEcosystemVersion: TransactionObjectInput;
129
- typusUserRegistry: TransactionObjectInput;
130
- index: bigint | TransactionArgument;
131
- userShareId: bigint | TransactionArgument;
132
- clock: TransactionObjectInput;
133
- }
134
- export declare function snapshot(tx: Transaction, args: SnapshotArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
135
125
  export interface StakeArgs {
136
126
  version: TransactionObjectInput;
137
127
  registry: TransactionObjectInput;
@@ -174,14 +164,6 @@ export interface UpdateIncentiveConfigArgs {
174
164
  u64Padding: Array<bigint | TransactionArgument> | TransactionArgument | TransactionArgument | null;
175
165
  }
176
166
  export declare function updateIncentiveConfig(tx: Transaction, typeArg: string, args: UpdateIncentiveConfigArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
177
- export interface UpdatePoolInfoU64PaddingArgs {
178
- version: TransactionObjectInput;
179
- registry: TransactionObjectInput;
180
- index: bigint | TransactionArgument;
181
- tlpPrice: bigint | TransactionArgument;
182
- usdPerExp: bigint | TransactionArgument;
183
- }
184
- export declare function updatePoolInfoU64Padding(tx: Transaction, args: UpdatePoolInfoU64PaddingArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
185
167
  export interface UpdateUnlockCountdownTsMsArgs {
186
168
  version: TransactionObjectInput;
187
169
  registry: TransactionObjectInput;
@@ -24,13 +24,11 @@ exports.newStakePool = newStakePool;
24
24
  exports.removeIncentive = removeIncentive;
25
25
  exports.removeIncentiveToken = removeIncentiveToken;
26
26
  exports.removeUserShareById = removeUserShareById;
27
- exports.snapshot = snapshot;
28
27
  exports.stake = stake;
29
28
  exports.storeUserShares = storeUserShares;
30
29
  exports.unstake = unstake;
31
30
  exports.unsubscribe = unsubscribe;
32
31
  exports.updateIncentiveConfig = updateIncentiveConfig;
33
- exports.updatePoolInfoU64Padding = updatePoolInfoU64Padding;
34
32
  exports.updateUnlockCountdownTsMs = updateUnlockCountdownTsMs;
35
33
  exports.withdrawIncentive = withdrawIncentive;
36
34
  var __1 = require("..");
@@ -214,21 +212,6 @@ function removeUserShareById(tx, args, published_at) {
214
212
  arguments: [(0, util_1.obj)(tx, args.id), (0, util_1.pure)(tx, args.user, "address"), (0, util_1.pure)(tx, args.userShareId, "u64")],
215
213
  });
216
214
  }
217
- function snapshot(tx, args, published_at) {
218
- if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
219
- return tx.moveCall({
220
- target: "".concat(published_at, "::stake_pool::snapshot"),
221
- arguments: [
222
- (0, util_1.obj)(tx, args.version),
223
- (0, util_1.obj)(tx, args.registry),
224
- (0, util_1.obj)(tx, args.typusEcosystemVersion),
225
- (0, util_1.obj)(tx, args.typusUserRegistry),
226
- (0, util_1.pure)(tx, args.index, "u64"),
227
- (0, util_1.pure)(tx, args.userShareId, "u64"),
228
- (0, util_1.obj)(tx, args.clock),
229
- ],
230
- });
231
- }
232
215
  function stake(tx, typeArg, args, published_at) {
233
216
  if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
234
217
  return tx.moveCall({
@@ -296,19 +279,6 @@ function updateIncentiveConfig(tx, typeArg, args, published_at) {
296
279
  ],
297
280
  });
298
281
  }
299
- function updatePoolInfoU64Padding(tx, args, published_at) {
300
- if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
301
- return tx.moveCall({
302
- target: "".concat(published_at, "::stake_pool::update_pool_info_u64_padding"),
303
- arguments: [
304
- (0, util_1.obj)(tx, args.version),
305
- (0, util_1.obj)(tx, args.registry),
306
- (0, util_1.pure)(tx, args.index, "u64"),
307
- (0, util_1.pure)(tx, args.tlpPrice, "u64"),
308
- (0, util_1.pure)(tx, args.usdPerExp, "u64"),
309
- ],
310
- });
311
- }
312
282
  function updateUnlockCountdownTsMs(tx, args, published_at) {
313
283
  if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
314
284
  return tx.moveCall({
@@ -1189,98 +1189,6 @@ export declare class RemoveIncentiveTokenEvent implements StructClass {
1189
1189
  static fromSuiObjectData(data: SuiObjectData): RemoveIncentiveTokenEvent;
1190
1190
  static fetch(client: SuiClient, id: string): Promise<RemoveIncentiveTokenEvent>;
1191
1191
  }
1192
- export declare function isSnapshotEvent(type: string): boolean;
1193
- export interface SnapshotEventFields {
1194
- sender: ToField<"address">;
1195
- index: ToField<"u64">;
1196
- userShareId: ToField<"u64">;
1197
- shares: ToField<"u64">;
1198
- tlpPrice: ToField<"u64">;
1199
- lastTsMs: ToField<"u64">;
1200
- currentTsMs: ToField<"u64">;
1201
- exp: ToField<"u64">;
1202
- u64Padding: ToField<Vector<"u64">>;
1203
- }
1204
- export type SnapshotEventReified = Reified<SnapshotEvent, SnapshotEventFields>;
1205
- export declare class SnapshotEvent implements StructClass {
1206
- __StructClass: true;
1207
- static readonly $typeName: string;
1208
- static readonly $numTypeParams = 0;
1209
- static readonly $isPhantom: readonly [];
1210
- readonly $typeName: string;
1211
- readonly $fullTypeName: `${typeof PKG_V1}::stake_pool::SnapshotEvent`;
1212
- readonly $typeArgs: [];
1213
- readonly $isPhantom: readonly [];
1214
- readonly sender: ToField<"address">;
1215
- readonly index: ToField<"u64">;
1216
- readonly userShareId: ToField<"u64">;
1217
- readonly shares: ToField<"u64">;
1218
- readonly tlpPrice: ToField<"u64">;
1219
- readonly lastTsMs: ToField<"u64">;
1220
- readonly currentTsMs: ToField<"u64">;
1221
- readonly exp: ToField<"u64">;
1222
- readonly u64Padding: ToField<Vector<"u64">>;
1223
- private constructor();
1224
- static reified(): SnapshotEventReified;
1225
- static get r(): reified.StructClassReified<SnapshotEvent, SnapshotEventFields>;
1226
- static phantom(): PhantomReified<ToTypeStr<SnapshotEvent>>;
1227
- static get p(): reified.PhantomReified<"0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966::stake_pool::SnapshotEvent" | "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6::stake_pool::SnapshotEvent">;
1228
- static get bcs(): import("@mysten/sui/bcs").BcsType<{
1229
- sender: string;
1230
- index: string;
1231
- user_share_id: string;
1232
- shares: string;
1233
- tlp_price: string;
1234
- last_ts_ms: string;
1235
- current_ts_ms: string;
1236
- exp: string;
1237
- u64_padding: string[];
1238
- }, {
1239
- sender: string;
1240
- index: string | number | bigint;
1241
- user_share_id: string | number | bigint;
1242
- shares: string | number | bigint;
1243
- tlp_price: string | number | bigint;
1244
- last_ts_ms: string | number | bigint;
1245
- current_ts_ms: string | number | bigint;
1246
- exp: string | number | bigint;
1247
- u64_padding: Iterable<string | number | bigint> & {
1248
- length: number;
1249
- };
1250
- }>;
1251
- static fromFields(fields: Record<string, any>): SnapshotEvent;
1252
- static fromFieldsWithTypes(item: FieldsWithTypes): SnapshotEvent;
1253
- static fromBcs(data: Uint8Array): SnapshotEvent;
1254
- toJSONField(): {
1255
- sender: string;
1256
- index: string;
1257
- userShareId: string;
1258
- shares: string;
1259
- tlpPrice: string;
1260
- lastTsMs: string;
1261
- currentTsMs: string;
1262
- exp: string;
1263
- u64Padding: string[];
1264
- };
1265
- toJSON(): {
1266
- sender: string;
1267
- index: string;
1268
- userShareId: string;
1269
- shares: string;
1270
- tlpPrice: string;
1271
- lastTsMs: string;
1272
- currentTsMs: string;
1273
- exp: string;
1274
- u64Padding: string[];
1275
- $typeName: string;
1276
- $typeArgs: [];
1277
- };
1278
- static fromJSONField(field: any): SnapshotEvent;
1279
- static fromJSON(json: Record<string, any>): SnapshotEvent;
1280
- static fromSuiParsedData(content: SuiParsedData): SnapshotEvent;
1281
- static fromSuiObjectData(data: SuiObjectData): SnapshotEvent;
1282
- static fetch(client: SuiClient, id: string): Promise<SnapshotEvent>;
1283
- }
1284
1192
  export declare function isStakeEvent(type: string): boolean;
1285
1193
  export interface StakeEventFields {
1286
1194
  sender: ToField<"address">;
@@ -2119,62 +2027,6 @@ export declare class UpdateIncentiveConfigEvent implements StructClass {
2119
2027
  static fromSuiObjectData(data: SuiObjectData): UpdateIncentiveConfigEvent;
2120
2028
  static fetch(client: SuiClient, id: string): Promise<UpdateIncentiveConfigEvent>;
2121
2029
  }
2122
- export declare function isUpdatePoolInfoU64PaddingEvent(type: string): boolean;
2123
- export interface UpdatePoolInfoU64PaddingEventFields {
2124
- sender: ToField<"address">;
2125
- index: ToField<"u64">;
2126
- u64Padding: ToField<Vector<"u64">>;
2127
- }
2128
- export type UpdatePoolInfoU64PaddingEventReified = Reified<UpdatePoolInfoU64PaddingEvent, UpdatePoolInfoU64PaddingEventFields>;
2129
- export declare class UpdatePoolInfoU64PaddingEvent implements StructClass {
2130
- __StructClass: true;
2131
- static readonly $typeName: string;
2132
- static readonly $numTypeParams = 0;
2133
- static readonly $isPhantom: readonly [];
2134
- readonly $typeName: string;
2135
- readonly $fullTypeName: `${typeof PKG_V1}::stake_pool::UpdatePoolInfoU64PaddingEvent`;
2136
- readonly $typeArgs: [];
2137
- readonly $isPhantom: readonly [];
2138
- readonly sender: ToField<"address">;
2139
- readonly index: ToField<"u64">;
2140
- readonly u64Padding: ToField<Vector<"u64">>;
2141
- private constructor();
2142
- static reified(): UpdatePoolInfoU64PaddingEventReified;
2143
- static get r(): reified.StructClassReified<UpdatePoolInfoU64PaddingEvent, UpdatePoolInfoU64PaddingEventFields>;
2144
- static phantom(): PhantomReified<ToTypeStr<UpdatePoolInfoU64PaddingEvent>>;
2145
- static get p(): reified.PhantomReified<"0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966::stake_pool::UpdatePoolInfoU64PaddingEvent" | "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6::stake_pool::UpdatePoolInfoU64PaddingEvent">;
2146
- static get bcs(): import("@mysten/sui/bcs").BcsType<{
2147
- sender: string;
2148
- index: string;
2149
- u64_padding: string[];
2150
- }, {
2151
- sender: string;
2152
- index: string | number | bigint;
2153
- u64_padding: Iterable<string | number | bigint> & {
2154
- length: number;
2155
- };
2156
- }>;
2157
- static fromFields(fields: Record<string, any>): UpdatePoolInfoU64PaddingEvent;
2158
- static fromFieldsWithTypes(item: FieldsWithTypes): UpdatePoolInfoU64PaddingEvent;
2159
- static fromBcs(data: Uint8Array): UpdatePoolInfoU64PaddingEvent;
2160
- toJSONField(): {
2161
- sender: string;
2162
- index: string;
2163
- u64Padding: string[];
2164
- };
2165
- toJSON(): {
2166
- sender: string;
2167
- index: string;
2168
- u64Padding: string[];
2169
- $typeName: string;
2170
- $typeArgs: [];
2171
- };
2172
- static fromJSONField(field: any): UpdatePoolInfoU64PaddingEvent;
2173
- static fromJSON(json: Record<string, any>): UpdatePoolInfoU64PaddingEvent;
2174
- static fromSuiParsedData(content: SuiParsedData): UpdatePoolInfoU64PaddingEvent;
2175
- static fromSuiObjectData(data: SuiObjectData): UpdatePoolInfoU64PaddingEvent;
2176
- static fetch(client: SuiClient, id: string): Promise<UpdatePoolInfoU64PaddingEvent>;
2177
- }
2178
2030
  export declare function isUpdateUnlockCountdownTsMsEvent(type: string): boolean;
2179
2031
  export interface UpdateUnlockCountdownTsMsEventFields {
2180
2032
  sender: ToField<"address">;
@@ -105,7 +105,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
105
105
  return to.concat(ar || Array.prototype.slice.call(from));
106
106
  };
107
107
  Object.defineProperty(exports, "__esModule", { value: true });
108
- exports.WithdrawIncentiveEvent = exports.UpdateUnlockCountdownTsMsEvent = exports.UpdatePoolInfoU64PaddingEvent = exports.UpdateIncentiveConfigEvent = exports.UnsubscribeEvent = exports.UnstakeEvent = exports.StakePoolRegistry = exports.StakePoolInfo = exports.StakePoolConfig = exports.StakePool = exports.StakeEvent = exports.SnapshotEvent = exports.RemoveIncentiveTokenEvent = exports.NewStakePoolEvent = exports.LpUserShare = exports.IncentiveInfo = exports.IncentiveConfig = exports.Incentive = exports.HarvestPerUserShareEvent = exports.DepositIncentiveEvent = exports.DeactivatingShares = exports.DeactivateIncentiveTokenEvent = exports.AddIncentiveTokenEvent = exports.ActivateIncentiveTokenEvent = void 0;
108
+ exports.WithdrawIncentiveEvent = exports.UpdateUnlockCountdownTsMsEvent = exports.UpdateIncentiveConfigEvent = exports.UnsubscribeEvent = exports.UnstakeEvent = exports.StakePoolRegistry = exports.StakePoolInfo = exports.StakePoolConfig = exports.StakePool = exports.StakeEvent = exports.RemoveIncentiveTokenEvent = exports.NewStakePoolEvent = exports.LpUserShare = exports.IncentiveInfo = exports.IncentiveConfig = exports.Incentive = exports.HarvestPerUserShareEvent = exports.DepositIncentiveEvent = exports.DeactivatingShares = exports.DeactivateIncentiveTokenEvent = exports.AddIncentiveTokenEvent = exports.ActivateIncentiveTokenEvent = void 0;
109
109
  exports.isActivateIncentiveTokenEvent = isActivateIncentiveTokenEvent;
110
110
  exports.isAddIncentiveTokenEvent = isAddIncentiveTokenEvent;
111
111
  exports.isDeactivateIncentiveTokenEvent = isDeactivateIncentiveTokenEvent;
@@ -118,7 +118,6 @@ exports.isIncentiveInfo = isIncentiveInfo;
118
118
  exports.isLpUserShare = isLpUserShare;
119
119
  exports.isNewStakePoolEvent = isNewStakePoolEvent;
120
120
  exports.isRemoveIncentiveTokenEvent = isRemoveIncentiveTokenEvent;
121
- exports.isSnapshotEvent = isSnapshotEvent;
122
121
  exports.isStakeEvent = isStakeEvent;
123
122
  exports.isStakePool = isStakePool;
124
123
  exports.isStakePoolConfig = isStakePoolConfig;
@@ -127,7 +126,6 @@ exports.isStakePoolRegistry = isStakePoolRegistry;
127
126
  exports.isUnstakeEvent = isUnstakeEvent;
128
127
  exports.isUnsubscribeEvent = isUnsubscribeEvent;
129
128
  exports.isUpdateIncentiveConfigEvent = isUpdateIncentiveConfigEvent;
130
- exports.isUpdatePoolInfoU64PaddingEvent = isUpdatePoolInfoU64PaddingEvent;
131
129
  exports.isUpdateUnlockCountdownTsMsEvent = isUpdateUnlockCountdownTsMsEvent;
132
130
  exports.isWithdrawIncentiveEvent = isWithdrawIncentiveEvent;
133
131
  var reified = __importStar(require("../../_framework/reified"));
@@ -2179,201 +2177,6 @@ var RemoveIncentiveTokenEvent = /** @class */ (function () {
2179
2177
  return RemoveIncentiveTokenEvent;
2180
2178
  }());
2181
2179
  exports.RemoveIncentiveTokenEvent = RemoveIncentiveTokenEvent;
2182
- /* ============================== SnapshotEvent =============================== */
2183
- function isSnapshotEvent(type) {
2184
- type = (0, util_1.compressSuiType)(type);
2185
- return type === "".concat(index_1.PKG_V1, "::stake_pool::SnapshotEvent");
2186
- }
2187
- var SnapshotEvent = /** @class */ (function () {
2188
- function SnapshotEvent(typeArgs, fields) {
2189
- this.__StructClass = true;
2190
- this.$typeName = SnapshotEvent.$typeName;
2191
- this.$isPhantom = SnapshotEvent.$isPhantom;
2192
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SnapshotEvent.$typeName], __read(typeArgs), false));
2193
- this.$typeArgs = typeArgs;
2194
- this.sender = fields.sender;
2195
- this.index = fields.index;
2196
- this.userShareId = fields.userShareId;
2197
- this.shares = fields.shares;
2198
- this.tlpPrice = fields.tlpPrice;
2199
- this.lastTsMs = fields.lastTsMs;
2200
- this.currentTsMs = fields.currentTsMs;
2201
- this.exp = fields.exp;
2202
- this.u64Padding = fields.u64Padding;
2203
- }
2204
- SnapshotEvent.reified = function () {
2205
- var _this = this;
2206
- return {
2207
- typeName: SnapshotEvent.$typeName,
2208
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SnapshotEvent.$typeName], [], false)),
2209
- typeArgs: [],
2210
- isPhantom: SnapshotEvent.$isPhantom,
2211
- reifiedTypeArgs: [],
2212
- fromFields: function (fields) { return SnapshotEvent.fromFields(fields); },
2213
- fromFieldsWithTypes: function (item) { return SnapshotEvent.fromFieldsWithTypes(item); },
2214
- fromBcs: function (data) { return SnapshotEvent.fromBcs(data); },
2215
- bcs: SnapshotEvent.bcs,
2216
- fromJSONField: function (field) { return SnapshotEvent.fromJSONField(field); },
2217
- fromJSON: function (json) { return SnapshotEvent.fromJSON(json); },
2218
- fromSuiParsedData: function (content) { return SnapshotEvent.fromSuiParsedData(content); },
2219
- fromSuiObjectData: function (content) { return SnapshotEvent.fromSuiObjectData(content); },
2220
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2221
- return [2 /*return*/, SnapshotEvent.fetch(client, id)];
2222
- }); }); },
2223
- new: function (fields) {
2224
- return new SnapshotEvent([], fields);
2225
- },
2226
- kind: "StructClassReified",
2227
- };
2228
- };
2229
- Object.defineProperty(SnapshotEvent, "r", {
2230
- get: function () {
2231
- return SnapshotEvent.reified();
2232
- },
2233
- enumerable: false,
2234
- configurable: true
2235
- });
2236
- SnapshotEvent.phantom = function () {
2237
- return (0, reified_1.phantom)(SnapshotEvent.reified());
2238
- };
2239
- Object.defineProperty(SnapshotEvent, "p", {
2240
- get: function () {
2241
- return SnapshotEvent.phantom();
2242
- },
2243
- enumerable: false,
2244
- configurable: true
2245
- });
2246
- Object.defineProperty(SnapshotEvent, "bcs", {
2247
- get: function () {
2248
- return bcs_1.bcs.struct("SnapshotEvent", {
2249
- sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2250
- index: bcs_1.bcs.u64(),
2251
- user_share_id: bcs_1.bcs.u64(),
2252
- shares: bcs_1.bcs.u64(),
2253
- tlp_price: bcs_1.bcs.u64(),
2254
- last_ts_ms: bcs_1.bcs.u64(),
2255
- current_ts_ms: bcs_1.bcs.u64(),
2256
- exp: bcs_1.bcs.u64(),
2257
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2258
- });
2259
- },
2260
- enumerable: false,
2261
- configurable: true
2262
- });
2263
- SnapshotEvent.fromFields = function (fields) {
2264
- return SnapshotEvent.reified().new({
2265
- sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2266
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
2267
- userShareId: (0, reified_1.decodeFromFields)("u64", fields.user_share_id),
2268
- shares: (0, reified_1.decodeFromFields)("u64", fields.shares),
2269
- tlpPrice: (0, reified_1.decodeFromFields)("u64", fields.tlp_price),
2270
- lastTsMs: (0, reified_1.decodeFromFields)("u64", fields.last_ts_ms),
2271
- currentTsMs: (0, reified_1.decodeFromFields)("u64", fields.current_ts_ms),
2272
- exp: (0, reified_1.decodeFromFields)("u64", fields.exp),
2273
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2274
- });
2275
- };
2276
- SnapshotEvent.fromFieldsWithTypes = function (item) {
2277
- if (!isSnapshotEvent(item.type)) {
2278
- throw new Error("not a SnapshotEvent type");
2279
- }
2280
- return SnapshotEvent.reified().new({
2281
- sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2282
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2283
- userShareId: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.user_share_id),
2284
- shares: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.shares),
2285
- tlpPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.tlp_price),
2286
- lastTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.last_ts_ms),
2287
- currentTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.current_ts_ms),
2288
- exp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.exp),
2289
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2290
- });
2291
- };
2292
- SnapshotEvent.fromBcs = function (data) {
2293
- return SnapshotEvent.fromFields(SnapshotEvent.bcs.parse(data));
2294
- };
2295
- SnapshotEvent.prototype.toJSONField = function () {
2296
- return {
2297
- sender: this.sender,
2298
- index: this.index.toString(),
2299
- userShareId: this.userShareId.toString(),
2300
- shares: this.shares.toString(),
2301
- tlpPrice: this.tlpPrice.toString(),
2302
- lastTsMs: this.lastTsMs.toString(),
2303
- currentTsMs: this.currentTsMs.toString(),
2304
- exp: this.exp.toString(),
2305
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2306
- };
2307
- };
2308
- SnapshotEvent.prototype.toJSON = function () {
2309
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2310
- };
2311
- SnapshotEvent.fromJSONField = function (field) {
2312
- return SnapshotEvent.reified().new({
2313
- sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2314
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2315
- userShareId: (0, reified_1.decodeFromJSONField)("u64", field.userShareId),
2316
- shares: (0, reified_1.decodeFromJSONField)("u64", field.shares),
2317
- tlpPrice: (0, reified_1.decodeFromJSONField)("u64", field.tlpPrice),
2318
- lastTsMs: (0, reified_1.decodeFromJSONField)("u64", field.lastTsMs),
2319
- currentTsMs: (0, reified_1.decodeFromJSONField)("u64", field.currentTsMs),
2320
- exp: (0, reified_1.decodeFromJSONField)("u64", field.exp),
2321
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2322
- });
2323
- };
2324
- SnapshotEvent.fromJSON = function (json) {
2325
- if (json.$typeName !== SnapshotEvent.$typeName) {
2326
- throw new Error("not a WithTwoGenerics json object");
2327
- }
2328
- return SnapshotEvent.fromJSONField(json);
2329
- };
2330
- SnapshotEvent.fromSuiParsedData = function (content) {
2331
- if (content.dataType !== "moveObject") {
2332
- throw new Error("not an object");
2333
- }
2334
- if (!isSnapshotEvent(content.type)) {
2335
- throw new Error("object at ".concat(content.fields.id, " is not a SnapshotEvent object"));
2336
- }
2337
- return SnapshotEvent.fromFieldsWithTypes(content);
2338
- };
2339
- SnapshotEvent.fromSuiObjectData = function (data) {
2340
- if (data.bcs) {
2341
- if (data.bcs.dataType !== "moveObject" || !isSnapshotEvent(data.bcs.type)) {
2342
- throw new Error("object at is not a SnapshotEvent object");
2343
- }
2344
- return SnapshotEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2345
- }
2346
- if (data.content) {
2347
- return SnapshotEvent.fromSuiParsedData(data.content);
2348
- }
2349
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2350
- };
2351
- SnapshotEvent.fetch = function (client, id) {
2352
- return __awaiter(this, void 0, void 0, function () {
2353
- var res;
2354
- var _a, _b;
2355
- return __generator(this, function (_c) {
2356
- switch (_c.label) {
2357
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2358
- case 1:
2359
- res = _c.sent();
2360
- if (res.error) {
2361
- throw new Error("error fetching SnapshotEvent object at id ".concat(id, ": ").concat(res.error.code));
2362
- }
2363
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isSnapshotEvent(res.data.bcs.type)) {
2364
- throw new Error("object at id ".concat(id, " is not a SnapshotEvent object"));
2365
- }
2366
- return [2 /*return*/, SnapshotEvent.fromSuiObjectData(res.data)];
2367
- }
2368
- });
2369
- });
2370
- };
2371
- SnapshotEvent.$typeName = "".concat(index_1.PKG_V1, "::stake_pool::SnapshotEvent");
2372
- SnapshotEvent.$numTypeParams = 0;
2373
- SnapshotEvent.$isPhantom = [];
2374
- return SnapshotEvent;
2375
- }());
2376
- exports.SnapshotEvent = SnapshotEvent;
2377
2180
  /* ============================== StakeEvent =============================== */
2378
2181
  function isStakeEvent(type) {
2379
2182
  type = (0, util_1.compressSuiType)(type);
@@ -3760,165 +3563,6 @@ var UpdateIncentiveConfigEvent = /** @class */ (function () {
3760
3563
  return UpdateIncentiveConfigEvent;
3761
3564
  }());
3762
3565
  exports.UpdateIncentiveConfigEvent = UpdateIncentiveConfigEvent;
3763
- /* ============================== UpdatePoolInfoU64PaddingEvent =============================== */
3764
- function isUpdatePoolInfoU64PaddingEvent(type) {
3765
- type = (0, util_1.compressSuiType)(type);
3766
- return type === "".concat(index_1.PKG_V1, "::stake_pool::UpdatePoolInfoU64PaddingEvent");
3767
- }
3768
- var UpdatePoolInfoU64PaddingEvent = /** @class */ (function () {
3769
- function UpdatePoolInfoU64PaddingEvent(typeArgs, fields) {
3770
- this.__StructClass = true;
3771
- this.$typeName = UpdatePoolInfoU64PaddingEvent.$typeName;
3772
- this.$isPhantom = UpdatePoolInfoU64PaddingEvent.$isPhantom;
3773
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdatePoolInfoU64PaddingEvent.$typeName], __read(typeArgs), false));
3774
- this.$typeArgs = typeArgs;
3775
- this.sender = fields.sender;
3776
- this.index = fields.index;
3777
- this.u64Padding = fields.u64Padding;
3778
- }
3779
- UpdatePoolInfoU64PaddingEvent.reified = function () {
3780
- var _this = this;
3781
- return {
3782
- typeName: UpdatePoolInfoU64PaddingEvent.$typeName,
3783
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdatePoolInfoU64PaddingEvent.$typeName], [], false)),
3784
- typeArgs: [],
3785
- isPhantom: UpdatePoolInfoU64PaddingEvent.$isPhantom,
3786
- reifiedTypeArgs: [],
3787
- fromFields: function (fields) { return UpdatePoolInfoU64PaddingEvent.fromFields(fields); },
3788
- fromFieldsWithTypes: function (item) { return UpdatePoolInfoU64PaddingEvent.fromFieldsWithTypes(item); },
3789
- fromBcs: function (data) { return UpdatePoolInfoU64PaddingEvent.fromBcs(data); },
3790
- bcs: UpdatePoolInfoU64PaddingEvent.bcs,
3791
- fromJSONField: function (field) { return UpdatePoolInfoU64PaddingEvent.fromJSONField(field); },
3792
- fromJSON: function (json) { return UpdatePoolInfoU64PaddingEvent.fromJSON(json); },
3793
- fromSuiParsedData: function (content) { return UpdatePoolInfoU64PaddingEvent.fromSuiParsedData(content); },
3794
- fromSuiObjectData: function (content) { return UpdatePoolInfoU64PaddingEvent.fromSuiObjectData(content); },
3795
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3796
- return [2 /*return*/, UpdatePoolInfoU64PaddingEvent.fetch(client, id)];
3797
- }); }); },
3798
- new: function (fields) {
3799
- return new UpdatePoolInfoU64PaddingEvent([], fields);
3800
- },
3801
- kind: "StructClassReified",
3802
- };
3803
- };
3804
- Object.defineProperty(UpdatePoolInfoU64PaddingEvent, "r", {
3805
- get: function () {
3806
- return UpdatePoolInfoU64PaddingEvent.reified();
3807
- },
3808
- enumerable: false,
3809
- configurable: true
3810
- });
3811
- UpdatePoolInfoU64PaddingEvent.phantom = function () {
3812
- return (0, reified_1.phantom)(UpdatePoolInfoU64PaddingEvent.reified());
3813
- };
3814
- Object.defineProperty(UpdatePoolInfoU64PaddingEvent, "p", {
3815
- get: function () {
3816
- return UpdatePoolInfoU64PaddingEvent.phantom();
3817
- },
3818
- enumerable: false,
3819
- configurable: true
3820
- });
3821
- Object.defineProperty(UpdatePoolInfoU64PaddingEvent, "bcs", {
3822
- get: function () {
3823
- return bcs_1.bcs.struct("UpdatePoolInfoU64PaddingEvent", {
3824
- sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
3825
- index: bcs_1.bcs.u64(),
3826
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3827
- });
3828
- },
3829
- enumerable: false,
3830
- configurable: true
3831
- });
3832
- UpdatePoolInfoU64PaddingEvent.fromFields = function (fields) {
3833
- return UpdatePoolInfoU64PaddingEvent.reified().new({
3834
- sender: (0, reified_1.decodeFromFields)("address", fields.sender),
3835
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
3836
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3837
- });
3838
- };
3839
- UpdatePoolInfoU64PaddingEvent.fromFieldsWithTypes = function (item) {
3840
- if (!isUpdatePoolInfoU64PaddingEvent(item.type)) {
3841
- throw new Error("not a UpdatePoolInfoU64PaddingEvent type");
3842
- }
3843
- return UpdatePoolInfoU64PaddingEvent.reified().new({
3844
- sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
3845
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
3846
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3847
- });
3848
- };
3849
- UpdatePoolInfoU64PaddingEvent.fromBcs = function (data) {
3850
- return UpdatePoolInfoU64PaddingEvent.fromFields(UpdatePoolInfoU64PaddingEvent.bcs.parse(data));
3851
- };
3852
- UpdatePoolInfoU64PaddingEvent.prototype.toJSONField = function () {
3853
- return {
3854
- sender: this.sender,
3855
- index: this.index.toString(),
3856
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3857
- };
3858
- };
3859
- UpdatePoolInfoU64PaddingEvent.prototype.toJSON = function () {
3860
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3861
- };
3862
- UpdatePoolInfoU64PaddingEvent.fromJSONField = function (field) {
3863
- return UpdatePoolInfoU64PaddingEvent.reified().new({
3864
- sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
3865
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
3866
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3867
- });
3868
- };
3869
- UpdatePoolInfoU64PaddingEvent.fromJSON = function (json) {
3870
- if (json.$typeName !== UpdatePoolInfoU64PaddingEvent.$typeName) {
3871
- throw new Error("not a WithTwoGenerics json object");
3872
- }
3873
- return UpdatePoolInfoU64PaddingEvent.fromJSONField(json);
3874
- };
3875
- UpdatePoolInfoU64PaddingEvent.fromSuiParsedData = function (content) {
3876
- if (content.dataType !== "moveObject") {
3877
- throw new Error("not an object");
3878
- }
3879
- if (!isUpdatePoolInfoU64PaddingEvent(content.type)) {
3880
- throw new Error("object at ".concat(content.fields.id, " is not a UpdatePoolInfoU64PaddingEvent object"));
3881
- }
3882
- return UpdatePoolInfoU64PaddingEvent.fromFieldsWithTypes(content);
3883
- };
3884
- UpdatePoolInfoU64PaddingEvent.fromSuiObjectData = function (data) {
3885
- if (data.bcs) {
3886
- if (data.bcs.dataType !== "moveObject" || !isUpdatePoolInfoU64PaddingEvent(data.bcs.type)) {
3887
- throw new Error("object at is not a UpdatePoolInfoU64PaddingEvent object");
3888
- }
3889
- return UpdatePoolInfoU64PaddingEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
3890
- }
3891
- if (data.content) {
3892
- return UpdatePoolInfoU64PaddingEvent.fromSuiParsedData(data.content);
3893
- }
3894
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
3895
- };
3896
- UpdatePoolInfoU64PaddingEvent.fetch = function (client, id) {
3897
- return __awaiter(this, void 0, void 0, function () {
3898
- var res;
3899
- var _a, _b;
3900
- return __generator(this, function (_c) {
3901
- switch (_c.label) {
3902
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3903
- case 1:
3904
- res = _c.sent();
3905
- if (res.error) {
3906
- throw new Error("error fetching UpdatePoolInfoU64PaddingEvent object at id ".concat(id, ": ").concat(res.error.code));
3907
- }
3908
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdatePoolInfoU64PaddingEvent(res.data.bcs.type)) {
3909
- throw new Error("object at id ".concat(id, " is not a UpdatePoolInfoU64PaddingEvent object"));
3910
- }
3911
- return [2 /*return*/, UpdatePoolInfoU64PaddingEvent.fromSuiObjectData(res.data)];
3912
- }
3913
- });
3914
- });
3915
- };
3916
- UpdatePoolInfoU64PaddingEvent.$typeName = "".concat(index_1.PKG_V1, "::stake_pool::UpdatePoolInfoU64PaddingEvent");
3917
- UpdatePoolInfoU64PaddingEvent.$numTypeParams = 0;
3918
- UpdatePoolInfoU64PaddingEvent.$isPhantom = [];
3919
- return UpdatePoolInfoU64PaddingEvent;
3920
- }());
3921
- exports.UpdatePoolInfoU64PaddingEvent = UpdatePoolInfoU64PaddingEvent;
3922
3566
  /* ============================== UpdateUnlockCountdownTsMsEvent =============================== */
3923
3567
  function isUpdateUnlockCountdownTsMsEvent(type) {
3924
3568
  type = (0, util_1.compressSuiType)(type);
@@ -3,9 +3,6 @@ import { LiquidityPool } from "../typus_perp/lp-pool/structs";
3
3
  import { PythClient, TypusConfig } from "@typus/typus-sdk/dist/src/utils";
4
4
  import { TOKEN } from "@typus/typus-sdk/dist/src/constants";
5
5
  import { StakePool } from "../../src/typus_stake_pool/stake-pool/structs";
6
- export declare function snapshot(config: TypusConfig, tx: Transaction, input: {
7
- userShareId: string;
8
- }): Promise<Transaction>;
9
6
  export declare function mintStakeLp(config: TypusConfig, tx: Transaction, pythClient: PythClient, input: {
10
7
  lpPool: LiquidityPool;
11
8
  stakePool: StakePool;
@@ -63,7 +63,6 @@ var __read = (this && this.__read) || function (o, n) {
63
63
  return ar;
64
64
  };
65
65
  Object.defineProperty(exports, "__esModule", { value: true });
66
- exports.snapshot = snapshot;
67
66
  exports.mintStakeLp = mintStakeLp;
68
67
  exports.unstakeBurn = unstakeBurn;
69
68
  exports.burnTlp = burnTlp;
@@ -75,22 +74,6 @@ var functions_2 = require("../typus_stake_pool/stake-pool/functions");
75
74
  var utils_1 = require("@typus/typus-sdk/dist/src/utils");
76
75
  var constants_1 = require("@typus/typus-sdk/dist/src/constants");
77
76
  var __1 = require("..");
78
- function snapshot(config, tx, input) {
79
- return __awaiter(this, void 0, void 0, function () {
80
- return __generator(this, function (_a) {
81
- (0, functions_2.snapshot)(tx, {
82
- version: __1.STAKE_POOL_VERSION,
83
- registry: __1.STAKE_POOL,
84
- index: BigInt(0),
85
- clock: constants_1.CLOCK,
86
- userShareId: BigInt(input.userShareId),
87
- typusEcosystemVersion: config.version.typus,
88
- typusUserRegistry: config.registry.typus.user,
89
- });
90
- return [2 /*return*/, tx];
91
- });
92
- });
93
- }
94
77
  function mintStakeLp(config, tx, pythClient, input) {
95
78
  return __awaiter(this, void 0, void 0, function () {
96
79
  var tokens, tokens_1, tokens_1_1, token, coin, destination, cToken, lpCoin;
@@ -192,7 +175,9 @@ function unstakeBurn(config, tx, pythClient, input) {
192
175
  }
193
176
  finally { if (e_2) throw e_2.error; }
194
177
  }
195
- harvestStakeReward(config, tx, { stakePool: input.stakePool, userShareId: input.userShareId, user: input.user });
178
+ if (input.userShareId) {
179
+ harvestStakeReward(config, tx, { stakePool: input.stakePool, userShareId: input.userShareId, user: input.user });
180
+ }
196
181
  lpCoin = (0, functions_2.unstake)(tx, __1.TLP_TOKEN, {
197
182
  version: __1.STAKE_POOL_VERSION,
198
183
  registry: __1.STAKE_POOL,
@@ -319,15 +304,6 @@ function swap(config, tx, pythClient, input) {
319
304
  function unsubscribe(config, tx, input) {
320
305
  return __awaiter(this, void 0, void 0, function () {
321
306
  return __generator(this, function (_a) {
322
- (0, functions_2.snapshot)(tx, {
323
- version: __1.STAKE_POOL_VERSION,
324
- registry: __1.STAKE_POOL,
325
- index: BigInt(0),
326
- clock: constants_1.CLOCK,
327
- userShareId: BigInt(input.userShareId),
328
- typusEcosystemVersion: config.version.typus,
329
- typusUserRegistry: config.registry.typus.user,
330
- });
331
307
  (0, functions_2.unsubscribe)(tx, __1.TLP_TOKEN, {
332
308
  version: __1.STAKE_POOL_VERSION,
333
309
  registry: __1.STAKE_POOL,
@@ -346,15 +322,6 @@ function harvestStakeReward(config, tx, input) {
346
322
  var e_4, _a;
347
323
  return __generator(this, function (_b) {
348
324
  iTokens = input.stakePool.incentives.map(function (i) { return i.tokenType.name; });
349
- (0, functions_2.snapshot)(tx, {
350
- version: __1.STAKE_POOL_VERSION,
351
- registry: __1.STAKE_POOL,
352
- index: BigInt(0),
353
- clock: constants_1.CLOCK,
354
- userShareId: BigInt(input.userShareId),
355
- typusEcosystemVersion: config.version.typus,
356
- typusUserRegistry: config.registry.typus.user,
357
- });
358
325
  try {
359
326
  for (iTokens_1 = __values(iTokens), iTokens_1_1 = iTokens_1.next(); !iTokens_1_1.done; iTokens_1_1 = iTokens_1.next()) {
360
327
  iToken = iTokens_1_1.value;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.0.54-feat-exp-c",
3
+ "version": "1.0.55",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "@typus/typus-sdk": "1.6.16"
9
+ "@typus/typus-sdk": "1.6.18"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/bs58": "^4.0.1",