From 48e85c21998ede0ca91c20005e6b6e0ddb26947c Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Wed, 8 Nov 2023 16:29:02 +0400 Subject: [PATCH] Fix CCTX tracking if the destination chain is Bitcoin --- helpers/tx.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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,