pub struct EthClient { /* private fields */ }Expand description
A minimal Ethereum JSON-RPC client.
Implementations§
Source§impl EthClient
impl EthClient
pub fn new(url: &str) -> Self
Sourcepub fn default_url() -> String
pub fn default_url() -> String
Get the default L1 RPC URL from env or fallback.
pub async fn rpc_call( &self, method: &str, params: Value, ) -> Result<Value, Error>
Sourcepub async fn get_account(&self) -> Result<String, Error>
pub async fn get_account(&self) -> Result<String, Error>
Get the first account from the L1 node (for sandbox use).
Auto Trait Implementations§
impl Freeze for EthClient
impl !RefUnwindSafe for EthClient
impl Send for EthClient
impl Sync for EthClient
impl Unpin for EthClient
impl !UnwindSafe for EthClient
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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