import Maybe from 'folktale/maybe' import React from 'react' import { Code, H3 } from './Base' import { Button } from './Base' import { CheckboxButton, Input, InnerLabel } from './Base' import { renderSignedTx, // createUnsignedTxn, signTransaction, } from '../lib/txn'; const StatelessTransaction = props => { const generateButtonColor = Maybe.Nothing.hasInstance(props.txn) ? 'blue' : 'green' const signerButtonColor = Maybe.Nothing.hasInstance(props.stx) ? 'blue' : 'green' return ( { props.txn.matchWith({ Nothing: () => '', Just: (tx) => { console.log(tx.value) const rendered = tx.value return (

{'Unsigned Transaction'}

{JSON.stringify(rendered, null, 2)}
) } }) } props.setGasPrice(v) }> { 'Gas Price (gwei)' } props.setGasLimit(v) }> { 'Gas Limit' } { props.web3.matchWith({ Just: () =>
, Nothing: () => props.setNonce(v) }> { 'Nonce' } props.setChainId(v) }> { 'Chain ID' } }) } { props.stx.matchWith({ Nothing: () => '', Just: (tx) => { const rendered = renderSignedTx(tx.value) return (

{'Signed Transaction'}

{JSON.stringify(rendered, null, 2)}
) } }) } { props.web3.matchWith({ Nothing: () => '', Just: () => { return ( props.setUserApproval() } state={props.userApproval}>
{ `I approve this transaction and wish to send.` }
) } }) } ) } export default StatelessTransaction