@dedot/api 0.5.0 → 0.6.0
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.
|
@@ -45,6 +45,14 @@ class EventExecutor extends Executor_js_1.Executor {
|
|
|
45
45
|
return events.filter(is);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
const watch = (callback) => {
|
|
49
|
+
return this.client.query.system.events((records) => {
|
|
50
|
+
const events = filter(records);
|
|
51
|
+
if (events.length === 0)
|
|
52
|
+
return;
|
|
53
|
+
callback(filter(records));
|
|
54
|
+
});
|
|
55
|
+
};
|
|
48
56
|
const meta = {
|
|
49
57
|
...eventDef,
|
|
50
58
|
pallet: targetPallet.name,
|
|
@@ -55,6 +63,7 @@ class EventExecutor extends Executor_js_1.Executor {
|
|
|
55
63
|
find,
|
|
56
64
|
filter,
|
|
57
65
|
meta,
|
|
66
|
+
watch,
|
|
58
67
|
};
|
|
59
68
|
}
|
|
60
69
|
#getEventDef(eventTypeId, errorName) {
|
|
@@ -42,6 +42,14 @@ export class EventExecutor extends Executor {
|
|
|
42
42
|
return events.filter(is);
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
+
const watch = (callback) => {
|
|
46
|
+
return this.client.query.system.events((records) => {
|
|
47
|
+
const events = filter(records);
|
|
48
|
+
if (events.length === 0)
|
|
49
|
+
return;
|
|
50
|
+
callback(filter(records));
|
|
51
|
+
});
|
|
52
|
+
};
|
|
45
53
|
const meta = {
|
|
46
54
|
...eventDef,
|
|
47
55
|
pallet: targetPallet.name,
|
|
@@ -52,6 +60,7 @@ export class EventExecutor extends Executor {
|
|
|
52
60
|
find,
|
|
53
61
|
filter,
|
|
54
62
|
meta,
|
|
63
|
+
watch,
|
|
55
64
|
};
|
|
56
65
|
}
|
|
57
66
|
#getEventDef(eventTypeId, errorName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dedot/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A delightful JavaScript/TypeScript client for Polkadot & Substrate",
|
|
5
5
|
"author": "Thang X. Vu <thang@coongcrafts.io>",
|
|
6
6
|
"homepage": "https://github.com/dedotdev/dedot/tree/main/packages/api",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"sideEffects": false,
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dedot/codecs": "0.
|
|
17
|
-
"@dedot/providers": "0.
|
|
18
|
-
"@dedot/runtime-specs": "0.
|
|
19
|
-
"@dedot/shape": "0.
|
|
20
|
-
"@dedot/storage": "0.
|
|
21
|
-
"@dedot/types": "0.
|
|
22
|
-
"@dedot/utils": "0.
|
|
16
|
+
"@dedot/codecs": "0.6.0",
|
|
17
|
+
"@dedot/providers": "0.6.0",
|
|
18
|
+
"@dedot/runtime-specs": "0.6.0",
|
|
19
|
+
"@dedot/shape": "0.6.0",
|
|
20
|
+
"@dedot/storage": "0.6.0",
|
|
21
|
+
"@dedot/types": "0.6.0",
|
|
22
|
+
"@dedot/utils": "0.6.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"license": "Apache-2.0",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@polkadot/types": "^
|
|
49
|
+
"@polkadot/types": "^14.0.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "80e64c7da483c4f5b757f6af7259aa4fdd5397fc",
|
|
52
52
|
"module": "./index.js",
|
|
53
53
|
"types": "./index.d.ts"
|
|
54
54
|
}
|