Skip to content

Commit

Permalink
chore(docs): document the next_light_client_block RPC method (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
iTranscend authored Dec 22, 2023
1 parent adcc92c commit a3c3540
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/methods/next_light_client_block.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
//! Returns the next light client block.
//!
//! ## Example
//!
//! ```
//! use near_jsonrpc_client::{methods, JsonRpcClient};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = JsonRpcClient::connect("https://archival-rpc.mainnet.near.org");
//!
//! let request = methods::next_light_client_block::RpcLightClientNextBlockRequest {
//! last_block_hash: "ANm3jm5wq1Z4rJv6tXWyiDtC3wYKpXVHY4iq6bE1te7B".parse()?,
//! };
//!
//! let response = client.call(request).await?;
//!
//! assert!(matches!(
//! response,
//! Some(methods::next_light_client_block::LightClientBlockView { .. })
//! ));
//! # Ok(())
//! # }
//! ```
use super::*;

pub use near_jsonrpc_primitives::types::light_client::{
Expand Down

0 comments on commit a3c3540

Please sign in to comment.