Fix asset-aware subaddress balance bindings
build / peya x86_64 Linux (push) Successful in 13m21s
build / peya Win64 (push) Has been cancelled
consistency / checksum sync (push) Has been cancelled
consistency / Dart bindings sync (push) Has been cancelled

This commit is contained in:
Codex
2026-04-09 15:11:44 +02:00
parent 4b03e7aefa
commit c74e024f98
4 changed files with 24 additions and 8 deletions
@@ -994,7 +994,8 @@ const char* PEYA_SubaddressAccountRow_getLabel(void* subaddressAccountRow_ptr) {
const char* PEYA_SubaddressAccountRow_getBalance(void* subaddressAccountRow_ptr, const char* asset) {
DEBUG_START()
Monero::SubaddressAccountRow *subaddressAccountRow = reinterpret_cast<Monero::SubaddressAccountRow*>(subaddressAccountRow_ptr);
std::string str = subaddressAccountRow->getBalance("SAL1");
const std::string requested_asset = asset ? asset : "PEY";
std::string str = subaddressAccountRow->getBalance(requested_asset);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
@@ -1005,7 +1006,8 @@ const char* PEYA_SubaddressAccountRow_getBalance(void* subaddressAccountRow_ptr,
const char* PEYA_SubaddressAccountRow_getUnlockedBalance(void* subaddressAccountRow_ptr, const char* asset) {
DEBUG_START()
Monero::SubaddressAccountRow *subaddressAccountRow = reinterpret_cast<Monero::SubaddressAccountRow*>(subaddressAccountRow_ptr);
std::string str = subaddressAccountRow->getUnlockedBalance("SAL1");
const std::string requested_asset = asset ? asset : "PEY";
std::string str = subaddressAccountRow->getUnlockedBalance(requested_asset);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);