Sync salvium and peya tx info bindings
full compatibility check / lib_mingw (monero) (push) Has been cancelled
full compatibility check / lib_mingw (peya) (push) Has been cancelled
full compatibility check / lib_mingw (salvium) (push) Has been cancelled
full compatibility check / lib_android (monero) (push) Has been cancelled
full compatibility check / lib_android (peya) (push) Has been cancelled
full compatibility check / lib_android (salvium) (push) Has been cancelled
full compatibility check / lib_linux (monero) (push) Has been cancelled
full compatibility check / lib_linux (peya) (push) Has been cancelled
full compatibility check / lib_linux (salvium) (push) Has been cancelled
full compatibility check / macos build (monero) (push) Has been cancelled
full compatibility check / macos build (peya) (push) Has been cancelled
full compatibility check / macos build (salvium) (push) Has been cancelled
full compatibility check / ios build (monero) (push) Has been cancelled
full compatibility check / ios build (peya) (push) Has been cancelled
full compatibility check / ios build (salvium) (push) Has been cancelled
full compatibility check / create single release file (push) Has been cancelled
full compatibility check / test ts library (push) Has been cancelled
full compatibility check / linux regression tests (monero) (push) Has been cancelled
full compatibility check / linux regression tests (peya) (push) Has been cancelled
full compatibility check / linux regression tests (salvium) (push) Has been cancelled
full compatibility check / macos regression tests (monero) (push) Has been cancelled
full compatibility check / macos regression tests (peya) (push) Has been cancelled
full compatibility check / macos regression tests (salvium) (push) Has been cancelled
full compatibility check / linux integration tests (monero) (push) Has been cancelled
full compatibility check / linux integration tests (peya) (push) Has been cancelled
full compatibility check / linux integration tests (salvium) (push) Has been cancelled
full compatibility check / macos integration tests (monero) (push) Has been cancelled
full compatibility check / macos integration tests (peya) (push) Has been cancelled
full compatibility check / macos integration tests (salvium) (push) Has been cancelled
full compatibility check / comment on pr (push) Has been cancelled
Build documentation / build (push) Has been cancelled
Check if dart bindings are in sync / android (push) Has been cancelled
Check if checksums are in sync / android (push) Has been cancelled

This commit is contained in:
Codex
2026-04-06 18:30:06 +02:00
parent 1af4416964
commit c3474df916
24 changed files with 985 additions and 661 deletions
@@ -43,6 +43,8 @@ _PEYA_TransactionInfo_unlockTime
_PEYA_TransactionInfo_hash
_PEYA_TransactionInfo_timestamp
_PEYA_TransactionInfo_paymentId
_PEYA_TransactionInfo_returnAddresses_count
_PEYA_TransactionInfo_returnAddresses_at
_PEYA_TransactionInfo_transfers_count
_PEYA_TransactionInfo_transfers_amount
_PEYA_TransactionInfo_transfers_address
@@ -126,6 +128,8 @@ _PEYA_MultisigState_total
_PEYA_DeviceProgress_progress
_PEYA_DeviceProgress_indeterminate
_PEYA_Wallet_seed
_PEYA_Wallet_setStoreTxInfo
_PEYA_Wallet_getStoreTxInfo
_PEYA_Wallet_setLedgerCallback
_PEYA_Wallet_serializeCacheToJson
_PEYA_Wallet_getSeedLanguage
+22 -14
View File
@@ -80,7 +80,9 @@ void library_init() {
const char* vectorToString(const std::vector<std::string>& vec, const std::string separator) {
// Check if the vector is empty
if (vec.empty()) {
return "";
char *buffer = new char[1];
buffer[0] = '\0';
return buffer;
}
// Concatenate all strings in the vector
@@ -99,6 +101,11 @@ const char* vectorToString(const std::vector<std::string>& vec, const std::strin
}
const char* vectorToString(const std::vector<uint32_t>& vec, const std::string separator) {
if (vec.empty()) {
char *buffer = new char[1];
buffer[0] = '\0';
return buffer;
}
// Calculate the size needed for the result string
size_t size = 0;
for (size_t i = 0; i < vec.size(); ++i) {
@@ -111,11 +118,7 @@ const char* vectorToString(const std::vector<uint32_t>& vec, const std::string s
}
// Allocate memory for the result string
char* result = static_cast<char*>(malloc(size + 1));
if (result == nullptr) {
// Handle memory allocation failure
return nullptr;
}
char* result = new char[size + 1];
// Fill in the result string
char* current = result;
@@ -134,6 +137,11 @@ const char* vectorToString(const std::vector<uint32_t>& vec, const std::string s
}
const char* vectorToString(const std::vector<uint64_t>& vec, const std::string separator) {
if (vec.empty()) {
char *buffer = new char[1];
buffer[0] = '\0';
return buffer;
}
// Calculate the size needed for the result string
size_t size = 0;
for (size_t i = 0; i < vec.size(); ++i) {
@@ -146,11 +154,7 @@ const char* vectorToString(const std::vector<uint64_t>& vec, const std::string s
}
// Allocate memory for the result string
char* result = static_cast<char*>(malloc(size + 1));
if (result == nullptr) {
// Handle memory allocation failure
return nullptr;
}
char* result = new char[size + 1];
// Fill in the result string
char* current = result;
@@ -171,7 +175,9 @@ const char* vectorToString(const std::vector<uint64_t>& vec, const std::string s
const char* vectorToString(const std::vector<std::set<uint32_t>>& vec, const std::string separator) {
// Check if the vector is empty
if (vec.empty()) {
return "";
char *buffer = new char[1];
buffer[0] = '\0';
return buffer;
}
// Use a stringstream to concatenate sets with commas and individual elements with spaces
@@ -203,7 +209,9 @@ const char* vectorToString(const std::vector<std::set<uint32_t>>& vec, const std
const char* vectorToString(const std::set<uint32_t>& intSet, const std::string separator) {
// Check if the set is empty
if (intSet.empty()) {
return "";
char *buffer = new char[1];
buffer[0] = '\0';
return buffer;
}
// Use a stringstream to concatenate elements with commas
@@ -262,4 +270,4 @@ std::vector<uint64_t> splitStringUint(const std::string& str, const std::string&
}
tokens.push_back(std::stoull(content)); // Inserting the last token
return tokens;
}
}
@@ -1,6 +1,6 @@
#ifndef MONEROC_CHECKSUMS
#define MONEROC_CHECKSUMS
const char * PEYA_wallet2_api_c_h_sha256 = "93ad4f6247f0b89c17218766c960e956047b0e8032c3db2b791842d576279330";
const char * PEYA_wallet2_api_c_cpp_sha256 = "2d52bbe50a6db8c1bd68ce4be288c28319f35f48c6d093a3d67d888c8e4b3230-3b00a41fff328c841de122bff97525614fd7da41";
const char * PEYA_wallet2_api_c_exp_sha256 = "f7ab584f1271f4d533980f403597a1d9e50bced85c233ca2b17c77f4a94ed3bc";
const char * PEYA_wallet2_api_c_h_sha256 = "5ccccf76d6ce6a38985030ed89ff49c8d688b7920c38b85e6072bad415e5c28f";
const char * PEYA_wallet2_api_c_cpp_sha256 = "cfbc7bcfb8f8066660a2b19225249d6cc44958272c7816676a32c8ec37fedbda-10d687cab8b3f85d140c3d8cd9eb54b25f029154";
const char * PEYA_wallet2_api_c_exp_sha256 = "31b4f92a01ff4812c46e5978c0195f725fe93c87bcd8036391a12fe9d5774621";
#endif
@@ -396,6 +396,30 @@ const char* PEYA_TransactionInfo_paymentId(void* txInfo_ptr) {
DEBUG_END()
}
int PEYA_TransactionInfo_returnAddresses_count(void* txInfo_ptr) {
DEBUG_START()
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
return txInfo->returnAddresses().size();
DEBUG_END()
}
const char* PEYA_TransactionInfo_returnAddresses_at(void* txInfo_ptr, int index) {
DEBUG_START()
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
const auto &addresses = txInfo->returnAddresses();
if (index < 0 || static_cast<size_t>(index) >= addresses.size()) {
char *buffer = new char[1];
buffer[0] = '\0';
return buffer;
}
std::string str = addresses[static_cast<size_t>(index)];
const std::string::size_type size = str.size();
char *buffer = new char[size + 1];
memcpy(buffer, str.c_str(), size + 1);
return buffer;
DEBUG_END()
}
int PEYA_TransactionInfo_transfers_count(void* txInfo_ptr) {
DEBUG_START()
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
@@ -1096,6 +1120,20 @@ const char* PEYA_Wallet_seed(void* wallet_ptr, const char* seed_offset) {
DEBUG_END()
}
void PEYA_Wallet_setStoreTxInfo(void* wallet_ptr, bool store) {
DEBUG_START()
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
wallet->setStoreTxInfo(store);
DEBUG_END()
}
bool PEYA_Wallet_getStoreTxInfo(void* wallet_ptr) {
DEBUG_START()
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->storeTxInfo();
DEBUG_END()
}
const char* PEYA_Wallet_getSeedLanguage(void* wallet_ptr) {
DEBUG_START()
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
@@ -2722,7 +2760,7 @@ const char* PEYA_checksum_wallet2_api_c_exp() {
// i hate windows
void PEYA_free(void* ptr) {
free(ptr);
delete[] static_cast<char*>(ptr);
}
#ifdef __cplusplus
@@ -190,6 +190,9 @@ extern ADDAPI const char* PEYA_TransactionInfo_hash(void* txInfo_ptr);
extern ADDAPI uint64_t PEYA_TransactionInfo_timestamp(void* txInfo_ptr);
// virtual std::string paymentId() const = 0;
extern ADDAPI const char* PEYA_TransactionInfo_paymentId(void* txInfo_ptr);
// virtual const std::vector<std::string> & returnAddresses() const = 0;
extern ADDAPI int PEYA_TransactionInfo_returnAddresses_count(void* txInfo_ptr);
extern ADDAPI const char* PEYA_TransactionInfo_returnAddresses_at(void* txInfo_ptr, int index);
// virtual const std::vector<Transfer> & transfers() const = 0;
extern ADDAPI int PEYA_TransactionInfo_transfers_count(void* txInfo_ptr);
extern ADDAPI uint64_t PEYA_TransactionInfo_transfers_amount(void* txInfo_ptr, int index);
@@ -513,6 +516,10 @@ const int BackgroundSync_CustomPassword = 2;
// virtual ~Wallet() = 0;
// virtual std::string seed(const std::string& seed_offset = "") const = 0;
extern ADDAPI const char* PEYA_Wallet_seed(void* wallet_ptr, const char* seed_offset);
// virtual void setStoreTxInfo(bool store) = 0;
extern ADDAPI void PEYA_Wallet_setStoreTxInfo(void* wallet_ptr, bool store);
// virtual bool storeTxInfo() const = 0;
extern ADDAPI bool PEYA_Wallet_getStoreTxInfo(void* wallet_ptr);
// virtual std::string getSeedLanguage() const = 0;
extern ADDAPI const char* PEYA_Wallet_getSeedLanguage(void* wallet_ptr);
// virtual void setSeedLanguage(const std::string &arg) = 0;