Skip to content

Commit f026d96

Browse files
authored
Merge pull request #174 from ArkEcosystem/release/v1.4.0-arduino
release: 1.4.0-arduino
2 parents 235b4a7 + 194b508 commit f026d96

21 files changed

+717
-170
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [1.4.0] - 2020-02-13
9+
10+
## [1.4.0-arduino] - 2020-02-13
11+
12+
### Added
13+
- added Core 2.6 endpoints ([#159])
14+
15+
## [1.3.0] - 2019-10-09
16+
817
## [1.3.0-arduino] - 2019-10-09
918

1019
### Added
@@ -72,3 +81,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7281
[#114]: https://github.com/ArkEcosystem/cpp-client/pull/114
7382
[#140]: https://github.com/ArkEcosystem/cpp-client/pull/140
7483
[1.3.0-arduino]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0-arduino...1.3.0-arduino
84+
[1.3.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0...1.3.0
85+
[#159]: https://github.com/ArkEcosystem/cpp-client/pull/159
86+
[1.4.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.3.0...1.4.0
87+
[1.4.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.3.0-arduino...1.4.0-arduino

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @faustbrian @kristjank @supaiku0
1+
* @faustbrian @kristjank @supaiku0 @sleepdefic1t

README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@
66

77
> A simple C++ API client for the Ark Blockchain.
88
9-
[![Build Status](https://badgen.now.sh/circleci/github/ArkEcosystem/cpp-client)](https://circleci.com/gh/ArkEcosystem/cpp-client)
10-
[![Codecov](https://badgen.now.sh/codecov/c/github/arkecosystem/cpp-client)](https://codecov.io/gh/arkecosystem/cpp-client)
11-
[![Latest Version](https://badgen.now.sh/github/release/ArkEcosystem/cpp-client)](https://github.com/ArkEcosystem/cpp-client/releases)
12-
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)
9+
[![Test Actions](https://github.com/ArkEcosystem/cpp-client/workflows/Test/badge.svg)](https://github.com/ArkEcosystem/cpp-client/actions)
10+
[![Coverage Actions](https://github.com/ArkEcosystem/cpp-client/workflows/Coverage/badge.svg)](https://github.com/ArkEcosystem/cpp-client/actions)
11+
[![Latest Version](https://badgen.now.sh/github/release/ArkEcosystem/cpp-client?labelColor=black)](https://github.com/ArkEcosystem/cpp-client/releases)
12+
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green?labelColor=black)](https://opensource.org/licenses/MIT)
13+
14+
> Lead Maintainer: [Simon Downey](https://github.com/sleepdefic1t)
1315
1416
## Documentation
1517

16-
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).
18+
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).
1719

1820
## Security
1921

2022
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.
2123

2224
## Credits
2325

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

2928
## License
3029

31-
[MIT](LICENSE) © [ArkEcosystem](https://ark.io)
30+
[MIT](LICENSE) © [ARK Ecosystem](https://ark.io)

examples/ESP32/ESP32.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ void checkAPI() {
337337
// }
338338
// ]
339339
// }
340-
const auto topWallets = connection.api.wallets.top("limit=1&page=1");
340+
const auto topWallets = connection.api.wallets.top("?limit=1&page=1");
341341
Serial.print("\nTop Wallets: ");
342342
Serial.println(topWallets.c_str());
343343
};

extras/ARDUINO_IDE.sh

100644100755
+15-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env bash
2-
32
# This file is part of Ark Cpp Client.
43
#
54
# (c) Ark Ecosystem <info@ark.io>
@@ -38,7 +37,10 @@ SRC_API_DIR=${SRC_DIR}/api
3837

3938
INCLUDE_BLOCKCHAIN_DIR=${INCLUDE_DIR}/api/blockchain
4039
INCLUDE_BLOCKS_DIR=${INCLUDE_DIR}/api/blocks
40+
INCLUDE_BUSINESSES_DIR=${INCLUDE_DIR}/api/businesses
41+
INCLUDE_BRIDGECHAINS_DIR=${INCLUDE_DIR}/api/bridgechains
4142
INCLUDE_DELEGATES_DIR=${INCLUDE_DIR}/api/delegates
43+
INCLUDE_LOCKS_DIR=${INCLUDE_DIR}/api/locks
4244
INCLUDE_NODE_DIR=${INCLUDE_DIR}/api/node
4345
INCLUDE_PEERS_DIR=${INCLUDE_DIR}/api/peers
4446
INCLUDE_ROUNDS_DIR=${INCLUDE_DIR}/api/rounds
@@ -48,7 +50,10 @@ INCLUDE_WALLETS_DIR=${INCLUDE_DIR}/api/wallets
4850

4951
SRC_BLOCKCHAIN_DIR=${SRC_DIR}/api/blockchain
5052
SRC_BLOCKS_DIR=${SRC_DIR}/api/blocks
53+
SRC_BUSINESSES_DIR=${SRC_DIR}/api/businesses
54+
SRC_BRIDGECHAINS_DIR=${SRC_DIR}/api/bridgechains
5155
SRC_DELEGATES_DIR=${SRC_DIR}/api/delegates
56+
SRC_LOCKS_DIR=${SRC_DIR}/api/locks
5257
SRC_NODE_DIR=${SRC_DIR}/api/node
5358
SRC_PEERS_DIR=${SRC_DIR}/api/peers
5459
SRC_ROUNDS_DIR=${SRC_DIR}/api/rounds
@@ -112,7 +117,10 @@ if [[ -d ${INCLUDE_DIR} ]]; then
112117

113118
mv ${INCLUDE_BLOCKCHAIN_DIR}/blockchain.hpp ${SRC_BLOCKCHAIN_DIR}
114119
mv ${INCLUDE_BLOCKS_DIR}/blocks.h ${SRC_BLOCKS_DIR}
120+
mv ${INCLUDE_BUSINESSES_DIR}/businesses.h ${SRC_BUSINESSES_DIR}
121+
mv ${INCLUDE_BRIDGECHAINS_DIR}/bridgechains.h ${SRC_BRIDGECHAINS_DIR}
115122
mv ${INCLUDE_DELEGATES_DIR}/delegates.h ${SRC_DELEGATES_DIR}
123+
mv ${INCLUDE_LOCKS_DIR}/locks.h ${SRC_LOCKS_DIR}
116124
mv ${INCLUDE_NODE_DIR}/node.h ${SRC_NODE_DIR}
117125
mv ${INCLUDE_PEERS_DIR}/peers.h ${SRC_PEERS_DIR}
118126
mv ${INCLUDE_ROUNDS_DIR}/rounds.h ${SRC_ROUNDS_DIR}
@@ -156,7 +164,10 @@ else
156164
mkdir ${INCLUDE_API_DIR}
157165
mkdir ${INCLUDE_BLOCKCHAIN_DIR}
158166
mkdir ${INCLUDE_BLOCKS_DIR}
167+
mkdir ${INCLUDE_BUSINESSES_DIR}
168+
mkdir ${INCLUDE_BRIDGECHAINS_DIR}
159169
mkdir ${INCLUDE_DELEGATES_DIR}
170+
mkdir ${INCLUDE_LOCKS_DIR}
160171
mkdir ${INCLUDE_NODE_DIR}
161172
mkdir ${INCLUDE_PEERS_DIR}
162173
mkdir ${INCLUDE_ROUNDS_DIR}
@@ -172,7 +183,10 @@ else
172183

173184
mv ${SRC_BLOCKCHAIN_DIR}/blockchain.hpp ${INCLUDE_BLOCKCHAIN_DIR}
174185
mv ${SRC_BLOCKS_DIR}/blocks.h ${INCLUDE_BLOCKS_DIR}
186+
mv ${SRC_BUSINESSES_DIR}/businesses.h ${INCLUDE_BUSINESSES_DIR}
187+
mv ${SRC_BRIDGECHAINS_DIR}/bridgechains.h ${INCLUDE_BRIDGECHAINS_DIR}
175188
mv ${SRC_DELEGATES_DIR}/delegates.h ${INCLUDE_DELEGATES_DIR}
189+
mv ${SRC_LOCKS_DIR}/locks.h ${INCLUDE_LOCKS_DIR}
176190
mv ${SRC_NODE_DIR}/node.h ${INCLUDE_NODE_DIR}
177191
mv ${SRC_PEERS_DIR}/peers.h ${INCLUDE_PEERS_DIR}
178192
mv ${SRC_ROUNDS_DIR}/rounds.h ${INCLUDE_ROUNDS_DIR}

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "git",
88
"url": "https://github.com/ArkEcosystem/Cpp-Client.git"
99
},
10-
"version": "1.3.0-arduino",
10+
"version": "1.4.0-arduino",
1111
"authors": [
1212
{
1313
"name": "Ark Ecosystem",

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Ark-Cpp-Client
2-
version=1.3.0-arduino
2+
version=1.4.0-arduino
33
author=Ark Ecosystem
44
maintainer=Ark Ecosystem
55
sentence=A simple API client implementation in C++ for the ARK Blockchain.

platformio.ini

-36
This file was deleted.

src/api/api.h

+9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
#include "api/api.h"
1515
#include "api/blockchain/blockchain.hpp"
1616
#include "api/blocks/blocks.h"
17+
#include "api/businesses/businesses.h"
18+
#include "api/bridgechains/bridgechains.h"
1719
#include "api/delegates/delegates.h"
20+
#include "api/locks/locks.h"
1821
#include "api/node/node.h"
1922
#include "api/peers/peers.h"
2023
#include "api/rounds/rounds.h"
@@ -29,7 +32,10 @@ class Api : public api::Abstract {
2932
public:
3033
api::Blockchain blockchain;
3134
api::Blocks blocks;
35+
api::Businesses businesses;
36+
api::Bridgechains bridgechains;
3237
api::Delegates delegates;
38+
api::Locks locks;
3339
api::Node node;
3440
api::Peers peers;
3541
api::Rounds rounds;
@@ -40,7 +46,10 @@ class Api : public api::Abstract {
4046
Api() : Abstract(),
4147
blockchain(host_, *http_),
4248
blocks(host_, *http_),
49+
businesses(host_, *http_),
50+
bridgechains(host_, *http_),
4351
delegates(host_, *http_),
52+
locks(host_, *http_),
4453
node(host_, *http_),
4554
peers(host_, *http_),
4655
rounds(host_, *http_),

src/api/bridgechains/bridgechains.cpp

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* This file is part of Ark Cpp Client.
3+
*
4+
* (c) Ark Ecosystem <info@ark.io>
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
**/
9+
10+
#include "api/bridgechains/bridgechains.h"
11+
12+
namespace Ark {
13+
namespace Client {
14+
namespace api {
15+
16+
std::string Bridgechains::get(const char* bridgechainId) {
17+
return http_->get(paths::Bridgechains::get(this->host_, bridgechainId).c_str());
18+
}
19+
20+
/**/
21+
22+
std::string Bridgechains::all(const char* const query) {
23+
return http_->get(paths::Bridgechains::all(this->host_, query).c_str());
24+
}
25+
26+
/**/
27+
28+
std::string Bridgechains::search(
29+
const std::map<std::string, std::string> &bodyParameters,
30+
const char* const query) {
31+
const auto searchPathPair = paths::Bridgechains::search(this->host_,
32+
bodyParameters,
33+
query);
34+
return http_->post(searchPathPair.first.c_str(),
35+
searchPathPair.second.c_str());
36+
}
37+
38+
} // namespace api
39+
} // namespace Client
40+
} // namespace Ark

src/api/bridgechains/bridgechains.h

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* This file is part of Ark Cpp Client.
3+
*
4+
* (c) Ark Ecosystem <info@ark.io>
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
**/
9+
10+
#ifndef BRIDGECHAINS_H
11+
#define BRIDGECHAINS_H
12+
13+
#include <map>
14+
#include <string>
15+
16+
#include "api/base.h"
17+
#include "api/paths.h"
18+
19+
namespace Ark {
20+
namespace Client {
21+
namespace api { // NOLINT
22+
23+
class IBridgechains : public Base {
24+
public:
25+
virtual ~IBridgechains() {}
26+
virtual std::string get(const char* const bridgechainId) = 0;
27+
virtual std::string all(const char* const query) = 0;
28+
virtual std::string search(const std::map<std::string, std::string>& bodyParameters, const char* const query) = 0;
29+
30+
protected:
31+
IBridgechains(Host& host, IHTTP& http) : Base(host, http) {}
32+
};
33+
34+
/**/
35+
36+
class Bridgechains : public IBridgechains {
37+
public:
38+
Bridgechains(Host& host, IHTTP& http) : IBridgechains(host, http) {}
39+
40+
std::string get(const char* const bridgechainId) override;
41+
std::string all(const char* const query) override;
42+
std::string search(const std::map<std::string, std::string>& bodyParameters, const char* const query) override;
43+
};
44+
45+
} // namespace api
46+
} // namespace Client
47+
} // namespace Ark
48+
49+
#endif

src/api/businesses/businesses.cpp

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* This file is part of Ark Cpp Client.
3+
*
4+
* (c) Ark Ecosystem <info@ark.io>
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
**/
9+
10+
#include "api/businesses/businesses.h"
11+
12+
namespace Ark {
13+
namespace Client {
14+
namespace api {
15+
16+
std::string Businesses::get(const char* businessId) {
17+
return http_->get(paths::Businesses::get(this->host_, businessId).c_str());
18+
}
19+
20+
/**/
21+
22+
std::string Businesses::all(const char* const query) {
23+
return http_->get(paths::Businesses::all(this->host_, query).c_str());
24+
}
25+
26+
/**/
27+
28+
std::string Businesses::bridgechains(const char* businessId,
29+
const char* const query) {
30+
return http_->get(paths::Businesses::bridgechains(this->host_,
31+
businessId,
32+
query).c_str());
33+
}
34+
35+
/**/
36+
37+
std::string Businesses::search(
38+
const std::map<std::string, std::string> &bodyParameters,
39+
const char* const query) {
40+
const auto searchPathPair = paths::Businesses::search(this->host_,
41+
bodyParameters,
42+
query);
43+
return http_->post(searchPathPair.first.c_str(),
44+
searchPathPair.second.c_str());
45+
}
46+
47+
} // namespace api
48+
} // namespace Client
49+
} // namespace Ark

0 commit comments

Comments
 (0)