mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 14:11:09 +00:00
feat(wallet): humanize shared wallet experience
Consolidate wallet account decoding and portfolio handling around the shared Rust IDL decoder. Simplify AMM wallet integration, remove obsolete caches and network plumbing, and cover account selection and live flows.
This commit is contained in:
@@ -1448,8 +1448,11 @@ LogosList AmmModuleImpl::resolveTokens(const LogosMap& request, bool wallet_open
|
||||
|
||||
LogosList out = LogosList::array();
|
||||
const auto it = result.value.find("tokens");
|
||||
if (it != result.value.end() && it->is_array())
|
||||
for (const auto& row : *it) out.push_back(row);
|
||||
if (it != result.value.end() && it->is_array()) {
|
||||
for (auto row : *it) {
|
||||
row["definitionIdHex"] = normalizeAccountId(jStr(row, "definitionId"));
|
||||
out.push_back(std::move(row));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -241,7 +241,8 @@ public:
|
||||
/// normalized to hex here) — the app owns the set: its configured tokens plus any
|
||||
/// custom/pasted ids it remembers (held-but-unlisted tokens are not auto-added by
|
||||
/// the app). Reads each definition and (when `wallet_open`) the wallet, then returns
|
||||
/// `[{ definitionId (base58), name, totalSupply, holdingId, balance }]`. Every
|
||||
/// `[{ definitionId (base58), definitionIdHex, name, totalSupply, holdingId,
|
||||
/// balance }]`. Every
|
||||
/// row has the same fields — a token the wallet doesn't hold gets `holdingId:""`
|
||||
/// and `balance:"0"` — held tokens first. A requested id whose definition is
|
||||
/// unreadable / non-fungible is omitted (the app treats a missing row as
|
||||
|
||||
Reference in New Issue
Block a user