Skip to content

Commit

Permalink
Merge pull request #174 from ArkEcosystem/release/v1.4.0-arduino
Browse files Browse the repository at this point in the history
release: 1.4.0-arduino
  • Loading branch information
faustbrian committed Feb 14, 2020
2 parents 235b4a7 + 194b508 commit f026d96
Show file tree
Hide file tree
Showing 21 changed files with 717 additions and 170 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.4.0] - 2020-02-13

## [1.4.0-arduino] - 2020-02-13

### Added
- added Core 2.6 endpoints ([#159])

## [1.3.0] - 2019-10-09

## [1.3.0-arduino] - 2019-10-09

### Added
Expand Down Expand Up @@ -72,3 +81,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[#114]: https://github.com/ArkEcosystem/cpp-client/pull/114
[#140]: https://github.com/ArkEcosystem/cpp-client/pull/140
[1.3.0-arduino]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0-arduino...1.3.0-arduino
[1.3.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0...1.3.0
[#159]: https://github.com/ArkEcosystem/cpp-client/pull/159
[1.4.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.3.0...1.4.0
[1.4.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.3.0-arduino...1.4.0-arduino
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @faustbrian @kristjank @supaiku0
* @faustbrian @kristjank @supaiku0 @sleepdefic1t
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@

> A simple C++ API client for the Ark Blockchain.
[![Build Status](https://badgen.now.sh/circleci/github/ArkEcosystem/cpp-client)](https://circleci.com/gh/ArkEcosystem/cpp-client)
[![Codecov](https://badgen.now.sh/codecov/c/github/arkecosystem/cpp-client)](https://codecov.io/gh/arkecosystem/cpp-client)
[![Latest Version](https://badgen.now.sh/github/release/ArkEcosystem/cpp-client)](https://github.com/ArkEcosystem/cpp-client/releases)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)
[![Test Actions](https://github.com/ArkEcosystem/cpp-client/workflows/Test/badge.svg)](https://github.com/ArkEcosystem/cpp-client/actions)
[![Coverage Actions](https://github.com/ArkEcosystem/cpp-client/workflows/Coverage/badge.svg)](https://github.com/ArkEcosystem/cpp-client/actions)
[![Latest Version](https://badgen.now.sh/github/release/ArkEcosystem/cpp-client?labelColor=black)](https://github.com/ArkEcosystem/cpp-client/releases)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green?labelColor=black)](https://opensource.org/licenses/MIT)

> Lead Maintainer: [Simon Downey](https://github.com/sleepdefic1t)
## Documentation

You can find installation instructions and detailed instructions on how to use this package at the [dedicated documentation site](https://docs.ark.io/sdk/clients/cpp.html).
You can find installation instructions and detailed instructions on how to use this package at the [dedicated documentation site](https://docs.ark.io/sdk/clients/usage.html).

## Security

If you discover a security vulnerability within this package, please send an e-mail to security@ark.io. All security vulnerabilities will be promptly addressed.

## Credits

- [Simon Downey](https://github.com/sleepdeficit)
- [Chris Johnson](https://github.com/ciband)
- [supaiku0](https://github.com/supaiku0)
- [All Contributors](../../../../contributors)
This project exists thanks to all the people who [contribute](../../contributors).

## License

[MIT](LICENSE) © [ArkEcosystem](https://ark.io)
[MIT](LICENSE) © [ARK Ecosystem](https://ark.io)
2 changes: 1 addition & 1 deletion examples/ESP32/ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void checkAPI() {
// }
// ]
// }
const auto topWallets = connection.api.wallets.top("limit=1&page=1");
const auto topWallets = connection.api.wallets.top("?limit=1&page=1");
Serial.print("\nTop Wallets: ");
Serial.println(topWallets.c_str());
};
Expand Down
16 changes: 15 additions & 1 deletion extras/ARDUINO_IDE.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash

# This file is part of Ark Cpp Client.
#
# (c) Ark Ecosystem <info@ark.io>
Expand Down Expand Up @@ -38,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 @@ -48,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 @@ -112,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 @@ -156,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 @@ -172,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
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/ArkEcosystem/Cpp-Client.git"
},
"version": "1.3.0-arduino",
"version": "1.4.0-arduino",
"authors": [
{
"name": "Ark Ecosystem",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Ark-Cpp-Client
version=1.3.0-arduino
version=1.4.0-arduino
author=Ark Ecosystem
maintainer=Ark Ecosystem
sentence=A simple API client implementation in C++ for the ARK Blockchain.
Expand Down
36 changes: 0 additions & 36 deletions platformio.ini

This file was deleted.

9 changes: 9 additions & 0 deletions src/api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
#include "api/api.h"
#include "api/blockchain/blockchain.hpp"
#include "api/blocks/blocks.h"
#include "api/businesses/businesses.h"
#include "api/bridgechains/bridgechains.h"
#include "api/delegates/delegates.h"
#include "api/locks/locks.h"
#include "api/node/node.h"
#include "api/peers/peers.h"
#include "api/rounds/rounds.h"
Expand All @@ -29,7 +32,10 @@ class Api : public api::Abstract {
public:
api::Blockchain blockchain;
api::Blocks blocks;
api::Businesses businesses;
api::Bridgechains bridgechains;
api::Delegates delegates;
api::Locks locks;
api::Node node;
api::Peers peers;
api::Rounds rounds;
Expand All @@ -40,7 +46,10 @@ class Api : public api::Abstract {
Api() : Abstract(),
blockchain(host_, *http_),
blocks(host_, *http_),
businesses(host_, *http_),
bridgechains(host_, *http_),
delegates(host_, *http_),
locks(host_, *http_),
node(host_, *http_),
peers(host_, *http_),
rounds(host_, *http_),
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/bridgechains/bridgechains.h
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.
**/

#ifndef BRIDGECHAINS_H
#define BRIDGECHAINS_H

#include <map>
#include <string>

#include "api/base.h"
#include "api/paths.h"

namespace Ark {
namespace Client {
namespace api { // NOLINT

class IBridgechains : public Base {
public:
virtual ~IBridgechains() {}
virtual std::string get(const char* const bridgechainId) = 0;
virtual std::string all(const char* const query) = 0;
virtual std::string search(const std::map<std::string, std::string>& bodyParameters, const char* const query) = 0;

protected:
IBridgechains(Host& host, IHTTP& http) : Base(host, http) {}
};

/**/

class Bridgechains : public IBridgechains {
public:
Bridgechains(Host& host, IHTTP& http) : IBridgechains(host, http) {}

std::string get(const char* const bridgechainId) override;
std::string all(const char* const query) override;
std::string search(const std::map<std::string, std::string>& bodyParameters, const char* const query) override;
};

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

#endif
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

0 comments on commit f026d96

Please sign in to comment.