[−][src]Struct ethers_core::types::TransactionRequest
Parameters for sending a transaction
Fields
from: Option<Address>
Sender address or ENS name
to: Option<NameOrAddress>
Recipient address (None for contract creation)
gas: Option<U256>
Supplied gas (None for sensible default)
gas_price: Option<U256>
Gas price (None for sensible default)
value: Option<U256>
Transfered value (None for no transfer)
data: Option<Bytes>
The compiled code of a contract OR the first 4 bytes of the hash of the invoked method signature and encoded parameters. For details see Ethereum Contract ABI
nonce: Option<U256>
Transaction nonce (None for next available nonce)
Implementations
impl TransactionRequest
[src]
pub fn new() -> Self
[src]
Creates an empty transaction request with all fields left empty
pub fn pay<T: Into<NameOrAddress>, V: Into<U256>>(to: T, value: V) -> Self
[src]
Convenience function for sending a new payment transaction to the receiver.
pub fn from<T: Into<Address>>(self, from: T) -> Self
[src]
Sets the from
field in the transaction to the provided value
pub fn send_to_str(self, to: &str) -> Result<Self, FromHexError>
[src]
Sets the to
field in the transaction to the provided value
pub fn to<T: Into<NameOrAddress>>(self, to: T) -> Self
[src]
Sets the to
field in the transaction to the provided value
pub fn gas<T: Into<U256>>(self, gas: T) -> Self
[src]
Sets the gas
field in the transaction to the provided value
pub fn gas_price<T: Into<U256>>(self, gas_price: T) -> Self
[src]
Sets the gas_price
field in the transaction to the provided value
pub fn value<T: Into<U256>>(self, value: T) -> Self
[src]
Sets the value
field in the transaction to the provided value
pub fn data<T: Into<Bytes>>(self, data: T) -> Self
[src]
Sets the data
field in the transaction to the provided value
pub fn nonce<T: Into<U256>>(self, nonce: T) -> Self
[src]
Sets the nonce
field in the transaction to the provided value
pub fn sighash<T: Into<U64>>(&self, chain_id: Option<T>) -> H256
[src]
Hashes the transaction's data with the provided chain id
pub fn rlp_signed(&self, signature: &Signature) -> Bytes
[src]
Produces the RLP encoding of the transaction with the provided signature
Trait Implementations
impl Clone for TransactionRequest
[src]
fn clone(&self) -> TransactionRequest
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TransactionRequest
[src]
impl Default for TransactionRequest
[src]
fn default() -> TransactionRequest
[src]
impl<'de> Deserialize<'de> for TransactionRequest
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for TransactionRequest
[src]
impl PartialEq<TransactionRequest> for TransactionRequest
[src]
fn eq(&self, other: &TransactionRequest) -> bool
[src]
fn ne(&self, other: &TransactionRequest) -> bool
[src]
impl Serialize for TransactionRequest
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for TransactionRequest
[src]
impl StructuralPartialEq for TransactionRequest
[src]
Auto Trait Implementations
impl RefUnwindSafe for TransactionRequest
impl Send for TransactionRequest
impl Sync for TransactionRequest
impl Unpin for TransactionRequest
impl UnwindSafe for TransactionRequest
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,