pub struct CosmosChainClient { /* private fields */ }Expand description
Cosmos implementation of ChainClient.
Translates ChainClient methods into Tendermint JSON-RPC calls:
get_head_height()→status→sync_info.latest_block_heightget_block_by_height(h)→blockwithheight=hhealth_check()→health
Implementations§
Trait Implementations§
Source§impl ChainClient for CosmosChainClient
impl ChainClient for CosmosChainClient
Source§fn get_head_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_head_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current head height (block number / slot / checkpoint).
Source§fn get_block_by_height<'life0, 'async_trait>(
&'life0 self,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<ChainBlock>, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_by_height<'life0, 'async_trait>(
&'life0 self,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<ChainBlock>, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a block by its height. Read more
Source§fn chain_id(&self) -> &str
fn chain_id(&self) -> &str
Return the chain identifier (e.g.
"1" for Ethereum mainnet,
"mainnet-beta" for Solana).Source§fn chain_family(&self) -> &str
fn chain_family(&self) -> &str
Return the chain family name (e.g.
"evm", "solana", "cosmos").Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a health check against the underlying transport.
Auto Trait Implementations§
impl Freeze for CosmosChainClient
impl !RefUnwindSafe for CosmosChainClient
impl Send for CosmosChainClient
impl Sync for CosmosChainClient
impl Unpin for CosmosChainClient
impl UnsafeUnpin for CosmosChainClient
impl !UnwindSafe for CosmosChainClient
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