@@ -17,6 +17,7 @@ import * as need from 'lib/need';
1717import { ensureFundsFor } from 'lib/tank';
1818import useDeepEqualReference from './useDeepEqualReference';
1919import useGasPrice from './useGasPrice';
20+import timeout from './timeout';
2021
2122const STATE = {
2223 NONE: 'NONE',
@@ -65,6 +66,7 @@ export default function useEthereumTransaction(
6566 const [signedTransaction, setSignedTransaction] = useState();
6667 const [txHash, setTxHash] = useState();
6768 const [needFunds, setNeedFunds] = useState();
69+ const [confirmationProgress, setConfirmationProgress] = useState(0.0);
6870
6971 const initializing = nonce === undefined || chainId === undefined;
7072 const constructed = !!unsignedTransaction;
@@ -126,6 +128,7 @@ export default function useEthereumTransaction(
126128
127129 const broadcast = useCallback(async () => {
128130 try {
131+ setConfirmationProgress(0.0);
129132 setError(undefined);
130133
131134 const rawTx = hexify(signedTransaction.serialize());
@@ -156,8 +159,14 @@ export default function useEthereumTransaction(
156159 setState(STATE.BROADCASTED);
157160 setTxHash(txHash);
158161
162+ await timeout(500); // wait for .animated-width to complete
163+
164+ setConfirmationProgress(0.2);
165+
159166 await waitForTransactionConfirm(_web3, txHash);
160167
168+ setConfirmationProgress(0.9);
169+
161170 setState(STATE.CONFIRMED);
162171 } catch (error) {
163172 setError(error);
@@ -181,6 +190,7 @@ export default function useEthereumTransaction(
181190 setState(STATE.NONE);
182191 setError(undefined);
183192 setNeedFunds(undefined);
193+ setConfirmationProgress(0.0);
184194 }, [resetGasPrice, setError]);
185195
186196 useEffect(() => {
@@ -236,6 +246,14 @@ export default function useEthereumTransaction(
236246 return;
237247 }
238248
249+ setConfirmationProgress(1.0);
250+
251+ await timeout(500); // wait for .animated-width to complete
252+
253+ if (!mounted) {
254+ return;
255+ }
256+
239257 setState(STATE.COMPLETED);
240258 })();
241259 }
@@ -259,7 +277,7 @@ export default function useEthereumTransaction(
259277 reset,
260278 error,
261279 inputsLocked,
262− //
280+ confirmationProgress,
263281 txHash,
264282 signedTransaction,
265283 gasPrice,