feat(addresses): improve address labeling and view-only handling
- Add expanded address icon picker with search, bottom-aligned actions, and improved modal sizing - Embed a pickaxe icon font subset and wire it into typography/address icon rendering - Track view-only shielded addresses and prevent sends from non-spendable z-addresses - Improve address transfer dialog sizing, max amount handling, and text clipping - Tune main header layout values in ui.toml - Update README, codebase overview, and third-party license documentation
This commit is contained in:
@@ -750,6 +750,19 @@ void App::refreshAddressData()
|
||||
AddressInfo info;
|
||||
info.address = addr.get<std::string>();
|
||||
info.type = "shielded";
|
||||
// Check if we have the spending key for this address
|
||||
try {
|
||||
json vResult = rpc_->call("z_validateaddress", json::array({info.address}));
|
||||
if (vResult.is_object() && vResult.contains("ismine") && vResult["ismine"].get<bool>()) {
|
||||
// "ismine" means we have the spending key
|
||||
info.has_spending_key = true;
|
||||
} else {
|
||||
info.has_spending_key = false;
|
||||
}
|
||||
} catch (...) {
|
||||
// If validation fails, assume spendable (safe default for older daemons)
|
||||
info.has_spending_key = true;
|
||||
}
|
||||
zAddrs.push_back(info);
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
@@ -1850,6 +1863,21 @@ void App::sendTransaction(const std::string& from, const std::string& to,
|
||||
return;
|
||||
}
|
||||
|
||||
// Check that we have the spending key for the from address
|
||||
if (!from.empty() && from[0] == 'z') {
|
||||
bool spendable = false;
|
||||
for (const auto& addr : state_.z_addresses) {
|
||||
if (addr.address == from) {
|
||||
spendable = addr.has_spending_key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!spendable) {
|
||||
if (callback) callback(false, "This is a view-only address (no spending key). Import the spending key to send from this address.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Build recipients array
|
||||
nlohmann::json recipients = nlohmann::json::array();
|
||||
nlohmann::json recipient;
|
||||
|
||||
Reference in New Issue
Block a user