1import React from 'react'
2import { Row, Col, H1, H2, P } from '../components/Base'
3import { Button } from '../components/Base'
4import * as azimuth from 'azimuth-js'
6import PointList from '../components/PointList'
7import { ROUTE_NAMES } from '../lib/router'
10 addressFromSecp256k1Public,
12 } from '../lib/wallet'
14const hasTransferProxy = (cache, point) =>
16 ? !eqAddr(cache[point].transferProxy, ETH_ZERO_ADDR)
19class Points extends React.Component {
36 const { web3, wallet, contracts, addToPointCache } = this.props
39 contracts.chain(ctrcs =>
40 wallet.chain(async wal => {
41 const pub = wal.publicKey
42 const addr = addressFromSecp256k1Public(pub)
45 await azimuth.azimuth.getOwnedPoints(ctrcs, addr)
48 await azimuth.azimuth.getTransferringFor(ctrcs, addr)
51 await azimuth.azimuth.getManagerFor(ctrcs, addr)
54 await azimuth.azimuth.getVotingFor(ctrcs, addr)
57 await azimuth.azimuth.getSpawningFor(ctrcs, addr)
60 await azimuth.ecliptic.owner(ctrcs)
62 const eclipticOwner = eqAddr(addr, owner)
74 this.cachePoints(ctrcs, addToPointCache, points)
78 cachePoints(contracts, addToPointCache, points) {
79 points.forEach(point => {
80 azimuth.azimuth.getPoint(contracts, point)
81 .then(details => addToPointCache({ [point]: details }))
86 const { setPointCursor, pushRoute } = this.props
87 const { pointCache } = this.props
89 const { points, incoming, managing, voting, spawning, loading } = this.state
90 const { eclipticOwner } = this.state
92 const lookupPointButton =
98 onClick={ () => pushRoute(ROUTE_NAMES.VIEW_SHIP) }
103 { "View a point on Azimuth." }
108 const createGalaxyButton =
109 eclipticOwner === false
116 onClick={ () => pushRoute(ROUTE_NAMES.CREATE_GALAXY) }
118 { 'Create a galaxy →' }
121 { "You have the authority to create a new Galaxy and you can do so here." }
126 const outgoing = points.filter(point =>
127 hasTransferProxy(pointCache, point)
130 const outgoingPoints =
131 outgoing.length !== 0
133 <H2>{ 'Outgoing Transfers' }</H2>
135 { `You own these points until the recipient accepts the incoming
136 transfer. You may cancel the transfer until accepted.` }
139 setPointCursor={ setPointCursor }
140 routeHandler={ pushRoute }
146 const incomingPoints =
147 incoming.length !== 0
149 <H2>{ 'Incoming Transfers' }</H2>
151 { `You do not own these points until you accept the incoming transfer.
152 You may reject any incoming transfers.` }
155 setPointCursor={ setPointCursor }
156 routeHandler={ pushRoute }
162 const managingPoints =
163 managing.length !== 0
165 <H2>{ 'You Are a Management Proxy For' }</H2>
167 { `You can configure or set public keys and conduct sponsorship
168 related operations for these points.` }
171 setPointCursor={ setPointCursor }
172 routeHandler={ pushRoute }
181 <H2>{ 'You Are a Voting Proxy For' }</H2>
183 { `Since you are part of the Galactic Senate, you can cast votes on
184 new Azimuth proposals on behalf of these points.` }
187 setPointCursor={ setPointCursor }
188 routeHandler={ pushRoute }
194 const spawningPoints =
195 spawning.length !== 0
197 <H2>{ 'You Are a Spawn Proxy For' }</H2>
199 { `You can create new child ships under these points.` }
202 setPointCursor={ setPointCursor }
203 routeHandler={ pushRoute }
212 <H1>{ 'Points' }</H1>
214 <P>{`A point is an identity on the Ethereum blockchain.
215 Points declare keys for ships on the Arvo network.`}</P>
218 { lookupPointButton }
220 { createGalaxyButton }
226 <H2>{ 'Your Points' }</H2>
229 setPointCursor={ setPointCursor }
230 routeHandler={ pushRoute }
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