Skip to content

Commit 777e724

Browse files
committed
deleted redundant var & updated gitignore
1 parent 20f05ac commit 777e724

File tree

5 files changed

+44
-70
lines changed

5 files changed

+44
-70
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,13 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
# MACOSX
35+
*.DS_Store
36+
37+
# VSCode
38+
.vscode/*
39+
40+
# Temp build files
41+
build/*
42+

libbittrex/include/libbittrex/api/base.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ class Base {
3030

3131
_api_call->dispatch(endpoint, type, json_tree, std::forward<Params_t>(rest)...);
3232

33-
BOOST_FOREACH(pt::ptree::value_type &child,
34-
json_tree.get_child("result")) {
35-
res_arr.emplace_back(M(child.second));
36-
}
33+
BOOST_FOREACH(pt::ptree::value_type &child, json_tree.get_child("result")) {
34+
res_arr.emplace_back(M(child.second));
35+
}
3736

3837
return res_arr;
3938
}

libbittrex/src/api/account.cpp

+14-29
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,44 @@
33
using namespace bittrex::api;
44

55
balance_list_t Account::get_balances() {
6-
auto res = api_request<balance_list_t, balance_t>("account/getbalances?", bittrex::api::Type::ACCOUNT, "");
7-
return res;
6+
return api_request<balance_list_t, balance_t>("account/getbalances?", bittrex::api::Type::ACCOUNT, "");
87
}
98

109

1110
balance_t Account::get_balance(const std::string &currency) {
12-
auto res = api_request<balance_t, balance_t>("account/getbalance?", bittrex::api::Type::ACCOUNT, "currency=",
13-
currency);
14-
return res;
15-
11+
return api_request<balance_t, balance_t>("account/getbalance?", bittrex::api::Type::ACCOUNT, "currency=", currency);
1612
}
1713

1814

1915
deposit_address_t Account::get_deposit_address(const std::string &currency) {
20-
auto res = api_request<deposit_address_t, deposit_address_t>("account/getdepositaddress?", bittrex::api::Type::ACCOUNT,
21-
"currency=", currency);
22-
return res;
16+
return api_request<deposit_address_t, deposit_address_t>(
17+
"account/getdepositaddress?", bittrex::api::Type::ACCOUNT, "currency=", currency);
2318

2419
}
2520

2621

27-
btx_uuid_t Account::withdraw(const std::string &currency, const float &quantity,
28-
const std::string &address, const int &payment_id) {
29-
30-
auto res = api_request<btx_uuid_t, btx_uuid_t>( "account/withdraw?", bittrex::api::Type::ACCOUNT,
31-
"currency=", currency, "quantity=", quantity,
32-
"address=", address, "paymentid=", payment_id);
33-
return res;
22+
btx_uuid_t Account::withdraw(
23+
const std::string &currency, const float &quantity, const std::string &address, const int &payment_id) {
24+
return api_request<btx_uuid_t, btx_uuid_t>(
25+
"account/withdraw?", bittrex::api::Type::ACCOUNT,
26+
"currency=", currency, "quantity=", quantity, "address=", address, "paymentid=", payment_id);
3427
}
3528

3629

3730
order_t Account::get_order(const std::string &uuid) {
38-
auto res = api_request<order_t, order_t>("account/getorder?", bittrex::api::Type::ACCOUNT, "uuid=", uuid);
39-
return res;
31+
return api_request<order_t, order_t>("account/getorder?", bittrex::api::Type::ACCOUNT, "uuid=", uuid);
4032
}
4133

4234

4335
order_history_ent_list_t Account::get_order_history(const std::string &market) {
44-
// json res = (!market.empty()) ?
45-
// _api_call->dispatch("account/getorderhistory?", bittrex::api::Type::ACCOUNT, "market=", market):
46-
// _api_call->dispatch("account/getorderhistory?", bittrex::api::Type::ACCOUNT, "");
47-
48-
auto res = api_request<order_history_ent_list_t, order_history_ent_t>("account/getorderhistory?",
49-
bittrex::api::Type::ACCOUNT, "market=",
50-
market);
51-
return res;
36+
return api_request<order_history_ent_list_t, order_history_ent_t>(
37+
"account/getorderhistory?", bittrex::api::Type::ACCOUNT, "market=", market);
5238
}
5339

5440

5541
withdrawal_history_ent_list_t Account::get_withdrawal_history(const std::string &currency) {
56-
auto res = api_request<withdrawal_history_ent_list_t, withdrawal_history_ent_t>(
57-
"account/getwithdrawalhistory?", bittrex::api::Type::ACCOUNT, "currency=", currency);
58-
return res;
42+
return api_request<withdrawal_history_ent_list_t, withdrawal_history_ent_t>(
43+
"account/getwithdrawalhistory?", bittrex::api::Type::ACCOUNT, "currency=", currency);
5944
}
6045

6146

libbittrex/src/api/market.cpp

+9-17
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,28 @@
33
using namespace bittrex::api;
44

55
btx_uuid_t Market::buy_limit(const std::string &market, const float &quantity, const float &rate) {
6-
auto res = api_request<btx_uuid_t, btx_uuid_t>("market/buylimit?", bittrex::api::Type::MARKET, "market=", market,
7-
"quantity=",
8-
quantity,
9-
"rate=", rate);
10-
return res;
6+
return api_request<btx_uuid_t, btx_uuid_t>(
7+
"market/buylimit?", bittrex::api::Type::MARKET,
8+
"market=", market, "quantity=", quantity, "rate=", rate);
119
}
1210

1311

1412
btx_uuid_t Market::sell_limit(const std::string &market, const float &quantity, const float &rate) {
15-
16-
auto res = api_request<btx_uuid_t, btx_uuid_t>("market/selllimit?", bittrex::api::Type::MARKET, "market=", market,
17-
"quantity=",
18-
quantity,
19-
"rate=", rate);
20-
return res;
13+
return api_request<btx_uuid_t, btx_uuid_t>(
14+
"market/selllimit?", bittrex::api::Type::MARKET,
15+
"market=", market, "quantity=", quantity, "rate=", rate);
2116

2217
}
2318

2419

2520
btx_uuid_t Market::cancel(const std::string &uuid) {
26-
auto res = api_request<btx_uuid_t, btx_uuid_t>("market/cancel?", bittrex::api::Type::MARKET, "uuid=", uuid);
27-
return res;
21+
return api_request<btx_uuid_t, btx_uuid_t>("market/cancel?", bittrex::api::Type::MARKET, "uuid=", uuid);
2822
}
2923

3024

3125
open_order_list_t Market::get_open_orders(const std::string &market) {
32-
auto res = api_request<open_order_list_t, open_order_t>("market/getopenorders?", bittrex::api::Type::MARKET,
33-
"market=",
34-
market);
35-
return res;
26+
return api_request<open_order_list_t, open_order_t>(
27+
"market/getopenorders?", bittrex::api::Type::MARKET, "market=", market);
3628
}
3729

3830

libbittrex/src/api/public.cpp

+8-20
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,37 @@
33
using namespace bittrex::api;
44

55
market_list_t Public::get_markets() {
6-
auto res = api_request<market_list_t, market_t>("public/getmarkets/", bittrex::api::Type::PUBLIC, "");
7-
return res;
6+
return api_request<market_list_t, market_t>("public/getmarkets/", bittrex::api::Type::PUBLIC, "");
87
}
98

109

1110
currency_list_t Public::get_currencies() {
12-
auto res = api_request<currency_list_t, currency_t>("public/getcurrencies/", bittrex::api::Type::PUBLIC, "");
13-
return res;
11+
return api_request<currency_list_t, currency_t>("public/getcurrencies/", bittrex::api::Type::PUBLIC, "");
1412
}
1513

1614

1715
ticker_t Public::get_ticker(const std::string &market) {
18-
auto res = api_request<ticker_t, ticker_t>("public/getticker?", bittrex::api::Type::PUBLIC, "market=", market);
19-
return res;
16+
return api_request<ticker_t, ticker_t>("public/getticker?", bittrex::api::Type::PUBLIC, "market=", market);
2017
}
2118

2219

2320
market_sum_list_t Public::get_market_summaries() {
24-
auto res = api_request<market_sum_list_t, market_sum_t>("public/getmarketsummaries/", bittrex::api::Type::PUBLIC,
25-
"");
26-
return res;
21+
return api_request<market_sum_list_t, market_sum_t>("public/getmarketsummaries/", bittrex::api::Type::PUBLIC, "");
2722

2823
}
2924

3025

3126
market_sum_list_t Public::get_market_summary(const std::string &market) {
32-
auto res = api_request<market_sum_list_t, market_sum_t>("public/getmarketsummary?", bittrex::api::Type::PUBLIC,
33-
"market=", market);
34-
return res;
27+
return api_request<market_sum_list_t, market_sum_t>("public/getmarketsummary?", bittrex::api::Type::PUBLIC, "market=", market);
3528
}
3629

3730

3831
order_book_t Public::get_order_book(const std::string &market, const std::string &type) {
39-
auto res = api_request<order_book_t, order_book_t>("public/getorderbook?", bittrex::api::Type::PUBLIC, "market=",
40-
market,
41-
"type=", type);
42-
return res;
32+
return api_request<order_book_t, order_book_t>(
33+
"public/getorderbook?", bittrex::api::Type::PUBLIC, "market=", market, "type=", type);
4334
}
4435

4536

4637
trade_list_t Public::get_market_history(const std::string &market) {
47-
auto res = api_request<trade_list_t, trade_t>("public/getmarkethistory?", bittrex::api::Type::PUBLIC,
48-
"market=", market);
49-
return res;
50-
38+
return api_request<trade_list_t, trade_t>("public/getmarkethistory?", bittrex::api::Type::PUBLIC, "market=", market);
5139
}

0 commit comments

Comments
 (0)