5 unstable releases

0.3.0 Oct 29, 2024
0.2.0 Oct 25, 2024
0.1.2 Aug 1, 2024
0.1.1 Jul 23, 2024
0.1.0 Jul 12, 2024

#50 in #alloy

Download history 138/week @ 2024-07-27 21/week @ 2024-08-03 9/week @ 2024-08-10 5/week @ 2024-08-17 8/week @ 2024-09-21 4/week @ 2024-09-28 71/week @ 2024-10-19 169/week @ 2024-10-26 34/week @ 2024-11-02 15/week @ 2024-11-09

289 downloads per month

MIT license

56KB
1K SLoC

Alloy-rs CCIP Reader

NOTE: This is fork of ethers-ccip-read implemented for alloy-rs crate

CI Status Crates.io Docs.rs

Install

cargo add alloy-ccip-read

or alternatively add it to your Cargo.toml file:

alloy-ccip-read = "0.1.0"

Usage

use alloy::providers::ProviderBuilder;
use alloy_ccip_read::CCIPReader;

#[tokio::main]
async fn main() -> Result<()> {
    let rpc = "https://your.web3.provider";
    let provider = ProviderBuilder::new().on_http(rpc.parse().unwrap());
    let reader = CCIPReader::new(provider.boxed());

    let ens_name = "1.offchainexample.eth";
    
    let resolver_address = reader.get_resolver(ens_name).await.unwrap();
    println!("resolver_address: {:?}", resolver_address);

    let supports_wildcard = reader.supports_wildcard(resolver_address).await.unwrap();
    println!("supports_wildcard: {:?}", supports_wildcard);

    let resolved_address = reader.resolve_name(ens_name).await.unwrap();
    println!("resolved_address: {:?}", resolved_address);
    
    Ok(())
}

For more examples, check out the examples directory

Dependencies

~21–35MB
~588K SLoC