@typus/typus-perp-sdk 1.0.55 → 1.0.57

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,8 +1,10 @@
1
1
  export declare function getFromSentio(event: string, userAddress: string, startTimestamp: string): Promise<any[]>;
2
- export declare function getTlpAPRFromSentio(): Promise<number>;
3
2
  export declare function getVolumeFromSentio(): Promise<any[]>;
4
3
  export interface Volume {
5
4
  timestamp: string;
6
5
  value: number;
7
6
  }
8
7
  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,9 +37,10 @@ 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;
41
40
  exports.getVolumeFromSentio = getVolumeFromSentio;
42
41
  exports.getTlpFeeFromSentio = getTlpFeeFromSentio;
42
+ exports.getTotalVolumeFromSentio = getTotalVolumeFromSentio;
43
+ exports.getAccumulatedUser = getAccumulatedUser;
43
44
  var src_1 = require("../../src");
44
45
  var headers = {
45
46
  "api-key": "ffJa6FwxeJNrQP8NZ5doEMXqdSA7XM6mT",
@@ -83,9 +84,9 @@ function getFromSentio(event, userAddress, startTimestamp) {
83
84
  });
84
85
  });
85
86
  }
86
- function getTlpAPRFromSentio() {
87
+ function getVolumeFromSentio() {
87
88
  return __awaiter(this, void 0, void 0, function () {
88
- var apiUrl, requestData, jsonData, response, data, first, last, r, apr;
89
+ var apiUrl, requestData, jsonData, response, data, symbols, volume;
89
90
  return __generator(this, function (_a) {
90
91
  switch (_a.label) {
91
92
  case 0:
@@ -94,23 +95,30 @@ function getTlpAPRFromSentio() {
94
95
  : "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
95
96
  requestData = {
96
97
  timeRange: {
97
- start: "now-7d",
98
+ start: "now-3d",
98
99
  end: "now",
99
100
  step: 3600,
100
101
  },
101
102
  limit: 20,
102
103
  queries: [
103
104
  {
104
- metricsQuery: {
105
- query: "tlp_price",
105
+ eventsQuery: {
106
+ resource: {
107
+ name: "OrderFilled",
108
+ type: "EVENTS",
109
+ },
106
110
  alias: "",
107
111
  id: "a",
108
- labelSelector: {},
109
- aggregate: null,
112
+ aggregation: {
113
+ total: {},
114
+ },
115
+ groupBy: ["base_token"],
116
+ limit: 0,
110
117
  functions: [],
118
+ color: "",
111
119
  disabled: false,
112
120
  },
113
- dataSource: "METRICS",
121
+ dataSource: "EVENTS",
114
122
  sourceName: "",
115
123
  },
116
124
  ],
@@ -127,19 +135,18 @@ function getTlpAPRFromSentio() {
127
135
  return [4 /*yield*/, response.json()];
128
136
  case 2:
129
137
  data = _a.sent();
130
- first = data.results[0].matrix.samples[0].values[0];
131
- last = data.results[0].matrix.samples[0].values.at(-1);
132
- r = last.value / first.value - 1;
133
- apr = (365 / 7) * r;
134
- // console.log(apr);
135
- return [2 /*return*/, apr];
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];
136
143
  }
137
144
  });
138
145
  });
139
146
  }
140
- function getVolumeFromSentio() {
147
+ function getTlpFeeFromSentio() {
141
148
  return __awaiter(this, void 0, void 0, function () {
142
- var apiUrl, requestData, jsonData, response, data, symbols, volume;
149
+ var apiUrl, requestData, jsonData, response, data, first, last, fee;
143
150
  return __generator(this, function (_a) {
144
151
  switch (_a.label) {
145
152
  case 0:
@@ -148,30 +155,26 @@ function getVolumeFromSentio() {
148
155
  : "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
149
156
  requestData = {
150
157
  timeRange: {
151
- start: "now-3d",
158
+ start: "now-7d",
152
159
  end: "now",
153
160
  step: 3600,
154
161
  },
155
162
  limit: 20,
156
163
  queries: [
157
164
  {
158
- eventsQuery: {
159
- resource: {
160
- name: "OrderFilled",
161
- type: "EVENTS",
162
- },
165
+ metricsQuery: {
166
+ query: "tlp_fee_usd",
163
167
  alias: "",
164
168
  id: "a",
165
- aggregation: {
166
- total: {},
169
+ labelSelector: {},
170
+ aggregate: {
171
+ op: "SUM",
172
+ grouping: [],
167
173
  },
168
- groupBy: ["base_token"],
169
- limit: 0,
170
174
  functions: [],
171
- color: "",
172
175
  disabled: false,
173
176
  },
174
- dataSource: "EVENTS",
177
+ dataSource: "METRICS",
175
178
  sourceName: "",
176
179
  },
177
180
  ],
@@ -188,18 +191,18 @@ function getVolumeFromSentio() {
188
191
  return [4 /*yield*/, response.json()];
189
192
  case 2:
190
193
  data = _a.sent();
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];
194
+ first = data.results[0].matrix.samples[0].values[0];
195
+ 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];
196
199
  }
197
200
  });
198
201
  });
199
202
  }
200
- function getTlpFeeFromSentio() {
203
+ function getTotalVolumeFromSentio() {
201
204
  return __awaiter(this, void 0, void 0, function () {
202
- var apiUrl, requestData, jsonData, response, data, first, last, fee;
205
+ var apiUrl, requestData, jsonData, response, data, result;
203
206
  return __generator(this, function (_a) {
204
207
  switch (_a.label) {
205
208
  case 0:
@@ -208,15 +211,15 @@ function getTlpFeeFromSentio() {
208
211
  : "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
209
212
  requestData = {
210
213
  timeRange: {
211
- start: "now-7d",
214
+ start: "now-1h",
212
215
  end: "now",
213
216
  step: 3600,
214
217
  },
215
- limit: 20,
218
+ limit: 1,
216
219
  queries: [
217
220
  {
218
221
  metricsQuery: {
219
- query: "tlp_fee_usd",
222
+ query: "trading_volume_usd",
220
223
  alias: "",
221
224
  id: "a",
222
225
  labelSelector: {},
@@ -225,6 +228,7 @@ function getTlpFeeFromSentio() {
225
228
  grouping: [],
226
229
  },
227
230
  functions: [],
231
+ color: "",
228
232
  disabled: false,
229
233
  },
230
234
  dataSource: "METRICS",
@@ -244,15 +248,78 @@ function getTlpFeeFromSentio() {
244
248
  return [4 /*yield*/, response.json()];
245
249
  case 2:
246
250
  data = _a.sent();
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];
251
+ result = data.results[0].matrix.samples[0].values.at(-1).value;
252
+ // console.log(result);
253
+ return [2 /*return*/, result];
254
+ }
255
+ });
256
+ });
257
+ }
258
+ /** Returns Accumulated Users */
259
+ function getAccumulatedUser() {
260
+ return __awaiter(this, void 0, void 0, function () {
261
+ var apiUrl, requestData, jsonData, response, data, result;
262
+ return __generator(this, function (_a) {
263
+ switch (_a.label) {
264
+ case 0:
265
+ apiUrl = src_1.NETWORK == "MAINNET"
266
+ ? "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query"
267
+ : "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
268
+ requestData = {
269
+ timeRange: {
270
+ start: "now-1h",
271
+ end: "now",
272
+ step: 3600,
273
+ timezone: "Asia/Taipei",
274
+ },
275
+ limit: 1,
276
+ queries: [
277
+ {
278
+ eventsQuery: {
279
+ resource: {
280
+ name: "",
281
+ type: "EVENTS",
282
+ },
283
+ alias: "",
284
+ id: "a",
285
+ aggregation: {
286
+ countUnique: {
287
+ duration: {
288
+ value: 0,
289
+ unit: "day",
290
+ },
291
+ },
292
+ },
293
+ groupBy: [],
294
+ limit: 1,
295
+ functions: [],
296
+ disabled: false,
297
+ },
298
+ dataSource: "EVENTS",
299
+ sourceName: "",
300
+ },
301
+ ],
302
+ formulas: [],
303
+ };
304
+ jsonData = JSON.stringify(requestData);
305
+ return [4 /*yield*/, fetch(apiUrl, {
306
+ method: "POST",
307
+ headers: headers,
308
+ body: jsonData,
309
+ })];
310
+ case 1:
311
+ response = _a.sent();
312
+ return [4 /*yield*/, response.json()];
313
+ case 2:
314
+ data = _a.sent();
315
+ result = data.results[0].matrix.samples[0].values.at(-1).value;
316
+ // console.log(result);
317
+ return [2 /*return*/, result];
252
318
  }
253
319
  });
254
320
  });
255
321
  }
256
- // getTlpAPRFromSentio();
257
322
  // getVolumeFromSentio();
258
323
  // 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
- ? "0xd50ea488da2b586c3db4e8ad805e9f8aa4891d315d6fc53517d662c3f6fd1b4c"
43
- : "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
42
+ ? "0xd9965c09d5ad7d69306b7c550b3b135d94b34f98c3adc379a7333fff2f05808b"
43
+ : "0x34ba6bf1893409b1a7494350189e060ee79cc2aba6f0c5e4045af9372d96fe85";
44
44
  exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
45
45
  ? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
46
46
  : "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
@@ -122,6 +122,16 @@ 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;
125
135
  export interface StakeArgs {
126
136
  version: TransactionObjectInput;
127
137
  registry: TransactionObjectInput;
@@ -164,6 +174,14 @@ export interface UpdateIncentiveConfigArgs {
164
174
  u64Padding: Array<bigint | TransactionArgument> | TransactionArgument | TransactionArgument | null;
165
175
  }
166
176
  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;
167
185
  export interface UpdateUnlockCountdownTsMsArgs {
168
186
  version: TransactionObjectInput;
169
187
  registry: TransactionObjectInput;
@@ -24,11 +24,13 @@ exports.newStakePool = newStakePool;
24
24
  exports.removeIncentive = removeIncentive;
25
25
  exports.removeIncentiveToken = removeIncentiveToken;
26
26
  exports.removeUserShareById = removeUserShareById;
27
+ exports.snapshot = snapshot;
27
28
  exports.stake = stake;
28
29
  exports.storeUserShares = storeUserShares;
29
30
  exports.unstake = unstake;
30
31
  exports.unsubscribe = unsubscribe;
31
32
  exports.updateIncentiveConfig = updateIncentiveConfig;
33
+ exports.updatePoolInfoU64Padding = updatePoolInfoU64Padding;
32
34
  exports.updateUnlockCountdownTsMs = updateUnlockCountdownTsMs;
33
35
  exports.withdrawIncentive = withdrawIncentive;
34
36
  var __1 = require("..");
@@ -212,6 +214,21 @@ function removeUserShareById(tx, args, published_at) {
212
214
  arguments: [(0, util_1.obj)(tx, args.id), (0, util_1.pure)(tx, args.user, "address"), (0, util_1.pure)(tx, args.userShareId, "u64")],
213
215
  });
214
216
  }
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
+ }
215
232
  function stake(tx, typeArg, args, published_at) {
216
233
  if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
217
234
  return tx.moveCall({
@@ -279,6 +296,19 @@ function updateIncentiveConfig(tx, typeArg, args, published_at) {
279
296
  ],
280
297
  });
281
298
  }
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
+ }
282
312
  function updateUnlockCountdownTsMs(tx, args, published_at) {
283
313
  if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
284
314
  return tx.moveCall({
@@ -1189,6 +1189,98 @@ 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
+ }
1192
1284
  export declare function isStakeEvent(type: string): boolean;
1193
1285
  export interface StakeEventFields {
1194
1286
  sender: ToField<"address">;
@@ -2027,6 +2119,62 @@ export declare class UpdateIncentiveConfigEvent implements StructClass {
2027
2119
  static fromSuiObjectData(data: SuiObjectData): UpdateIncentiveConfigEvent;
2028
2120
  static fetch(client: SuiClient, id: string): Promise<UpdateIncentiveConfigEvent>;
2029
2121
  }
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
+ }
2030
2178
  export declare function isUpdateUnlockCountdownTsMsEvent(type: string): boolean;
2031
2179
  export interface UpdateUnlockCountdownTsMsEventFields {
2032
2180
  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.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;
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;
109
109
  exports.isActivateIncentiveTokenEvent = isActivateIncentiveTokenEvent;
110
110
  exports.isAddIncentiveTokenEvent = isAddIncentiveTokenEvent;
111
111
  exports.isDeactivateIncentiveTokenEvent = isDeactivateIncentiveTokenEvent;
@@ -118,6 +118,7 @@ exports.isIncentiveInfo = isIncentiveInfo;
118
118
  exports.isLpUserShare = isLpUserShare;
119
119
  exports.isNewStakePoolEvent = isNewStakePoolEvent;
120
120
  exports.isRemoveIncentiveTokenEvent = isRemoveIncentiveTokenEvent;
121
+ exports.isSnapshotEvent = isSnapshotEvent;
121
122
  exports.isStakeEvent = isStakeEvent;
122
123
  exports.isStakePool = isStakePool;
123
124
  exports.isStakePoolConfig = isStakePoolConfig;
@@ -126,6 +127,7 @@ exports.isStakePoolRegistry = isStakePoolRegistry;
126
127
  exports.isUnstakeEvent = isUnstakeEvent;
127
128
  exports.isUnsubscribeEvent = isUnsubscribeEvent;
128
129
  exports.isUpdateIncentiveConfigEvent = isUpdateIncentiveConfigEvent;
130
+ exports.isUpdatePoolInfoU64PaddingEvent = isUpdatePoolInfoU64PaddingEvent;
129
131
  exports.isUpdateUnlockCountdownTsMsEvent = isUpdateUnlockCountdownTsMsEvent;
130
132
  exports.isWithdrawIncentiveEvent = isWithdrawIncentiveEvent;
131
133
  var reified = __importStar(require("../../_framework/reified"));
@@ -2177,6 +2179,201 @@ var RemoveIncentiveTokenEvent = /** @class */ (function () {
2177
2179
  return RemoveIncentiveTokenEvent;
2178
2180
  }());
2179
2181
  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;
2180
2377
  /* ============================== StakeEvent =============================== */
2181
2378
  function isStakeEvent(type) {
2182
2379
  type = (0, util_1.compressSuiType)(type);
@@ -3563,6 +3760,165 @@ var UpdateIncentiveConfigEvent = /** @class */ (function () {
3563
3760
  return UpdateIncentiveConfigEvent;
3564
3761
  }());
3565
3762
  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;
3566
3922
  /* ============================== UpdateUnlockCountdownTsMsEvent =============================== */
3567
3923
  function isUpdateUnlockCountdownTsMsEvent(type) {
3568
3924
  type = (0, util_1.compressSuiType)(type);
@@ -3,6 +3,9 @@ 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>;
6
9
  export declare function mintStakeLp(config: TypusConfig, tx: Transaction, pythClient: PythClient, input: {
7
10
  lpPool: LiquidityPool;
8
11
  stakePool: StakePool;
@@ -63,6 +63,7 @@ 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;
66
67
  exports.mintStakeLp = mintStakeLp;
67
68
  exports.unstakeBurn = unstakeBurn;
68
69
  exports.burnTlp = burnTlp;
@@ -74,6 +75,22 @@ var functions_2 = require("../typus_stake_pool/stake-pool/functions");
74
75
  var utils_1 = require("@typus/typus-sdk/dist/src/utils");
75
76
  var constants_1 = require("@typus/typus-sdk/dist/src/constants");
76
77
  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
+ }
77
94
  function mintStakeLp(config, tx, pythClient, input) {
78
95
  return __awaiter(this, void 0, void 0, function () {
79
96
  var tokens, tokens_1, tokens_1_1, token, coin, destination, cToken, lpCoin;
@@ -175,9 +192,7 @@ function unstakeBurn(config, tx, pythClient, input) {
175
192
  }
176
193
  finally { if (e_2) throw e_2.error; }
177
194
  }
178
- if (input.userShareId) {
179
- harvestStakeReward(config, tx, { stakePool: input.stakePool, userShareId: input.userShareId, user: input.user });
180
- }
195
+ harvestStakeReward(config, tx, { stakePool: input.stakePool, userShareId: input.userShareId, user: input.user });
181
196
  lpCoin = (0, functions_2.unstake)(tx, __1.TLP_TOKEN, {
182
197
  version: __1.STAKE_POOL_VERSION,
183
198
  registry: __1.STAKE_POOL,
@@ -304,6 +319,15 @@ function swap(config, tx, pythClient, input) {
304
319
  function unsubscribe(config, tx, input) {
305
320
  return __awaiter(this, void 0, void 0, function () {
306
321
  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
+ });
307
331
  (0, functions_2.unsubscribe)(tx, __1.TLP_TOKEN, {
308
332
  version: __1.STAKE_POOL_VERSION,
309
333
  registry: __1.STAKE_POOL,
@@ -322,6 +346,15 @@ function harvestStakeReward(config, tx, input) {
322
346
  var e_4, _a;
323
347
  return __generator(this, function (_b) {
324
348
  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
+ });
325
358
  try {
326
359
  for (iTokens_1 = __values(iTokens), iTokens_1_1 = iTokens_1.next(); !iTokens_1_1.done; iTokens_1_1 = iTokens_1.next()) {
327
360
  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.55",
3
+ "version": "1.0.57",
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.18"
9
+ "@typus/typus-sdk": "1.6.19"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/bs58": "^4.0.1",