suidouble 0.0.43 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/SuiMaster.js CHANGED
@@ -266,6 +266,28 @@ class SuiMaster extends SuiCommonMethods {
266
266
  return await (suiCoin.getBalance(queryingBalanceOf));
267
267
  }
268
268
 
269
+ async fetchEvents(params = {}) {
270
+ let query = params.query;
271
+
272
+ const queryParams = {
273
+ descending_order: params.descending_order || false,
274
+ query: query,
275
+ limit: params.limit || 50,
276
+ };
277
+
278
+ const paginatedResponse = new SuiPaginatedResponse({
279
+ debug: this._debug,
280
+ suiMaster: this,
281
+ params: queryParams,
282
+ method: 'queryEvents',
283
+ order: params.order,
284
+ });
285
+
286
+ await paginatedResponse.fetch();
287
+
288
+ return paginatedResponse;
289
+ }
290
+
269
291
  // export type TransactionFilter =
270
292
  // | { FromOrToAddress: { addr: string } }
271
293
  // | { Checkpoint: string }
@@ -216,12 +216,14 @@ class SuiPackageModule extends SuiCommonMethods {
216
216
  this.emit(suiEvent.typeName, suiEvent);
217
217
  }
218
218
 
219
- return {
220
- created: listCreated,
221
- mutated: listMutated,
222
- deleted: listDeleted,
223
- status: status,
224
- };
219
+ return suiTransaction;
220
+
221
+ // return {
222
+ // created: listCreated,
223
+ // mutated: listMutated,
224
+ // deleted: listDeleted,
225
+ // status: status,
226
+ // };
225
227
  }
226
228
 
227
229
  async getOwnedObjects(params = {}) {
@@ -16,6 +16,49 @@ class SuiTransaction extends SuiCommonMethods {
16
16
  this._events = null;
17
17
  }
18
18
 
19
+ get executedEpoch() {
20
+ if (this._data && this._data.effects && this._data.effects.executedEpoch) {
21
+ return BigInt(this._data.effects.executedEpoch);
22
+ }
23
+
24
+ return null;
25
+ }
26
+
27
+ get digest() {
28
+ if (this._data) {
29
+ return this._data.digest;
30
+ }
31
+
32
+ return null;
33
+ }
34
+
35
+ get gasUsed() {
36
+ try {
37
+ if (this._data && this._data.effects && this._data.effects.gasUsed) {
38
+ return BigInt(this._data.effects.gasUsed.computationCost) + BigInt(this._data.effects.gasUsed.storageCost) - BigInt(this._data.effects.gasUsed.storageRebate);
39
+ }
40
+ } catch (e) {
41
+ return null;
42
+ }
43
+
44
+ return null;
45
+ }
46
+
47
+ get deleted() {
48
+ const results = this.results;
49
+ return results.deleted;
50
+ }
51
+
52
+ get mutated() {
53
+ const results = this.results;
54
+ return results.mutated;
55
+ }
56
+
57
+ get created() {
58
+ const results = this.results;
59
+ return results.created;
60
+ }
61
+
19
62
  get data() {
20
63
  return this._data;
21
64
  }
@@ -135,6 +178,7 @@ class SuiTransaction extends SuiCommonMethods {
135
178
  mutated: listMutated,
136
179
  deleted: listDeleted,
137
180
  objects: Object.values(objects),
181
+ status: this.status,
138
182
  };
139
183
 
140
184
  return this._results;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suidouble",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "Set of provider, package and object classes for javascript representation of Sui Move smart contracts. Use same code for publishing, upgrading, integration testing, interaction with smart contracts and integration in browser web3 dapps",
5
5
  "main": "index.js",
6
6
  "scripts": {