1import React from 'react';
2import { Row, Col, H2, H4 } from '../../components/old/Base';
4import { ETH_ZERO_ADDR, eqAddr } from '../../lib/wallet';
7 '0x0000000000000000000000000000000000000000000000000000000000000000';
9const renderAddress = addr =>
10 eqAddr(addr, ETH_ZERO_ADDR) ? (
11 <div>{'(not set)'}</div>
15 <code>{addr.slice(0, 14)}</code>
18 <code>{addr.slice(14, 28)}</code>
21 <code>{addr.slice(28)}</code>
26const renderNetworkKey = hex => {
27 const sl = i => hex.slice(i, i + 4);
28 const rowFrom = i => `${sl(i)}.${sl(i + 4)}.${sl(i + 8)}.${sl(i + 12)}`;
29 return hex === NULL_KEY ? (
30 <div>{'(not set)'}</div>
34 <code>{hex.slice(0, 2)}</code>
37 <code>{rowFrom(2)}</code>
40 <code>{rowFrom(18)}</code>
43 <code>{rowFrom(34)}</code>
46 <code>{rowFrom(50)}</code>
52const KeysAndMetadata = props => {
53 const { pointDetails } = props;
58 <H2>{'Ownership and Proxy Addresses'}</H2>
61 <Col className={'flex flex-column items-start col-md-3'}>
63 {pointDetails.matchWith({
64 Nothing: () => <div />,
65 Just: deets => renderAddress(deets.value.owner),
69 <Col className={'flex flex-column items-start col-md-3'}>
70 <H4>{'Transfer Proxy'}</H4>
71 {pointDetails.matchWith({
72 Nothing: () => <div />,
73 Just: deets => renderAddress(deets.value.transferProxy),
77 <Col className={'flex flex-column items-start col-md-3'}>
78 <H4>{'Spawn Proxy'}</H4>
79 {pointDetails.matchWith({
80 Nothing: () => <div />,
81 Just: deets => renderAddress(deets.value.spawnProxy),
85 <Col className={'flex flex-column items-start col-md-3'}>
86 <H4>{'Mgmt Proxy'}</H4>
87 {pointDetails.matchWith({
88 Nothing: () => <div />,
89 Just: deets => renderAddress(deets.value.managementProxy),
94 <UrbitNetworking pointDetails={pointDetails} />
100const UrbitNetworking = props => {
101 const { pointDetails } = props;
103 const booted = pointDetails.matchWith({
105 Just: details => details.value.keyRevisionNumber > 0,
108 const body = !booted ? (
109 <div>{'(not set)'}</div>
112 <Col className={'flex flex-column items-start col-md-4'}>
113 <H4>{'Authentication'}</H4>
114 {pointDetails.matchWith({
115 Nothing: () => <div />,
116 Just: deets => renderNetworkKey(deets.value.authenticationKey),
120 <Col className={'flex flex-column items-start col-md-4'}>
121 <H4>{'Encryption'}</H4>
122 {pointDetails.matchWith({
123 Nothing: () => <div />,
124 Just: deets => renderNetworkKey(deets.value.encryptionKey),
128 <Col className={'flex flex-column items-start col-md-4'}>
129 <H4>{'Revision'}</H4>
130 {pointDetails.matchWith({
132 Just: deets => deets.value.keyRevisionNumber,
135 <H4>{'Continuity era'}</H4>
136 {pointDetails.matchWith({
138 Just: deets => deets.value.continuityNumber,
141 <H4>{'Crypto suite version'}</H4>
142 {pointDetails.matchWith({
144 Just: deets => deets.value.cryptoSuiteVersion,
152 <H2>{'Public Keys'}</H2>
159export default KeysAndMetadata;
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