From 7a71b08cf7bb8ebf9f88b2f76d6dc6fafd6b1054 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Wed, 23 Sep 2026 00:24:42 +0200 Subject: [PATCH] =?UTF-8?q?fix(aegis):=200.9.1=20=E2=80=94=20an=20unset=20?= =?UTF-8?q?custom=20RPC=20no=20longer=20becomes=20the=20text=20"undefined"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mounting an imported TRX/ETH/SOL wallet read the optional custom RPC as String(stored || undefined), so a wallet with no override got the literal "undefined" as its server: every history and token fetch went to "undefined/v1/accounts/…" and the panel showed "undefined" under the balance. Only a real https URL overrides the network default now, and the adapter itself rejects anything that does not look like one. --- bundled-addons/aegis/addon.json | 2 +- bundled-addons/aegis/index.js | 7 ++++++- bundled-addons/aegis/lib/chain-generic-imported.js | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bundled-addons/aegis/addon.json b/bundled-addons/aegis/addon.json index 59cfa0c6..63f66378 100644 --- a/bundled-addons/aegis/addon.json +++ b/bundled-addons/aegis/addon.json @@ -1,7 +1,7 @@ { "id": "aegis", "name": "Aegis Wallet", - "version": "0.9.0", + "version": "0.9.1", "category": "plugin", "description": "Multi-chain wallet (BCH, BTC, TRX, ETH, SOL, SC, DGB) derived from your Theseus vault. Dapps get window.bitcoincash on .x sites; window.tronWeb / window.tronLink / window.ethereum / window.solana on any https page.", "author": "Silent Mode", diff --git a/bundled-addons/aegis/index.js b/bundled-addons/aegis/index.js index 002e684c..c27f5d48 100644 --- a/bundled-addons/aegis/index.js +++ b/bundled-addons/aegis/index.js @@ -551,7 +551,12 @@ async function mountWallet(entry) { } else if (entry.chain === "eth" || entry.chain === "trx" || entry.chain === "sol") { adapter = new c.d.genericImportedAdapter.GenericImportedWallet({ ...commonOpts, chain: entry.chain, address: entry.importedAddress, - rpcUrl: String(c.api.storage.get(`wallets/${entry.id}/rpcUrl`, "") || undefined), + // Only a real custom URL overrides the network default. The old + // String(x || undefined) turned an unset override into the text + // "undefined", which is truthy — so every imported TRX/ETH/SOL wallet + // without a custom RPC fetched "undefined/v1/accounts/…" and showed + // "undefined" as its server. + rpcUrl: String(c.api.storage.get(`wallets/${entry.id}/rpcUrl`, "") || "").trim() || undefined, }); adapter.schedulePoll(20_000); } else if (entry.chain === "sc") { diff --git a/bundled-addons/aegis/lib/chain-generic-imported.js b/bundled-addons/aegis/lib/chain-generic-imported.js index b52419c3..c170c433 100644 --- a/bundled-addons/aegis/lib/chain-generic-imported.js +++ b/bundled-addons/aegis/lib/chain-generic-imported.js @@ -301,7 +301,10 @@ module.exports = function makeGenericImportedAdapter() { this.chain = chain; this.network = network; this._cfg = cfg; - this._net = { ...net, rpc: rpcUrl || net.rpc }; + // A custom RPC must look like one; anything else (empty, "undefined", + // a stray non-URL) falls back to the network default. + const customRpc = typeof rpcUrl === "string" && /^https?:\/\/\S+$/i.test(rpcUrl.trim()) ? rpcUrl.trim() : null; + this._net = { ...net, rpc: customRpc || net.rpc }; this.log = log; this.onChange = onChange; this._address = address;