diff --git a/package-lock.json b/package-lock.json index 82a28c06f..78bf7d50c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@walletconnect/jsonrpc-utils": "^1.0.8", "@zeriontech/components": "^1.0.3", "@zeriontech/hardware-wallet-connection": "^1.0.11", - "@zeriontech/transactions": "^0.2.0", + "@zeriontech/transactions": "^0.2.1", "bignumber.js": "^9.1.1", "buffer": "^6.0.3", "canvas-confetti": "^1.6.0", @@ -9248,9 +9248,9 @@ } }, "node_modules/@zeriontech/transactions": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@zeriontech/transactions/-/transactions-0.2.0.tgz", - "integrity": "sha512-drviAtJeI/nzUIhjcsUsmnN4+z9EAH7Wte9H4ewFj4xCA4S+TFa2vFM7Mt9+ETkHOYD/dbGeCkFVwhxYGjUY/Q==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@zeriontech/transactions/-/transactions-0.2.1.tgz", + "integrity": "sha512-1k4NlFcL/GR44skBSnwabQjVWRGJxUYkfqzgqPbeEjriewBkz60UHLcNLv33qOA3iG74v7xyayIoWjgdQZp+hA==", "dependencies": { "@store-unit/react": "^1.0.4", "bignumber.js": "^9.1.2", @@ -27023,9 +27023,9 @@ } }, "@zeriontech/transactions": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@zeriontech/transactions/-/transactions-0.2.0.tgz", - "integrity": "sha512-drviAtJeI/nzUIhjcsUsmnN4+z9EAH7Wte9H4ewFj4xCA4S+TFa2vFM7Mt9+ETkHOYD/dbGeCkFVwhxYGjUY/Q==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@zeriontech/transactions/-/transactions-0.2.1.tgz", + "integrity": "sha512-1k4NlFcL/GR44skBSnwabQjVWRGJxUYkfqzgqPbeEjriewBkz60UHLcNLv33qOA3iG74v7xyayIoWjgdQZp+hA==", "requires": { "@store-unit/react": "^1.0.4", "bignumber.js": "^9.1.2", diff --git a/package.json b/package.json index a6c480a00..a3ff78d44 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "@walletconnect/jsonrpc-utils": "^1.0.8", "@zeriontech/components": "^1.0.3", "@zeriontech/hardware-wallet-connection": "^1.0.11", - "@zeriontech/transactions": "^0.2.0", + "@zeriontech/transactions": "^0.2.1", "bignumber.js": "^9.1.1", "buffer": "^6.0.3", "canvas-confetti": "^1.6.0", diff --git a/src/ui/pages/History/AccelerateTransactionDialog/SpeedUp/SpeedUp.tsx b/src/ui/pages/History/AccelerateTransactionDialog/SpeedUp/SpeedUp.tsx index 7f6995cc5..1f3850b78 100644 --- a/src/ui/pages/History/AccelerateTransactionDialog/SpeedUp/SpeedUp.tsx +++ b/src/ui/pages/History/AccelerateTransactionDialog/SpeedUp/SpeedUp.tsx @@ -75,6 +75,7 @@ export function SpeedUp({ chainGasPrices: acceleratedGasPrices, networkFeeConfiguration: configuration.networkFee, onFeeValueCommonReady: handleFeeValueCommonReady, + keepPreviousData: true, }); const signTxBtnRef = useRef(null); diff --git a/src/ui/pages/SendForm/SendForm.tsx b/src/ui/pages/SendForm/SendForm.tsx index 0c4729cc6..c03517e0e 100644 --- a/src/ui/pages/SendForm/SendForm.tsx +++ b/src/ui/pages/SendForm/SendForm.tsx @@ -65,6 +65,7 @@ import { useWalletPortfolio } from 'src/modules/zerion-api/hooks/useWalletPortfo import { useHttpClientSource } from 'src/modules/zerion-api/hooks/useHttpClientSource'; import { assertProp } from 'src/shared/assert-property'; import { useGasbackEstimation } from 'src/modules/ethereum/account-abstraction/rewards'; +import { getError } from 'src/shared/errors/getError'; import { DEFAULT_CONFIGURATION, applyConfiguration, @@ -550,8 +551,11 @@ function SendFormComponent() { ( - + // TODO: + // Once this error boundary kicks in, we no longer render EstimateTransactionGas + // and therefore never refetch gas, even when form values change + renderError={(error) => ( + {' '} @@ -585,7 +589,9 @@ function SendFormComponent() { ); } if (gasQuery.isError) { - throw new Error('Failed to estimate gas'); + throw new Error( + `Failed to estimate gas (${getError(gasQuery.error).message})` + ); } return transaction && chain && transaction.gas ? ( setView('default')} + onClosed={() => { + if (!customViewOnly) { + setView('default'); + } + }} > {view === 'default' ? ( <> @@ -685,10 +689,12 @@ export const NetworkFeeDialog = React.forwardRef< chain={chain} value={value} onSubmit={(value) => { - if (!customViewOnly) { + onSubmit(value); + if (customViewOnly) { + onDismiss(); + } else { setView('default'); } - onSubmit(value); }} transaction={transaction} chainGasPrices={chainGasPrices}