use anyhow::Result;
use privy_rs::PrivyClient;
use tracing_subscriber::EnvFilter;
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_env_filter(
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")),
)
.init();
let wallet_id =
std::env::var("PRIVY_WALLET_ID").expect("PRIVY_WALLET_ID environment variable not set");
let public_key =
std::env::var("PRIVY_PUBLIC_KEY").expect("PRIVY_PUBLIC_KEY environment variable not set");
let client = PrivyClient::new_from_env()?;
tracing::info!(
"initialized privy client from environment, wallet_id: {}, public_key: {}",
wallet_id,
public_key
);
let wallets = client.wallets().list(None, None, Some(5.0), None).await?;
tracing::info!("got wallets: {:?}", wallets);
Ok(())
}