alchemy-api 0.1.0

A high-level binding for Alchemy Enhanced APIs, written in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use alchemy_api::{
    alchemy::Alchemy,
    api::notify::{GetAllWebhooks, GetAllWebhooksResponse},
    cores::query::Query,
};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = Alchemy::new(&std::env::var("ALCHEMY_TOKEN")?);

    // Create a simple endpoint.
    let endpoint = GetAllWebhooks;
    // Call the endpoint. The return type decides how to represent the value.
    let webhooks: GetAllWebhooksResponse = endpoint.query(&client).await?;
    println!("webhooks: {:?}", webhooks);

    anyhow::Ok(())
}