Crates.io | layerzero_scan_client |
lib.rs | layerzero_scan_client |
version | 0.1.1 |
source | src |
created_at | 2023-05-25 21:42:59.368334 |
updated_at | 2023-05-25 22:55:44.173355 |
description | Layerzero Scan Client |
homepage | |
repository | https://github.com/AndoroidX/layerzero_scan_client |
max_upload_size | |
id | 874652 |
size | 6,225 |
layerzero_scan_client = "0.1"
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 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,
}
This library is based on official LayerZero JavaScript Client