1import React from 'react';
2import { Nothing } from 'folktale/maybe';
3import { H1, H2, P, Grid } from 'indigo-react';
5import { ROUTE_NAMES } from 'lib/routeNames';
6import { isZeroAddress } from 'lib/wallet';
7import useIsEclipticOwner from 'lib/useIsEclipticOwner';
8import { useSyncKnownPoints } from 'lib/useSyncPoints';
10import { useHistory } from 'store/history';
11import { useWallet } from 'store/wallet';
12import { usePointCache } from 'store/pointCache';
14import PointList from 'components/old/PointList';
15import View from 'components/View';
16import { ForwardButton } from 'components/Buttons';
17import useLifecycle from 'lib/useLifecycle';
19const matchArray = obj =>
20 obj.matchWith({ Nothing: () => [], Just: p => p.value });
22const hasTransferProxy = (details, point) =>
23 !isZeroAddress(details.transferProxy);
25export default function Points() {
26 const { wallet } = useWallet();
27 const history = useHistory();
39 } = getControlledPoints(wallet);
40 const isEclipticOwner = useIsEclipticOwner();
42 const owned = matchArray(ownedPoints);
43 const incoming = matchArray(incomingPoints);
44 const managing = matchArray(managingPoints);
45 const voting = matchArray(votingPoints);
46 const spawning = matchArray(spawningPoints);
48 // sync controlled points on mount
50 syncControlledPoints();
53 // sync display details for known points
62 const loading = Nothing.hasInstance(ownedPoints);
64 const outgoing = ownedPoints.filter(point =>
65 getDetails(point).matchWith({
67 Just: p => hasTransferProxy(p.value),
76 A point is an identity on the Ethereum blockchain. Points declare keys
77 for ships on the Arvo network.
83 detail="View a point on Azimuth"
84 onClick={() => history.push(ROUTE_NAMES.VIEW_POINT)}>
94 detail="You have the authority to create a new Galaxy."
95 onClick={() => history.push(ROUTE_NAMES.CREATE_GALAXY)}>
102 {incoming.length > 0 && (
104 <H2>Incoming Transfers</H2>
106 You do not own these points until you accept the incoming transfer.
107 You may reject any incoming transfers.
109 <PointList routeHandler={history.push} points={incoming} />
113 {outgoing.length > 0 && (
115 <H2>Outgoing Transfers</H2>
117 You own these points until the recipient accepts the incoming
118 transfer. You may cancel the transfer until accepted.
120 <PointList routeHandler={history.push} points={outgoing} />
126 <PointList routeHandler={history.push} points={owned} loading={loading} />
128 {managing.length > 0 && (
130 <H2>You Are a Management Proxy For</H2>
132 You can configure or set network keys and conduct sponsorship
133 related operations for these points.
135 <PointList routeHandler={history.push} points={managing} />
139 {voting.length > 0 && (
141 <H2>You Are a Voting Proxy For</H2>
143 Since you are part of the Galactic Senate, you can cast votes on new
144 Azimuth proposals on behalf of these points.
146 <PointList routeHandler={history.push} points={voting} />
150 {spawning.length > 0 && (
152 <H2>You Are a Spawn Proxy For</H2>
153 <P>You can create new child points under these points.</P>
154 <PointList routeHandler={history.push} points={spawning} />
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