pub struct RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> { /* private fields */ }Expand description
A builder to construct a Request.
To construct a RequestBuilder, refer to the EvmRpcClient documentation.
Implementations§
Source§impl<R, C, P, Output> RequestBuilder<R, C, P, <CallRequest as EvmRpcRequest>::Config, <CallRequest as EvmRpcRequest>::Params, <CallRequest as EvmRpcRequest>::CandidOutput, Output>
impl<R, C, P, Output> RequestBuilder<R, C, P, <CallRequest as EvmRpcRequest>::Config, <CallRequest as EvmRpcRequest>::Params, <CallRequest as EvmRpcRequest>::CandidOutput, Output>
Sourcepub fn with_block(self, block: impl Into<BlockTag>) -> Self
pub fn with_block(self, block: impl Into<BlockTag>) -> Self
Change the block parameter for an eth_call request.
Source§impl<R, C, P, Output> RequestBuilder<R, C, P, <FeeHistoryRequest as EvmRpcRequest>::Config, <FeeHistoryRequest as EvmRpcRequest>::Params, <FeeHistoryRequest as EvmRpcRequest>::CandidOutput, Output>
impl<R, C, P, Output> RequestBuilder<R, C, P, <FeeHistoryRequest as EvmRpcRequest>::Config, <FeeHistoryRequest as EvmRpcRequest>::Params, <FeeHistoryRequest as EvmRpcRequest>::CandidOutput, Output>
Sourcepub fn with_block_count(self, block_count: impl Into<Nat256>) -> Self
pub fn with_block_count(self, block_count: impl Into<Nat256>) -> Self
Change the block_count parameter for an eth_feeHistory request.
Sourcepub fn with_newest_block(self, newest_block: impl Into<BlockTag>) -> Self
pub fn with_newest_block(self, newest_block: impl Into<BlockTag>) -> Self
Change the newest_block parameter for an eth_feeHistory request.
Sourcepub fn with_reward_percentiles(
self,
reward_percentiles: impl Into<Vec<u8>>,
) -> Self
pub fn with_reward_percentiles( self, reward_percentiles: impl Into<Vec<u8>>, ) -> Self
Change the reward_percentiles parameter for an eth_feeHistory request.
Source§impl<R, C, P, Output> RequestBuilder<R, C, P, <GetLogsRequest as EvmRpcRequest>::Config, <GetLogsRequest as EvmRpcRequest>::Params, <GetLogsRequest as EvmRpcRequest>::CandidOutput, Output>
impl<R, C, P, Output> RequestBuilder<R, C, P, <GetLogsRequest as EvmRpcRequest>::Config, <GetLogsRequest as EvmRpcRequest>::Params, <GetLogsRequest as EvmRpcRequest>::CandidOutput, Output>
Sourcepub fn with_from_block(self, from_block: impl Into<BlockTag>) -> Self
pub fn with_from_block(self, from_block: impl Into<BlockTag>) -> Self
Change the from_block parameter for an eth_getLogs request.
Sourcepub fn with_to_block(self, to_block: impl Into<BlockTag>) -> Self
pub fn with_to_block(self, to_block: impl Into<BlockTag>) -> Self
Change the to_block parameter for an eth_getLogs request.
Sourcepub fn with_addresses(self, addresses: Vec<impl Into<Hex20>>) -> Self
pub fn with_addresses(self, addresses: Vec<impl Into<Hex20>>) -> Self
Change the addresses parameter for an eth_getLogs request.
Source§impl<R, C, P, Output> RequestBuilder<R, C, P, <GetTransactionCountRequest as EvmRpcRequest>::Config, <GetTransactionCountRequest as EvmRpcRequest>::Params, <GetTransactionCountRequest as EvmRpcRequest>::CandidOutput, Output>
impl<R, C, P, Output> RequestBuilder<R, C, P, <GetTransactionCountRequest as EvmRpcRequest>::Config, <GetTransactionCountRequest as EvmRpcRequest>::Params, <GetTransactionCountRequest as EvmRpcRequest>::CandidOutput, Output>
Sourcepub fn with_address(self, address: impl Into<Hex20>) -> Self
pub fn with_address(self, address: impl Into<Hex20>) -> Self
Change the address parameter for an eth_getTransactionCount request.
Sourcepub fn with_block(self, block: impl Into<BlockTag>) -> Self
pub fn with_block(self, block: impl Into<BlockTag>) -> Self
Change the block parameter for an eth_getTransactionCount request.
Source§impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
Sourcepub fn request_cost(
self,
) -> RequestCostBuilder<Runtime, Converter, RetryPolicy, Config, Params>
pub fn request_cost( self, ) -> RequestCostBuilder<Runtime, Converter, RetryPolicy, Config, Params>
Query the cycles cost for that request
Sourcepub fn with_cycles(self, cycles: u128) -> Self
pub fn with_cycles(self, cycles: u128) -> Self
Change the amount of cycles to send for that request.
Sourcepub fn with_params(self, params: impl Into<Params>) -> Self
pub fn with_params(self, params: impl Into<Params>) -> Self
Change the parameters to send for that request.
Sourcepub fn modify_params<F>(self, mutator: F) -> Selfwhere
F: FnOnce(&mut Params),
pub fn modify_params<F>(self, mutator: F) -> Selfwhere
F: FnOnce(&mut Params),
Modify current parameters to send for that request.
Sourcepub fn with_rpc_config(self, rpc_config: impl Into<Config>) -> Self
pub fn with_rpc_config(self, rpc_config: impl Into<Config>) -> Self
Change the RPC configuration to use for that request.
Source§impl<R: Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> RequestBuilder<R, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
impl<R: Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> RequestBuilder<R, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
Sourcepub async fn send(self) -> Outputwhere
Config: CandidType + Clone + Send,
Params: CandidType + Clone + Send,
CandidOutput: Into<Output> + CandidType + DeserializeOwned,
RetryPolicy: RetryPolicy<Config, Params, CandidOutput, Output> + Clone,
pub async fn send(self) -> Outputwhere
Config: CandidType + Clone + Send,
Params: CandidType + Clone + Send,
CandidOutput: Into<Output> + CandidType + DeserializeOwned,
RetryPolicy: RetryPolicy<Config, Params, CandidOutput, Output> + Clone,
Constructs the Request and sends it using the EvmRpcClient returning the response.
§Panics
If the request was not successful.
Sourcepub async fn try_send(self) -> Result<Output, IcError>where
Config: CandidType + Clone + Send,
Params: CandidType + Clone + Send,
CandidOutput: Into<Output> + CandidType + DeserializeOwned,
RetryPolicy: RetryPolicy<Config, Params, CandidOutput, Output> + Clone,
pub async fn try_send(self) -> Result<Output, IcError>where
Config: CandidType + Clone + Send,
Params: CandidType + Clone + Send,
CandidOutput: Into<Output> + CandidType + DeserializeOwned,
RetryPolicy: RetryPolicy<Config, Params, CandidOutput, Output> + Clone,
Constructs the Request and sends it using the EvmRpcClient. This method returns
either the request response or any error that occurs while sending the request.
Source§impl<Runtime, Converter, RetryPolicy, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, GetLogsRpcConfig, Params, CandidOutput, Output>
impl<Runtime, Converter, RetryPolicy, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, GetLogsRpcConfig, Params, CandidOutput, Output>
Sourcepub fn with_max_block_range(self, max_block_range: u32) -> Self
pub fn with_max_block_range(self, max_block_range: u32) -> Self
Change the max block range error for eth_getLogs request.
Source§impl<Runtime, Converter, RetryPolicy, Config: EvmRpcConfig + Default, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
impl<Runtime, Converter, RetryPolicy, Config: EvmRpcConfig + Default, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
Sourcepub fn with_response_size_estimate(self, response_size_estimate: u64) -> Self
pub fn with_response_size_estimate(self, response_size_estimate: u64) -> Self
Change the response size estimate to use for that request.
Sourcepub fn with_response_consensus(
self,
response_consensus: ConsensusStrategy,
) -> Self
pub fn with_response_consensus( self, response_consensus: ConsensusStrategy, ) -> Self
Change the consensus strategy to use for that request.