diff --git a/helpers/tx.ts b/helpers/tx.ts index 6d2c5963..1d90c85a 100644 --- a/helpers/tx.ts +++ b/helpers/tx.ts @@ -69,10 +69,12 @@ const fetchCCTXData = async ( let confirmed_on_destination = false; if (outbound_tx_hash) { const chainName = findByChainId(networks, parseInt(receiver_chainId)); - const rpc = getEndpoints("evm", chainName as any)[0]?.url; - const provider = new ethers.providers.JsonRpcProvider(rpc); - const confirmed = await provider.getTransaction(outbound_tx_hash); - confirmed_on_destination = confirmed !== null; + if (chainName) { + const rpc = getEndpoints("evm", chainName as any)[0]?.url; + const provider = new ethers.providers.JsonRpcProvider(rpc); + const confirmed = await provider.getTransaction(outbound_tx_hash); + confirmed_on_destination = confirmed !== null; + } } const tx = { confirmed_on_destination,