pub struct EvmClient { /* private fields */ }Expand description
EVM client for interacting with Hanzo/Zoo chains
Implementations§
Source§impl EvmClient
impl EvmClient
pub fn new(config: ChainConfig) -> Self
pub fn from_network(network: &NetworkType) -> Self
Sourcepub async fn get_block_number(&self) -> Result<u64, EvmError>
pub async fn get_block_number(&self) -> Result<u64, EvmError>
Get current block number
Sourcepub async fn get_balance(&self, address: &str) -> Result<u128, EvmError>
pub async fn get_balance(&self, address: &str) -> Result<u128, EvmError>
Get native token balance
Sourcepub async fn get_pending_rewards(
&self,
miner_address: &str,
) -> Result<u128, EvmError>
pub async fn get_pending_rewards( &self, miner_address: &str, ) -> Result<u128, EvmError>
Get pending rewards for a miner
Sourcepub async fn register_miner(
&self,
private_key: &str,
stats: &PerformanceStats,
capabilities: &[MinerCapability],
) -> Result<String, EvmError>
pub async fn register_miner( &self, private_key: &str, stats: &PerformanceStats, capabilities: &[MinerCapability], ) -> Result<String, EvmError>
Register as a miner on the network
Sourcepub async fn claim_rewards(&self, private_key: &str) -> Result<String, EvmError>
pub async fn claim_rewards(&self, private_key: &str) -> Result<String, EvmError>
Claim pending rewards
Sourcepub async fn submit_job_completion(
&self,
private_key: &str,
job_id: &str,
result_hash: &str,
) -> Result<String, EvmError>
pub async fn submit_job_completion( &self, private_key: &str, job_id: &str, result_hash: &str, ) -> Result<String, EvmError>
Submit job completion proof
Sourcepub async fn send_heartbeat(
&self,
private_key: &str,
) -> Result<String, EvmError>
pub async fn send_heartbeat( &self, private_key: &str, ) -> Result<String, EvmError>
Send heartbeat to maintain miner registration
Sourcepub async fn bridge_tokens(
&self,
private_key: &str,
dest_chain: &NetworkType,
amount: u128,
recipient: &str,
) -> Result<String, EvmError>
pub async fn bridge_tokens( &self, private_key: &str, dest_chain: &NetworkType, amount: u128, recipient: &str, ) -> Result<String, EvmError>
Initiate cross-chain bridge transfer
Auto Trait Implementations§
impl Freeze for EvmClient
impl !RefUnwindSafe for EvmClient
impl Send for EvmClient
impl Sync for EvmClient
impl Unpin for EvmClient
impl UnsafeUnpin for EvmClient
impl !UnwindSafe for EvmClient
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