1import Maybe from 'folktale/maybe';
2import React from 'react';
3import * as azimuth from 'azimuth-js';
4import * as ob from 'urbit-ob';
5import * as need from '../lib/need';
15} from '../components/old/Base';
16import { AddressInput } from '../components/old/Base';
17import StatelessTransaction from '../components/old/StatelessTransaction';
19import { NETWORK_TYPES } from '../lib/network';
21import { isValidAddress } from '../lib/wallet';
22import { withNetwork } from '../store/network';
23import { compose } from '../lib/lib';
24import { withPointCursor } from '../store/pointCursor';
26class Transfer extends React.Component {
30 const issuingPoint = need.pointCursor(props);
34 issuingPoint: issuingPoint,
37 this.handleAddressInput = this.handleAddressInput.bind(this);
38 this.createUnsignedTxn = this.createUnsignedTxn.bind(this);
39 this.statelessRef = React.createRef();
42 handleAddressInput(receivingAddress) {
43 this.setState({ receivingAddress });
44 this.statelessRef.current.clearTxn();
47 handleConfirmAvailability() {
48 this.confirmPointAvailability().then(r => {
49 this.setState({ isAvailable: r });
54 const { state, props } = this;
56 const validContracts = need.contracts(props);
58 const validPoint = need.pointCursor(props);
60 const txn = azimuth.ecliptic.setTransferProxy(
63 state.receivingAddress
66 return Maybe.Just(txn);
70 const { props, state } = this;
72 const validAddress = isValidAddress(state.receivingAddress);
73 const canGenerate = validAddress === true;
76 props.networkType === NETWORK_TYPES.ROPSTEN ||
77 props.networkType === NETWORK_TYPES.MAINNET;
80 props.networkType === NETWORK_TYPES.ROPSTEN
81 ? 'ropsten.etherscan.io'
88 {'Transfer'} <code>{` ${ob.patp(state.issuingPoint)} `}</code>
93 {`Please provide the Ethereum address of the new owner. You own these
94 points until the recipient accepts the incoming transfer.
95 You may cancel the transfer until the transfer is accepted.`}
99 className={'mono mt-8'}
101 prop-format="innerLabel"
102 value={state.receivingAddress}
103 placeholder={`e.g. 0x84295d5e054d8cff5a22428b195f5a1615bd644f`}
104 onChange={v => this.handleAddressInput(v)}>
105 <InnerLabel>{'New ownership address'}</InnerLabel>
106 <ShowBlockie className={'mt-1'} address={state.receivingAddress} />
113 !isValidAddress(state.receivingAddress) || !esvisible
116 href={`https://${esdomain}/address/${state.receivingAddress}`}>
117 {'View on Etherscan ↗'}
120 <StatelessTransaction
124 userApproval={state.userApproval}
125 canGenerate={canGenerate}
127 createUnsignedTxn={this.createUnsignedTxn}
128 ref={this.statelessRef}
136export default compose(
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