pub struct LayerZeroTransport {
pub endpoint_address: [u8; 20],
pub supported_chains: HashMap<ChainId, u32>,
/* private fields */
}Expand description
LayerZero v2 transport for xenith.
Communicates with a LayerZero endpoint contract to relay cross-chain messages. Each supported destination chain is mapped to its LayerZero endpoint ID (EID).
§Example
use xenith_layerzero::LayerZeroTransport;
use xenith_core::ChainId;
let transport = LayerZeroTransport::new(
[0u8; 20],
vec![(ChainId::from(42161), 30110)],
);Fields§
§endpoint_address: [u8; 20]Address of the LayerZero endpoint contract on the source chain.
supported_chains: HashMap<ChainId, u32>Maps a xenith ChainId to the LayerZero endpoint ID for that chain.
Implementations§
Trait Implementations§
Source§impl MessagingTransport for LayerZeroTransport
impl MessagingTransport for LayerZeroTransport
Source§fn send_message<'life0, 'async_trait>(
&'life0 self,
destination: ChainId,
_payload: Bytes,
_options: SendOptions,
) -> Pin<Box<dyn Future<Output = Result<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_message<'life0, 'async_trait>(
&'life0 self,
destination: ChainId,
_payload: Bytes,
_options: SendOptions,
) -> Pin<Box<dyn Future<Output = Result<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit a message to the destination chain and return its tracking ID.
Source§fn estimate_fee<'life0, 'async_trait>(
&'life0 self,
_destination: ChainId,
_payload: Bytes,
) -> Pin<Box<dyn Future<Output = Result<u128>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn estimate_fee<'life0, 'async_trait>(
&'life0 self,
_destination: ChainId,
_payload: Bytes,
) -> Pin<Box<dyn Future<Output = Result<u128>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Estimate the native-token fee for sending
payload to destination.Source§fn message_status<'life0, 'async_trait>(
&'life0 self,
_id: MessageId,
) -> Pin<Box<dyn Future<Output = Result<MessageStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn message_status<'life0, 'async_trait>(
&'life0 self,
_id: MessageId,
) -> Pin<Box<dyn Future<Output = Result<MessageStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Poll the current delivery status of a previously sent message.
Source§fn sender_address(&self) -> Option<[u8; 20]>
fn sender_address(&self) -> Option<[u8; 20]>
Returns the address this transport will submit transactions from, if applicable. Read more
Source§fn poll_incoming<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(StateKey, StateValue, Option<KeyMetadata>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn poll_incoming<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(StateKey, StateValue, Option<KeyMetadata>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Poll for messages received by this transport since the last call. Read more
Auto Trait Implementations§
impl Freeze for LayerZeroTransport
impl RefUnwindSafe for LayerZeroTransport
impl Send for LayerZeroTransport
impl Sync for LayerZeroTransport
impl Unpin for LayerZeroTransport
impl UnsafeUnpin for LayerZeroTransport
impl UnwindSafe for LayerZeroTransport
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