layerzero_scan_client

Crates.iolayerzero_scan_client
lib.rslayerzero_scan_client
version0.1.1
sourcesrc
created_at2023-05-25 21:42:59.368334
updated_at2023-05-25 22:55:44.173355
descriptionLayerzero Scan Client
homepage
repositoryhttps://github.com/AndoroidX/layerzero_scan_client
max_upload_size
id874652
size6,225
Andrew Tretyakov (0xAndoroid)

documentation

README

LayerZero Scan Client

Installation

layerzero_scan_client = "0.1"

Usage

Initialize client with the desired environment

#[tokio::main]
async fn main() {
    let client = Client::new(Environment::Mainnet, None);
    let src_tx_hash = "0x...";
    let response = client.get_message_by_src_tx_hash(src_tx_hash).await.unwrap();
}

Response

Response will include Vec<Message> with following parameters: For new transactions the message list may be empty. Polling should be implemented at the application level since it is app specific. Expect the messages list to be empty for recent transactions, before moving to status: INFLIGHT, and finally status: DELIVERED.

pub struct Message {
    pub src_ua_address: String,
    pub dst_ua_address: String,
    pub src_chain_id: u64,
    pub dst_chain_id: u64,
    pub dst_tx_hash: Option<String>,
    pub dst_tx_error: Option<String>,
    pub src_tx_hash: String,
    pub src_block_hash: String,
    pub src_block_number: String,
    pub src_ua_nonce: u64,
    pub status: MessageStatus,
}

pub enum MessageStatus {
    Inflight,
    Delivered,
    Failed,
}

Note

This library is based on official LayerZero JavaScript Client

Commit count: 5

cargo fmt