pre-ai
This commit is contained in:
parent
be13205ffd
commit
367c19386c
17 changed files with 561 additions and 166 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
bin/
|
||||||
|
build/
|
||||||
|
|
@ -19,6 +19,7 @@ nostro connectors # shows currently added connectors and their status
|
||||||
nostro accounts # shows all accounts of all connectors
|
nostro accounts # shows all accounts of all connectors
|
||||||
nostro connectors add {type} {...}
|
nostro connectors add {type} {...}
|
||||||
nostro connectors add bunq {api key} {allowed ip, optional}
|
nostro connectors add bunq {api key} {allowed ip, optional}
|
||||||
|
nostro send {account name} {recipient iban} {recipient name} {amount} {description} # amount is in the smallest unit of your currency, so for EUR 100 = €1.00
|
||||||
```
|
```
|
||||||
|
|
||||||
## Supported banks
|
## Supported banks
|
||||||
|
|
|
||||||
210
implementations/Nostro-Account.cpp
Normal file
210
implementations/Nostro-Account.cpp
Normal file
|
|
@ -0,0 +1,210 @@
|
||||||
|
//SPDX-License-Identifier: LGPL-3.0-only
|
||||||
|
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||||
|
|
||||||
|
module Nostro:Account_impl;
|
||||||
|
import :Account;
|
||||||
|
import :File;
|
||||||
|
import std;
|
||||||
|
|
||||||
|
using namespace Nostro;
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
std::chrono::system_clock::time_point Account::GetLastTransactionTime(std::string_view connector) const {
|
||||||
|
const fs::path path = cachePath / "transactions" / connector / (name + ".bin");
|
||||||
|
if(!fs::exists(path) || fs::file_size(path) == 0) {
|
||||||
|
return std::chrono::system_clock::time_point::min();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ifstream file(path, std::ios::binary);
|
||||||
|
if(!file) {
|
||||||
|
throw std::runtime_error(std::format("cannot open {}", path.string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
file.seekg(-static_cast<std::streamoff>(sizeof(std::int64_t)), std::ios::end);
|
||||||
|
std::int64_t lastTime;
|
||||||
|
file.read(reinterpret_cast<char*>(&lastTime), sizeof(lastTime));
|
||||||
|
return std::chrono::system_clock::time_point(std::chrono::microseconds(lastTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::SaveTransactions(std::string_view connector) {
|
||||||
|
const fs::path path = cachePath / "transactions" / connector / (name + ".bin");
|
||||||
|
CreatePrivateFile(path);
|
||||||
|
std::ofstream file(path, std::ios::in | std::ios::out | std::ios::binary);
|
||||||
|
if(!file) {
|
||||||
|
throw std::runtime_error(std::format("cannot open {}", path.string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::chrono::system_clock::time_point last = GetLastTransactionTime(connector);
|
||||||
|
|
||||||
|
std::uint32_t pendingIndex = transactions.size();
|
||||||
|
for(std::uint32_t i = 0; i < transactions.size(); i++) {
|
||||||
|
if(transactions[i].timePoint > last) {
|
||||||
|
pendingIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file.seekp(0, std::ios::end);
|
||||||
|
for(std::uint32_t i = pendingIndex; i < transactions.size(); i++) {
|
||||||
|
WriteString(file, transactions[i].name);
|
||||||
|
WriteString(file, transactions[i].bic);
|
||||||
|
WriteString(file, transactions[i].iban);
|
||||||
|
WriteString(file, transactions[i].description);
|
||||||
|
file.write(reinterpret_cast<char*>(&transactions[i].amount), sizeof(transactions[i].amount));
|
||||||
|
file.write(reinterpret_cast<char*>(&transactions[i].currency), sizeof(Currency));
|
||||||
|
std::int64_t time = std::chrono::duration_cast<std::chrono::microseconds>(transactions[i].timePoint.time_since_epoch()).count();
|
||||||
|
file.write(reinterpret_cast<char*>(&time), sizeof(time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Transaction& Account::LoadTransaction(std::ifstream& file) {
|
||||||
|
Transaction& tr = transactions.emplace_back();
|
||||||
|
ReadString(file, tr.name);
|
||||||
|
ReadString(file, tr.bic);
|
||||||
|
ReadString(file, tr.iban);
|
||||||
|
ReadString(file, tr.description);
|
||||||
|
file.read(reinterpret_cast<char*>(&tr.amount), sizeof(tr.amount));
|
||||||
|
file.read(reinterpret_cast<char*>(&tr.currency), sizeof(tr.currency));
|
||||||
|
std::int64_t time;
|
||||||
|
file.read(reinterpret_cast<char*>(&time), sizeof(time));
|
||||||
|
tr.timePoint = std::chrono::system_clock::time_point(std::chrono::duration_cast<std::chrono::system_clock::duration>(std::chrono::microseconds(time)));
|
||||||
|
return tr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::LoadTransactions(std::string_view connector) {
|
||||||
|
const fs::path path = cachePath / "transactions" / connector / (name + ".bin");
|
||||||
|
if(!fs::exists(path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::fstream file(path, std::ios::in | std::ios::binary);
|
||||||
|
if(!file) {
|
||||||
|
throw std::runtime_error(std::format("cannot open {}", path.string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
while(file.peek() != std::fstream::traits_type::eof()) {
|
||||||
|
LoadTransaction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ifstream Account::LoadUntilFrom(std::string_view connector, std::chrono::system_clock::time_point from) {
|
||||||
|
const fs::path path = cachePath / "transactions" / connector / (name + ".bin");
|
||||||
|
if(!fs::exists(path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ifstream file(path, std::ios::in | std::ios::binary);
|
||||||
|
if(!file) {
|
||||||
|
throw std::runtime_error(std::format("cannot open {}", path.string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
while(file.peek() != std::fstream::traits_type::eof()) {
|
||||||
|
std::uint16_t seeked = SeekString();
|
||||||
|
seeked += SeekString();
|
||||||
|
seeked += SeekString();
|
||||||
|
seeked += SeekString();
|
||||||
|
in.seekg(sizeof(tr.amount)+sizeof(tr.Currency), std::ios::cur);
|
||||||
|
std::int64_t timeI;
|
||||||
|
file.read(reinterpret_cast<char*>(&timeI), sizeof(tr.timeI));
|
||||||
|
std::chrono::system_clock::time_point timePoint = std::chrono::system_clock::from_time_t(timeI);
|
||||||
|
if(timePoint > from) {
|
||||||
|
in.seekg(-seeked-sizeof(tr.amount)-sizeof(tr.Currency)-sizeof(tr.timeI), std::ios::cur);
|
||||||
|
LoadTransaction();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::LoadTransactions(std::string_view connector, std::chrono::system_clock::time_point from, std::chrono::system_clock::time_point to) {
|
||||||
|
std::ifstream file = LoadUntilFrom(connector, from);
|
||||||
|
while(file.peek() != std::fstream::traits_type::eof()) {
|
||||||
|
Transaction& tr = LoadTransaction();
|
||||||
|
if(tr.timePoint > to) {
|
||||||
|
transactions.pop_back();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::LoadTransactions(std::string_view connector, std::chrono::system_clock::time_point from) {
|
||||||
|
std::ifstream file = LoadUntilFrom(connector, from);
|
||||||
|
while(file.peek() != std::fstream::traits_type::eof()) {
|
||||||
|
LoadTransaction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Account::LoadTransactionsByProperty(std::string_view connector, std::string_view property) {
|
||||||
|
const fs::path path = cachePath / "transactions" / connector / (name + ".bin");
|
||||||
|
if(!fs::exists(path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ifstream file(path, std::ios::in | std::ios::binary);
|
||||||
|
if(!file) {
|
||||||
|
throw std::runtime_error(std::format("cannot open {}", path.string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
while(file.peek() != std::fstream::traits_type::eof()) {
|
||||||
|
std::uint16_t seeked = SeekString();
|
||||||
|
seeked += SeekString();
|
||||||
|
seeked += SeekString();
|
||||||
|
std::uint16_t size;
|
||||||
|
file.read(reinterpret_cast<char*>(&size), sizeof(size));
|
||||||
|
if(description.size() == size) {
|
||||||
|
std::string readDescription;
|
||||||
|
readDescription.resize(size);
|
||||||
|
file.read(readDescription.data(), size);
|
||||||
|
if(readDescription == description) {
|
||||||
|
in.seekg(-seeked-readDescription.size()-sizeof(size), std::ios::cur);
|
||||||
|
Transaction& tr = transactions.emplace_back();
|
||||||
|
ReadString(file, tr.name);
|
||||||
|
ReadString(file, tr.bic);
|
||||||
|
ReadString(file, tr.iban);
|
||||||
|
SeekString();
|
||||||
|
file.read(reinterpret_cast<char*>(&tr.amount), sizeof(tr.amount));
|
||||||
|
file.read(reinterpret_cast<char*>(&tr.currency), sizeof(tr.Currency));
|
||||||
|
file.read(reinterpret_cast<char*>(&tr.time), sizeof(tr.time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::LoadTransactionsByIban(std::string_view connector, std::string_view iban) {
|
||||||
|
transactions.clear();
|
||||||
|
|
||||||
|
const fs::path path = cachePath / "transactions" / connector / (name + ".bin");
|
||||||
|
if(!fs::exists(path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ifstream file(path, std::ios::in | std::ios::binary);
|
||||||
|
if(!file) {
|
||||||
|
throw std::runtime_error(std::format("cannot open {}", path.string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
while(file.peek() != std::fstream::traits_type::eof()) {
|
||||||
|
std::uint16_t seeked = SeekString();
|
||||||
|
seeked += SeekString();
|
||||||
|
std::uint16_t size;
|
||||||
|
file.read(reinterpret_cast<char*>(&size), sizeof(size));
|
||||||
|
if(iban.size() == size) {
|
||||||
|
std::string readIban;
|
||||||
|
readIban.resize(size);
|
||||||
|
file.read(readIban.data(), size);
|
||||||
|
if(readIban == iban) {
|
||||||
|
in.seekg(-seeked-readIban.size()-sizeof(size), std::ios::cur);
|
||||||
|
Transaction& tr = transactions.emplace_back();
|
||||||
|
ReadString(file, tr.name);
|
||||||
|
ReadString(file, tr.bic);
|
||||||
|
SeekString();
|
||||||
|
ReadString(file, tr.description);
|
||||||
|
file.read(reinterpret_cast<char*>(&tr.amount), sizeof(tr.amount));
|
||||||
|
file.read(reinterpret_cast<char*>(&tr.currency), sizeof(tr.Currency));
|
||||||
|
file.read(reinterpret_cast<char*>(&tr.time), sizeof(tr.time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,7 +14,9 @@ module Nostro:Bunq_impl;
|
||||||
|
|
||||||
import std;
|
import std;
|
||||||
import :Bunq;
|
import :Bunq;
|
||||||
|
import :Connector;
|
||||||
import :Crypto;
|
import :Crypto;
|
||||||
|
import :Utils;
|
||||||
import Crafter.Network;
|
import Crafter.Network;
|
||||||
|
|
||||||
using namespace Nostro;
|
using namespace Nostro;
|
||||||
|
|
@ -24,27 +26,6 @@ using namespace Crafter;
|
||||||
|
|
||||||
std::vector<BunqConnector> BunqConnector::connectors;
|
std::vector<BunqConnector> BunqConnector::connectors;
|
||||||
|
|
||||||
std::string EscB(std::string_view s) {
|
|
||||||
std::string out;
|
|
||||||
out.reserve(s.size() + 8);
|
|
||||||
for (const char c : s) {
|
|
||||||
switch (c) {
|
|
||||||
case '"': out += "\\\""; break;
|
|
||||||
case '\\': out += "\\\\"; break;
|
|
||||||
case '\n': out += "\\n"; break;
|
|
||||||
case '\r': out += "\\r"; break;
|
|
||||||
case '\t': out += "\\t"; break;
|
|
||||||
default:
|
|
||||||
if (static_cast<unsigned char>(c) < 0x20) {
|
|
||||||
out += std::format("\\u{:04x}", static_cast<unsigned char>(c));
|
|
||||||
} else {
|
|
||||||
out += c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
json InResponse(const json& doc, std::string_view key) {
|
json InResponse(const json& doc, std::string_view key) {
|
||||||
for (const json& item : doc.at("Response")) {
|
for (const json& item : doc.at("Response")) {
|
||||||
if (item.is_object()) {
|
if (item.is_object()) {
|
||||||
|
|
@ -64,13 +45,21 @@ json GetUser(std::string_view body) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string StringOrEmpty(const json& object, std::string_view key) {
|
||||||
|
const json::const_iterator value = object.find(key);
|
||||||
|
if(value == object.end() || !value->is_string()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return value->get<std::string>();
|
||||||
|
}
|
||||||
|
|
||||||
BunqAccount::BunqAccount(std::string&& name, std::string&& bic, std::string&& iban, Currency currency, std::int64_t balance, std::uint32_t id, BunqConnector* connector) : Account(std::move(name), std::move(bic), std::move(iban), currency, balance), id(id), connector(connector) {
|
BunqAccount::BunqAccount(std::string&& name, std::string&& bic, std::string&& iban, Currency currency, std::int64_t balance, std::uint32_t id, BunqConnector* connector) : Account(std::move(name), std::move(bic), std::move(iban), currency, balance), id(id), connector(connector) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BunqAccount::Send(std::string_view iban, std::string_view name, std::int64_t amount, Currency currency, std::string_view description) const {
|
||||||
void BunqAccount::SendPayment(std::string body) const {
|
const std::string body = std::format("{{\"amount\": {{\"value\":\"{}\", \"currency\":\"{}\"}},\"counterparty_alias\":{{\"type\":\"IBAN\",\"value\":\"{}\", \"name\":\"{}\"}}, \"description\":\"{}\"}}", amount, GetCurrencyCode(currency), iban, name, description);
|
||||||
std::string route = std::format("v1/user/{}/monetary-account/{}/payment", connector->id, id);
|
const std::string route = std::format("/v1/user/{}/monetary-account/{}/payment", connector->id, id);
|
||||||
|
|
||||||
HTTPResponse response = connector->client.Send(CreateRequestHTTP("POST", route, "public-api.sandbox.bunq.com", {{"User-Agent", "Nostro Crafter.Network"}, {"Content-Type", "application/json"}, {"Accept", "application/json"}, {"X-Bunq-Client-Authentication", connector->sessionToken}, {"X-Bunq-Client-Signature", EscB(SignBody(connector->privateKey, body))}},
|
HTTPResponse response = connector->client.Send(CreateRequestHTTP("POST", route, "public-api.sandbox.bunq.com", {{"User-Agent", "Nostro Crafter.Network"}, {"Content-Type", "application/json"}, {"Accept", "application/json"}, {"X-Bunq-Client-Authentication", connector->sessionToken}, {"X-Bunq-Client-Signature", EscB(SignBody(connector->privateKey, body))}},
|
||||||
body
|
body
|
||||||
|
|
@ -81,18 +70,70 @@ void BunqAccount::SendPayment(std::string body) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BunqAccount::Send(std::string_view iban, std::string_view name, std::int64_t amount, Currency currency) const {
|
void BunqConnector::GetNewTransactions() {
|
||||||
std::string body = std::format("{{\"amount\": {{\"value\":{}, \"currency\":\"{}\"}},\"counterparty_alias\":{{\"type\":\"IBAN\",\"value\":{}, \"name\":{}}}}}", amount, GetCurrencyCode(currency), iban, name);
|
for(BunqAccount& account : accounts) {
|
||||||
SendPayment(body);
|
account.transactions.clear();
|
||||||
}
|
|
||||||
|
|
||||||
void BunqAccount::Send(std::string_view iban, std::string_view name, std::int64_t amount, Currency currency, std::string_view description) const {
|
const std::chrono::system_clock::time_point last = account.GetLastTransactionTime(connectorId);
|
||||||
std::string body = std::format("{{\"amount\": {{\"value\":{}, \"currency\":\"{}\"}},\"counterparty_alias\":{{\"type\":\"IBAN\",\"value\":{}, \"name\":{}}}, \"description\":\"{}\"}}", amount, GetCurrencyCode(currency), iban, name, description);
|
|
||||||
SendPayment(body);
|
std::string route = std::format("/v1/user/{}/monetary-account/{}/payment?count=200", id, account.id);
|
||||||
|
while(!route.empty()) {
|
||||||
|
HTTPResponse response = client.Send(CreateRequestHTTP("GET", route, "public-api.sandbox.bunq.com", {{"User-Agent", "Nostro Crafter.Network"}, {"Content-Type", "application/json"}, {"Accept", "application/json"}, {"X-Bunq-Client-Authentication", sessionToken}}));
|
||||||
|
|
||||||
|
if(response.status == "429") {
|
||||||
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(response.status != "200") {
|
||||||
|
throw std::runtime_error(std::format("{} non 200 status code: {}", route, response.body));
|
||||||
|
}
|
||||||
|
|
||||||
|
const json doc = json::parse(response.body);
|
||||||
|
|
||||||
|
const json& olderUrl = doc.at("Pagination").at("older_url");
|
||||||
|
if( olderUrl.is_null()) {
|
||||||
|
route.clear();
|
||||||
|
} else {
|
||||||
|
route = olderUrl.get<std::string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
for(const json& item : doc.at("Response")) {
|
||||||
|
const json::const_iterator paymentIt = item.find("Payment");
|
||||||
|
if(paymentIt == item.end()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const json& paymentJ = *paymentIt;
|
||||||
|
const std::chrono::system_clock::time_point timePoint = ParseTimestamp(paymentJ.at("created").get<std::string>());
|
||||||
|
if(timePoint <= last) {
|
||||||
|
route.clear();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
const json& counterpartyJ = paymentJ.at("counterparty_alias");
|
||||||
|
const Currency currency = GetCurrency(paymentJ.at("amount").at("currency").get<std::string>());
|
||||||
|
|
||||||
|
account.transactions.emplace_back(
|
||||||
|
StringOrEmpty(counterpartyJ, "display_name"),
|
||||||
|
StringOrEmpty(counterpartyJ, "swift_bic"),
|
||||||
|
StringOrEmpty(counterpartyJ, "iban"),
|
||||||
|
StringOrEmpty(paymentJ, "description"),
|
||||||
|
currency,
|
||||||
|
ParseAmount(paymentJ.at("amount").at("value").get<std::string>(), currency),
|
||||||
|
timePoint
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ranges::reverse(account.transactions);
|
||||||
|
|
||||||
|
account.SaveTransactions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BunqConnector::RefreshSession() {
|
void BunqConnector::RefreshSession() {
|
||||||
std::string body = std::format("{{\"secret\": \"{}\"}}", apiKey);
|
const std::string body = std::format("{{\"secret\": \"{}\"}}", apiKey);
|
||||||
|
|
||||||
HTTPResponse response = client.Send(CreateRequestHTTP("POST", "/v1/session-server", "public-api.sandbox.bunq.com", {{"User-Agent", "Nostro Crafter.Network"}, {"Content-Type", "application/json"}, {"Accept", "application/json"}, {"X-Bunq-Client-Authentication", installationToken}, {"X-Bunq-Client-Signature", EscB(SignBody(privateKey, body))}},
|
HTTPResponse response = client.Send(CreateRequestHTTP("POST", "/v1/session-server", "public-api.sandbox.bunq.com", {{"User-Agent", "Nostro Crafter.Network"}, {"Content-Type", "application/json"}, {"Accept", "application/json"}, {"X-Bunq-Client-Authentication", installationToken}, {"X-Bunq-Client-Signature", EscB(SignBody(privateKey, body))}},
|
||||||
body
|
body
|
||||||
|
|
|
||||||
|
|
@ -14,75 +14,27 @@ module Nostro:Connector_impl;
|
||||||
import std;
|
import std;
|
||||||
import :Connector;
|
import :Connector;
|
||||||
import :Banks;
|
import :Banks;
|
||||||
|
import :File;
|
||||||
|
|
||||||
using namespace Nostro;
|
using namespace Nostro;
|
||||||
using namespace nlohmann;
|
using namespace nlohmann;
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
fs::path Connector::GetConnectorPath() {
|
|
||||||
const char* const xdg = std::getenv("XDG_CONFIG_HOME");
|
|
||||||
if(xdg) {
|
|
||||||
return fs::path(fs::path(std::move(xdg)) / "nostro/connectors.json");
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* const home = std::getenv("HOME");
|
|
||||||
if(home) {
|
|
||||||
return fs::path(fs::path(std::move(home)) / ".config/nostro/connectors.json");
|
|
||||||
}
|
|
||||||
|
|
||||||
throw std::runtime_error("XDG_CONFIG_HOME and HOME not set");
|
|
||||||
}
|
|
||||||
void Connector::SaveConnectors() {
|
void Connector::SaveConnectors() {
|
||||||
const fs::path path = GetConnectorPath();
|
const fs::path path = configPath/"connectors.json";
|
||||||
const fs::path dir(path.parent_path());
|
CreatePrivateFile(path);
|
||||||
|
|
||||||
fs::create_directories(dir.parent_path());
|
|
||||||
|
|
||||||
if(mkdir(dir.c_str(), S_IRWXU) == -1) {
|
|
||||||
if(errno == EEXIST) {
|
|
||||||
fs::permissions(dir, fs::perms::owner_all);
|
|
||||||
} else {
|
|
||||||
throw std::system_error(errno, std::generic_category(), std::format("cannot create {}", dir.string()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::int32_t fd = ::open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR);
|
|
||||||
|
|
||||||
if(fd == -1) {
|
|
||||||
throw std::system_error(errno, std::generic_category(), std::format("cannot create {}", path.string()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
json jsonConnectors = json::object();
|
json jsonConnectors = json::object();
|
||||||
tuple_for<EnabledBanks>([&jsonConnectors]<typename Bank>() {
|
tuple_for<EnabledBanks>([&jsonConnectors]<typename Bank>() {
|
||||||
jsonConnectors[Bank::connectorId] = Bank::connectors;
|
jsonConnectors[Bank::connectorId] = Bank::connectors;
|
||||||
});
|
});
|
||||||
|
|
||||||
const std::string text = jsonConnectors.dump(4);
|
std::ofstream out(path, std::ios::binary);
|
||||||
const char* const textPtr = text.c_str();
|
out << jsonConnectors.dump(4);
|
||||||
|
|
||||||
for(ssize_t i = 0; i < text.size();) {
|
|
||||||
const ssize_t written = write(fd, textPtr + i, text.size() - i);
|
|
||||||
|
|
||||||
if(written == -1) {
|
|
||||||
if(errno == EINTR) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
throw std::system_error(errno, std::generic_category(), std::format("cannot write {}", path.string()));
|
|
||||||
}
|
|
||||||
|
|
||||||
i += written;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Connector::LoadConnectors() {
|
void Connector::LoadConnectors() {
|
||||||
const fs::path path = GetConnectorPath();
|
std::ifstream f(configPath/"connectors.json");
|
||||||
std::ifstream f(path);
|
|
||||||
const json jsonConnectors = json::parse(f);
|
const json jsonConnectors = json::parse(f);
|
||||||
tuple_for<EnabledBanks>([&jsonConnectors]<typename Bank>() {
|
tuple_for<EnabledBanks>([&jsonConnectors]<typename Bank>() {
|
||||||
Bank::connectors = std::move(jsonConnectors.at(Bank::connectorId).template get<std::vector<Bank>>());
|
Bank::connectors = std::move(jsonConnectors.at(Bank::connectorId).template get<std::vector<Bank>>());
|
||||||
|
|
@ -91,35 +43,3 @@ void Connector::LoadConnectors() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string Connector::ListConnectors() {
|
|
||||||
std::string out;
|
|
||||||
|
|
||||||
tuple_for<EnabledBanks>([&out]<typename Bank>() {
|
|
||||||
for(Bank& bank : Bank::connectors) {
|
|
||||||
out += std::format("{}\t{}\t{}\n", bank, Bank::connectorId, bank.TestConnector());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
out.pop_back();
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Connector::ListBalance() {
|
|
||||||
std::string out;
|
|
||||||
|
|
||||||
tuple_for<EnabledBanks>([&out]<typename Bank>() {
|
|
||||||
for(Bank& bank : Bank::connectors) {
|
|
||||||
out += std::format("{}\t{}\n", bank, Bank::connectorId);
|
|
||||||
for(typename Bank::Account& account : bank.accounts) {
|
|
||||||
out += std::format("\t{}\n", account);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
out.pop_back();
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
81
implementations/Nostro-File.cpp
Normal file
81
implementations/Nostro-File.cpp
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
//SPDX-License-Identifier: LGPL-3.0-only
|
||||||
|
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||||
|
|
||||||
|
module;
|
||||||
|
|
||||||
|
#include <cerrno>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
module Nostro:File_impl;
|
||||||
|
import :File;
|
||||||
|
import std;
|
||||||
|
|
||||||
|
using namespace Nostro;
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
fs::path Nostro::GetConfigPath() {
|
||||||
|
const char* const xdg = std::getenv("XDG_CONFIG_HOME");
|
||||||
|
if(xdg) {
|
||||||
|
return fs::path(fs::path(std::move(xdg)) / ".config/nostro");
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* const home = std::getenv("HOME");
|
||||||
|
if(home) {
|
||||||
|
return fs::path(fs::path(std::move(home)) / ".config/nostro");
|
||||||
|
}
|
||||||
|
|
||||||
|
throw std::runtime_error("XDG_CONFIG_HOME and HOME not set");
|
||||||
|
}
|
||||||
|
|
||||||
|
fs::path Nostro::GetCachePath() {
|
||||||
|
const char* const xdg = std::getenv("XDG_CACHE_HOME");
|
||||||
|
if(xdg) {
|
||||||
|
return fs::path(fs::path(std::move(xdg)) / "nostro");
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* const home = std::getenv("HOME");
|
||||||
|
if(home) {
|
||||||
|
return fs::path(fs::path(std::move(home)) / ".cache/nostro");
|
||||||
|
}
|
||||||
|
|
||||||
|
throw std::runtime_error("XDG_CACHE_HOME and HOME not set");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Nostro::CreatePrivateFile(const fs::path& path) {
|
||||||
|
const fs::path dir(path.parent_path());
|
||||||
|
|
||||||
|
fs::create_directories(dir.parent_path());
|
||||||
|
|
||||||
|
if(mkdir(dir.c_str(), S_IRWXU) == -1) {
|
||||||
|
if(errno != EEXIST) {
|
||||||
|
throw std::system_error(errno, std::generic_category(), std::format("cannot create {}", dir.string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mknod(path.c_str(), S_IFREG | S_IRUSR | S_IWUSR, 0) == -1) {
|
||||||
|
if(errno != EEXIST) {
|
||||||
|
throw std::system_error(errno, std::generic_category(), std::format("cannot create {}", path.string()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Nostro::WriteString(std::ofstream& file, std::string_view str) {
|
||||||
|
std::uint16_t size = str.size();
|
||||||
|
file.write(reinterpret_cast<char*>(&size), sizeof(size));
|
||||||
|
file.write(str.data(), size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Nostro::ReadString(std::ifstream& file, std::string& str) {
|
||||||
|
std::uint16_t size;
|
||||||
|
file.read(reinterpret_cast<char*>(&size), sizeof(size));
|
||||||
|
str.resize(size);
|
||||||
|
file.read(str.data(), size);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::uint16_t Nostro::SeekString(std::ifstream& file) {
|
||||||
|
std::uint16_t size;
|
||||||
|
file.read(reinterpret_cast<char*>(&size), sizeof(size));
|
||||||
|
file.seekg(size, std::ios::cur);
|
||||||
|
return size;
|
||||||
|
}
|
||||||
13
implementations/Nostro-Transaction.cpp
Normal file
13
implementations/Nostro-Transaction.cpp
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
//SPDX-License-Identifier: LGPL-3.0-only
|
||||||
|
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||||
|
|
||||||
|
module Nostro:Transaction_impl;
|
||||||
|
import :Transaction;
|
||||||
|
import std;
|
||||||
|
|
||||||
|
using namespace Nostro;
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
Transaction::Transaction(std::string&& name, std::string&& bic, std::string&& iban, std::string&& description, Currency currency, std::int64_t amount, std::chrono::system_clock::time_point timePoint): name(std::move(name)), bic(std::move(bic)), iban(std::move(iban)), description(std::move(description)), currency(currency), amount(amount), timePoint(timePoint) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -45,46 +45,72 @@ int main(int argc, char *argv[]) {
|
||||||
std::println("unknown command");
|
std::println("unknown command");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::println("{}", Connector::ListConnectors());
|
std::string out;
|
||||||
|
|
||||||
|
tuple_for<EnabledBanks>([&out]<typename Bank>() {
|
||||||
|
for(Bank& bank : Bank::connectors) {
|
||||||
|
out += std::format("{}\t{}\t{}\n", bank, Bank::connectorId, bank.TestConnector());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(out.size()) {
|
||||||
|
out.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::println("{}", out);
|
||||||
}
|
}
|
||||||
} else if(cmd == "accounts") {
|
} else if(cmd == "accounts") {
|
||||||
|
std::string out;
|
||||||
|
|
||||||
|
tuple_for<EnabledBanks>([&out]<typename Bank>() {
|
||||||
|
for(Bank& bank : Bank::connectors) {
|
||||||
|
out += std::format("{}\t{}\n", bank, Bank::connectorId);
|
||||||
|
for(typename Bank::Account& account : bank.accounts) {
|
||||||
|
out += std::format("\t{}\n", account);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(out.size()) {
|
||||||
|
out.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::println("{}", out);
|
||||||
|
} else if(cmd == "send") {
|
||||||
if(argc > 2) {
|
if(argc > 2) {
|
||||||
cmd = argv[2];
|
std::string_view accountName = argv[2];
|
||||||
if(cmd == "send") {
|
|
||||||
if(argc > 3) {
|
|
||||||
std::string_view accountName = argv[3];
|
|
||||||
bool notFound = true;
|
bool notFound = true;
|
||||||
tuple_for<EnabledBanks>([argc, argv, accountName, ¬Found]<typename Bank>() {
|
tuple_for<EnabledBanks>([argc, argv, accountName, ¬Found]<typename Bank>() {
|
||||||
for(Bank& bank : Bank::connectors) {
|
for(Bank& bank : Bank::connectors) {
|
||||||
for(typename Bank::Account& account : bank.accounts) {
|
for(typename Bank::Account& account : bank.accounts) {
|
||||||
if(account.name == accountName) {
|
if(account.name == accountName) {
|
||||||
notFound = false;
|
notFound = false;
|
||||||
|
if(argc > 3) {
|
||||||
|
std::string_view iban = argv[3];
|
||||||
if(argc > 4) {
|
if(argc > 4) {
|
||||||
std::int64_t amount = std::stoll(argv[4]);
|
std::string_view name = argv[4];
|
||||||
if(argc > 5) {
|
if(argc > 5) {
|
||||||
std::string_view iban = argv[5];
|
std::int64_t amount = std::stoll(argv[5]);
|
||||||
if(argc > 6) {
|
if(argc > 6) {
|
||||||
std::string_view name = argv[6];
|
account.Send(iban, name, amount, account.currency, argv[6]);
|
||||||
if(argc > 7) {
|
|
||||||
account.Send(iban, name, amount, account.currency, argv[7]);
|
|
||||||
} else {
|
} else {
|
||||||
account.Send(iban, name, amount, account.currency);
|
account.Send(iban, name, amount, account.currency, "");
|
||||||
}
|
|
||||||
} else {
|
|
||||||
std::println("reciepant name not provided");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
std::println("iban not provided");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::println("amount not provided");
|
std::println("amount not provided");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
std::println("recipient name not provided");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
std::println("iban not provided");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(!notFound) {
|
if(notFound) {
|
||||||
std::println("account not found");
|
std::println("account not found");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -96,11 +122,4 @@ int main(int argc, char *argv[]) {
|
||||||
std::println("unknown command");
|
std::println("unknown command");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
std::println("{}", Connector::ListBalance());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
std::println("unknown command");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -14,8 +14,20 @@ namespace Nostro {
|
||||||
std::string iban;
|
std::string iban;
|
||||||
Currency currency;
|
Currency currency;
|
||||||
std::int64_t balance;
|
std::int64_t balance;
|
||||||
|
|
||||||
std::vector<Transaction> transactions;
|
std::vector<Transaction> transactions;
|
||||||
|
|
||||||
|
std::chrono::system_clock::time_point GetLastTransactionTime(std::string_view connector) const;
|
||||||
|
void SaveTransactions(std::string_view connector);
|
||||||
|
void LoadTransactions(std::string_view connector);
|
||||||
|
void LoadTransactions(std::string_view connector, std::chrono::system_clock::time_point from);
|
||||||
|
void LoadTransactions(std::string_view connector, std::chrono::system_clock::time_point from, std::chrono::system_clock::time_point to);
|
||||||
|
void LoadTransactionsByDescription(std::string_view connector, std::string_view description);
|
||||||
|
void LoadTransactionsByIban(std::string_view connector, std::string_view iban);
|
||||||
|
void LoadTransactions(std::string_view connector, std::int64_t amount);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::ifstream LoadUntilFrom(std::string_view connector, std::chrono::system_clock::time_point from);
|
||||||
|
Transaction& LoadTransaction(std::ifstream& file);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,7 @@ namespace Nostro {
|
||||||
BunqConnector* connector;
|
BunqConnector* connector;
|
||||||
|
|
||||||
BunqAccount(std::string&& name, std::string&& bic, std::string&& iban, Currency currency, std::int64_t balance, std::uint32_t id, BunqConnector* connector);
|
BunqAccount(std::string&& name, std::string&& bic, std::string&& iban, Currency currency, std::int64_t balance, std::uint32_t id, BunqConnector* connector);
|
||||||
void Send(std::string_view iban, std::string_view name, std::int64_t amount, Currency currency) const;
|
|
||||||
void Send(std::string_view iban, std::string_view name, std::int64_t amount, Currency currency, std::string_view description) const;
|
void Send(std::string_view iban, std::string_view name, std::int64_t amount, Currency currency, std::string_view description) const;
|
||||||
private:
|
|
||||||
void SendPayment(std::string iban) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export struct BunqConnector {
|
export struct BunqConnector {
|
||||||
|
|
@ -44,6 +41,7 @@ namespace Nostro {
|
||||||
|
|
||||||
void RefreshSession();
|
void RefreshSession();
|
||||||
void RefreshAccounts();
|
void RefreshAccounts();
|
||||||
|
void GetNewTransactions();
|
||||||
bool TestConnector();
|
bool TestConnector();
|
||||||
|
|
||||||
static constexpr std::string connectorId = "bunq";
|
static constexpr std::string connectorId = "bunq";
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ namespace Nostro {
|
||||||
export struct Connector {
|
export struct Connector {
|
||||||
static void SaveConnectors();
|
static void SaveConnectors();
|
||||||
static void LoadConnectors();
|
static void LoadConnectors();
|
||||||
static std::filesystem::path GetConnectorPath();
|
|
||||||
static std::string ListConnectors();
|
|
||||||
static std::string ListBalance();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export module Nostro:Currency;
|
||||||
import std;
|
import std;
|
||||||
|
|
||||||
export namespace Nostro {
|
export namespace Nostro {
|
||||||
enum class Currency {
|
enum class Currency : std::uint16_t {
|
||||||
Euro
|
Euro
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
19
interfaces/Nostro-File.cppm
Normal file
19
interfaces/Nostro-File.cppm
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
//SPDX-License-Identifier: LGPL-3.0-only
|
||||||
|
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||||
|
|
||||||
|
export module Nostro:File;
|
||||||
|
|
||||||
|
import std;
|
||||||
|
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
export namespace Nostro {
|
||||||
|
fs::path GetConfigPath();
|
||||||
|
fs::path GetCachePath();
|
||||||
|
fs::path configPath = GetConfigPath();
|
||||||
|
fs::path cachePath = GetCachePath();
|
||||||
|
void CreatePrivateFile(const fs::path& path);
|
||||||
|
void WriteString(std::ofstream& file, std::string_view str);
|
||||||
|
void ReadString(std::ifstream& file, std::string& str);
|
||||||
|
std::uint16_t SeekString(std::ifstream& file);
|
||||||
|
}
|
||||||
|
|
@ -8,10 +8,16 @@ import :Currency;
|
||||||
|
|
||||||
namespace Nostro {
|
namespace Nostro {
|
||||||
export struct Transaction {
|
export struct Transaction {
|
||||||
std::string_view bic;
|
std::string name;
|
||||||
std::string_view iban;
|
std::string bic;
|
||||||
|
std::string iban;
|
||||||
|
std::string description;
|
||||||
Currency currency;
|
Currency currency;
|
||||||
std::int64_t amount;
|
std::int64_t amount;
|
||||||
|
std::chrono::system_clock::time_point timePoint;
|
||||||
|
|
||||||
|
Transaction();
|
||||||
|
Transaction(std::string&& name, std::string&& bic, std::string&& iban, std::string&& description, Currency currency, std::int64_t amount, std::chrono::system_clock::time_point timePoint);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
69
interfaces/Nostro-Utils.cppm
Normal file
69
interfaces/Nostro-Utils.cppm
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
//SPDX-License-Identifier: LGPL-3.0-only
|
||||||
|
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||||
|
|
||||||
|
export module Nostro:Utils;
|
||||||
|
|
||||||
|
import std;
|
||||||
|
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
export namespace Nostro {
|
||||||
|
constexpr std::string EscB(std::string_view s) {
|
||||||
|
std::string out;
|
||||||
|
out.reserve(s.size() + 8);
|
||||||
|
for (const char c : s) {
|
||||||
|
switch (c) {
|
||||||
|
case '"': out += "\\\""; break;
|
||||||
|
case '\\': out += "\\\\"; break;
|
||||||
|
case '\n': out += "\\n"; break;
|
||||||
|
case '\r': out += "\\r"; break;
|
||||||
|
case '\t': out += "\\t"; break;
|
||||||
|
default:
|
||||||
|
if (static_cast<unsigned char>(c) < 0x20) {
|
||||||
|
out += std::format("\\u{:04x}", static_cast<unsigned char>(c));
|
||||||
|
} else {
|
||||||
|
out += c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr std::chrono::system_clock::time_point ParseTimestamp(std::string_view text) {
|
||||||
|
const auto field = [text](std::size_t offset, std::size_t length) {
|
||||||
|
std::uint32_t value = 0;
|
||||||
|
const char* const first = text.data() + offset;
|
||||||
|
if(offset + length > text.size()) {
|
||||||
|
throw std::runtime_error(std::format("malformed timestamp '{}'", text));
|
||||||
|
}
|
||||||
|
const std::from_chars_result result = std::from_chars(first, first + length, value);
|
||||||
|
if(result.ec != std::errc() || result.ptr != first + length) {
|
||||||
|
throw std::runtime_error(std::format("malformed timestamp '{}'", text));
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
|
if(text.size() < 19 || text[4] != '-' || text[7] != '-' || text[10] != ' ' || text[13] != ':' || text[16] != ':') {
|
||||||
|
throw std::runtime_error(std::format("malformed timestamp '{}'", text));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::uint32_t micros = 0;
|
||||||
|
if(text.size() > 19) {
|
||||||
|
const std::size_t digits = text.size() - 20;
|
||||||
|
if(text[19] != '.' || digits == 0 || digits > 6) {
|
||||||
|
throw std::runtime_error(std::format("malformed timestamp '{}'", text));
|
||||||
|
}
|
||||||
|
micros = field(20, digits);
|
||||||
|
for(std::size_t i = digits; i < 6; i++) {
|
||||||
|
micros *= 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::chrono::year_month_day date(std::chrono::year(static_cast<std::int32_t>(field(0, 4))), std::chrono::month(field(5, 2)), std::chrono::day(field(8, 2)));
|
||||||
|
if(!date.ok()) {
|
||||||
|
throw std::runtime_error(std::format("malformed timestamp '{}'", text));
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::chrono::sys_days(date) + std::chrono::hours(field(11, 2)) + std::chrono::minutes(field(14, 2)) + std::chrono::seconds(field(17, 2)) + std::chrono::microseconds(micros);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,8 @@ export import :Transaction;
|
||||||
export import :Connector;
|
export import :Connector;
|
||||||
export import :Banks;
|
export import :Banks;
|
||||||
export import :Currency;
|
export import :Currency;
|
||||||
|
export import :File;
|
||||||
|
export import :Utils;
|
||||||
|
|
||||||
#ifdef NOSTRO_BUNQ_ENABLED
|
#ifdef NOSTRO_BUNQ_ENABLED
|
||||||
export import :Bunq;
|
export import :Bunq;
|
||||||
|
|
|
||||||
|
|
@ -71,9 +71,14 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
|
||||||
"interfaces/Nostro-Bunq",
|
"interfaces/Nostro-Bunq",
|
||||||
"interfaces/Nostro-Crypto",
|
"interfaces/Nostro-Crypto",
|
||||||
"interfaces/Nostro-Currency",
|
"interfaces/Nostro-Currency",
|
||||||
|
"interfaces/Nostro-File",
|
||||||
|
"interfaces/Nostro-Utils",
|
||||||
|
|
||||||
};
|
};
|
||||||
std::vector<fs::path> libImplementations = {
|
std::vector<fs::path> libImplementations = {
|
||||||
|
"implementations/Nostro-Account",
|
||||||
|
"implementations/Nostro-File",
|
||||||
|
"implementations/Nostro-Transaction",
|
||||||
"implementations/Nostro-Connector"
|
"implementations/Nostro-Connector"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue