Skip to content

Commit

Permalink
Move Pair and Currency to coinnect::types
Browse files Browse the repository at this point in the history
  • Loading branch information
ainestal committed Jun 25, 2017
1 parent e59117c commit 721359e
Show file tree
Hide file tree
Showing 15 changed files with 259 additions and 271 deletions.
2 changes: 1 addition & 1 deletion examples/generic_api.rs
Expand Up @@ -9,7 +9,7 @@ extern crate coinnect;
use coinnect::coinnect::Coinnect;
use coinnect::kraken::KrakenCreds;
use coinnect::exchange::Exchange::*;
use coinnect::pair::Pair::*;
use coinnect::types::Pair::*;

fn main() {
// We create a Coinnect Generic API
Expand Down
2 changes: 1 addition & 1 deletion src/bitstamp/api.rs
Expand Up @@ -18,7 +18,7 @@ use exchange::Exchange;

use error::*;
use helpers;
use pair::Pair;
use types::Pair;
use bitstamp::utils;
use types::*;

Expand Down
1 change: 0 additions & 1 deletion src/bitstamp/generic_api.rs
Expand Up @@ -7,7 +7,6 @@ use bitstamp::api::BitstampApi;
use bitstamp::utils;

use error::*;
use pair::Pair;
use types::*;
use helpers;

Expand Down
10 changes: 5 additions & 5 deletions src/bitstamp/utils.rs
Expand Up @@ -12,9 +12,9 @@ use std::time::Duration;

use error::*;
use helpers;
use pair::Pair;
use pair::Pair::*;
use currency::Currency;
use types::Currency;
use types::Pair;
use types::Pair::*;

lazy_static! {
static ref PAIRS_STRING: BidirMap<Pair, &'static str> = {
Expand Down Expand Up @@ -123,7 +123,7 @@ pub fn parse_result(response: &Map<String, Value>) -> Result<Map<String, Value>>
///
/// ```
/// use coinnect::bitstamp::utils::get_currency_enum;
/// use coinnect::currency::Currency;
/// use coinnect::types::Currency;
///
/// let currency = get_currency_enum("usd_balance");
/// assert_eq!(Some(Currency::USD), currency);
Expand All @@ -145,7 +145,7 @@ pub fn get_currency_enum(currency: &str) -> Option<Currency> {
///
/// ```
/// use coinnect::bitstamp::utils::get_currency_string;
/// use coinnect::currency::Currency;
/// use coinnect::types::Currency;
///
/// let currency = get_currency_string(Currency::USD);
/// assert_eq!(currency, Some("USD".to_string()));
Expand Down
83 changes: 0 additions & 83 deletions src/currency.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/exchange.rs
Expand Up @@ -5,7 +5,6 @@ use std::convert::Into;
use std::str::FromStr;

use error::*;
use pair::Pair;
use types::*;


Expand Down
1 change: 0 additions & 1 deletion src/kraken/generic_api.rs
Expand Up @@ -6,7 +6,6 @@ use exchange::ExchangeApi;
use kraken::api::KrakenApi;

use error::*;
use pair::Pair;
use types::*;
use kraken::utils;
use helpers;
Expand Down
10 changes: 5 additions & 5 deletions src/kraken/utils.rs
Expand Up @@ -4,9 +4,9 @@ use serde_json::Value;
use serde_json::value::Map;

use error::*;
use pair::Pair;
use pair::Pair::*;
use currency::Currency;
use types::Currency;
use types::Pair;
use types::Pair::*;

lazy_static! {
static ref PAIRS_STRING: BidirMap<Pair, &'static str> = {
Expand Down Expand Up @@ -147,7 +147,7 @@ pub fn parse_result(response: &Map<String, Value>) -> Result<Map<String, Value>>
///
/// ```
/// use coinnect::kraken::utils::get_currency_enum;
/// use coinnect::currency::Currency;
/// use coinnect::types::Currency;
///
/// let currency = get_currency_enum("ZUSD");
/// assert_eq!(Some(Currency::USD), currency);
Expand Down Expand Up @@ -185,7 +185,7 @@ pub fn get_currency_enum(currency: &str) -> Option<Currency> {
///
/// ```
/// use coinnect::kraken::utils::get_currency_string;
/// use coinnect::currency::Currency;
/// use coinnect::types::Currency;
///
/// let currency = get_currency_string(Currency::BTC);
/// assert_eq!(currency, Some("XXBT".to_string()));
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Expand Up @@ -44,8 +44,6 @@ extern crate error_chain;
pub mod coinnect;
pub mod exchange;
pub mod error;
pub mod currency;
pub mod pair;
pub mod types;
mod helpers;

Expand Down
160 changes: 0 additions & 160 deletions src/pair.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/poloniex/generic_api.rs
Expand Up @@ -6,7 +6,6 @@ use exchange::ExchangeApi;
use poloniex::api::PoloniexApi;

use error::*;
use pair::Pair;
use types::*;
use poloniex::utils;
use helpers;
Expand Down
10 changes: 5 additions & 5 deletions src/poloniex/utils.rs
Expand Up @@ -3,10 +3,10 @@ use serde_json;
use serde_json::Value;
use serde_json::value::Map;

use currency::Currency;
use error::*;
use pair::Pair;
use pair::Pair::*;
use types::Currency;
use types::Pair;
use types::Pair::*;

lazy_static! {
static ref PAIRS_STRING: BidirMap<Pair, &'static str> = {
Expand Down Expand Up @@ -157,7 +157,7 @@ pub fn parse_result(response: &Map<String, Value>) -> Result<Map<String, Value>>
///
/// ```
/// use coinnect::poloniex::utils::get_currency_enum;
/// use coinnect::currency::Currency;
/// use coinnect::types::Currency;
///
/// let currency = get_currency_enum("BTC").unwrap();
/// assert_eq!(currency, Currency::BTC);
Expand Down Expand Up @@ -186,7 +186,7 @@ pub fn get_currency_enum(currency: &str) -> Option<Currency> {
///
/// ```
/// use coinnect::poloniex::utils::get_currency_string;
/// use coinnect::currency::Currency;
/// use coinnect::types::Currency;
///
/// let currency = get_currency_string(Currency::BTC);
/// assert_eq!(currency, Some("BTC".to_string()));
Expand Down

0 comments on commit 721359e

Please sign in to comment.