You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dsc
2277be574f
|
4 weeks ago | |
---|---|---|
cmake | 4 weeks ago | |
docs | 2 months ago | |
src | 4 weeks ago | |
test | 4 weeks ago | |
tools/deps | 4 weeks ago | |
.gitignore | 5 years ago | |
CMakeLists.txt | 4 weeks ago | |
README.md | 4 weeks ago |
README.md
Wownero C++ Library
A C++ library for creating Wownero applications using native bindings to Wownero.
- Supports fully client-side wallets by wrapping wallet2.
- Supports multisig, view-only, and offline wallets.
- Query wallet transactions, transfers, and outputs by their properties.
- Receive notifications when wallets sync, send, or receive.
- Unit tests
Forked from monero-cpp and modified, credits go to the original author.
Example usage
Install the following into, for example, /usr/local/
:
- wownero-ng
- This repository
Install commands:
cmake -Bbuild .
make -Cbuild -j8 install
Then in your own project:
find_package(wownero_cpp REQUIRED)
add_executable(test main.cpp)
target_link_libraries(test PUBLIC wownero_cpp)
#include <iostream>
#include "wallet/wownero_wallet_full.h"
#include "utils/wownero_utils.h"
using namespace std;
wownero_wallet* wallet_restored = nullptr;
int main() {
// create a wallet from a seed phrase into /tmp/test.keys
wownero_wallet_config wallet_config;
wallet_config.m_seed = "afar industrial unafraid input ulcers innocent aggravate pulp insult sawmill ankle smash niece hydrogen mouth issued unusual pride fully identity fever hatchet knife knowledge issued";
wallet_config.m_path = "/tmp/test";
wallet_config.m_password = "";
wallet_config.m_network_type = wownero_network_type::MAINNET;
// configure your own remote node here
wallet_config.m_server = wownero_rpc_connection("http://10.1.0.10:34568", "", "");
wallet_config.m_restore_height = 610000;
wallet_config.m_seed_offset = "";
wallet_restored = wownero_wallet_full::create_wallet(wallet_config);
wallet_restored->save();
// synchronize the wallet and receive progress notifications
struct : wownero_wallet_listener {
void on_sync_progress(uint64_t height, uint64_t start_height, uint64_t end_height, double percent_done, const string& message) {
// feed a progress bar?
printf("%f", percent_done);
wallet_restored->save();
}
} my_sync_listener;
wallet_restored->sync(my_sync_listener);
// start syncing the wallet continuously in the background
wallet_restored->start_syncing();
return 0;
}