ombrachain_sdk — C++ SDK
SDK static C++20 pentru OmbraChain. Construit pe libsodium (Ed25519 + SHA-256), libcurl (REST/SSE), nlohmann/json (ordered_json pentru canonical serialization).
Dependencies (vcpkg)
vcpkg install libsodium curl nlohmann-json
Build
git clone https://github.com/ombrachain/OmbraBlockChain
cd OmbraBlockChain/sdk-cpp
mkdir build && cd build
cmake .. -DOMBRACHAIN_BUILD_EXAMPLES=ON \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Release
Quick start
#include <ombrachain/wallet.hpp>
#include <ombrachain/tx_builder.hpp>
#include <ombrachain/client.hpp>
using namespace ombrachain;
int main() {
auto wallet = Wallet::random();
OmbraClient client("https://api.ombra-net.com");
// ── Fork V6 — submit agent run ──
AgentRequestParams p;
p.agent_run_id = compute_agent_run_id(wallet.address(), 0, "Explain Bitcoin");
p.conversation_id = compute_conversation_id(wallet.address());
p.prompt = "Explain Bitcoin in 100 words";
p.tools_whitelist = {"web_search", "chain_query"};
p.max_fee_str = "1000000"; // 1 OMBRA
p.max_steps = 100;
auto tx = build_agent_request_tx(wallet.address(), p, 0, wallet.private_key());
client.submit_tx(tx);
client.stream_events([](const OrderedJson& evt) {
std::cout << evt.dump() << "\n";
return true; // continue
});
return 0;
}
Cross-language compatibility
OrderedJson (alias pentru nlohmann::ordered_json) păstrează insertion order la serializare → bit-exact cu TS JSON.stringify(obj, replacer).