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;