We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f29f0d5 commit 0ab766fCopy full SHA for 0ab766f
node/common/src/service/rpc/state.rs
@@ -23,6 +23,16 @@ impl State {
23
#[cfg(target_family = "wasm")]
24
#[cfg_attr(target_family = "wasm", wasm_bindgen)]
25
impl State {
26
+ pub async fn get(&self, filter: String) -> JsValue {
27
+ let res = self
28
+ .sender
29
+ .oneshot_request::<RpcStateGetResponse>(RpcRequest::StateGet(Some(filter)))
30
+ .await
31
+ .and_then(|v| v.ok());
32
+ res.map(|res| JsValue::from_serde(&res).unwrap_or_default())
33
+ .unwrap_or_default()
34
+ }
35
+
36
pub async fn peers(&self) -> JsValue {
37
let res = self
38
.sender
0 commit comments