avanza-rs

Inspired by fhqvst/avanza

Usage

```rust use avanza_rs::client:{Client, Credentials};

let username = "username"; let password = "password"; let totpsecret = "totpsecret";

let credentials = super::client::Credentials { username: String::from(username), password: String::from(password), totpsecret: String::from(totpsecret) };

let client = super::client::Client::authenticate(&credentials).await?;

let accounts = client.list_accounts().await?;

let account = client.get_acccount("1234567").await?;

let stockorder = StockOrder { orderbookid: String::from("5247"), account_id: account.id.clone(), price: 215.0, volume: 10, side: Side::BUY, };

let result = client.newstockorder(&stock_order).await?;

```

How to create totp_secret

  1. Go to Mina Sidor > Profil > Sajtinställningar > Tvåfaktorsinloggning and click "Återaktivera". (Only do this step if you have already set up two-factor auth.)
  2. Click "Aktivera" on the next screen.
  3. Select "Annan app för tvåfaktorsinloggning".
  4. Click "Kan du inte scanna QR-koden?" to reveal your TOTP Secret.
  5. 5.