diff --git a/src/components/CreateButton.tsx b/src/components/CreateButton.tsx index 9195a9c8..242d74c7 100644 --- a/src/components/CreateButton.tsx +++ b/src/components/CreateButton.tsx @@ -250,27 +250,30 @@ export const CreateButton = () => { let claimAddress = onchainAddress(); - if (assetReceive() === RBTC) { - const [balance, gasPrice] = await Promise.all([ - signer().provider.getBalance(await signer().getAddress()), - signer() - .provider.getFeeData() - .then((data) => data.gasPrice), - ]); - log.debug("RSK balance", balance); + try { + if (assetReceive() === RBTC) { + const [balance, gasPrice] = await Promise.all([ + signer().provider.getBalance(await signer().getAddress()), + signer() + .provider.getFeeData() + .then((data) => data.gasPrice), + ]); + log.debug("RSK balance", balance); - const balanceNeeded = gasPrice * GasNeededToClaim; - log.debug("RSK balance needed", balanceNeeded); + const balanceNeeded = gasPrice * GasNeededToClaim; + log.debug("RSK balance needed", balanceNeeded); - if (balance <= balanceNeeded) { - claimAddress = (await getSmartWalletAddress(signer())).address; - log.info("Using RIF smart wallet as claim address"); + if (balance <= balanceNeeded) { + claimAddress = (await getSmartWalletAddress(signer())) + .address; + log.info("Using RIF smart wallet as claim address"); + } else { + log.info("RIF smart wallet not needed"); + } } - } - const useRif = onchainAddress() !== claimAddress; + const useRif = onchainAddress() !== claimAddress; - try { let data: SomeSwap; switch (swapType()) { case SwapType.Submarine: