import React, { Component } from 'react'; import { connect } from 'react-redux'; import { AppState } from 'reducers'; import TabSection from 'containers/TabSection'; import { translateRaw } from 'translations'; import { broadcastTx as dBroadcastTx, TBroadcastTx } from 'actions/wallet'; import { QRCode } from 'components/ui'; import './index.scss'; import { BroadcastTransactionStatus, getTransactionFields } from 'libs/transaction'; import EthTx from 'ethereumjs-tx'; import { ConfirmationModal } from 'containers/Tabs/SendTransaction/components'; import classnames from 'classnames'; interface Props { broadcastTx: TBroadcastTx; transactions: BroadcastTransactionStatus[]; } interface State { signedTx: string; showConfirmationModal: boolean; disabled: boolean; } const initialState: State = { showConfirmationModal: false, signedTx: '', disabled: true }; class BroadcastTx extends Component { public state = initialState; public ensureValidSignedTxInputOnUpdate() { try { const tx = new EthTx(this.state.signedTx); getTransactionFields(tx); if (this.state.disabled) { this.setState({ disabled: false }); } } catch (e) { if (!this.state.disabled) { this.setState({ disabled: true }); } } } public componentDidUpdate() { this.ensureValidSignedTxInputOnUpdate(); } public render() { const { signedTx, disabled, showConfirmationModal } = this.state; const inputClasses = classnames({ 'form-control': true, 'is-valid': !disabled, 'is-invalid': disabled }); return (

Broadcast Signed Transaction

Paste a signed transaction and press the "SEND TRANSACTION" button.