1import React from 'react';
2import { H2, H4 } from '../../components/old/Base';
4import { isZeroAddress } from '../../lib/wallet';
5import { Grid } from 'indigo-react';
6import { CURVE_ZERO_ADDR } from 'lib/keys';
8const renderAddress = addr =>
9 isZeroAddress(addr) ? (
10 <div>{'(not set)'}</div>
14 <code>{addr.slice(0, 14)}</code>
17 <code>{addr.slice(14, 28)}</code>
20 <code>{addr.slice(28)}</code>
25const renderNetworkKey = hex => {
26 const sl = i => hex.slice(i, i + 4);
27 const rowFrom = i => `${sl(i)}.${sl(i + 4)}.${sl(i + 8)}.${sl(i + 12)}`;
28 return hex === CURVE_ZERO_ADDR ? (
29 <div>{'(not set)'}</div>
33 <code>{hex.slice(0, 2)}</code>
36 <code>{rowFrom(2)}</code>
39 <code>{rowFrom(18)}</code>
42 <code>{rowFrom(34)}</code>
45 <code>{rowFrom(50)}</code>
51const KeysAndMetadata = props => {
52 const { pointDetails } = props;
57 <H2>{'Ownership and Proxy Addresses'}</H2>
59 <Grid.Item fourth={1}>
61 {pointDetails.matchWith({
62 Nothing: () => <div />,
63 Just: deets => renderAddress(deets.value.owner),
66 <Grid.Item fourth={2}>
67 <H4>{'Transfer Proxy'}</H4>
68 {pointDetails.matchWith({
69 Nothing: () => <div />,
70 Just: deets => renderAddress(deets.value.transferProxy),
73 <Grid.Item fourth={3}>
74 <H4>{'Spawn Proxy'}</H4>
75 {pointDetails.matchWith({
76 Nothing: () => <div />,
77 Just: deets => renderAddress(deets.value.spawnProxy),
80 <Grid.Item fourth={4}>
81 <H4>{'Mgmt Proxy'}</H4>
82 {pointDetails.matchWith({
83 Nothing: () => <div />,
84 Just: deets => renderAddress(deets.value.managementProxy),
88 <UrbitNetworking pointDetails={pointDetails} />
94const UrbitNetworking = props => {
95 const { pointDetails } = props;
97 const booted = pointDetails.matchWith({
99 Just: details => details.value.keyRevisionNumber > 0,
102 const body = !booted ? (
103 <div>{'(not set)'}</div>
106 <Grid.Item third={1}>
107 <H4>{'Authentication'}</H4>
108 {pointDetails.matchWith({
109 Nothing: () => <div />,
110 Just: deets => renderNetworkKey(deets.value.authenticationKey),
113 <Grid.Item third={2}>
114 <H4>{'Encryption'}</H4>
115 {pointDetails.matchWith({
116 Nothing: () => <div />,
117 Just: deets => renderNetworkKey(deets.value.encryptionKey),
120 <Grid.Item third={3}>
121 <H4>{'Revision'}</H4>
122 {pointDetails.matchWith({
124 Just: deets => deets.value.keyRevisionNumber,
127 <H4>{'Continuity era'}</H4>
128 {pointDetails.matchWith({
130 Just: deets => deets.value.continuityNumber,
133 <H4>{'Crypto suite version'}</H4>
134 {pointDetails.matchWith({
136 Just: deets => deets.value.cryptoSuiteVersion,
144 <H2>{'Public Keys'}</H2>
151export 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