0.0.2 • Published 2 years ago
@cryc/tx-modal v0.0.2
tx-modal
Render a modal that shows every step of a transaction
const MyComponent: React.FC = () => {
const { txState, execTransaction, reset } = useContractTx()
const run = async () => {
await execTransaction(() => {
//...
})
}
return <>
<TxModal txState={txState} done={reset} />
<button onClick={run}>Run tx</button>
</>
}