pub async fn send(&self, transaction_request: TransactionRequest) -> Result<H256> {
        let transaction_request = to_value(&transaction_request)?;
        let params = Params::Array(vec![transaction_request]);
        let response = self.send_rpc("eth_sendTransaction", Some(params)).await?;
        let tx_hash: H256 = serde_json::from_value(response)?;

        Ok(tx_hash)
    }
/// Create a new message call transaction or deploy a contract.
///
/// See https://eth.wiki/json-rpc/API#eth_sendTransaction
///
/// # Examples
///
/// ```ignore
/// use types::transaction::TransactionRequest;
///
/// let web3 = web3::Web3::new("http://127.0.0.1:8545").unwrap();
/// let from = web3.get_all_accounts().await.unwrap()[0];
/// let to = web3.get_all_accounts().await.unwrap()[1];
/// let gas = U256::from(1_000_000);
/// let gas_price = U256::from(1);
/// let data = include_bytes!("./../../contracts/artifacts/contracts/ERC20.sol/RustCoinToken.json").to_vec();
/// let transaction_request = TransactionRequest {
///     from: None,
///     to: Some(to),
///     value: None,
///     gas,
///     gas_price,
///     data: Some(data.into()),
///     };
/// let tx_hash = web3.send(transaction_request).await;
/// ```
Create a new message call transaction or deploy a contract.
Create a new message call transaction or deploy a contract .
pub async fn send(&self, transaction_request: TransactionRequest) -> Result<H256> {
        let transaction_request = to_value(&transaction_request)?;
        let params = Params::Array(vec![transaction_request]);
        let response = self.send_rpc("eth_sendTransaction", Some(params)).await?;
        let tx_hash: H256 = serde_json::from_value(response)?;
        Ok(tx_hash)
    }
pub async fn send ( & self , transaction_request : TransactionRequest ) -> Result < H256 > { let transaction_request = to_value ( & transaction_request ) ? ; let params = Params :: Array ( vec ! [ transaction_request ] ) ; let response = self . send_rpc ( " " , Some ( params ) ) . await ? ; let tx_hash : H256 = serde_json :: from_value ( response ) ? ; Ok ( tx_hash ) }
Create a new message call transaction or deploy a contract.
Create a new message call transaction or deploy a contract .
&self
transaction_request
TransactionRequest
examples
```ignore
use types::transaction::TransactionRequest.


` ` ` ignore use types :: transaction :: TransactionRequest .