Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify error message when wallet RPC does not support gas estimation #4291

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,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(chainId)}`
: txErrorMessage;

const formattedErrorMessage =
'Error Message: ' + txErrorMessage?.replace('err: ', '');
'Error Message: ' + updatedErrorMessage?.replace('err: ', '');

function handleCopyErrorMessage() {
copy(txErrorCopyable);
Expand Down
Loading