erc8128 0.3.2

Signed HTTP Requests with Ethereum.
Documentation
#![allow(clippy::print_stdout)]
//! Send an ERC-8128 signed HTTP request with reqwest.
//!
//! ```sh
//! cargo run --example reqwest_client --features k256,reqwest
//! ```

use erc8128::{SignOptions, client::signed_fetch, eoa::EoaSigner};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let signer = EoaSigner::from_slice(&[0xAB; 32], 1)?;
    let client = reqwest::Client::new();

    let resp = signed_fetch(
        &client,
        reqwest::Method::GET,
        "https://httpbin.org/get",
        &[],
        None,
        &signer,
        &SignOptions::default(),
    )
    .await?;

    println!("Status: {}", resp.status());
    println!("Body:\n{}", resp.text().await?);
    Ok(())
}