HardhatApiClient

Trait HardhatApiClient 

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 { ... }
}
Expand description

Client implementation for the HardhatApi RPC API.

Provided Methods§

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.

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

Allows Hardhat Network to sign transactions as the given address.

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

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

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

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

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.

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.

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

Sets the balance for the given address.

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

Modifies the bytecode stored at an account’s address.

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

Sets the coinbase address to be used in new blocks.

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

Enables or disables logging.

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).

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.

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

Sets the PREVRANDAO value of the next block.

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.

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.

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", so this trait is not object safe.

Implementors§

§

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