1import Maybe from 'folktale/maybe'
2import React from 'react'
4import { Code, H3 } from './Base'
5import { Button } from './Base'
6import { CheckboxButton, Input, InnerLabel } from './Base'
16const StatelessTransaction = props => {
18 const generateButtonColor = Maybe.Nothing.hasInstance(props.txn)
22 const signerButtonColor = Maybe.Nothing.hasInstance(props.stx)
31 prop-color={generateButtonColor}
33 disabled={ !props.canGenerate }
34 onClick={ () => props.createUnsignedTxn()}>
35 { 'Generate Transaction' }
44 const rendered = tx.value
47 <H3 className={'mt-8'}>{'Unsigned Transaction'}</H3>
48 <Code> {JSON.stringify(rendered, null, 2)} </Code>
59 prop-format='innerLabel'
60 value={ props.gasPrice }
61 onChange={ v => props.setGasPrice(v) }>
63 { 'Gas Price (gwei)' }
70 prop-format='innerLabel'
71 value={ props.gasLimit }
72 onChange={ v => props.setGasLimit(v) }>
79 props.web3.matchWith({
86 prop-format='innerLabel'
88 onChange={ v => props.setNonce(v) }>
95 className='mono mt-4 mb-8'
97 prop-format='innerLabel'
98 value={ props.chainId }
99 onChange={ v => props.setChainId(v) }>
109 disabled={ !props.canSign }
111 prop-size={'lg wide'}
112 prop-color={signerButtonColor}
113 onClick={ () => signTransaction({
114 wallet: props.wallet,
115 walletType: props.walletType,
116 walletHdPath: props.walletHdPath,
117 networkType: props.networkType,
119 setStx: props.setStx,
121 chainId: props.chainId,
122 gasPrice: props.gasPrice,
123 gasLimit: props.gasLimit,
125 { 'Sign Transaction' }
130 props.stx.matchWith({
133 const rendered = renderSignedTx(tx.value)
136 <H3 className={'mt-8'}>{'Signed Transaction'}</H3>
137 <Code> {JSON.stringify(rendered, null, 2)} </Code>
145 props.web3.matchWith({
152 disabled={ !props.canApprove }
153 onClick={ () => props.setUserApproval() }
154 state={props.userApproval}>
156 { `I approve this transaction and wish to send.` }
160 prop-size={'xl wide'}
162 disabled={ !props.canSend }
163 onClick={ () => props.handleSubmit() }>
164 { 'Send Transaction' }
177export default StatelessTransaction
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list