@@ -1,3 +1,4 @@
1+import Maybe from 'folktale/maybe'
1import React from 'react'
2import React from 'react'
2import { Row, Col, H1, H3, P, Warning, Anchor } from '../components/Base'
3import { Row, Col, H1, H3, P, Warning, Anchor } from '../components/Base'
3import { Button } from '../components/Base'
4import { Button } from '../components/Base'
@@ -6,14 +7,17 @@ import { ROUTE_NAMES } from '../lib/router'
6import { BRIDGE_ERROR, renderTxnError } from '../lib/error'
7import { BRIDGE_ERROR, renderTxnError } from '../lib/error'
7import { NETWORK_NAMES } from '../lib/network'
8import { NETWORK_NAMES } from '../lib/network'
9const Success = (props) => {
11const Success = (props) => {
13+ const { networkType, hash, txnConfirmations } = props
11 const esvisible =
15 const esvisible =
12− props.networkType === NETWORK_NAMES.ROPSTEN ||
16+ networkType === NETWORK_NAMES.ROPSTEN ||
13− props.networkType === NETWORK_NAMES.MAINNET
17+ networkType === NETWORK_NAMES.MAINNET
15 const esdomain =
19 const esdomain =
16− props.networkType === NETWORK_NAMES.ROPSTEN
20+ networkType === NETWORK_NAMES.ROPSTEN
17 ? "ropsten.etherscan.io"
21 ? "ropsten.etherscan.io"
18 : "etherscan.io"
22 : "etherscan.io"
@@ -29,10 +33,16 @@ const Success = (props) => {
29 className={'mb-4 mt-1'}
33 className={'mb-4 mt-1'}
30 prop-size={'sm'}
34 prop-size={'sm'}
31 target={'_blank'}
35 target={'_blank'}
32− href={`https://${esdomain}/tx/${props.hash}`}>
36+ href={`https://${esdomain}/tx/${hash}`}>
33 {'View on Etherscan ↗'}
37 {'View on Etherscan ↗'}
40+ const confirmations = Maybe.fromNullable(txnConfirmations[hash]).getOrElse(0)
42+ const requiredConfirmations = 1
44+ const status = confirmations < requiredConfirmations ? 'Pending...' : `Confirmed x${confirmations}!`
@@ -47,10 +57,17 @@ const Success = (props) => {
48 <H3>{ 'Transaction Hash' }</H3>
58 <H3>{ 'Transaction Hash' }</H3>
50− { props.hash }
60+ { hash }
63+ <H3>{ 'Transaction Status' }</H3>
65+ <div>{ status }</div>
66+ <div>{ esanchor }</div>
@@ -76,7 +93,7 @@ const Failure = (props) =>
78const SentTransaction = (props) => {
95const SentTransaction = (props) => {
79− const { web3, txnHashCursor, networkType, popRoute, pushRoute } = props
96+ const { web3, txnHashCursor, networkType, popRoute, pushRoute, txnConfirmations} = props
80 const { setPointCursor, pointCursor } = props
97 const { setPointCursor, pointCursor } = props
82 const promptKeyfile = props.routeData && props.routeData.promptKeyfile
99 const promptKeyfile = props.routeData && props.routeData.promptKeyfile
@@ -97,6 +114,7 @@ const SentTransaction = (props) => {
98 hash={ hash.value }
115 hash={ hash.value }
99 networkType={ networkType }
116 networkType={ networkType }
117+ txnConfirmations={ txnConfirmations }