@@ -1,4 +1,4 @@
1−import Maybe from 'folktale/maybe'
1+import { Just, Nothing } from 'folktale/maybe'
2import React from 'react'
2import React from 'react'
3import { Row, Col, H1, H3, P, Warning } from '../components/Base'
3import { Row, Col, H1, H3, P, Warning } from '../components/Base'
4import { InnerLabel, AddressInput, ShowBlockie, Anchor } from '../components/Base'
4import { InnerLabel, AddressInput, ShowBlockie, Anchor } from '../components/Base'
@@ -41,15 +41,15 @@ class AcceptTransfer extends React.Component {
42 this.state = {
42 this.state = {
43 receivingAddress: receivingAddress,
43 receivingAddress: receivingAddress,
44− txn: Maybe.Nothing(),
44+ txn: Nothing(),
45− txError: Maybe.Nothing(),
45+ txError: Nothing(),
46 incomingPoint: incomingPoint,
46 incomingPoint: incomingPoint,
47 userApproval: false,
47 userApproval: false,
48 nonce: '',
48 nonce: '',
49 gasPrice: '5',
49 gasPrice: '5',
50 chainId: '',
50 chainId: '',
51 gasLimit: '600000',
51 gasLimit: '600000',
52− stx: Maybe.Nothing(),
52+ stx: Nothing(),
54 this.handleAddressInput = this.handleAddressInput.bind(this)
54 this.handleAddressInput = this.handleAddressInput.bind(this)
55 // Transaction
55 // Transaction
@@ -188,7 +188,7 @@ class AcceptTransfer extends React.Component {
188 handleClearStx() {
188 handleClearStx() {
189 this.setState({
189 this.setState({
190 userApproval: false,
190 userApproval: false,
191− stx: Maybe.Nothing(),
191+ stx: Nothing(),
@@ -197,8 +197,8 @@ class AcceptTransfer extends React.Component {
197 handleClearTxn() {
197 handleClearTxn() {
198 this.setState({
198 this.setState({
199 userApproval: false,
199 userApproval: false,
200− txn: Maybe.Nothing(),
200+ txn: Nothing(),
201− stx: Maybe.Nothing(),
201+ stx: Nothing(),
@@ -207,8 +207,8 @@ class AcceptTransfer extends React.Component {
207 handleClearTransaction() {
207 handleClearTransaction() {
208 this.setState({
208 this.setState({
209 userApproval: false,
209 userApproval: false,
210− txn: Maybe.Nothing(),
210+ txn: Nothing(),
211− stx: Maybe.Nothing(),
211+ stx: Nothing(),
@@ -223,8 +223,7 @@ class AcceptTransfer extends React.Component {
223 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
223 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
225 .catch(err => {
225 .catch(err => {
226− // Note that value.value is due to wrapped Maybe.Just + Result.Error
227− this.setState({ txError: Maybe.Just(err.value.value) })
226+ this.setState({ txError: err.map(val => val.merge()) })
@@ -247,7 +246,7 @@ class AcceptTransfer extends React.Component {
248 const owner = props.pointCache[validPoint].owner
247 const owner = props.pointCache[validPoint].owner
250− return Maybe.Just(azimuth.ecliptic.transferFrom(
249+ return Just(azimuth.ecliptic.transferFrom(
251 validContracts,
250 validContracts,
253 state.receivingAddress,
252 state.receivingAddress,
@@ -260,9 +259,11 @@ class AcceptTransfer extends React.Component {
260 const { state, props } = this
259 const { state, props } = this
261 const validAddress = isValidAddress(state.receivingAddress)
260 const validAddress = isValidAddress(state.receivingAddress)
262 const canGenerate = validAddress === true
261 const canGenerate = validAddress === true
263− const canSign = !Maybe.Nothing.hasInstance(state.txn)
262+ const canSign = Just.hasInstance(state.txn)
264− const canApprove = !Maybe.Nothing.hasInstance(state.stx)
263+ const canApprove = Just.hasInstance(state.stx)
265+ Just.hasInstance(state.stx)
265− const canSend = !Maybe.Nothing.hasInstance(state.stx) && state.userApproval === true
266+ && state.userApproval === true
267 const esvisible =
268 const esvisible =
268 props.networkType === NETWORK_NAMES.ROPSTEN ||
269 props.networkType === NETWORK_NAMES.ROPSTEN ||
@@ -339,7 +340,7 @@ class AcceptTransfer extends React.Component {
339 handleSubmit={this.handleSubmit} />
340 handleSubmit={this.handleSubmit} />
342− Maybe.Nothing.hasInstance(state.txError)
343+ Nothing.hasInstance(state.txError)
344 : <Warning className={'mt-8'}>
345 : <Warning className={'mt-8'}>
345 <H3 style={{marginTop: 0, paddingTop: 0}}>
346 <H3 style={{marginTop: 0, paddingTop: 0}}>