suidouble 0.0.25 → 0.0.27

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/SuiEvent.js CHANGED
@@ -2,7 +2,7 @@ const SuiCommonMethods = require('./SuiCommonMethods.js');
2
2
 
3
3
  class SuiEvent extends Event {
4
4
  constructor(params = {}) {
5
- const typeName = params.data ? (params.data.type.split('::').pop()) : null;
5
+ const typeName = params.data ? ((''+params.data.type).split('<')[0].split('::').pop()) : null;
6
6
  super(typeName, {});
7
7
 
8
8
  this._debug = !!params.debug;
@@ -34,10 +34,10 @@ class SuiEvent extends Event {
34
34
  }
35
35
 
36
36
  /**
37
- * In module type name, without package and module prefix
37
+ * In module type name, without package and module prefix and without <T..> suffix
38
38
  */
39
39
  get typeName() {
40
- return this._data ? this._data.type.split('::').pop() : null;
40
+ return this._data ? (''+this._data.type).split('<')[0].split('::').pop() : null;
41
41
  }
42
42
 
43
43
  get data() {
@@ -29,7 +29,7 @@ class SuiInBrowser extends SuiCommonMethods {
29
29
  }, 50);
30
30
  }
31
31
 
32
- activeAdapter() {
32
+ get activeAdapter() {
33
33
  return this._activeAdapter;
34
34
  }
35
35
 
package/lib/SuiObject.js CHANGED
@@ -82,10 +82,10 @@ class SuiObject extends SuiCommonMethods {
82
82
  }
83
83
 
84
84
  /**
85
- * In module type name, without package and module prefix
85
+ * In module type name, without package and module prefix and without <T..> suffix
86
86
  */
87
87
  get typeName() {
88
- return this._type ? this._type.split('::').pop() : null;
88
+ return this._type ? (''+this._type).split('<')[0].split('::').pop() : null;
89
89
  }
90
90
 
91
91
  idEquals(toId) {
@@ -48,7 +48,9 @@ class SuiPackageModule extends SuiCommonMethods {
48
48
 
49
49
  const eventTypeName = suiEvent.typeName;
50
50
  this.log('got event', eventTypeName);
51
- this.emit(eventTypeName, suiEvent);
51
+
52
+ this.emit(eventTypeName, suiEvent); // emit specific event name
53
+ this.emit('event', suiEvent); // emit to common events flow
52
54
  };
53
55
 
54
56
  this._unsubscribeFunction = await this._suiMaster._provider.subscribeEvent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suidouble",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
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": {