1import React from 'react';
2import { H2, H4 } from '../../components/old/Base';
4import { CURVE_ZERO_ADDR, isZeroAddress } from '../../lib/wallet';
5import { Grid } from 'indigo-react';
7const renderAddress = addr =>
8 isZeroAddress(addr) ? (
9 <div>{'(not set)'}</div>
13 <code>{addr.slice(0, 14)}</code>
16 <code>{addr.slice(14, 28)}</code>
19 <code>{addr.slice(28)}</code>
24const renderNetworkKey = hex => {
25 const sl = i => hex.slice(i, i + 4);
26 const rowFrom = i => `${sl(i)}.${sl(i + 4)}.${sl(i + 8)}.${sl(i + 12)}`;
27 return hex === CURVE_ZERO_ADDR ? (
28 <div>{'(not set)'}</div>
32 <code>{hex.slice(0, 2)}</code>
35 <code>{rowFrom(2)}</code>
38 <code>{rowFrom(18)}</code>
41 <code>{rowFrom(34)}</code>
44 <code>{rowFrom(50)}</code>
50const KeysAndMetadata = props => {
51 const { pointDetails } = props;
56 <H2>{'Ownership and Proxy Addresses'}</H2>
58 <Grid.Item fourth={1}>
60 {pointDetails.matchWith({
61 Nothing: () => <div />,
62 Just: deets => renderAddress(deets.value.owner),
65 <Grid.Item fourth={2}>
66 <H4>{'Transfer Proxy'}</H4>
67 {pointDetails.matchWith({
68 Nothing: () => <div />,
69 Just: deets => renderAddress(deets.value.transferProxy),
72 <Grid.Item fourth={3}>
73 <H4>{'Spawn Proxy'}</H4>
74 {pointDetails.matchWith({
75 Nothing: () => <div />,
76 Just: deets => renderAddress(deets.value.spawnProxy),
79 <Grid.Item fourth={4}>
80 <H4>{'Mgmt Proxy'}</H4>
81 {pointDetails.matchWith({
82 Nothing: () => <div />,
83 Just: deets => renderAddress(deets.value.managementProxy),
87 <UrbitNetworking pointDetails={pointDetails} />
93const UrbitNetworking = props => {
94 const { pointDetails } = props;
96 const booted = pointDetails.matchWith({
98 Just: details => details.value.keyRevisionNumber > 0,
101 const body = !booted ? (
102 <div>{'(not set)'}</div>
105 <Grid.Item third={1}>
106 <H4>{'Authentication'}</H4>
107 {pointDetails.matchWith({
108 Nothing: () => <div />,
109 Just: deets => renderNetworkKey(deets.value.authenticationKey),
112 <Grid.Item third={2}>
113 <H4>{'Encryption'}</H4>
114 {pointDetails.matchWith({
115 Nothing: () => <div />,
116 Just: deets => renderNetworkKey(deets.value.encryptionKey),
119 <Grid.Item third={3}>
120 <H4>{'Revision'}</H4>
121 {pointDetails.matchWith({
123 Just: deets => deets.value.keyRevisionNumber,
126 <H4>{'Continuity era'}</H4>
127 {pointDetails.matchWith({
129 Just: deets => deets.value.continuityNumber,
132 <H4>{'Crypto suite version'}</H4>
133 {pointDetails.matchWith({
135 Just: deets => deets.value.cryptoSuiteVersion,
143 <H2>{'Public Keys'}</H2>
150export 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