Currensees

Crates.io Build Status

A Rust library to interact with the Currency API.

Usage

Add this library as a dependency in your Cargo.toml:

toml [dependencies] currensees = "0.1.1"

Authentication

```rs use currensees::auth;

async fn main() { let username = "yourusername"; let password = "yourpassword";

let result = auth::login(username, password).await;

match result {
    Ok(response) => println!("Received response: {:?}", response),
    Err(error) => println!("Error: {:?}", error),
}

} ```

Convert

Converting between two currencies

```rs use currensees::convert;

async fn main() { let usertype = "member"; let username = "yourusername"; let date = "20230402"; let basecurrency = "GBP"; let targetcurrency = "EUR"; let amount = "500";

let result = convert::convert(user_type, username, date, base_currency, target_currency, amount).await;

match result {
    Ok(response) => println!("Received response: {:?}", response),
    Err(error) => println!("Error: {:?}", error),
}

} ```

Convert All

Converting between two currencies

```rs use currensees::convert_all;

async fn main() { let usertype = "member"; let username = "yourusername"; let basecurrency = "GBP"; let amount = "500"; let date = "202304_02";

let result = convert_all::convert_all(user_type, username, base_currency, amount, date).await;

match result {
    Ok(response) => println!("Received response: {:?}", response),
    Err(error) => println!("Error: {:?}", error),
}

} ```

Daily Average

```rs use currensees::daily_average;

async fn main() { let usertype = "member"; let username = "yourusername"; let date = "20230410";

let result = daily_average::daily_average(user_type, username, date).await;

match result {
    Ok(response) => println!("Received response: {:?}", response),
    Err(error) => println!("Error: {:?}", error),
}

} ```

Weekly Average

```rs use currensees::weekly_average;

async fn main() { let usertype = "member"; let username = "yourusername"; let fromdate = "20230403"; let todate = "20230407";

let result = weekly_average::weekly_average(user_type, username, from_date, to_date).await;

match result {
    Ok(response) => println!("Received response: {:?}", response),
    Err(error) => println!("Error: {:?}", error),
}

} ```

Margins and Spreads

```rs use currensees::margins_spreads;

async fn examplemarginsspreads() { let usertype = "member"; let username = "yourusername"; let day = "19"; let month = "04"; let year = "2023"; let uuid = Some("marginsspreadsuuid");

let result = margins_spreads::margins_spreads(user_type, username, day, month, year, uuid).await;

match result {
    Ok(response) => println!("Received response: {:?}", response),
    Err(error) => println!("Error: {:?}", error),
}

} ```

Setting up Currency API Account

Subscribe here for a user account.

Using the Currency API

You can read the API documentation to understand what's possible with the Currency API. If you need further assistance, don't hesitate to contact us.

License

This project is licensed under the BSD 3-Clause License.

Copyright

(c) 2020 - 2023 Moat Systems Limited.