add withdraw function
This commit is contained in:
parent
9b2bc3d97a
commit
d7a0f19f20
|
@ -11,7 +11,11 @@ import TextField from '@material-ui/core/TextField'
|
||||||
import indigo from '@material-ui/core/colors/indigo'
|
import indigo from '@material-ui/core/colors/indigo'
|
||||||
import blueGrey from '@material-ui/core/colors/blueGrey'
|
import blueGrey from '@material-ui/core/colors/blueGrey'
|
||||||
import Collapse from '@material-ui/core/Collapse'
|
import Collapse from '@material-ui/core/Collapse'
|
||||||
|
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock'
|
||||||
import { getTokenLabel } from '../../utils/currencies'
|
import { getTokenLabel } from '../../utils/currencies'
|
||||||
|
import { toWei } from '../../utils/conversions'
|
||||||
|
|
||||||
|
const { withdraw } = LiquidPledgingMock.methods
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
card: {
|
card: {
|
||||||
|
@ -54,6 +58,19 @@ class Withdraw extends PureComponent {
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={{}}
|
initialValues={{}}
|
||||||
onSubmit={async (values, { setSubmitting, resetForm, setStatus }) => {
|
onSubmit={async (values, { setSubmitting, resetForm, setStatus }) => {
|
||||||
|
const { amount } = values
|
||||||
|
const args = [rowData.id, toWei(amount)]
|
||||||
|
withdraw(...args)
|
||||||
|
.send()
|
||||||
|
.then(res => {
|
||||||
|
console.log({res})
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.log({e})
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.close()
|
||||||
|
})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{({
|
{({
|
||||||
|
|
Loading…
Reference in New Issue