suidouble 0.0.26 → 0.0.28
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/SuiCommonMethods.js +2 -2
- package/lib/SuiEvent.js +3 -3
- package/lib/SuiObject.js +2 -2
- package/lib/SuiPackageModule.js +3 -1
- package/package.json +1 -1
package/lib/SuiCommonMethods.js
CHANGED
|
@@ -32,9 +32,9 @@ class SuiCommonMethods extends EventTarget {
|
|
|
32
32
|
console.info.apply(null, args);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
emit(eventType, data) {
|
|
35
|
+
emit(eventType, data, forceCustom = false) {
|
|
36
36
|
try {
|
|
37
|
-
if (data && data.isSuiEvent) {
|
|
37
|
+
if (data && data.isSuiEvent && !forceCustom) {
|
|
38
38
|
this.dispatchEvent(data);
|
|
39
39
|
} else {
|
|
40
40
|
this.dispatchEvent(new CustomEvent(eventType, { detail: data }));
|
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() {
|
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) {
|
package/lib/SuiPackageModule.js
CHANGED
|
@@ -48,7 +48,9 @@ class SuiPackageModule extends SuiCommonMethods {
|
|
|
48
48
|
|
|
49
49
|
const eventTypeName = suiEvent.typeName;
|
|
50
50
|
this.log('got event', eventTypeName);
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
this.emit(eventTypeName, suiEvent); // emit specific event name
|
|
53
|
+
this.emit('event', suiEvent, true); // 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.
|
|
3
|
+
"version": "0.0.28",
|
|
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": {
|