@@ -9,7 +9,7 @@ import { renderSignedTx, signTransaction } from '../lib/txn'
10const StatelessTransaction = props => {
10const StatelessTransaction = props => {
11 const { web3, gasPrice, gasLimit, nonce, chainId } = props
11 const { web3, gasPrice, gasLimit, nonce, chainId } = props
12− const { setNonce, setChainId, setGasLimit, setGasPrice } = props
12+ const { setNonce, setChainId, setGasLimit, setGasPrice, showGasDetails, toggleGasDetails } = props
13 const { txn, stx, createUnsignedTxn } = props
13 const { txn, stx, createUnsignedTxn } = props
14 const { canSign, canGenerate, canApprove } = props
14 const { canSign, canGenerate, canApprove } = props
15 const { setUserApproval, userApproval } = props
15 const { setUserApproval, userApproval } = props
@@ -20,6 +20,10 @@ const StatelessTransaction = props => {
20 // - TypeError: Cannot read property 'updater' of undefined
20 // - TypeError: Cannot read property 'updater' of undefined
21 // so just modifying the DOM manually here. (https://imgur.com/a/i0Qsyq1)
21 // so just modifying the DOM manually here. (https://imgur.com/a/i0Qsyq1)
23+ const handleRangeChange = (e) => {
24+ setGasPrice(e.target.value);
23 const sendTxn = (e) => {
27 const sendTxn = (e) => {
24 e.target.setAttribute("disabled", true);
28 e.target.setAttribute("disabled", true);
25 let spinner = e.target.querySelectorAll('.btn-spinner')[0];
29 let spinner = e.target.querySelectorAll('.btn-spinner')[0];
@@ -61,6 +65,40 @@ const StatelessTransaction = props => {
61 </React.Fragment>
65 </React.Fragment>
68+ const gasPriceRangeDialogue = (
70+ <div className="mt-12 flex space-between align-baseline">
72+ <span>Gas Price:</span>
73+ <span className="ml-4 text-700 text-sm">{gasPrice} gwei</span>
75+ <div className="text-sm">
76+ <span>Max transaction fee: </span>
77+ <span className="text-700">{(gasPrice * gasLimit) / 1000000000} eth</span>
88+ onChange={handleRangeChange}
91+ <div className="flex space-between text-sm mb-8">
98+ const toggleGasDetailsDialogue = (
99+ <a href="javascript:void(0)" onClick={toggleGasDetails}>Gas Details</a>
64 const gasPriceDialogue =
102 const gasPriceDialogue =
66 className={ 'mono mt-4' }
104 className={ 'mono mt-4' }
@@ -184,8 +222,15 @@ const StatelessTransaction = props => {
184 { generateTxnButton }
222 { generateTxnButton }
185 { unsignedTxnDisplay }
223 { unsignedTxnDisplay }
225+ { gasPriceRangeDialogue }
226+ { toggleGasDetailsDialogue }
187− { gasPriceDialogue }
230+ { gasPriceDialogue }
188− { gasLimitDialogue }
231+ { gasLimitDialogue }
189 { onlineParamsDialogue }
234 { onlineParamsDialogue }
191 { signTxnButton }
236 { signTxnButton }