Skip to content

Commit

Permalink
chore(docs): document the EXPERIMENTAL_protocol_config RPC method (#65
Browse files Browse the repository at this point in the history
)
  • Loading branch information
iTranscend authored Dec 22, 2023
1 parent 7a79fdc commit 4c3c037
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/methods/experimental/protocol_config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
//! Queries the protocol config of the blockchain at a given block.
//!
//! The `RpcProtocolConfigRequest` takes in a [`BlockReference`](https://docs.rs/near-primitives/0.12.0/near_primitives/types/enum.BlockReference.html) enum which has multiple variants.
//!
//! ## Example
//!
//! Returns the protocol config of the blockchain at a given block.
//!
//! ```
//! use near_jsonrpc_client::{methods, JsonRpcClient};
//! use near_primitives::types::{BlockReference, BlockId};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = JsonRpcClient::connect("https://archival-rpc.mainnet.near.org");
//!
//! let request = methods::EXPERIMENTAL_protocol_config::RpcProtocolConfigRequest {
//! block_reference: BlockReference::BlockId(BlockId::Height(47988413))
//! };
//!
//! let response = client.call(request).await?;
//!
//! assert!(matches!(
//! response,
//! methods::EXPERIMENTAL_protocol_config::RpcProtocolConfigResponse { .. }
//! ));
//! # Ok(())
//! # }
//! ```
use super::*;

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

0 comments on commit 4c3c037

Please sign in to comment.