32 #ifndef LEDGER_CORE_NODERIPPLELIKEBLOCKCHAINEXPLORER_H 33 #define LEDGER_CORE_NODERIPPLELIKEBLOCKCHAINEXPLORER_H 36 #include <wallet/common/explorers/AbstractLedgerApiBlockchainExplorer.h> 37 #include <wallet/ripple/explorers/RippleLikeBlockchainExplorer.h> 38 #include <wallet/ripple/explorers/api/RippleLikeTransactionsParser.h> 39 #include <wallet/ripple/explorers/api/RippleLikeTransactionsBulkParser.h> 40 #include <wallet/ripple/explorers/api/RippleLikeBlockParser.h> 41 #include <api/RippleLikeNetworkParameters.hpp> 45 using LedgerApiBlockchainExplorer = AbstractLedgerApiBlockchainExplorer<RippleLikeBlockchainExplorerTransaction, RippleLikeBlockchainExplorer::TransactionsBulk, RippleLikeTransactionsParser, RippleLikeTransactionsBulkParser, RippleLikeBlockParser, api::RippleLikeNetworkParameters>;
58 _document.SetObject();
59 _params = rapidjson::Value(rapidjson::kObjectType);
64 rapidjson::Document::AllocatorType &allocator = _document.GetAllocator();
66 rapidjson::Value vMethod(rapidjson::kStringType);
67 vMethod.SetString(method.c_str(),
static_cast<rapidjson::SizeType
>(method.length()), allocator);
68 _document.AddMember(
"method", vMethod, allocator);
73 rapidjson::Document::AllocatorType &allocator = _document.GetAllocator();
74 rapidjson::Value vKeyParam(rapidjson::kStringType);
75 vKeyParam.SetString(key.c_str(),
static_cast<rapidjson::SizeType
>(key.length()), allocator);
76 rapidjson::Value vParam(rapidjson::kStringType);
77 vParam.SetString(value.c_str(),
static_cast<rapidjson::SizeType
>(value.length()), allocator);
78 _params.AddMember(vKeyParam, vParam, allocator);
83 rapidjson::Document::AllocatorType &allocator = _document.GetAllocator();
84 rapidjson::Value vKeyParam(rapidjson::kStringType);
85 vKeyParam.SetString(key.c_str(),
static_cast<rapidjson::SizeType
>(key.length()), allocator);
86 rapidjson::Value vParam(rapidjson::kNumberType);
87 vParam.SetInt64(value);
88 _params.AddMember(vKeyParam, vParam, allocator);
92 std::string getString() {
93 rapidjson::Document::AllocatorType &allocator = _document.GetAllocator();
94 rapidjson::Value container(rapidjson::kArrayType);
95 container.PushBack(_params, allocator);
96 _document.AddMember(
"params", container, allocator);
98 rapidjson::StringBuffer buffer;
99 rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
100 _document.Accept(writer);
101 return buffer.GetString();
105 rapidjson::Document _document;
106 rapidjson::Value _params;
112 public std::enable_shared_from_this<NodeRippleLikeBlockchainExplorer> {
115 const std::shared_ptr<HttpClient> &http,
117 const std::shared_ptr<api::DynamicObject> &configuration);
120 getBalance(
const std::vector<RippleLikeKeychain::Address> &addresses)
override;
123 getSequence(
const std::string &address)
override;
129 getBaseReserve()
override;
132 getLedgerSequence()
override;
135 getServerState(
const std::string &field);
137 Future<String> pushLedgerApiTransaction(
const std::vector<uint8_t> &transaction)
override;
145 Future<String> pushTransaction(
const std::vector<uint8_t> &transaction)
override;
148 getTransactions(
const std::vector<std::string> &addresses,
155 getTransactionByHash(
const String &transactionHash)
const override;
159 std::shared_ptr<api::ExecutionContext> getExplorerContext()
const override;
163 std::string getExplorerVersion()
const override;
167 getAccountInfo(
const std::string &address,
168 const std::string &key,
169 const BigInt &defaultValue);
177 #endif //LEDGER_CORE_NODERIPPLELIKEBLOCKCHAINEXPLORER_H Definition: RippleLikeNetworkParameters.hpp:15
Definition: NodeRippleLikeBlockchainExplorer.h:109
Definition: Deffered.hpp:49
Definition: AbstractLedgerApiBlockchainExplorer.h:51
Definition: Account.cpp:8
Definition: DedicatedContext.hpp:39
Definition: RippleLikeBlockchainExplorer.h:89
Definition: NodeRippleLikeBlockchainExplorer.h:53