1import React from 'react';
2import { Row, Col, H1, H2, P } from '../components/old/Base';
3import { Button } from '../components/old/Base';
4import * as azimuth from 'azimuth-js';
6import PointList from '../components/old/PointList';
7import { NETWORK_TYPES } from '../lib/network';
8import { ROUTE_NAMES } from '../lib/routeNames';
9import { withHistory } from '../store/history';
10import { ETH_ZERO_ADDR, eqAddr } from '../lib/wallet';
11import { withNetwork } from '../store/network';
12import { compose } from '../lib/lib';
13import { withWallet } from '../store/wallet';
14import { withPointCache } from '../store/pointCache';
16const hasTransferProxy = (cache, point) =>
17 point in cache ? !eqAddr(cache[point].transferProxy, ETH_ZERO_ADDR) : false;
19class Points extends React.Component {
23 const { networkType } = props;
24 const loading = networkType !== NETWORK_TYPES.OFFLINE;
38 const { web3, wallet, contracts, addToPointCache } = this.props;
41 contracts.chain(ctrcs =>
42 wallet.chain(async wal => {
43 const addr = wal.address;
45 const points = await azimuth.azimuth.getOwnedPoints(ctrcs, addr);
47 const incoming = await azimuth.azimuth.getTransferringFor(
52 const managing = await azimuth.azimuth.getManagerFor(ctrcs, addr);
54 const voting = await azimuth.azimuth.getVotingFor(ctrcs, addr);
56 const spawning = await azimuth.azimuth.getSpawningFor(ctrcs, addr);
58 const owner = await azimuth.ecliptic.owner(ctrcs);
60 const eclipticOwner = eqAddr(addr, owner);
72 this.cachePoints(ctrcs, addToPointCache, points);
78 cachePoints(contracts, addToPointCache, points) {
79 points.forEach(point => {
81 .getPoint(contracts, point)
82 .then(details => addToPointCache({ [point]: details }));
87 const { history, pointCache } = this.props;
99 const lookupPointButton = (
105 onClick={() => history.push(ROUTE_NAMES.VIEW_SHIP)}>
108 <P>{'View a point on Azimuth.'}</P>
113 const createGalaxyButton =
114 eclipticOwner === false ? (
122 onClick={() => history.push(ROUTE_NAMES.CREATE_GALAXY)}>
123 {'Create a galaxy →'}
127 'You have the authority to create a new Galaxy and you can do so here.'
134 const outgoing = points.filter(point =>
135 hasTransferProxy(pointCache, point)
138 const outgoingPoints =
139 outgoing.length !== 0 ? (
141 <H2>{'Outgoing Transfers'}</H2>
143 {`You own these points until the recipient accepts the incoming
144 transfer. You may cancel the transfer until accepted.`}
146 <PointList routeHandler={history.push} points={outgoing} />
152 const incomingPoints =
153 incoming.length !== 0 ? (
155 <H2>{'Incoming Transfers'}</H2>
157 {`You do not own these points until you accept the incoming transfer.
158 You may reject any incoming transfers.`}
160 <PointList routeHandler={history.push} points={incoming} />
166 const managingPoints =
167 managing.length !== 0 ? (
169 <H2>{'You Are a Management Proxy For'}</H2>
171 {`You can configure or set network keys and conduct sponsorship
172 related operations for these points.`}
174 <PointList routeHandler={history.push} points={managing} />
181 voting.length !== 0 ? (
183 <H2>{'You Are a Voting Proxy For'}</H2>
185 {`Since you are part of the Galactic Senate, you can cast votes on
186 new Azimuth proposals on behalf of these points.`}
188 <PointList routeHandler={history.push} points={voting} />
194 const spawningPoints =
195 spawning.length !== 0 ? (
197 <H2>{'You Are a Spawn Proxy For'}</H2>
198 <P>{`You can create new child ships under these points.`}</P>
199 <PointList routeHandler={history.push} points={spawning} />
210 <P>{`A point is an identity on the Ethereum blockchain.
211 Points declare keys for ships on the Arvo network.`}</P>
221 <H2>{'Your Points'}</H2>
224 routeHandler={history.push}
240export 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