Expand description

Queries the protocol config of the blockchain at a given block.

The RpcProtocolConfigRequest takes in a BlockReference enum which has multiple variants.

§Example

Returns the protocol config of the blockchain at a given block.

use unc_jsonrpc_client::{methods, JsonRpcClient};
use unc_primitives::types::{BlockReference, BlockId};

let client = JsonRpcClient::connect("https://archival-rpc.mainnet.unc.org");

let request = methods::EXPERIMENTAL_protocol_config::RpcProtocolConfigRequest {
    block_reference: BlockReference::BlockId(BlockId::Height(100_000_000))
};

let response = client.call(request).await?;

assert!(matches!(
    response,
    methods::EXPERIMENTAL_protocol_config::RpcProtocolConfigResponse { .. }
));

Structs§

Enums§

Type Aliases§