1import React from 'react';
2import { Just } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
4import * as ob from 'urbit-ob';
5import * as need from '../lib/need';
7import { H1, InnerLabel, ShowBlockie, P, Anchor } from '../components/old/Base';
8import { AddressInput } from '../components/old/Base';
9import StatelessTransaction from '../components/old/StatelessTransaction';
11import { NETWORK_TYPES } from '../lib/network';
13import { isValidAddress } from '../lib/wallet';
14import { withNetwork } from '../store/network';
15import { compose } from '../lib/lib';
16import { withPointCursor } from '../store/pointCursor';
17import View from 'components/View';
19class Transfer extends React.Component {
23 const issuingPoint = need.point(props.pointCursor);
27 issuingPoint: issuingPoint,
30 this.handleAddressInput = this.handleAddressInput.bind(this);
31 this.createUnsignedTxn = this.createUnsignedTxn.bind(this);
32 this.statelessRef = React.createRef();
35 handleAddressInput(receivingAddress) {
36 this.setState({ receivingAddress });
37 this.statelessRef.current.clearTxn();
40 handleConfirmAvailability() {
41 this.confirmPointAvailability().then(r => {
42 this.setState({ isAvailable: r });
47 const { state, props } = this;
49 const validContracts = need.contracts(props.contracts);
50 const validPoint = need.point(props.pointCursor);
52 const txn = azimuth.ecliptic.setTransferProxy(
55 state.receivingAddress
62 const { props, state } = this;
64 const validAddress = isValidAddress(state.receivingAddress);
65 const canGenerate = validAddress === true;
68 props.networkType === NETWORK_TYPES.ROPSTEN ||
69 props.networkType === NETWORK_TYPES.MAINNET;
72 props.networkType === NETWORK_TYPES.ROPSTEN
73 ? 'ropsten.etherscan.io'
79 {'Transfer'} <code>{` ${ob.patp(state.issuingPoint)} `}</code>
84 {`Please provide the Ethereum address of the new owner. You own these
85 points until the recipient accepts the incoming transfer.
86 You may cancel the transfer until the transfer is accepted.`}
90 className={'mono mt-8'}
92 prop-format="innerLabel"
93 value={state.receivingAddress}
94 placeholder={`e.g. 0x84295d5e054d8cff5a22428b195f5a1615bd644f`}
95 onChange={v => this.handleAddressInput(v)}>
96 <InnerLabel>{'New ownership address'}</InnerLabel>
97 <ShowBlockie className={'mt-1'} address={state.receivingAddress} />
103 prop-disabled={!isValidAddress(state.receivingAddress) || !esvisible}
105 href={`https://${esdomain}/address/${state.receivingAddress}`}>
106 {'View on Etherscan ↗'}
109 <StatelessTransaction
113 userApproval={state.userApproval}
114 canGenerate={canGenerate}
116 createUnsignedTxn={this.createUnsignedTxn}
117 ref={this.statelessRef}
124export 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