near_jsonrpc_client/methods/
next_light_client_block.rs1use super::*;
26
27pub use near_jsonrpc_primitives::types::light_client::{
28 RpcLightClientNextBlockError, RpcLightClientNextBlockRequest,
29};
30pub use near_primitives::views::LightClientBlockView;
31
32pub type RpcLightClientNextBlockResponse = Option<LightClientBlockView>;
33
34impl RpcHandlerResponse for RpcLightClientNextBlockResponse {}
35
36impl RpcHandlerError for RpcLightClientNextBlockError {
37 fn parse(value: serde_json::Value) -> Result<Self, serde_json::Error> {
38 common::parse_unknown_block!(value => Self)
39 }
40}
41
42impl RpcMethod for RpcLightClientNextBlockRequest {
43 type Response = RpcLightClientNextBlockResponse;
44 type Error = RpcLightClientNextBlockError;
45
46 fn method_name(&self) -> &str {
47 "next_light_client_block"
48 }
49
50 fn params(&self) -> Result<serde_json::Value, io::Error> {
51 Ok(json!(self))
52 }
53}
54
55impl private::Sealed for RpcLightClientNextBlockRequest {}