From 2b509b94080fee189cf6b37b23ffc7336935adf0 Mon Sep 17 00:00:00 2001 From: Ben Wolski <570819+benwolski@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:49:08 -0500 Subject: [PATCH 1/2] modify error message when wallet RPC does not support gas estimation --- .../TransactionException/TransactionException.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/Trade/TradeModules/SubmitTransaction/TransactionException/TransactionException.tsx b/src/components/Trade/TradeModules/SubmitTransaction/TransactionException/TransactionException.tsx index 28ee6dd669..c63274575a 100644 --- a/src/components/Trade/TradeModules/SubmitTransaction/TransactionException/TransactionException.tsx +++ b/src/components/Trade/TradeModules/SubmitTransaction/TransactionException/TransactionException.tsx @@ -52,8 +52,14 @@ export default function TransactionException(props: propsIF) { const primaryTokenSymbol = isTokenAPrimary ? tokenA.symbol : tokenB.symbol; + const isBadRpcError = txErrorMessage === 'not support this call'; + + const updatedErrorMessage = isBadRpcError + ? `Please try a different RPC URL in your wallet. E.g. open Rabby -> press More -> Modify RPC URL and enter any server address found on https://chainlist.org/chain/${Number(chainData.chainId)}` + : txErrorMessage; + const formattedErrorMessage = - 'Error Message: ' + txErrorMessage?.replace('err: ', ''); + 'Error Message: ' + updatedErrorMessage?.replace('err: ', ''); function handleCopyErrorMessage() { copy(txErrorCopyable); From 0e3af47fdaa7aa818232304f53a8633326ab6b5a Mon Sep 17 00:00:00 2001 From: Ben Wolski <570819+benwolski@users.noreply.github.com> Date: Mon, 11 Nov 2024 19:47:48 -0500 Subject: [PATCH 2/2] fix build error --- .../TransactionException/TransactionException.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Trade/TradeModules/SubmitTransaction/TransactionException/TransactionException.tsx b/src/components/Trade/TradeModules/SubmitTransaction/TransactionException/TransactionException.tsx index 95fda96b0c..4b2cb0b550 100644 --- a/src/components/Trade/TradeModules/SubmitTransaction/TransactionException/TransactionException.tsx +++ b/src/components/Trade/TradeModules/SubmitTransaction/TransactionException/TransactionException.tsx @@ -56,7 +56,7 @@ export default function TransactionException(props: propsIF) { const isBadRpcError = txErrorMessage === 'not support this call'; const updatedErrorMessage = isBadRpcError - ? `Please try a different RPC URL in your wallet. E.g. open Rabby -> press More -> Modify RPC URL and enter any server address found on https://chainlist.org/chain/${Number(chainData.chainId)}` + ? `Please try a different RPC URL in your wallet. E.g. open Rabby -> press More -> Modify RPC URL and enter any server address found on https://chainlist.org/chain/${Number(chainId)}` : txErrorMessage; const formattedErrorMessage =