Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add 2.6 endpoints #159

Merged
merged 16 commits into from
Oct 29, 2019
15 changes: 15 additions & 0 deletions extras/ARDUINO_IDE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ SRC_API_DIR=${SRC_DIR}/api

INCLUDE_BLOCKCHAIN_DIR=${INCLUDE_DIR}/api/blockchain
INCLUDE_BLOCKS_DIR=${INCLUDE_DIR}/api/blocks
INCLUDE_BUSINESSES_DIR=${INCLUDE_DIR}/api/businesses
INCLUDE_BRIDGECHAINS_DIR=${INCLUDE_DIR}/api/bridgechains
INCLUDE_DELEGATES_DIR=${INCLUDE_DIR}/api/delegates
INCLUDE_LOCKS_DIR=${INCLUDE_DIR}/api/locks
INCLUDE_NODE_DIR=${INCLUDE_DIR}/api/node
INCLUDE_PEERS_DIR=${INCLUDE_DIR}/api/peers
INCLUDE_ROUNDS_DIR=${INCLUDE_DIR}/api/rounds
Expand All @@ -47,7 +50,10 @@ INCLUDE_WALLETS_DIR=${INCLUDE_DIR}/api/wallets

SRC_BLOCKCHAIN_DIR=${SRC_DIR}/api/blockchain
SRC_BLOCKS_DIR=${SRC_DIR}/api/blocks
SRC_BUSINESSES_DIR=${SRC_DIR}/api/businesses
SRC_BRIDGECHAINS_DIR=${SRC_DIR}/api/bridgechains
SRC_DELEGATES_DIR=${SRC_DIR}/api/delegates
SRC_LOCKS_DIR=${SRC_DIR}/api/locks
SRC_NODE_DIR=${SRC_DIR}/api/node
SRC_PEERS_DIR=${SRC_DIR}/api/peers
SRC_ROUNDS_DIR=${SRC_DIR}/api/rounds
Expand Down Expand Up @@ -111,7 +117,10 @@ if [[ -d ${INCLUDE_DIR} ]]; then

mv ${INCLUDE_BLOCKCHAIN_DIR}/blockchain.hpp ${SRC_BLOCKCHAIN_DIR}
mv ${INCLUDE_BLOCKS_DIR}/blocks.h ${SRC_BLOCKS_DIR}
mv ${INCLUDE_BUSINESSES_DIR}/businesses.h ${SRC_BUSINESSES_DIR}
mv ${INCLUDE_BRIDGECHAINS_DIR}/bridgechains.h ${SRC_BRIDGECHAINS_DIR}
mv ${INCLUDE_DELEGATES_DIR}/delegates.h ${SRC_DELEGATES_DIR}
mv ${INCLUDE_LOCKS_DIR}/locks.h ${SRC_LOCKS_DIR}
mv ${INCLUDE_NODE_DIR}/node.h ${SRC_NODE_DIR}
mv ${INCLUDE_PEERS_DIR}/peers.h ${SRC_PEERS_DIR}
mv ${INCLUDE_ROUNDS_DIR}/rounds.h ${SRC_ROUNDS_DIR}
Expand Down Expand Up @@ -155,7 +164,10 @@ else
mkdir ${INCLUDE_API_DIR}
mkdir ${INCLUDE_BLOCKCHAIN_DIR}
mkdir ${INCLUDE_BLOCKS_DIR}
mkdir ${INCLUDE_BUSINESSES_DIR}
mkdir ${INCLUDE_BRIDGECHAINS_DIR}
mkdir ${INCLUDE_DELEGATES_DIR}
mkdir ${INCLUDE_LOCKS_DIR}
mkdir ${INCLUDE_NODE_DIR}
mkdir ${INCLUDE_PEERS_DIR}
mkdir ${INCLUDE_ROUNDS_DIR}
Expand All @@ -171,7 +183,10 @@ else

mv ${SRC_BLOCKCHAIN_DIR}/blockchain.hpp ${INCLUDE_BLOCKCHAIN_DIR}
mv ${SRC_BLOCKS_DIR}/blocks.h ${INCLUDE_BLOCKS_DIR}
mv ${SRC_BUSINESSES_DIR}/businesses.h ${INCLUDE_BUSINESSES_DIR}
mv ${SRC_BRIDGECHAINS_DIR}/bridgechains.h ${INCLUDE_BRIDGECHAINS_DIR}
mv ${SRC_DELEGATES_DIR}/delegates.h ${INCLUDE_DELEGATES_DIR}
mv ${SRC_LOCKS_DIR}/locks.h ${INCLUDE_LOCKS_DIR}
mv ${SRC_NODE_DIR}/node.h ${INCLUDE_NODE_DIR}
mv ${SRC_PEERS_DIR}/peers.h ${INCLUDE_PEERS_DIR}
mv ${SRC_ROUNDS_DIR}/rounds.h ${INCLUDE_ROUNDS_DIR}
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ set(PATHS_SRC api/paths.cpp)
set(API_SRC
api/blockchain/blockchain.cpp
api/blocks/blocks.cpp
api/businesses/businesses.cpp
api/bridgechains/bridgechains.cpp
api/delegates/delegates.cpp
api/locks/locks.cpp
api/node/node.cpp
api/peers/peers.cpp
api/rounds/rounds.cpp
Expand Down
40 changes: 40 additions & 0 deletions src/api/bridgechains/bridgechains.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* This file is part of Ark Cpp Client.
*
* (c) Ark Ecosystem <info@ark.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
**/

#include "api/bridgechains/bridgechains.h"

namespace Ark {
namespace Client {
namespace api {

std::string Bridgechains::get(const char* bridgechainId) {
return http_->get(paths::Bridgechains::get(this->host_, bridgechainId).c_str());
}

/**/

std::string Bridgechains::all(const char* const query) {
return http_->get(paths::Bridgechains::all(this->host_, query).c_str());
}

/**/

std::string Bridgechains::search(
const std::map<std::string, std::string> &bodyParameters,
const char* const query) {
const auto searchPathPair = paths::Bridgechains::search(this->host_,
bodyParameters,
query);
return http_->post(searchPathPair.first.c_str(),
searchPathPair.second.c_str());
}

} // namespace api
} // namespace Client
} // namespace Ark
49 changes: 49 additions & 0 deletions src/api/businesses/businesses.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* This file is part of Ark Cpp Client.
*
* (c) Ark Ecosystem <info@ark.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
**/

#include "api/businesses/businesses.h"

namespace Ark {
namespace Client {
namespace api {

std::string Businesses::get(const char* businessId) {
return http_->get(paths::Businesses::get(this->host_, businessId).c_str());
}

/**/

std::string Businesses::all(const char* const query) {
return http_->get(paths::Businesses::all(this->host_, query).c_str());
}

/**/

std::string Businesses::bridgechains(const char* businessId,
const char* const query) {
return http_->get(paths::Businesses::bridgechains(this->host_,
businessId,
query).c_str());
}

/**/

std::string Businesses::search(
const std::map<std::string, std::string> &bodyParameters,
const char* const query) {
const auto searchPathPair = paths::Businesses::search(this->host_,
bodyParameters,
query);
return http_->post(searchPathPair.first.c_str(),
searchPathPair.second.c_str());
}

} // namespace api
} // namespace Client
} // namespace Ark
47 changes: 47 additions & 0 deletions src/api/locks/locks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* This file is part of Ark Cpp Client.
*
* (c) Ark Ecosystem <info@ark.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
**/

#include "api/locks/locks.h"

namespace Ark {
namespace Client {
namespace api {

std::string Locks::get(const char* lockId) {
return http_->get(paths::Locks::get(this->host_, lockId).c_str());
}

/**/

std::string Locks::all(const char* const query) {
return http_->get(paths::Locks::all(this->host_, query).c_str());
}

/**/

std::string Locks::search(
const std::map<std::string, std::string> &bodyParameters,
const char* const query) {
const auto searchPathPair = paths::Locks::search(this->host_,
bodyParameters,
query);
return http_->post(searchPathPair.first.c_str(),
searchPathPair.second.c_str());
}

/**/

std::string Locks::unlocked(std::string& jsonIds, const char* const query) {
const auto pathPair = paths::Locks::unlocked(this->host_, jsonIds, query);
return http_->post(pathPair.first.c_str(), pathPair.second.c_str());
}

} // namespace api
} // namespace Client
} // namespace Ark
Loading