1import React from 'react';
2import { 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';
15import View from 'components/View';
16import Grid from 'components/Grid';
18const hasTransferProxy = (cache, point) =>
19 point in cache ? !eqAddr(cache[point].transferProxy, ETH_ZERO_ADDR) : false;
21class Points extends React.Component {
25 const { networkType } = props;
26 const loading = networkType !== NETWORK_TYPES.OFFLINE;
40 const { web3, wallet, contracts, addToPointCache } = this.props;
43 contracts.chain(ctrcs =>
44 wallet.chain(async wal => {
45 const addr = wal.address;
47 const points = await azimuth.azimuth.getOwnedPoints(ctrcs, addr);
49 const incoming = await azimuth.azimuth.getTransferringFor(
54 const managing = await azimuth.azimuth.getManagerFor(ctrcs, addr);
56 const voting = await azimuth.azimuth.getVotingFor(ctrcs, addr);
58 const spawning = await azimuth.azimuth.getSpawningFor(ctrcs, addr);
60 const owner = await azimuth.ecliptic.owner(ctrcs);
62 const eclipticOwner = eqAddr(addr, owner);
74 this.cachePoints(ctrcs, addToPointCache, points);
80 cachePoints(contracts, addToPointCache, points) {
81 points.forEach(point => {
83 .getPoint(contracts, point)
84 .then(details => addToPointCache({ [point]: details }));
89 const { history, pointCache } = this.props;
101 const lookupPointButton = (
107 onClick={() => history.push(ROUTE_NAMES.VIEW_POINT)}>
110 <P>{'View a point on Azimuth.'}</P>
115 const createGalaxyButton =
116 eclipticOwner === false ? (
124 onClick={() => history.push(ROUTE_NAMES.CREATE_GALAXY)}>
125 {'Create a galaxy →'}
129 'You have the authority to create a new Galaxy and you can do so here.'
136 const outgoing = points.filter(point =>
137 hasTransferProxy(pointCache, point)
140 const outgoingPoints =
141 outgoing.length !== 0 ? (
143 <H2>{'Outgoing Transfers'}</H2>
145 {`You own these points until the recipient accepts the incoming
146 transfer. You may cancel the transfer until accepted.`}
148 <PointList routeHandler={history.push} points={outgoing} />
154 const incomingPoints =
155 incoming.length !== 0 ? (
157 <H2>{'Incoming Transfers'}</H2>
159 {`You do not own these points until you accept the incoming transfer.
160 You may reject any incoming transfers.`}
162 <PointList routeHandler={history.push} points={incoming} />
168 const managingPoints =
169 managing.length !== 0 ? (
171 <H2>{'You Are a Management Proxy For'}</H2>
173 {`You can configure or set network keys and conduct sponsorship
174 related operations for these points.`}
176 <PointList routeHandler={history.push} points={managing} />
183 voting.length !== 0 ? (
185 <H2>{'You Are a Voting Proxy For'}</H2>
187 {`Since you are part of the Galactic Senate, you can cast votes on
188 new Azimuth proposals on behalf of these points.`}
190 <PointList routeHandler={history.push} points={voting} />
196 const spawningPoints =
197 spawning.length !== 0 ? (
199 <H2>{'You Are a Spawn Proxy For'}</H2>
200 <P>{`You can create new child ships under these points.`}</P>
201 <PointList routeHandler={history.push} points={spawning} />
211 <P>{`A point is an identity on the Ethereum blockchain.
212 Points declare keys for ships on the Arvo network.`}</P>
222 <H2>{'Your Points'}</H2>
225 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