From d622554ab53a20aaead76ea5c61687f240d2368f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 13 Feb 2018 15:58:28 +0000 Subject: [PATCH 01/28] chore(package): update @types/react to version 16.0.38 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 978a968ccac..3127163523d 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "@types/qrcode": "0.8.0", "@types/qrcode.react": "0.6.3", "@types/query-string": "5.0.1", - "@types/react": "16.0.37", + "@types/react": "16.0.38", "@types/react-dom": "16.0.4", "@types/react-redux": "5.0.15", "@types/react-router-dom": "4.2.4", From 84f5e9f00f5ca185d774490e170794aafcf30987 Mon Sep 17 00:00:00 2001 From: Michael - Blurpesec Date: Tue, 13 Feb 2018 21:11:47 -0500 Subject: [PATCH 02/28] Updated addresses for helpArticles list (#1089) --- common/config/helpArticles.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/config/helpArticles.ts b/common/config/helpArticles.ts index 0cfcfa39e82..9609db94cdf 100644 --- a/common/config/helpArticles.ts +++ b/common/config/helpArticles.ts @@ -3,10 +3,10 @@ export enum HELP_ARTICLE { ENS = 'ens', ENS_BAD_REVEAL = 'ens/ens-debugging-a-bad-instruction-reveal', DIFFERENCE_BETWEEN_PKEY_AND_KEYSTORE = 'private-keys-passwords/difference-beween-private-key-and-keystore-file.html', - RUNNING_LOCALLY = 'offline/running-myetherwallet-locally.html', + RUNNING_LOCALLY = 'offline/running-mycrypto-locally.html', MIGRATE_TO_METAMASK = 'migration/moving-from-private-key-to-metamask.html', MIGRATE_TO_LEDGER = 'migration/moving-from-private-key-to-ledger-hardware-wallet.html', - ADDING_NEW_TOKENS = 'send/adding-new-token-and-sending-custom-tokens.html', + ADDING_NEW_TOKENS = 'tokens/adding-new-token-and-sending-custom-tokens.html', HARDWARE_WALLET_RECOMMENDATIONS = 'hardware-wallets/hardware-wallet-recommendations.html', SENDING_TO_TREZOR = 'hardware-wallets/trezor-sending-to-trezor-device.html', SECURING_YOUR_ETH = 'security/securing-your-ethereum.html', From 011b8d5ce8eb98f2af7e7ed9077529e473c89447 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 13 Feb 2018 20:14:32 -0600 Subject: [PATCH 03/28] chore(package): update @types/query-string to version 5.1.0 (#1087) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3127163523d..1efe80987c0 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@types/lodash": "4.14.102", "@types/qrcode": "0.8.0", "@types/qrcode.react": "0.6.3", - "@types/query-string": "5.0.1", + "@types/query-string": "5.1.0", "@types/react": "16.0.38", "@types/react-dom": "16.0.4", "@types/react-redux": "5.0.15", From 643ea7c351e614748ce9d4ae9ca549b50ca8a4e6 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 13 Feb 2018 20:14:44 -0600 Subject: [PATCH 04/28] chore(package): update tslint-microsoft-contrib to version 5.0.3 (#1086) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1efe80987c0..283b8961e55 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "ts-loader": "3.3.1", "tslint": "5.9.1", "tslint-config-prettier": "1.7.0", - "tslint-microsoft-contrib": "5.0.2", + "tslint-microsoft-contrib": "5.0.3", "tslint-react": "3.5.0", "types-rlp": "0.0.1", "typescript": "2.6.2", From a4c7e0e3c0149f8ad012e0bc1b6e316b3f89d36f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 13 Feb 2018 20:15:14 -0600 Subject: [PATCH 05/28] chore(package): update tslint-react to version 3.5.1 (#1085) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 283b8961e55..6d8f99f647f 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "tslint": "5.9.1", "tslint-config-prettier": "1.7.0", "tslint-microsoft-contrib": "5.0.3", - "tslint-react": "3.5.0", + "tslint-react": "3.5.1", "types-rlp": "0.0.1", "typescript": "2.6.2", "url-loader": "0.6.2", From 5abf5ba632a75f2def5672d13f2d76b21f4f926e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 13 Feb 2018 20:15:28 -0600 Subject: [PATCH 06/28] chore(package): update electron-builder to version 20.0.4 (#1077) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d8f99f647f..a12fcde293e 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "copy-webpack-plugin": "4.4.1", "css-loader": "0.28.9", "electron": "1.8.2", - "electron-builder": "19.56.0", + "electron-builder": "20.0.4", "empty": "0.10.1", "enzyme": "3.3.0", "enzyme-adapter-react-16": "1.1.1", From ab51bde9e8b47c7b4c137550be580568525d006f Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Wed, 14 Feb 2018 15:21:02 -0600 Subject: [PATCH 07/28] Add Coveralls Badge (#1093) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 09bce8cbbfc..8b197644084 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # MyCrypto Beta (VISIT [MyCryptoHQ/mycrypto.com](https://github.com/MyCryptoHQ/mycrypto.com) for the current site)
Just looking to download? Grab our [latest release](https://github.com/MyCryptoHQ/MyCrypto/releases) [![Greenkeeper badge](https://badges.greenkeeper.io/MyCryptoHq/MyCrypto.svg)](https://greenkeeper.io/) +[![Coverage Status](https://coveralls.io/repos/github/MyCryptoHQ/MyCrypto/badge.svg?branch=develop)](https://coveralls.io/github/MyCryptoHQ/MyCrypto?branch=develop) ## Running the App From 20c6007a7bb49dbcdf43099204d2b672bbdf3f42 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 14 Feb 2018 16:41:18 -0600 Subject: [PATCH 08/28] chore(package): update webpack-subresource-integrity to version 1.0.4 (#1092) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a12fcde293e..223e7782153 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "webpack-dev-middleware": "2.0.5", "webpack-hot-middleware": "2.21.0", "webpack-sources": "1.0.1", - "webpack-subresource-integrity": "1.0.3", + "webpack-subresource-integrity": "1.0.4", "worker-loader": "1.1.0", "what-input": "5.0.5" }, From 9f682f6a46d8372969fde00e82656abeb200dd2a Mon Sep 17 00:00:00 2001 From: Luit Hollander Date: Thu, 15 Feb 2018 00:05:43 +0100 Subject: [PATCH 09/28] Update infura endpoints (#1094) --- common/reducers/config/nodes/staticNodes.ts | 6 +++--- spec/reducers/config/nodes/staticNodes.spec.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/reducers/config/nodes/staticNodes.ts b/common/reducers/config/nodes/staticNodes.ts index b5b9e029279..b630c8f514a 100644 --- a/common/reducers/config/nodes/staticNodes.ts +++ b/common/reducers/config/nodes/staticNodes.ts @@ -23,14 +23,14 @@ export const INITIAL_STATE: State = { network: 'ETH', isCustom: false, service: 'infura.io', - lib: new InfuraNode('https://mainnet.infura.io/mew'), + lib: new InfuraNode('https://mainnet.infura.io/mycrypto'), estimateGas: false }, rop_infura: { network: 'Ropsten', isCustom: false, service: 'infura.io', - lib: new InfuraNode('https://ropsten.infura.io/mew'), + lib: new InfuraNode('https://ropsten.infura.io/mycrypto'), estimateGas: false }, kov_ethscan: { @@ -51,7 +51,7 @@ export const INITIAL_STATE: State = { network: 'Rinkeby', isCustom: false, service: 'infura.io', - lib: new InfuraNode('https://rinkeby.infura.io/mew'), + lib: new InfuraNode('https://rinkeby.infura.io/mycrypto'), estimateGas: false }, etc_epool: { diff --git a/spec/reducers/config/nodes/staticNodes.spec.ts b/spec/reducers/config/nodes/staticNodes.spec.ts index 3454b4f11e3..c51d8d0c758 100644 --- a/spec/reducers/config/nodes/staticNodes.spec.ts +++ b/spec/reducers/config/nodes/staticNodes.spec.ts @@ -23,14 +23,14 @@ const expectedInitialState = { network: 'ETH', isCustom: false, service: 'infura.io', - lib: new InfuraNode('https://mainnet.infura.io/mew'), + lib: new InfuraNode('https://mainnet.infura.io/mycrypto'), estimateGas: false }, rop_infura: { network: 'Ropsten', isCustom: false, service: 'infura.io', - lib: new InfuraNode('https://ropsten.infura.io/mew'), + lib: new InfuraNode('https://ropsten.infura.io/mycrypto'), estimateGas: false }, kov_ethscan: { @@ -51,7 +51,7 @@ const expectedInitialState = { network: 'Rinkeby', isCustom: false, service: 'infura.io', - lib: new InfuraNode('https://rinkeby.infura.io/mew'), + lib: new InfuraNode('https://rinkeby.infura.io/mycrypto'), estimateGas: false }, etc_epool: { From b5b1ff73adc277574a594f6dd1b00d5639edf698 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 14 Feb 2018 17:26:47 -0600 Subject: [PATCH 10/28] chore(package): update @types/react-select to version 1.2.3 (#1091) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 223e7782153..2650c617ec3 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "@types/react-redux": "5.0.15", "@types/react-router-dom": "4.2.4", "@types/react-router-redux": "5.0.12", - "@types/react-select": "1.2.2", + "@types/react-select": "1.2.3", "@types/redux-logger": "3.0.5", "@types/uuid": "3.4.3", "@types/webpack-env": "1.13.4", From 7807cf09aae7c3c8ad2d3e2159b9ee3880fb78dd Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 15 Feb 2018 19:47:42 -0600 Subject: [PATCH 11/28] chore(package): update nodemon to version 1.15.0 (#1102) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2650c617ec3..7148964ee07 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "lint-staged": "6.1.0", "minimist": "1.2.0", "node-sass": "4.7.2", - "nodemon": "1.14.12", + "nodemon": "1.15.0", "null-loader": "0.1.1", "prettier": "1.10.2", "progress": "2.0.0", From 43853fd1982fa7450a8ac42d1704019e494d7cd6 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 15 Feb 2018 19:47:56 -0600 Subject: [PATCH 12/28] chore(package): update @types/lodash to version 4.14.103 (#1101) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7148964ee07..3a13a8b8bd0 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/classnames": "2.2.3", "@types/history": "4.6.2", "@types/jest": "22.1.2", - "@types/lodash": "4.14.102", + "@types/lodash": "4.14.103", "@types/qrcode": "0.8.0", "@types/qrcode.react": "0.6.3", "@types/query-string": "5.1.0", From 5db958128aa9540d4269e57d81b1d4516bb9aa2e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 15 Feb 2018 19:48:12 -0600 Subject: [PATCH 13/28] chore(package): update style-loader to version 0.20.2 (#1100) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a13a8b8bd0..bdeb18ac17e 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "resolve-url-loader": "2.2.1", "rimraf": "2.6.2", "sass-loader": "6.0.6", - "style-loader": "0.20.0", + "style-loader": "0.20.2", "thread-loader": "1.1.2", "ts-jest": "22.0.4", "ts-loader": "3.3.1", From f46df010db8c870e9f99073115a9ba6c9b156a2d Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 15 Feb 2018 19:48:35 -0600 Subject: [PATCH 14/28] chore(package): update tslint-config-prettier to version 1.8.0 (#1098) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bdeb18ac17e..7777db4d769 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "ts-jest": "22.0.4", "ts-loader": "3.3.1", "tslint": "5.9.1", - "tslint-config-prettier": "1.7.0", + "tslint-config-prettier": "1.8.0", "tslint-microsoft-contrib": "5.0.3", "tslint-react": "3.5.1", "types-rlp": "0.0.1", From be61d804e0af642a9363c763d138a453a68c1026 Mon Sep 17 00:00:00 2001 From: William O'Beirne Date: Fri, 16 Feb 2018 11:57:23 -0500 Subject: [PATCH 15/28] Check Transaction page (Pt. 1 - The Basics) (#1099) * Component layer and routing for transaction status. * Initial start on redux for transactions. * Initial crack at reducer / actions / saga for transactions. * Finish off check transaction saga, reducer, component, and page. --- common/Root.tsx | 5 +- common/actions/transactions/actionCreators.ts | 20 ++ common/actions/transactions/actionTypes.ts | 20 ++ common/actions/transactions/constants.ts | 5 + common/actions/transactions/index.ts | 3 + .../Header/components/Navigation.tsx | 4 + .../TransactionDataTable.scss | 49 +++++ .../TransactionDataTable.tsx | 174 ++++++++++++++++++ .../TransactionStatus/TransactionStatus.scss | 35 ++++ .../TransactionStatus/TransactionStatus.tsx | 88 +++++++++ common/components/TransactionStatus/index.tsx | 2 + common/components/index.ts | 1 + common/components/ui/NewTabLink.tsx | 4 +- .../components/TxHashInput.scss | 4 + .../components/TxHashInput.tsx | 63 +++++++ .../Tabs/CheckTransaction/index.scss | 12 ++ .../Tabs/CheckTransaction/index.tsx | 69 +++++++ common/libs/nodes/INode.ts | 31 ++++ common/libs/nodes/etherscan/requests.ts | 9 + common/libs/nodes/etherscan/types.ts | 7 + common/libs/nodes/index.ts | 1 + common/libs/nodes/rpc/index.ts | 40 +++- common/libs/nodes/rpc/requests.ts | 20 +- common/libs/nodes/rpc/types.ts | 12 ++ common/libs/validators.ts | 13 +- .../config/networks/staticNetworks.ts | 20 +- common/reducers/index.ts | 12 +- common/reducers/transactions.ts | 63 +++++++ common/sagas/index.ts | 4 +- common/sagas/transactions.ts | 39 ++++ common/selectors/transactions.ts | 5 + common/translations/lang/en.json | 4 - common/utils/formatters.ts | 6 + shared/types/network.d.ts | 4 +- .../config/networks/staticNetworks.spec.ts | 14 +- 35 files changed, 825 insertions(+), 37 deletions(-) create mode 100644 common/actions/transactions/actionCreators.ts create mode 100644 common/actions/transactions/actionTypes.ts create mode 100644 common/actions/transactions/constants.ts create mode 100644 common/actions/transactions/index.ts create mode 100644 common/components/TransactionStatus/TransactionDataTable.scss create mode 100644 common/components/TransactionStatus/TransactionDataTable.tsx create mode 100644 common/components/TransactionStatus/TransactionStatus.scss create mode 100644 common/components/TransactionStatus/TransactionStatus.tsx create mode 100644 common/components/TransactionStatus/index.tsx create mode 100644 common/containers/Tabs/CheckTransaction/components/TxHashInput.scss create mode 100644 common/containers/Tabs/CheckTransaction/components/TxHashInput.tsx create mode 100644 common/containers/Tabs/CheckTransaction/index.scss create mode 100644 common/containers/Tabs/CheckTransaction/index.tsx create mode 100644 common/reducers/transactions.ts create mode 100644 common/sagas/transactions.ts create mode 100644 common/selectors/transactions.ts diff --git a/common/Root.tsx b/common/Root.tsx index 0de08d6f98a..572cae7d313 100644 --- a/common/Root.tsx +++ b/common/Root.tsx @@ -9,6 +9,7 @@ import SendTransaction from 'containers/Tabs/SendTransaction'; import Swap from 'containers/Tabs/Swap'; import SignAndVerifyMessage from 'containers/Tabs/SignAndVerifyMessage'; import BroadcastTx from 'containers/Tabs/BroadcastTx'; +import CheckTransaction from 'containers/Tabs/CheckTransaction'; import ErrorScreen from 'components/ErrorScreen'; import PageNotFound from 'components/PageNotFound'; import LogOutPrompt from 'components/LogOutPrompt'; @@ -67,6 +68,7 @@ export default class Root extends Component { + @@ -120,8 +122,7 @@ const LegacyRoutes = withRouter(props => { history.push('/account/info'); break; case '#check-tx-status': - history.push('/check-tx-status'); - break; + return ; } } diff --git a/common/actions/transactions/actionCreators.ts b/common/actions/transactions/actionCreators.ts new file mode 100644 index 00000000000..30e2ff95560 --- /dev/null +++ b/common/actions/transactions/actionCreators.ts @@ -0,0 +1,20 @@ +import * as interfaces from './actionTypes'; +import { TypeKeys } from './constants'; + +export type TFetchTransactionData = typeof fetchTransactionData; +export function fetchTransactionData(txhash: string): interfaces.FetchTransactionDataAction { + return { + type: TypeKeys.TRANSACTIONS_FETCH_TRANSACTION_DATA, + payload: txhash + }; +} + +export type TSetTransactionData = typeof setTransactionData; +export function setTransactionData( + payload: interfaces.SetTransactionDataAction['payload'] +): interfaces.SetTransactionDataAction { + return { + type: TypeKeys.TRANSACTIONS_SET_TRANSACTION_DATA, + payload + }; +} diff --git a/common/actions/transactions/actionTypes.ts b/common/actions/transactions/actionTypes.ts new file mode 100644 index 00000000000..ee4380b320e --- /dev/null +++ b/common/actions/transactions/actionTypes.ts @@ -0,0 +1,20 @@ +import { TypeKeys } from './constants'; +import { TransactionData, TransactionReceipt } from 'libs/nodes'; + +export interface FetchTransactionDataAction { + type: TypeKeys.TRANSACTIONS_FETCH_TRANSACTION_DATA; + payload: string; +} + +export interface SetTransactionDataAction { + type: TypeKeys.TRANSACTIONS_SET_TRANSACTION_DATA; + payload: { + txhash: string; + data: TransactionData | null; + receipt: TransactionReceipt | null; + error: string | null; + }; +} + +/*** Union Type ***/ +export type TransactionsAction = FetchTransactionDataAction | SetTransactionDataAction; diff --git a/common/actions/transactions/constants.ts b/common/actions/transactions/constants.ts new file mode 100644 index 00000000000..cbd8ad82b1e --- /dev/null +++ b/common/actions/transactions/constants.ts @@ -0,0 +1,5 @@ +export enum TypeKeys { + TRANSACTIONS_FETCH_TRANSACTION_DATA = 'TRANSACTIONS_FETCH_TRANSACTION_DATA', + TRANSACTIONS_SET_TRANSACTION_DATA = 'TRANSACTIONS_SET_TRANSACTION_DATA', + TRANSACTIONS_SET_TRANSACTION_ERROR = 'TRANSACTIONS_SET_TRANSACTION_ERROR' +} diff --git a/common/actions/transactions/index.ts b/common/actions/transactions/index.ts new file mode 100644 index 00000000000..51fcd517a16 --- /dev/null +++ b/common/actions/transactions/index.ts @@ -0,0 +1,3 @@ +export * from './actionCreators'; +export * from './actionTypes'; +export * from './constants'; diff --git a/common/components/Header/components/Navigation.tsx b/common/components/Header/components/Navigation.tsx index 2695082f573..353217541e2 100644 --- a/common/components/Header/components/Navigation.tsx +++ b/common/components/Header/components/Navigation.tsx @@ -34,6 +34,10 @@ const tabs: TabLink[] = [ name: 'Sign & Verify Message', to: '/sign-and-verify-message' }, + { + name: 'NAV_TxStatus', + to: '/tx-status' + }, { name: 'Broadcast Transaction', to: '/pushTx' diff --git a/common/components/TransactionStatus/TransactionDataTable.scss b/common/components/TransactionStatus/TransactionDataTable.scss new file mode 100644 index 00000000000..be38bb82376 --- /dev/null +++ b/common/components/TransactionStatus/TransactionDataTable.scss @@ -0,0 +1,49 @@ +@import 'common/sass/variables'; +@import 'common/sass/mixins'; + +.TxData { + &-row { + font-size: 0.9rem; + + &-label { + font-weight: bold; + text-align: right; + } + + &-data { + @include mono; + + &-more { + margin-left: $space-sm; + font-size: 0.7rem; + opacity: 0.7; + } + + &-status { + font-weight: bold; + + &.is-success { + color: $brand-success; + } + &.is-warning { + color: $brand-warning; + } + &.is-danger { + color: $brand-danger; + } + } + + .Identicon { + float: left; + margin-right: $space-sm; + } + + textarea { + display: block; + width: 100%; + height: 7.2rem; + background: $gray-lighter; + } + } + } +} diff --git a/common/components/TransactionStatus/TransactionDataTable.tsx b/common/components/TransactionStatus/TransactionDataTable.tsx new file mode 100644 index 00000000000..4e5d2a6c216 --- /dev/null +++ b/common/components/TransactionStatus/TransactionDataTable.tsx @@ -0,0 +1,174 @@ +import React from 'react'; +import translate from 'translations'; +import { Identicon, UnitDisplay, NewTabLink } from 'components/ui'; +import { TransactionData, TransactionReceipt } from 'libs/nodes'; +import { NetworkConfig } from 'types/network'; +import './TransactionDataTable.scss'; + +interface TableRow { + label: React.ReactElement | string; + data: React.ReactElement | string | number | null; +} + +const MaybeLink: React.SFC<{ + href: string | null | undefined | false; + children: any; // Too many damn React element types +}> = ({ href, children }) => { + if (href) { + return {children}; + } else { + return {children}; + } +}; + +interface Props { + data: TransactionData; + receipt: TransactionReceipt | null; + network: NetworkConfig; +} + +const TransactionDataTable: React.SFC = ({ data, receipt, network }) => { + const explorer: { [key: string]: string | false | null } = {}; + const hasInputData = data.input && data.input !== '0x'; + + if (!network.isCustom) { + explorer.tx = network.blockExplorer && network.blockExplorer.txUrl(data.hash); + explorer.block = + network.blockExplorer && + !!data.blockNumber && + network.blockExplorer.blockUrl(data.blockNumber); + explorer.to = network.blockExplorer && network.blockExplorer.addressUrl(data.to); + explorer.from = network.blockExplorer && network.blockExplorer.addressUrl(data.from); + explorer.contract = + network.blockExplorer && + receipt && + receipt.contractAddress && + network.blockExplorer.addressUrl(receipt.contractAddress); + } + + let statusMsg = ''; + let statusType = ''; + let statusSeeMore = false; + if (receipt) { + if (receipt.status === 1) { + statusMsg = 'SUCCESSFUL'; + statusType = 'success'; + } else if (receipt.status === 0) { + statusMsg = 'FAILED'; + statusType = 'danger'; + statusSeeMore = true; + } else { + // Pre-byzantium transactions don't use status, and cannot have their + // success determined over the JSON RPC api + statusMsg = 'UNKNOWN'; + statusType = 'warning'; + statusSeeMore = true; + } + } else { + statusMsg = 'PENDING'; + statusType = 'warning'; + } + + const rows: TableRow[] = [ + { + label: 'Status', + data: ( + + {statusMsg} + {statusSeeMore && + explorer.tx && + !network.isCustom && ( + + (See more on {network.blockExplorer.name}) + + )} + + ) + }, + { + label: translate('x_TxHash'), + data: {data.hash} + }, + { + label: 'Block Number', + data: receipt && {receipt.blockNumber} + }, + { + label: translate('OFFLINE_Step1_Label_1'), + data: ( + + + {data.from} + + ) + }, + { + label: translate('OFFLINE_Step2_Label_1'), + data: ( + + + {data.to} + + ) + }, + { + label: translate('SEND_amount_short'), + data: + }, + { + label: translate('OFFLINE_Step2_Label_3'), + data: + }, + { + label: translate('OFFLINE_Step2_Label_4'), + data: + }, + { + label: 'Gas Used', + data: receipt && + }, + { + label: 'Transaction Fee', + data: receipt && ( + + ) + }, + { + label: translate('New contract address'), + data: receipt && + receipt.contractAddress && ( + {receipt.contractAddress} + ) + }, + { + label: translate('OFFLINE_Step2_Label_5'), + data: data.nonce + }, + { + label: translate('TRANS_data'), + data: hasInputData ? ( +