pub struct EvmTransactionData {
pub to: String,
pub data: String,
pub value: String,
pub gas_limit: String,
pub gas_price: String,
pub chain_id: u64,
}Expand description
EVM transaction data for cross-chain operations
Fields§
§to: StringTarget contract address
data: StringTransaction data (hex encoded)
value: StringValue to send (in wei, hex encoded)
gas_limit: StringGas limit (hex encoded)
gas_price: StringGas price (in wei, hex encoded)
chain_id: u64Chain ID for this transaction
Implementations§
Source§impl EvmTransactionData
impl EvmTransactionData
Sourcepub fn new(
to: &str,
data: &str,
value: Uint<256, 4>,
gas_limit: u64,
gas_price: Uint<256, 4>,
chain_id: u64,
) -> Result<EvmTransactionData, EvmCommonError>
pub fn new( to: &str, data: &str, value: Uint<256, 4>, gas_limit: u64, gas_price: Uint<256, 4>, chain_id: u64, ) -> Result<EvmTransactionData, EvmCommonError>
Create new EVM transaction data with validation
Sourcepub fn to_address(&self) -> Result<Address, EvmCommonError>
pub fn to_address(&self) -> Result<Address, EvmCommonError>
Parse to address as Alloy Address
Sourcepub fn data_bytes(&self) -> Result<Bytes, EvmCommonError>
pub fn data_bytes(&self) -> Result<Bytes, EvmCommonError>
Parse data as Alloy Bytes
Sourcepub fn value_u256(&self) -> Result<Uint<256, 4>, EvmCommonError>
pub fn value_u256(&self) -> Result<Uint<256, 4>, EvmCommonError>
Parse value as U256
Sourcepub fn gas_limit_u64(&self) -> Result<u64, EvmCommonError>
pub fn gas_limit_u64(&self) -> Result<u64, EvmCommonError>
Parse gas limit as u64
Sourcepub fn gas_price_u256(&self) -> Result<Uint<256, 4>, EvmCommonError>
pub fn gas_price_u256(&self) -> Result<Uint<256, 4>, EvmCommonError>
Parse gas price as U256
Trait Implementations§
Source§impl Clone for EvmTransactionData
impl Clone for EvmTransactionData
Source§fn clone(&self) -> EvmTransactionData
fn clone(&self) -> EvmTransactionData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EvmTransactionData
impl Debug for EvmTransactionData
Source§impl<'de> Deserialize<'de> for EvmTransactionData
impl<'de> Deserialize<'de> for EvmTransactionData
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EvmTransactionData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EvmTransactionData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for EvmTransactionData
impl JsonSchema for EvmTransactionData
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for EvmTransactionData
impl Serialize for EvmTransactionData
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for EvmTransactionData
impl RefUnwindSafe for EvmTransactionData
impl Send for EvmTransactionData
impl Sync for EvmTransactionData
impl Unpin for EvmTransactionData
impl UnsafeUnpin for EvmTransactionData
impl UnwindSafe for EvmTransactionData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'de, T> BorrowedRpcObject<'de> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more