pub struct EvmAccount {
pub address: String,
pub chain_id: u64,
pub name: Option<String>,
}Expand description
Common EVM account metadata
Fields§
§address: StringAddress of the account (hex format with 0x prefix)
chain_id: u64Chain ID where this account exists
name: Option<String>Optional account alias/name
Implementations§
Source§impl EvmAccount
impl EvmAccount
Sourcepub fn new(address: &str, chain_id: u64) -> Result<EvmAccount, EvmCommonError>
pub fn new(address: &str, chain_id: u64) -> Result<EvmAccount, EvmCommonError>
Create new EVM account with validation
Sourcepub fn with_name(
address: &str,
chain_id: u64,
name: String,
) -> Result<EvmAccount, EvmCommonError>
pub fn with_name( address: &str, chain_id: u64, name: String, ) -> Result<EvmAccount, EvmCommonError>
Create new EVM account with name
Sourcepub fn to_address(&self) -> Result<Address, EvmCommonError>
pub fn to_address(&self) -> Result<Address, EvmCommonError>
Get address as Alloy Address type
Sourcepub fn display_address(&self) -> Result<String, EvmCommonError>
pub fn display_address(&self) -> Result<String, EvmCommonError>
Format address for display (checksummed)
Trait Implementations§
Source§impl Clone for EvmAccount
impl Clone for EvmAccount
Source§fn clone(&self) -> EvmAccount
fn clone(&self) -> EvmAccount
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 EvmAccount
impl Debug for EvmAccount
Source§impl<'de> Deserialize<'de> for EvmAccount
impl<'de> Deserialize<'de> for EvmAccount
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EvmAccount, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EvmAccount, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for EvmAccount
impl JsonSchema for EvmAccount
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 EvmAccount
impl Serialize for EvmAccount
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 EvmAccount
impl RefUnwindSafe for EvmAccount
impl Send for EvmAccount
impl Sync for EvmAccount
impl Unpin for EvmAccount
impl UnsafeUnpin for EvmAccount
impl UnwindSafe for EvmAccount
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