duners

A convenience library for executing queries and recovering results from Dune Analytics API.

Installation and Usage

shell cargo add duners

```rust use std::env; use dotenv::dotenv; use duners::client::{DuneClient, DuneRequestError}; use serde::Deserialize;

// User must declare the expected query return fields and types!

[derive(Deserialize, Debug, PartialEq)]

struct ResultStruct { textfield: String, numberfield: String, datefield: String, listfield: String, }

[tokio::main]

async fn main() -> Result<(), DuneRequestError> { dotenv().ok(); let dune = DuneClient::new(env::var("DUNEAPIKEY").unwrap()); let results = dune.refresh::(1215383, None, None).await?; println!("{:?}", results.get_rows()); Ok(()) } ```