Skip to main content

HardhatApiClient

Trait HardhatApiClient 

Source
pub trait HardhatApiClient: ClientT {
Show 16 methods // Provided methods fn hardhat_drop_transaction( &self, tx_hash: FixedBytes<32>, ) -> impl Future<Output = Result<bool, Error>> + Send { ... } fn hardhat_impersonate_account( &self, address: Address, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_get_automine( &self, ) -> impl Future<Output = Result<bool, Error>> + Send { ... } fn hardhat_metadata( &self, ) -> impl Future<Output = Result<Metadata, Error>> + Send { ... } fn hardhat_mine( &self, blocks: Option<Uint<256, 4>>, interval: Option<Uint<256, 4>>, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_reset( &self, fork: Option<Forking>, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_balance( &self, address: Address, balance: Uint<256, 4>, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_code( &self, address: Address, code: Bytes, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_coinbase( &self, address: Address, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_logging_enabled( &self, enabled: bool, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_min_gas_price( &self, gas_price: Uint<256, 4>, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_next_block_base_fee_per_gas( &self, base_fee_per_gas: Uint<256, 4>, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_prev_randao( &self, prev_randao: FixedBytes<32>, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_nonce( &self, address: Address, nonce: Uint<256, 4>, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_set_storage_at( &self, address: Address, slot: Uint<256, 4>, value: FixedBytes<32>, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn hardhat_stop_impersonating_account( &self, address: Address, ) -> impl Future<Output = Result<(), Error>> + Send { ... }
}
Available on crate features client and rpc only.
Expand description

Client implementation for the HardhatApi RPC API.

Provided Methods§

Source

fn hardhat_drop_transaction( &self, tx_hash: FixedBytes<32>, ) -> impl Future<Output = Result<bool, Error>> + Send

Removes the given transaction from the mempool, if it exists.

Returns true if successful, otherwise false.

Source

fn hardhat_impersonate_account( &self, address: Address, ) -> impl Future<Output = Result<(), Error>> + Send

Allows Hardhat Network to sign transactions as the given address.

Source

fn hardhat_get_automine( &self, ) -> impl Future<Output = Result<bool, Error>> + Send

Returns true if automatic mining is enabled, and false otherwise.

Source

fn hardhat_metadata( &self, ) -> impl Future<Output = Result<Metadata, Error>> + Send

Returns an object with metadata about the instance of the Hardhat network.

Source

fn hardhat_mine( &self, blocks: Option<Uint<256, 4>>, interval: Option<Uint<256, 4>>, ) -> impl Future<Output = Result<(), Error>> + Send

Mines a specified number of blocks at a given interval.

Source

fn hardhat_reset( &self, fork: Option<Forking>, ) -> impl Future<Output = Result<(), Error>> + Send

Resets back to a fresh forked state, fork from another block number or disable forking.

Source

fn hardhat_set_balance( &self, address: Address, balance: Uint<256, 4>, ) -> impl Future<Output = Result<(), Error>> + Send

Sets the balance for the given address.

Source

fn hardhat_set_code( &self, address: Address, code: Bytes, ) -> impl Future<Output = Result<(), Error>> + Send

Modifies the bytecode stored at an account’s address.

Source

fn hardhat_set_coinbase( &self, address: Address, ) -> impl Future<Output = Result<(), Error>> + Send

Sets the coinbase address to be used in new blocks.

Source

fn hardhat_set_logging_enabled( &self, enabled: bool, ) -> impl Future<Output = Result<(), Error>> + Send

Enables or disables logging.

Source

fn hardhat_set_min_gas_price( &self, gas_price: Uint<256, 4>, ) -> impl Future<Output = Result<(), Error>> + Send

Changes the minimum gas price accepted by the network (in wei).

Source

fn hardhat_set_next_block_base_fee_per_gas( &self, base_fee_per_gas: Uint<256, 4>, ) -> impl Future<Output = Result<(), Error>> + Send

Sets the base fee of the next block.

Source

fn hardhat_set_prev_randao( &self, prev_randao: FixedBytes<32>, ) -> impl Future<Output = Result<(), Error>> + Send

Sets the PREVRANDAO value of the next block.

Source

fn hardhat_set_nonce( &self, address: Address, nonce: Uint<256, 4>, ) -> impl Future<Output = Result<(), Error>> + Send

Modifies an account’s nonce by overwriting it.

Source

fn hardhat_set_storage_at( &self, address: Address, slot: Uint<256, 4>, value: FixedBytes<32>, ) -> impl Future<Output = Result<(), Error>> + Send

Writes a single position of an account’s storage.

Source

fn hardhat_stop_impersonating_account( &self, address: Address, ) -> impl Future<Output = Result<(), Error>> + Send

Stops impersonating the given address.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<TypeJsonRpseeInternal> HardhatApiClient for TypeJsonRpseeInternal
where TypeJsonRpseeInternal: ClientT,