use tradestation_api::{Client, Credentials, Scope};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client_id =
std::env::var("TRADESTATION_CLIENT_ID").unwrap_or_else(|_| "YOUR_CLIENT_ID".to_string());
let client_secret = std::env::var("TRADESTATION_CLIENT_SECRET")
.unwrap_or_else(|_| "YOUR_CLIENT_SECRET".to_string());
let creds = Credentials::new(client_id, client_secret);
println!("Authorization URL:");
println!("{}", creds.authorization_url(&Scope::defaults()));
println!();
println!("Visit the URL above, authorize the app, then paste the code from the callback URL.");
let _client = Client::new(creds).with_sim();
println!("(See README for full OAuth2 flow)");
Ok(())
}