robonomics-interface-vue 0.1.3 → 0.1.4

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.
@@ -68,22 +68,28 @@ function useQuery() {
68
68
  * // Unsubscribe
69
69
  * unsubscribe()
70
70
  */
71
- const listen = async (address, cb) => {
72
- return await tools.events.on(instance.api, { section: "datalog" }, (r) => {
73
- r = address
74
- ? r.filter(
75
- (item) => encodeAddress(item.data[0]) === encodeAddress(address)
76
- )
77
- : r;
78
- if (r.length) {
79
- for (const item of r) {
80
- cb({
81
- sender: encodeAddress(item.data[0]),
82
- data: toHuman([item.data[1], item.data[2]])
83
- });
71
+ const listen = async (filter, cb) => {
72
+ const { sender } = filter;
73
+ return await tools.events.on(
74
+ instance.api,
75
+ { section: "datalog", success: true },
76
+ (r) => {
77
+ r = sender
78
+ ? r.filter(
79
+ (item) => encodeAddress(item.data[0]) === encodeAddress(sender)
80
+ )
81
+ : r;
82
+ if (r.length) {
83
+ for (const item of r) {
84
+ cb({
85
+ sender: encodeAddress(item.data[0]),
86
+ data: toHuman([item.data[1], item.data[2]]),
87
+ event: item
88
+ });
89
+ }
84
90
  }
85
91
  }
86
- });
92
+ );
87
93
  };
88
94
 
89
95
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robonomics-interface-vue",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -32,7 +32,7 @@
32
32
  "description": "",
33
33
  "peerDependencies": {
34
34
  "@polkadot/util-crypto": "^13.5.3",
35
- "robonomics-interface": "^0.4.0",
35
+ "robonomics-interface": "^0.4.1",
36
36
  "vue": "^3.0.0"
37
37
  },
38
38
  "devDependencies": {