1import React from 'react';
2import { H2, H4 } from '../../components/old/Base';
4import { ETH_ZERO_ADDR, eqAddr } from '../../lib/wallet';
5import { Grid } from 'indigo-react';
8 '0x0000000000000000000000000000000000000000000000000000000000000000';
10const renderAddress = addr =>
11 eqAddr(addr, ETH_ZERO_ADDR) ? (
12 <div>{'(not set)'}</div>
16 <code>{addr.slice(0, 14)}</code>
19 <code>{addr.slice(14, 28)}</code>
22 <code>{addr.slice(28)}</code>
27const renderNetworkKey = hex => {
28 const sl = i => hex.slice(i, i + 4);
29 const rowFrom = i => `${sl(i)}.${sl(i + 4)}.${sl(i + 8)}.${sl(i + 12)}`;
30 return hex === NULL_KEY ? (
31 <div>{'(not set)'}</div>
35 <code>{hex.slice(0, 2)}</code>
38 <code>{rowFrom(2)}</code>
41 <code>{rowFrom(18)}</code>
44 <code>{rowFrom(34)}</code>
47 <code>{rowFrom(50)}</code>
53const KeysAndMetadata = props => {
54 const { pointDetails } = props;
59 <H2>{'Ownership and Proxy Addresses'}</H2>
61 <Grid.Item fourth={1}>
63 {pointDetails.matchWith({
64 Nothing: () => <div />,
65 Just: deets => renderAddress(deets.value.owner),
68 <Grid.Item fourth={2}>
69 <H4>{'Transfer Proxy'}</H4>
70 {pointDetails.matchWith({
71 Nothing: () => <div />,
72 Just: deets => renderAddress(deets.value.transferProxy),
75 <Grid.Item fourth={3}>
76 <H4>{'Spawn Proxy'}</H4>
77 {pointDetails.matchWith({
78 Nothing: () => <div />,
79 Just: deets => renderAddress(deets.value.spawnProxy),
82 <Grid.Item fourth={4}>
83 <H4>{'Mgmt Proxy'}</H4>
84 {pointDetails.matchWith({
85 Nothing: () => <div />,
86 Just: deets => renderAddress(deets.value.managementProxy),
90 <UrbitNetworking pointDetails={pointDetails} />
96const UrbitNetworking = props => {
97 const { pointDetails } = props;
99 const booted = pointDetails.matchWith({
101 Just: details => details.value.keyRevisionNumber > 0,
104 const body = !booted ? (
105 <div>{'(not set)'}</div>
108 <Grid.Item third={1}>
109 <H4>{'Authentication'}</H4>
110 {pointDetails.matchWith({
111 Nothing: () => <div />,
112 Just: deets => renderNetworkKey(deets.value.authenticationKey),
115 <Grid.Item third={2}>
116 <H4>{'Encryption'}</H4>
117 {pointDetails.matchWith({
118 Nothing: () => <div />,
119 Just: deets => renderNetworkKey(deets.value.encryptionKey),
122 <Grid.Item third={3}>
123 <H4>{'Revision'}</H4>
124 {pointDetails.matchWith({
126 Just: deets => deets.value.keyRevisionNumber,
129 <H4>{'Continuity era'}</H4>
130 {pointDetails.matchWith({
132 Just: deets => deets.value.continuityNumber,
135 <H4>{'Crypto suite version'}</H4>
136 {pointDetails.matchWith({
138 Just: deets => deets.value.cryptoSuiteVersion,
146 <H2>{'Public Keys'}</H2>
153export 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