diff --git a/chrome-extension/src/background/chains/ethereumHandler.ts b/chrome-extension/src/background/chains/ethereumHandler.ts index e1518c3..0fcd5a0 100644 --- a/chrome-extension/src/background/chains/ethereumHandler.ts +++ b/chrome-extension/src/background/chains/ethereumHandler.ts @@ -1321,12 +1321,22 @@ const sendTransaction = async (params: any, KEEPKEY_WALLET: any, ADDRESS: string response.txid = txHash; await requestStorage.updateEventById(id, response); + // Defensive explorer-link resolution: if the stored provider was built + // through a code path that didn't carry explorerTxLink (e.g., older + // saved state), look it up from the static EIP155_CHAINS table by + // networkId. Otherwise the TxidPage gets no link and the user sees a + // bare hex hash with no way to navigate to etherscan. + let explorerTxLink = currentProvider.explorerTxLink; + if (!explorerTxLink && currentProvider.networkId) { + explorerTxLink = EIP155_CHAINS[currentProvider.networkId]?.explorerTxLink; + } + //push event chrome.runtime.sendMessage({ action: 'transaction_complete', eventId: id, txHash: txHash, - explorerTxLink: currentProvider.explorerTxLink, + explorerTxLink, networkId: currentProvider.networkId, }); diff --git a/chrome-extension/src/background/index.ts b/chrome-extension/src/background/index.ts index 65ec3b1..a570920 100644 --- a/chrome-extension/src/background/index.ts +++ b/chrome-extension/src/background/index.ts @@ -1001,6 +1001,12 @@ chrome.runtime.onMessage.addListener((message: any, sender: any, sendResponse: a name: chainInfo.name, providerUrl: chainInfo.rpc, fallbacks: [], + // Carry the static chain's explorer URL forward so + // transaction_complete events fired from sendTransaction + // have somewhere to deep-link the txid. Without this + // the TxidPage shows just the hex hash with no link. + explorerTxLink: chainInfo.explorerTxLink, + networkId: asset.networkId, }; } else { console.error(tag, 'Network not found in custom or static chains:', asset.networkId);