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 {
35 const { web3, wallet, contracts, addToPointCache } = this.props
38 contracts.chain(ctrcs =>
39 wallet.chain(async wal => {
40 const pub = wal.publicKey
41 const addr = addressFromSecp256k1Public(pub)
44 await azimuth.azimuth.getOwnedPoints(ctrcs, addr)
47 await azimuth.azimuth.getTransferringFor(ctrcs, addr)
50 await azimuth.azimuth.getManagerFor(ctrcs, addr)
53 await azimuth.azimuth.getVotingFor(ctrcs, addr)
56 await azimuth.azimuth.getSpawningFor(ctrcs, addr)
59 await azimuth.ecliptic.owner(ctrcs)
61 const eclipticOwner = eqAddr(addr, owner)
72 this.cachePoints(ctrcs, addToPointCache, points)
76 cachePoints(contracts, addToPointCache, points) {
77 points.forEach(point => {
78 azimuth.azimuth.getPoint(contracts, point)
79 .then(details => addToPointCache({ [point]: details }))
84 const { setPointCursor, pushRoute } = this.props
85 const { pointCache } = this.props
87 const { points, incoming, managing, voting, spawning } = this.state
88 const { eclipticOwner } = this.state
90 const lookupPointButton =
96 onClick={ () => pushRoute(ROUTE_NAMES.VIEW_SHIP) }
101 { "View a point on Azimuth." }
106 const createGalaxyButton =
107 eclipticOwner === false
114 onClick={ () => pushRoute(ROUTE_NAMES.CREATE_GALAXY) }
116 { 'Create a galaxy →' }
119 { "You have the authority to create a new Galaxy and you can do so here." }
124 const outgoing = points.filter(point =>
125 hasTransferProxy(pointCache, point)
128 const outgoingPoints =
129 outgoing.length !== 0
131 <H2>{ 'Outgoing Transfers' }</H2>
133 { `You own these points until the recipient accepts the incoming
134 transfer. You may cancel the transfer until accepted.` }
137 setPointCursor={ setPointCursor }
138 routeHandler={ pushRoute }
144 const incomingPoints =
145 incoming.length !== 0
147 <H2>{ 'Incoming Transfers' }</H2>
149 { `You do not own these points until you accept the incoming transfer.
150 You may reject any incoming transfers.` }
153 setPointCursor={ setPointCursor }
154 routeHandler={ pushRoute }
160 const managingPoints =
161 managing.length !== 0
163 <H2>{ 'You Are a Management Proxy For' }</H2>
165 { `You can configure or set Urbit networking keys and conduct
166 sponsorship related operations for these points.` }
169 setPointCursor={ setPointCursor }
170 routeHandler={ pushRoute }
179 <H2>{ 'You Are a Voting Proxy For' }</H2>
181 { `Since you are part of the Galactic Senate, you can cast votes on
182 new Azimuth proposals on behalf of these points.` }
185 setPointCursor={ setPointCursor }
186 routeHandler={ pushRoute }
192 const spawningPoints =
193 spawning.length !== 0
195 <H2>{ 'You Are a Spawn Proxy For' }</H2>
197 { `You can create new child ships under these points.` }
200 setPointCursor={ setPointCursor }
201 routeHandler={ pushRoute }
210 <H1>{ 'Points' }</H1>
212 <P>{`A point is an identity on the Ethereum blockchain.
213 Points declare keys for ships on the Arvo network.`}</P>
216 { lookupPointButton }
218 { createGalaxyButton }
224 <H2>{ 'Your Points' }</H2>
227 setPointCursor={ setPointCursor }
228 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