Skip to content

Commit

Permalink
feat(unstoppable): eth, erc20, bch
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Apr 29, 2021
1 parent 8c608f1 commit 834c0f3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,20 @@ export default ({
payment = yield payment.to(value.xpub, toType)
break
// ensure 'r' exists, otherwise its just a BCH address in cash addr format
case includes('.', (address as unknown) as string):
yield put(
actions.components.send.fetchUnstoppableDomainResults(
(address as unknown) as string,
'BCH'
)
)
break
case !isNil(tryParsePayPro()) &&
hasPath(['options', 'r'], payProInvoice):
yield call(bitPayInvoiceEntered, payProInvoice)
break
default:
payment = yield payment.to(address, toType)
payment = yield payment.to((address as unknown) as string, toType)
}
break
case 'amount':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ export default ({
case 'to':
const toPayload = payload as SendEthFormToActionType['payload']
const value = pathOr(toPayload, ['value', 'value'], toPayload)
if (includes('.', (value as unknown) as string)) {
yield put(
actions.components.send.fetchUnstoppableDomainResults(
(value as unknown) as string,
coin
)
)
return
}
// @ts-ignore
payment = yield payment.to(value)
// Do not block payment update when to is changed w/ isContract check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
import QRCodeCapture from 'components/QRCode/Capture'
import { CustodyToAccountMessage, Row } from 'components/Send'
import MnemonicRequiredForCustodySend from 'components/Send/RecoveryPhrase'
import UnstoppableDomains from 'components/UnstoppableDomains'
import { model } from 'data'
import { required, validBchAddress } from 'services/forms'

Expand Down Expand Up @@ -195,6 +196,7 @@ const FirstStep = props => {
</Row>
</FormItem>
</FormGroup>
<UnstoppableDomains form={model.components.sendBch.FORM} />
<FormGroup>
<CustodyToAccountMessage coin='BCH' account={from} amount={amount} />
</FormGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
Row
} from 'components/Send'
import MnemonicRequiredForCustodySend from 'components/Send/RecoveryPhrase'
import UnstoppableDomains from 'components/UnstoppableDomains'
import { model } from 'data'
import { required, validEthAddress } from 'services/forms'

Expand Down Expand Up @@ -207,6 +208,7 @@ const FirstStep = props => {
)}
</FormItem>
</FormGroup>
<UnstoppableDomains form={model.components.sendEth.FORM} />
<FormGroup>
<CustodyToAccountMessage coin={coin} account={from} amount={amount} />
</FormGroup>
Expand Down

0 comments on commit 834c0f3

Please sign in to comment.