on master help sign in
formatting update
commitb7e6d6f8b90e609dbc1350effb44ec59d5e8d504 authorMatt Condon (shrugs) <mattgcondon@gmail.com> dateTue 11 Jun 2019, 12:03 (7 years ago) parente7ea855
44 files changed+1241−1345
src/bridge/Bridge.js+22−23 src/bridge/components/DropdownItem.js+1−3 src/bridge/components/Header.js+12−13 src/bridge/components/HorizontalSelector.js+1−3 src/bridge/components/OldHeader.js+26−30 src/bridge/components/RenderedPoint.js+15−18 src/bridge/components/StatelessTransaction.js+95−102 src/bridge/components/icons/Chevron.js+1−3 src/bridge/lib/flags.js+1−1 src/bridge/lib/invite.js+67−67 src/bridge/lib/keys.js+20−20 src/bridge/lib/routeNames.js+29−29 src/bridge/lib/router.js+55−55 src/bridge/lib/wallet.js+38−38 src/bridge/lib/web3.js+6−8 src/bridge/store/history.js+4−4 src/bridge/store/txnConfirmations.js+2−3 src/bridge/views/AcceptTransfer.js+23−25 src/bridge/views/CancelTransfer.js+12−12 src/bridge/views/CreateGalaxy.js+39−43 src/bridge/views/GenKeyfile.js+22−23 src/bridge/views/InviteTicket.js+34−40 src/bridge/views/InvitesManage.js+22−24 src/bridge/views/InvitesSend.js+69−72 src/bridge/views/IssueChild.js+42−46 src/bridge/views/Keystore.js+33−37 src/bridge/views/Landing.js+24−27 src/bridge/views/Ledger.js+63−67 src/bridge/views/Mnemonic.js+28−32 src/bridge/views/Network.js+30−35 src/bridge/views/Point.js+17−17 src/bridge/views/Point/Actions.js+55−65 src/bridge/views/Points.js+30−32 src/bridge/views/PrivateKey.js+18−20 src/bridge/views/SentTransaction.js+34−37 src/bridge/views/SetKeys.js+36−36 src/bridge/views/SetProxy.js+29−31 src/bridge/views/Shards.js+46−53 src/bridge/views/Ticket.js+31−34 src/bridge/views/Transfer.js+25−27 src/bridge/views/Trezor.js+34−37 src/bridge/views/ViewPoint.js+17−19 src/bridge/views/Wallet.js+24−25 src/walletgen/lib/lib.js+9−9
src/bridge/Bridge.js+22−23
@@ -1,25 +1,25 @@
1−import React from "react";
2−import { Just, Nothing } from "folktale/maybe";
3−import { includes } from "lodash";
1+import React from 'react';
2+import { Just, Nothing } from 'folktale/maybe';
3+import { includes } from 'lodash';
44
5−import Footer from "./components/Footer";
6−import Header from "./components/Header";
7−import { Container, Row, Col } from "./components/Base";
5+import Footer from './components/Footer';
6+import Header from './components/Header';
7+import { Container, Row, Col } from './components/Base';
88
9−import { router } from "./lib/router";
10−import { initWeb3 } from "./lib/web3";
11−import { ROUTE_NAMES } from "./lib/routeNames";
12−import { HistoryProvider, withHistory, useHistory } from "./store/history";
13−import { TxnConfirmationsProvider } from "./store/txnConfirmations";
14−import { NETWORK_NAMES } from "./lib/network";
9+import { router } from './lib/router';
10+import { initWeb3 } from './lib/web3';
11+import { ROUTE_NAMES } from './lib/routeNames';
12+import { HistoryProvider, withHistory, useHistory } from './store/history';
13+import { TxnConfirmationsProvider } from './store/txnConfirmations';
14+import { NETWORK_NAMES } from './lib/network';
1515import {
1616 WALLET_NAMES,
1717 DEFAULT_HD_PATH,
1818 walletFromMnemonic,
1919 addressFromSecp256k1Public,
20−} from "./lib/wallet";
21−import { BRIDGE_ERROR } from "./lib/error";
22−import { isLocal } from "./lib/flags";
20+} from './lib/wallet';
21+import { BRIDGE_ERROR } from './lib/error';
22+import { isLocal } from './lib/flags';
2323
2424// NB(shrugs): toggle this variable to use the default local state.
2525// don't commit changes to this line, but there shouldn't be a problem
@@ -51,13 +51,12 @@ const VariableWidthColumn = withHistory(({ history, children }) => (
5151 <Col
5252 className={
5353 history.includes(ROUTE_NAMES.INVITE_TICKET)
54− ? "col-md-12"
55− : "col-md-offset-1 col-md-10"
54+ ? 'col-md-12'
55+ : 'col-md-offset-1 col-md-10'
5656 }
5757 style={
58− history.includes(ROUTE_NAMES.INVITE_TICKET) ? {} : { maxWidth: "620px" }
59− }
60− >
58+ history.includes(ROUTE_NAMES.INVITE_TICKET) ? {} : { maxWidth: '620px' }
59+ }>
6160 {children}
6261 </Col>
6362));
@@ -192,7 +191,7 @@ class Bridge extends React.Component {
192191 wallet = walletFromMnemonic(
193192 mnemonic,
194193 DEFAULT_HD_PATH,
195− urbitWallet.value.meta.passphrase,
194+ urbitWallet.value.meta.passphrase
196195 );
197196 wallet.map(wal => {
198197 wal.address = urbitWallet.value.ownership.keys.address;
@@ -250,7 +249,7 @@ class Bridge extends React.Component {
250249 pointCursor={pointCursor}
251250 />
252251
253− <Row className={"row wrapper"}>
252+ <Row className={'row wrapper'}>
254253 <Router
255254 // network
256255 setNetworkType={this.setNetworkType}
@@ -284,7 +283,7 @@ class Bridge extends React.Component {
284283 txnHashCursor={txnHashCursor}
285284 />
286285
287− <div className={"push"} />
286+ <div className={'push'} />
288287 </Row>
289288
290289 <Footer />
src/bridge/components/DropdownItem.js+1−3
@@ -10,9 +10,7 @@ const DropdownItem = props => {
1010 <button
1111 disabled={props.disabled}
1212 style={props.style}
13− className={`h-10 m-0 p-0 ph-2 bg-white flex align-center items-start bs-solid brw-2 blw-2 btw-0 bbw-0 sans ${_disabled} ${
14− props.className
15− }`}
13+ className={`h-10 m-0 p-0 ph-2 bg-white flex align-center items-start bs-solid brw-2 blw-2 btw-0 bbw-0 sans ${_disabled} ${props.className}`}
1614 onClick={props.onClick}>
1715 {props.children}
1816 </button>
src/bridge/components/Header.js+12−13
@@ -1,10 +1,10 @@
1−import React from "react";
2−import { Button, Chevron } from "../components/Base";
1+import React from 'react';
2+import { Button, Chevron } from '../components/Base';
33
4−import { getRouteBreadcrumb } from "../lib/router";
5−import { ROUTE_NAMES } from "../lib/routeNames";
6−import { useHistory } from "../store/history";
7−import { isLast } from "../lib/lib";
4+import { getRouteBreadcrumb } from '../lib/router';
5+import { ROUTE_NAMES } from '../lib/routeNames';
6+import { useHistory } from '../store/history';
7+import { isLast } from '../lib/lib';
88
99function Crumbs(props) {
1010 const history = useHistory();
@@ -13,20 +13,19 @@ function Crumbs(props) {
1313 // return the reversed array of renders
1414 const rendered = history.routes.map((route, idx) => {
1515 return (
16− <div className={"flex items-center"} key={`history-${idx}`}>
16+ <div className={'flex items-center'} key={`history-${idx}`}>
1717 <Button
18− prop-type={"link"}
19− prop-size={"sm"}
18+ prop-type={'link'}
19+ prop-size={'sm'}
2020 key={`history-button-${idx}`}
21− onClick={() => history.pop(history.size - idx - 1)}
22− >
21+ onClick={() => history.pop(history.size - idx - 1)}>
2322 {getRouteBreadcrumb(props, route)}
2423 </Button>
2524
2625 {isLast(history.size, idx) ? (
2726 <div />
2827 ) : (
29− <Chevron className={"h-4 mh-2"} />
28+ <Chevron className={'h-4 mh-2'} />
3029 )}
3130 </div>
3231 );
@@ -42,7 +41,7 @@ function Header(props) {
4241
4342 if (showCrumbs) {
4443 return (
45− <div className={"flex items-center h-10"}>
44+ <div className={'flex items-center h-10'}>
4645 <Crumbs
4746 networkType={props.networkType}
4847 wallet={props.wallet}
src/bridge/components/HorizontalSelector.js+1−3
@@ -22,9 +22,7 @@ class HorizontalSelector extends React.Component {
2222 let active = opt.value === this.state.option ? 'btn-primary active' : '';
2323 return (
2424 <button
25− className={`btn ${active} h-10 ph-4 flex sans ${
26− this.props.className
27− }`}
25+ className={`btn ${active} h-10 ph-4 flex sans ${this.props.className}`}
2826 value={opt.value}
2927 onClick={() => this.selectOption(opt.value)}>
3028 {opt.title}
src/bridge/components/OldHeader.js+26−30
@@ -1,8 +1,8 @@
11import React from 'react';
22import { Button, Chevron } from '../components/Base';
33
4−import { getRouteBreadcrumb } from '../lib/router'
5−import { isLast } from '../lib/lib'
4+import { getRouteBreadcrumb } from '../lib/router';
5+import { isLast } from '../lib/lib';
66
77const Crumbs = props => {
88 const { routeCrumbs, skipRoute } = props;
@@ -11,34 +11,30 @@ const Crumbs = props => {
1111 // FIXME probably more straightforward to render them normally and just
1212 // return the reversed array of renders
1313 const rendered = history.map((route, idx) => {
14−
15− return (
16− <div className={'flex items-center'} key={ `history-${idx}` }>
17−
18− <Button
19− size={'s'}
20− type={'link'}
21− color={'black'}
22− key={ `history-button-${idx}` }
23− onClick={ () => skipRoute(history.size - idx - 1) }
24− >
25− { `${getRouteBreadcrumb(props, route)}` }
26− </Button>
27−
28− {
29− isLast(history.size, idx)
30− ? <div />
31− : <Chevron className={'h-4 mh-2'} />
32− }
33−
34− </div>
35− )
36− })
37−
38− return rendered
39−}
40−
41−const Header = (props) =>
14+ return (
15+ <div className={'flex items-center'} key={`history-${idx}`}>
16+ <Button
17+ size={'s'}
18+ type={'link'}
19+ color={'black'}
20+ key={`history-button-${idx}`}
21+ onClick={() => skipRoute(history.size - idx - 1)}>
22+ {`${getRouteBreadcrumb(props, route)}`}
23+ </Button>
24+
25+ {isLast(history.size, idx) ? (
26+ <div />
27+ ) : (
28+ <Chevron className={'h-4 mh-2'} />
29+ )}
30+ </div>
31+ );
32+ });
33+
34+ return rendered;
35+};
36+
37+const Header = props => (
4238 <div className={'flex items-center h-8 pt-4'}>
4339 <Crumbs
4440 routeCrumbs={props.routeCrumbs}
src/bridge/components/RenderedPoint.js+15−18
@@ -1,12 +1,12 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import { Col } from "./Base";
4−import { Button } from "./Base";
5−import { pour } from "sigil-js";
6−import * as ob from "urbit-ob";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import { Col } from './Base';
4+import { Button } from './Base';
5+import { pour } from 'sigil-js';
6+import * as ob from 'urbit-ob';
77
8−import { ROUTE_NAMES } from "../lib/routeNames";
9−import ReactSVGComponents from "./ReactSVGComponents";
8+import { ROUTE_NAMES } from '../lib/routeNames';
9+import ReactSVGComponents from './ReactSVGComponents';
1010
1111const RenderedPoint = props => {
1212 const { setPointCursor, routeHandler, point } = props;
@@ -19,15 +19,14 @@ const RenderedPoint = props => {
1919 });
2020
2121 return (
22− <Col className={"col-md-3 mb-8"} key={`rendered-${point}`}>
22+ <Col className={'col-md-3 mb-8'} key={`rendered-${point}`}>
2323 <div
2424 key={`rendered-sigil-${point}`}
2525 className="clickable"
2626 onClick={() => {
2727 setPointCursor(Maybe.Just(point));
2828 routeHandler(ROUTE_NAMES.SHIP);
29− }}
30− >
29+ }}>
3130 {sigil}
3231 </div>
3332 <div
@@ -36,21 +35,19 @@ const RenderedPoint = props => {
3635 onClick={() => {
3736 setPointCursor(Maybe.Just(point));
3837 routeHandler(ROUTE_NAMES.SHIP);
39− }}
40− >
38+ }}>
4139 <code>{name}</code>
4240 </div>
4341 <div key={`rendered-deets-${point}`}>
4442 <Button
4543 key={`rendered-deets-button-${point}`}
46− prop-type={"link"}
47− prop-size={"sm"}
44+ prop-type={'link'}
45+ prop-size={'sm'}
4846 onClick={() => {
4947 setPointCursor(Maybe.Just(point));
5048 routeHandler(ROUTE_NAMES.SHIP);
51− }}
52− >
53− {"Details →"}
49+ }}>
50+ {'Details →'}
5451 </Button>
5552 </div>
5653 </Col>
src/bridge/components/StatelessTransaction.js+95−102
@@ -1,17 +1,17 @@
1−import { Nothing, Just } from "folktale/maybe";
2−import { Ok } from "folktale/result";
3−import React from "react";
4−import * as need from "../lib/need";
1+import { Nothing, Just } from 'folktale/maybe';
2+import { Ok } from 'folktale/result';
3+import React from 'react';
4+import * as need from '../lib/need';
55
6−import { Code, H3 } from "./Base";
7−import { Button } from "./Base";
8−import { CheckboxButton, Input, InnerLabel, InnerLabelDropdown } from "./Base";
9−import { Warning } from "../components/Base";
6+import { Code, H3 } from './Base';
7+import { Button } from './Base';
8+import { CheckboxButton, Input, InnerLabel, InnerLabelDropdown } from './Base';
9+import { Warning } from '../components/Base';
1010
11−import { BRIDGE_ERROR } from "../lib/error";
12−import { ROUTE_NAMES } from "../lib/routeNames";
13−import { withHistory } from "../store/history";
14−import * as tank from "../lib/tank";
11+import { BRIDGE_ERROR } from '../lib/error';
12+import { ROUTE_NAMES } from '../lib/routeNames';
13+import { withHistory } from '../store/history';
14+import * as tank from '../lib/tank';
1515
1616import {
1717 sendSignedTransaction,
@@ -20,14 +20,14 @@ import {
2020 hexify,
2121 renderSignedTx,
2222 signTransaction,
23−} from "../lib/txn";
24−import { withTxnConfirmations } from "../store/txnConfirmations";
23+} from '../lib/txn';
24+import { withTxnConfirmations } from '../store/txnConfirmations';
2525
2626const SUBMISSION_STATES = {
27− PROMPT: "Send transaction",
28− PREPARING: "Preparing...",
29− FUNDING: "Finding transaction funding...",
30− SENDING: "Sending transaction...",
27+ PROMPT: 'Send transaction',
28+ PREPARING: 'Preparing...',
29+ FUNDING: 'Finding transaction funding...',
30+ SENDING: 'Sending transaction...',
3131};
3232
3333class StatelessTransaction extends React.Component {
@@ -35,13 +35,13 @@ class StatelessTransaction extends React.Component {
3535 super(props);
3636
3737 this.state = {
38− gasPrice: "5",
39− gasLimit: "600000",
38+ gasPrice: '5',
39+ gasLimit: '600000',
4040 showGasDetails: false,
4141 userApproval: false,
42− chainId: "1",
42+ chainId: '1',
4343 customChain: false,
44− nonce: "0",
44+ nonce: '0',
4545 stx: Nothing(),
4646 txn: Nothing(),
4747 txStatus: SUBMISSION_STATES.PROMPT,
@@ -82,7 +82,7 @@ class StatelessTransaction extends React.Component {
8282 const txMetadata = {
8383 nonce: r[0],
8484 chainId: r[1],
85− gasPrice: fromWei(r[2], "gwei"),
85+ gasPrice: fromWei(r[2], 'gwei'),
8686 };
8787
8888 this.setState({ ...txMetadata });
@@ -188,12 +188,12 @@ class StatelessTransaction extends React.Component {
188188 try {
189189 this.setState({ txStatus: SUBMISSION_STATES.PREPARING });
190190 const res = await props.beforeSend(stx);
191− if (res === false) throw new Error("beforeSend disallowed sending");
191+ if (res === false) throw new Error('beforeSend disallowed sending');
192192 } catch (e) {
193− console.log("beforeSend error", e);
193+ console.log('beforeSend error', e);
194194 this.setState({
195195 txStatus: SUBMISSION_STATES.PROMPT,
196− txError: Just("Something went wrong!"),
196+ txError: Just('Something went wrong!'),
197197 });
198198 return;
199199 }
@@ -202,7 +202,7 @@ class StatelessTransaction extends React.Component {
202202 this.setState({ txStatus: SUBMISSION_STATES.FUNDING });
203203
204204 const rawTx = hexify(stx.serialize());
205− const cost = state.gasLimit * toWei(state.gasPrice, "gwei");
205+ const cost = state.gasLimit * toWei(state.gasPrice, 'gwei');
206206
207207 const address = need.address(props);
208208 let balance = await web3.eth.getBalance(address);
@@ -232,7 +232,7 @@ class StatelessTransaction extends React.Component {
232232 web3,
233233 state.stx,
234234 usedTank,
235− props.setTxnConfirmations,
235+ props.setTxnConfirmations
236236 )
237237 .then(txHash => {
238238 props.onSent(Just(Ok(txHash)), state.stx.value);
@@ -271,13 +271,13 @@ class StatelessTransaction extends React.Component {
271271
272272 getChainTitle(chainId) {
273273 let map = {
274− "1": "Mainnet - 1",
275− "2": "Morden - 2",
276− "3": "Ropsten - 3",
277− "4": "Goerli - 4",
278− "42": "Kovan - 42",
279− "1337": "Geth private chains - 1337",
280− custom: "Custom",
274+ '1': 'Mainnet - 1',
275+ '2': 'Morden - 2',
276+ '3': 'Ropsten - 3',
277+ '4': 'Goerli - 4',
278+ '42': 'Kovan - 42',
279+ '1337': 'Geth private chains - 1337',
280+ custom: 'Custom',
281281 };
282282
283283 return map[chainId];
@@ -286,32 +286,32 @@ class StatelessTransaction extends React.Component {
286286 getChainOptions() {
287287 return [
288288 {
289− title: this.getChainTitle("1"),
290− value: "1",
289+ title: this.getChainTitle('1'),
290+ value: '1',
291291 },
292292 {
293− title: this.getChainTitle("2"),
294− value: "2",
293+ title: this.getChainTitle('2'),
294+ value: '2',
295295 },
296296 {
297− title: this.getChainTitle("3"),
298− value: "3",
297+ title: this.getChainTitle('3'),
298+ value: '3',
299299 },
300300 {
301− title: this.getChainTitle("4"),
302− value: "4",
301+ title: this.getChainTitle('4'),
302+ value: '4',
303303 },
304304 {
305− title: this.getChainTitle("42"),
306− value: "42",
305+ title: this.getChainTitle('42'),
306+ value: '42',
307307 },
308308 {
309− title: this.getChainTitle("1337"),
310− value: "1337",
309+ title: this.getChainTitle('1337'),
310+ value: '1337',
311311 },
312312 {
313− title: this.getChainTitle("custom"),
314− value: "custom",
313+ title: this.getChainTitle('custom'),
314+ value: 'custom',
315315 },
316316 ];
317317 }
@@ -351,27 +351,26 @@ class StatelessTransaction extends React.Component {
351351
352352 const chainOptions = this.getChainOptions();
353353
354− const generateButtonColor = Nothing.hasInstance(txn) ? "blue" : "green";
354+ const generateButtonColor = Nothing.hasInstance(txn) ? 'blue' : 'green';
355355
356− const signerButtonColor = Nothing.hasInstance(stx) ? "blue" : "green";
356+ const signerButtonColor = Nothing.hasInstance(stx) ? 'blue' : 'green';
357357
358358 const generateTxnButton = (
359359 <Button
360− className={"mt-8"}
360+ className={'mt-8'}
361361 disabled={!canGenerate}
362362 prop-color={generateButtonColor}
363− prop-size={"lg wide"}
364− onClick={createUnsignedTxn}
365− >
366− {"Generate Transaction"}
363+ prop-size={'lg wide'}
364+ onClick={createUnsignedTxn}>
365+ {'Generate Transaction'}
367366 </Button>
368367 );
369368
370369 const unsignedTxnDisplay = txn.matchWith({
371− Nothing: _ => "",
370+ Nothing: _ => '',
372371 Just: tx => (
373372 <React.Fragment>
374− <H3 className={"mt-8"}>{"Unsigned Transaction"}</H3>
373+ <H3 className={'mt-8'}>{'Unsigned Transaction'}</H3>
375374 <Code>{JSON.stringify(tx.value, null, 2)}</Code>
376375 </React.Fragment>
377376 ),
@@ -417,48 +416,45 @@ class StatelessTransaction extends React.Component {
417416
418417 const gasPriceDialogue = (
419418 <Input
420− className={"mono mt-4"}
421− prop-size={"md"}
422− prop-format={"innerLabel"}
419+ className={'mono mt-4'}
420+ prop-size={'md'}
421+ prop-format={'innerLabel'}
423422 value={gasPrice}
424− onChange={setGasPrice}
425− >
426− <InnerLabel>{"Gas Price (gwei)"}</InnerLabel>
423+ onChange={setGasPrice}>
424+ <InnerLabel>{'Gas Price (gwei)'}</InnerLabel>
427425 </Input>
428426 );
429427
430428 const gasLimitDialogue = (
431429 <Input
432− className={"mono mt-4"}
433− prop-size={"md"}
434− prop-format={"innerLabel"}
430+ className={'mono mt-4'}
431+ prop-size={'md'}
432+ prop-format={'innerLabel'}
435433 value={gasLimit}
436− onChange={setGasLimit}
437− >
438− <InnerLabel>{"Gas Limit"}</InnerLabel>
434+ onChange={setGasLimit}>
435+ <InnerLabel>{'Gas Limit'}</InnerLabel>
439436 </Input>
440437 );
441438
442439 const nonceDialogue = (
443440 <Input
444− className={"mono mt-4 mb-4"}
445− prop-size={"md"}
446− prop-format={"innerLabel"}
441+ className={'mono mt-4 mb-4'}
442+ prop-size={'md'}
443+ prop-format={'innerLabel'}
447444 value={nonce}
448− onChange={setNonce}
449− >
450− <InnerLabel>{"Nonce"}</InnerLabel>
445+ onChange={setNonce}>
446+ <InnerLabel>{'Nonce'}</InnerLabel>
451447 </Input>
452448 );
453449
454450 const chainDialogueTitle = customChain
455− ? "Custom"
451+ ? 'Custom'
456452 : this.getChainTitle(chainId);
457453 const chainDialogue = (
458454 <InnerLabelDropdown
459− className={"mt-6"}
455+ className={'mt-6'}
460456 fullWidth={true}
461− title={"Chain ID"}
457+ title={'Chain ID'}
462458 options={chainOptions}
463459 handleUpdate={handleChainUpdate}
464460 currentSelectionTitle={chainDialogueTitle}
@@ -467,13 +463,12 @@ class StatelessTransaction extends React.Component {
467463
468464 const customChainDialogue = !customChain ? null : (
469465 <Input
470− className={"mono mt-4 mb-8"}
471− prop-size={"md"}
472− prop-format={"innerLabel"}
466+ className={'mono mt-4 mb-8'}
467+ prop-size={'md'}
468+ prop-format={'innerLabel'}
473469 value={chainId}
474− onChange={setChainId}
475− >
476− <InnerLabel>{"Chain ID"}</InnerLabel>
470+ onChange={setChainId}>
471+ <InnerLabel>{'Chain ID'}</InnerLabel>
477472 </Input>
478473 );
479474
@@ -491,22 +486,21 @@ class StatelessTransaction extends React.Component {
491486 const signTxnButton = (
492487 <Button
493488 disabled={!canSign}
494− className={"mt-8"}
495− prop-size={"lg wide"}
489+ className={'mt-8'}
490+ prop-size={'lg wide'}
496491 prop-color={signerButtonColor}
497492 onClick={() =>
498493 signTransaction({ ...this.props, ...this.state, setStx: this.setStx })
499− }
500− >
501− {"Sign Transaction"}
494+ }>
495+ {'Sign Transaction'}
502496 </Button>
503497 );
504498
505499 const signedTxnDisplay = stx.matchWith({
506− Nothing: _ => "",
500+ Nothing: _ => '',
507501 Just: tx => (
508502 <React.Fragment>
509− <H3 className={"mt-8"}>{"Signed Transaction"}</H3>
503+ <H3 className={'mt-8'}>{'Signed Transaction'}</H3>
510504 <Code>{JSON.stringify(renderSignedTx(tx.value), null, 2)}</Code>
511505 </React.Fragment>
512506 ),
@@ -514,7 +508,7 @@ class StatelessTransaction extends React.Component {
514508
515509 const confirmButton = (
516510 <CheckboxButton
517− className={"mt-8"}
511+ className={'mt-8'}
518512 disabled={!canApprove}
519513 onToggle={setUserApproval}
520514 state={userApproval}
@@ -523,14 +517,13 @@ class StatelessTransaction extends React.Component {
523517 );
524518
525519 const sending = txStatus !== SUBMISSION_STATES.PROMPT;
526− const sendTxnSpinner = sending ? "" : "hide";
520+ const sendTxnSpinner = sending ? '' : 'hide';
527521 const sendTxnButton = (
528522 <Button
529− prop-size={"xl wide"}
530− className={"mt-8"}
523+ prop-size={'xl wide'}
524+ className={'mt-8'}
531525 disabled={!canSend || sending}
532− onClick={sendTxn}
533− >
526+ onClick={sendTxn}>
534527 <span className="relative">
535528 <span className={`btn-spinner ${sendTxnSpinner}`} />
536529 {txStatus}
@@ -539,7 +532,7 @@ class StatelessTransaction extends React.Component {
539532 );
540533
541534 const sendDialogue = web3.matchWith({
542− Nothing: _ => "",
535+ Nothing: _ => '',
543536 Just: _ => (
544537 <React.Fragment>
545538 {confirmButton}
@@ -549,11 +542,11 @@ class StatelessTransaction extends React.Component {
549542 });
550543
551544 const txnErrorDialogue = Nothing.hasInstance(state.txError) ? (
552− ""
545+ ''
553546 ) : (
554− <Warning className={"mt-8"}>
547+ <Warning className={'mt-8'}>
555548 <H3 style={{ marginTop: 0, paddingTop: 0 }}>
556− {"There was an error sending your transaction."}
549+ {'There was an error sending your transaction.'}
557550 </H3>
558551 {state.txError.value}
559552 </Warning>
src/bridge/components/icons/Chevron.js+1−3
@@ -4,9 +4,7 @@ import PropTypes from 'prop-types';
44const Chevron = props => {
55 return (
66 <img
7− src={`data:image/svg+xml;utf8,<svg width="11" height="24" viewBox="0 0 11 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 12L10.387 12.3166L10.646 12L10.387 11.6833L10 12ZM0.613022 1.31662L9.61302 12.3166L10.387 11.6833L1.38698 0.68338L0.613022 1.31662ZM9.61302 11.6833L0.613021 22.6834L1.38698 23.3166L10.387 12.3166L9.61302 11.6833Z" stroke="${
8− props.color
9− }" stroke-width="${props.strokeWidth}" fill="${props.color}"/></svg>`}
7+ src={`data:image/svg+xml;utf8,<svg width="11" height="24" viewBox="0 0 11 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 12L10.387 12.3166L10.646 12L10.387 11.6833L10 12ZM0.613022 1.31662L9.61302 12.3166L10.387 11.6833L1.38698 0.68338L0.613022 1.31662ZM9.61302 11.6833L0.613021 22.6834L1.38698 23.3166L10.387 12.3166L9.61302 11.6833Z" stroke="${props.color}" stroke-width="${props.strokeWidth}" fill="${props.color}"/></svg>`}
108 alt=""
119 style={props.style}
1210 className={props.className}
src/bridge/lib/flags.js+1−1
@@ -1 +1 @@
1−export const isLocal = process.env.NODE_ENV === "development";
1+export const isLocal = process.env.NODE_ENV === 'development';
src/bridge/lib/invite.js+67−67
@@ -1,67 +1,67 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import Tx from "ethereumjs-tx";
1+import { Just, Nothing } from 'folktale/maybe';
2+import Tx from 'ethereumjs-tx';
33
4−import * as azimuth from "azimuth-js";
5−import * as kg from "urbit-key-generation/dist/index";
6−import * as wg from "../../walletgen/lib/lib.js";
7−import * as tank from "./tank";
4+import * as azimuth from 'azimuth-js';
5+import * as kg from 'urbit-key-generation/dist/index';
6+import * as wg from '../../walletgen/lib/lib.js';
7+import * as tank from './tank';
88
9−import JSZip from "jszip";
10−import saveAs from "file-saver";
9+import JSZip from 'jszip';
10+import saveAs from 'file-saver';
1111
12−import { sendSignedTransaction } from "./txn";
13−import { BRIDGE_ERROR } from "../lib/error";
14−import { attemptSeedDerivation } from "./keys";
15−import { addHexPrefix, WALLET_NAMES } from "./wallet";
12+import { sendSignedTransaction } from './txn';
13+import { BRIDGE_ERROR } from '../lib/error';
14+import { attemptSeedDerivation } from './keys';
15+import { addHexPrefix, WALLET_NAMES } from './wallet';
1616
1717const INVITE_STAGES = {
18− INVITE_LOGIN: "invite login",
19− INVITE_WALLET: "invite wallet",
20− INVITE_VERIFY: "invite verify",
21− INVITE_TRANSACTIONS: "invite transactions",
18+ INVITE_LOGIN: 'invite login',
19+ INVITE_WALLET: 'invite wallet',
20+ INVITE_VERIFY: 'invite verify',
21+ INVITE_TRANSACTIONS: 'invite transactions',
2222};
2323
2424const WALLET_STATES = {
25− UNLOCKING: "Unlocking invite wallet",
26− GENERATING: "Generating your wallet",
27− RENDERING: "Creating paper collateral",
28− PAPER_READY: "Download your wallet",
29− DOWNLOADED: "Wallet downloaded",
30− TRANSACTIONS: "Sending transactions",
25+ UNLOCKING: 'Unlocking invite wallet',
26+ GENERATING: 'Generating your wallet',
27+ RENDERING: 'Creating paper collateral',
28+ PAPER_READY: 'Download your wallet',
29+ DOWNLOADED: 'Wallet downloaded',
30+ TRANSACTIONS: 'Sending transactions',
3131};
3232
3333const TRANSACTION_STATES = {
3434 GENERATING: {
35− label: "Generating transactions",
36− pct: "0%",
35+ label: 'Generating transactions',
36+ pct: '0%',
3737 },
3838 SIGNING: {
39− label: "Signing transactions",
40− pct: "15%",
39+ label: 'Signing transactions',
40+ pct: '15%',
4141 },
4242 FUNDING_INVITE: {
43− label: "Funding invite wallet",
44− pct: "30%",
43+ label: 'Funding invite wallet',
44+ pct: '30%',
4545 },
4646 CLAIMING: {
47− label: "Claiming invite",
48− pct: "55%",
47+ label: 'Claiming invite',
48+ pct: '55%',
4949 },
5050 FUNDING_RECIPIENT: {
51− label: "Funding recipient wallet",
52− pct: "65%",
51+ label: 'Funding recipient wallet',
52+ pct: '65%',
5353 },
5454 CONFIGURING: {
55− label: "Configuring planet",
56− pct: "85%",
55+ label: 'Configuring planet',
56+ pct: '85%',
5757 },
5858 CLEANING: {
59− label: "Cleaning up",
60− pct: "95%",
59+ label: 'Cleaning up',
60+ pct: '95%',
6161 },
6262 DONE: {
63− label: "Done",
64− pct: "100%",
63+ label: 'Done',
64+ pct: '100%',
6565 },
6666};
6767
@@ -77,11 +77,11 @@ async function downloadWallet(paper) {
7777 const zip = new JSZip();
7878 //TODO the categories here aren't explained in bridge at all...
7979
80− const bin0 = paper.filter(item => item.bin === "0");
81− const bin1 = paper.filter(item => item.bin === "1");
82− const bin2 = paper.filter(item => item.bin === "2");
83− const bin3 = paper.filter(item => item.bin === "3");
84− const bin4 = paper.filter(item => item.bin === "4");
80+ const bin0 = paper.filter(item => item.bin === '0');
81+ const bin1 = paper.filter(item => item.bin === '1');
82+ const bin2 = paper.filter(item => item.bin === '2');
83+ const bin3 = paper.filter(item => item.bin === '3');
84+ const bin4 = paper.filter(item => item.bin === '4');
8585
8686 const bin0Folder = zip.folder('0. Public');
8787 const bin1Folder = zip.folder('1. Very High Friction Custody');
@@ -95,8 +95,8 @@ async function downloadWallet(paper) {
9595 bin3.forEach(item => bin3Folder.file(`${item.pageTitle}.png`, item.png));
9696 bin4.forEach(item => bin4Folder.file(`${item.pageTitle}.png`, item.png));
9797
98− zip.generateAsync({ type: "blob" }).then(content => {
99− saveAs(content, "urbit-wallet.zip");
98+ zip.generateAsync({ type: 'blob' }).then(content => {
99+ saveAs(content, 'urbit-wallet.zip');
100100 resolve(true);
101101 });
102102 });
@@ -115,7 +115,7 @@ async function startTransactions(args) {
115115
116116 const askForFunding = (address, amount, current) => {
117117 updateProgress({
118− type: "notify",
118+ type: 'notify',
119119 value: `Please make sure ${address} has at least ${amount} wei, we'll continue once that's true. Current balance: ${current}. Waiting`,
120120 });
121121 };
@@ -148,14 +148,14 @@ async function startTransactions(args) {
148148 const point = realPointM.value;
149149
150150 const inviteAddress = inviteWallet.address;
151− console.log("working as", inviteAddress);
151+ console.log('working as', inviteAddress);
152152
153153 // transfer from invite wallet to new wallet
154154
155155 let transferTx = azimuth.ecliptic.transferPoint(
156156 contracts,
157157 point,
158− realWallet.ownership.keys.address,
158+ realWallet.ownership.keys.address
159159 );
160160 transferTx.gas = 500000; //TODO can maybe be lower?
161161
@@ -169,11 +169,11 @@ async function startTransactions(args) {
169169 //NOTE using web3.eth.accounts.signTransaction is broken (1.0.0-beta51)
170170 let transferStx = new Tx(transferTx);
171171 transferStx.sign(inviteWallet.privateKey);
172− let rawTransferStx = "0x" + transferStx.serialize().toString("hex");
172+ let rawTransferStx = '0x' + transferStx.serialize().toString('hex');
173173
174174 const transferCost = transferTx.gas * transferTx.gasPrice;
175175 updateProgress({
176− type: "progress",
176+ type: 'progress',
177177 value: TRANSACTION_STATES.FUNDING_INVITE,
178178 });
179179 let usedTank = await tank.ensureFundsFor(
@@ -182,11 +182,11 @@ async function startTransactions(args) {
182182 inviteAddress,
183183 transferCost,
184184 [rawTransferStx],
185− askForFunding,
185+ askForFunding
186186 );
187187
188188 updateProgress({
189− type: "progress",
189+ type: 'progress',
190190 value: TRANSACTION_STATES.CLAIMING,
191191 });
192192
@@ -205,7 +205,7 @@ async function startTransactions(args) {
205205 let managementTx = azimuth.ecliptic.setManagementProxy(
206206 contracts,
207207 point,
208− realWallet.management.keys.address,
208+ realWallet.management.keys.address
209209 );
210210 managementTx.gas = 200000;
211211 managementTx.nonce = 0;
@@ -219,7 +219,7 @@ async function startTransactions(args) {
219219 pointCache: { [point]: { keyRevisionNumber: 0 } },
220220 });
221221 if (Nothing.hasInstance(networkSeed)) {
222− throw new Error("wtf network seed not derived");
222+ throw new Error('wtf network seed not derived');
223223 }
224224 networkSeed = networkSeed.value;
225225 const networkKeys = kg.deriveNetworkKeys(networkSeed);
@@ -230,7 +230,7 @@ async function startTransactions(args) {
230230 addHexPrefix(networkKeys.crypt.public),
231231 addHexPrefix(networkKeys.auth.public),
232232 1,
233− false,
233+ false
234234 );
235235 keysTx.gas = 150000;
236236 keysTx.nonce = 1;
@@ -247,12 +247,12 @@ async function startTransactions(args) {
247247
248248 let rawStxs = txs.map(tx => {
249249 let stx = new Tx(tx);
250− stx.sign(Buffer.from(realWallet.ownership.keys.private, "hex"));
251− return "0x" + stx.serialize().toString("hex");
250+ stx.sign(Buffer.from(realWallet.ownership.keys.private, 'hex'));
251+ return '0x' + stx.serialize().toString('hex');
252252 });
253253
254254 updateProgress({
255− type: "progress",
255+ type: 'progress',
256256 value: TRANSACTION_STATES.FUNDING_RECIPIENT,
257257 });
258258 usedTank = await tank.ensureFundsFor(
@@ -261,18 +261,18 @@ async function startTransactions(args) {
261261 newAddress,
262262 totalCost,
263263 rawStxs,
264− askForFunding,
264+ askForFunding
265265 );
266266
267267 updateProgress({
268− type: "progress",
268+ type: 'progress',
269269 value: TRANSACTION_STATES.CONFIGURING,
270270 });
271271
272272 await sendAndAwaitConfirm(web3, rawStxs, usedTank);
273273
274274 updateProgress({
275− type: "progress",
275+ type: 'progress',
276276 value: TRANSACTION_STATES.CLEANING,
277277 });
278278
@@ -283,7 +283,7 @@ async function startTransactions(args) {
283283 const sendEthCost = gasPrice * gasLimit;
284284 if (balance > sendEthCost) {
285285 const value = balance - sendEthCost;
286− console.log("sending", value);
286+ console.log('sending', value);
287287 const tx = {
288288 to: newAddress,
289289 value: value,
@@ -293,15 +293,15 @@ async function startTransactions(args) {
293293 };
294294 let stx = new Tx(tx);
295295 stx.sign(inviteWallet.privateKey);
296− const rawTx = "0x" + stx.serialize().toString("hex");
296+ const rawTx = '0x' + stx.serialize().toString('hex');
297297 web3.eth.sendSignedTransaction(rawTx).catch(err => {
298− console.log("error sending value tx, who cares", err);
298+ console.log('error sending value tx, who cares', err);
299299 });
300− console.log("sent old balance");
300+ console.log('sent old balance');
301301 }
302302
303303 updateProgress({
304− type: "progress",
304+ type: 'progress',
305305 value: TRANSACTION_STATES.DONE,
306306 });
307307
@@ -315,7 +315,7 @@ async function sendAndAwaitConfirm(web3, signedTxs, usedTank) {
315315 return new Promise((resolve, reject) => {
316316 sendSignedTransaction(web3, tx, usedTank, resolve);
317317 });
318− }),
318+ })
319319 );
320320}
321321
src/bridge/lib/keys.js+20−20
@@ -1,18 +1,18 @@
1−import BN from "bn.js";
2−import Maybe from "folktale/maybe";
3−import * as need from "../lib/need";
1+import BN from 'bn.js';
2+import Maybe from 'folktale/maybe';
3+import * as need from '../lib/need';
44
5−import * as noun from "../nockjs/noun";
6−import * as serial from "../nockjs/serial";
7−import * as kg from "urbit-key-generation/dist/index";
5+import * as noun from '../nockjs/noun';
6+import * as serial from '../nockjs/serial';
7+import * as kg from 'urbit-key-generation/dist/index';
88
9−import { BRIDGE_ERROR } from "./error";
10−import { WALLET_NAMES, eqAddr } from "./wallet";
9+import { BRIDGE_ERROR } from './error';
10+import { WALLET_NAMES, eqAddr } from './wallet';
1111
1212// ctsy joemfb
1313const b64 = buf => {
14− let hex = buf.reverse().toString("hex");
15− let n = new BN(hex, "hex");
14+ let hex = buf.reverse().toString('hex');
15+ let n = new BN(hex, 'hex');
1616 let c = [];
1717 while (1 === n.cmpn(0)) {
1818 c.push(n.andln(0x3f));
@@ -24,11 +24,11 @@ const b64 = buf => {
2424 10 > j ? j + 48 : 36 > j ? j + 87 : 62 > j ? j + 29 : 62 === j ? 45 : 126;
2525
2626 return (
27− "0w" +
27+ '0w' +
2828 c.reduce(
2929 (a, b, i) =>
30− String.fromCharCode(trans(b)) + (i && 0 === i % 5 ? "." : "") + a,
31− "",
30+ String.fromCharCode(trans(b)) + (i && 0 === i % 5 ? '.' : '') + a,
31+ ''
3232 )
3333 );
3434};
@@ -38,19 +38,19 @@ const jam = seed => {
3838 .jam(seed)
3939 .toString()
4040 .slice(2);
41− const pad = hex.length % 2 === 0 ? hex : "0" + hex;
42− return Buffer.from(pad, "hex").reverse();
41+ const pad = hex.length % 2 === 0 ? hex : '0' + hex;
42+ return Buffer.from(pad, 'hex').reverse();
4343};
4444
4545const genKey = (networkSeed, point, revision) => {
4646 const pair = kg.deriveNetworkKeys(networkSeed);
47− const bnsec = new BN(pair.crypt.private + pair.auth.private + "42", "hex"); // '42' is curve parameter
47+ const bnsec = new BN(pair.crypt.private + pair.auth.private + '42', 'hex'); // '42' is curve parameter
4848
4949 const sed = noun.dwim(
5050 noun.Atom.fromString(point),
5151 noun.Atom.fromInt(revision),
5252 noun.Atom.fromString(bnsec.toString()),
53− noun.Atom.yes,
53+ noun.Atom.yes
5454 );
5555
5656 return b64(jam(sed));
@@ -74,7 +74,7 @@ const attemptSeedDerivation = async (next, args) => {
7474 ? parseInt(pointDetails.keyRevisionNumber)
7575 : parseInt(pointDetails.keyRevisionNumber) - 1;
7676
77− let managementSeed = "";
77+ let managementSeed = '';
7878
7979 const ticketLike = [WALLET_NAMES.TICKET, WALLET_NAMES.SHARDS];
8080
@@ -110,8 +110,8 @@ const attemptSeedDerivation = async (next, args) => {
110110
111111 let networkSeed = Maybe.Nothing();
112112
113− if (managementSeed !== "") {
114− const seed = await kg.deriveNetworkSeed(managementSeed, "", revision);
113+ if (managementSeed !== '') {
114+ const seed = await kg.deriveNetworkSeed(managementSeed, '', revision);
115115
116116 networkSeed = Maybe.Just(seed);
117117 }
src/bridge/lib/routeNames.js+29−29
@@ -1,33 +1,33 @@
11export const ROUTE_NAMES = {
2− DEFAULT: Symbol("DEFAULT"),
2+ DEFAULT: Symbol('DEFAULT'),
33 //
4− INVITE_TICKET: Symbol("INVITE_TICKET"),
5− INVITE_TRANSACTIONS: Symbol("INVITE_TRANSACTIONS"),
6− INVITES_SEND: Symbol("INVITES_SEND"),
7− INVITES_MANAGE: Symbol("INVITES_MANAGE"),
4+ INVITE_TICKET: Symbol('INVITE_TICKET'),
5+ INVITE_TRANSACTIONS: Symbol('INVITE_TRANSACTIONS'),
6+ INVITES_SEND: Symbol('INVITES_SEND'),
7+ INVITES_MANAGE: Symbol('INVITES_MANAGE'),
88 //
9− ACCEPT_TRANSFER: Symbol("ACCEPT_TRANSFER"),
10− CANCEL_TRANSFER: Symbol("CANCEL_TRANSFER"),
11− LANDING: Symbol("LANDING"),
12− NETWORK: Symbol("NETWORK"),
13− WALLET: Symbol("WALLET"),
14− MNEMONIC: Symbol("MNEMONIC"),
15− TICKET: Symbol("TICKET"),
16− SHARDS: Symbol("SHARDS"),
17− LEDGER: Symbol("LEDGER"),
18− TREZOR: Symbol("TREZOR"),
19− PRIVATE_KEY: Symbol("PRIVATE_KEY"),
20− KEYSTORE: Symbol("KEYSTORE"),
21− VIEW_SHIP: Symbol("VIEW_SHIP"),
22− SHIPS: Symbol("SHIPS"),
23− SHIP: Symbol("SHIP"),
24− SET_MANAGEMENT_PROXY: Symbol("SET_MANAGEMENT_PROXY"),
25− SET_SPAWN_PROXY: Symbol("SET_SPAWN_PROXY"),
26− SET_TRANSFER_PROXY: Symbol("SET_TRANSFER_PROXY"),
27− CREATE_GALAXY: Symbol("CREATE_GALAXY"),
28− ISSUE_CHILD: Symbol("ISSUE_CHILD"),
29− SET_KEYS: Symbol("SET_KEYS"),
30− TRANSFER: Symbol("TRANSFER"),
31− SENT_TRANSACTION: Symbol("SENT_TRANSACTION"),
32− GEN_KEYFILE: Symbol("GEN_KEYFILE"),
9+ ACCEPT_TRANSFER: Symbol('ACCEPT_TRANSFER'),
10+ CANCEL_TRANSFER: Symbol('CANCEL_TRANSFER'),
11+ LANDING: Symbol('LANDING'),
12+ NETWORK: Symbol('NETWORK'),
13+ WALLET: Symbol('WALLET'),
14+ MNEMONIC: Symbol('MNEMONIC'),
15+ TICKET: Symbol('TICKET'),
16+ SHARDS: Symbol('SHARDS'),
17+ LEDGER: Symbol('LEDGER'),
18+ TREZOR: Symbol('TREZOR'),
19+ PRIVATE_KEY: Symbol('PRIVATE_KEY'),
20+ KEYSTORE: Symbol('KEYSTORE'),
21+ VIEW_SHIP: Symbol('VIEW_SHIP'),
22+ SHIPS: Symbol('SHIPS'),
23+ SHIP: Symbol('SHIP'),
24+ SET_MANAGEMENT_PROXY: Symbol('SET_MANAGEMENT_PROXY'),
25+ SET_SPAWN_PROXY: Symbol('SET_SPAWN_PROXY'),
26+ SET_TRANSFER_PROXY: Symbol('SET_TRANSFER_PROXY'),
27+ CREATE_GALAXY: Symbol('CREATE_GALAXY'),
28+ ISSUE_CHILD: Symbol('ISSUE_CHILD'),
29+ SET_KEYS: Symbol('SET_KEYS'),
30+ TRANSFER: Symbol('TRANSFER'),
31+ SENT_TRANSACTION: Symbol('SENT_TRANSACTION'),
32+ GEN_KEYFILE: Symbol('GEN_KEYFILE'),
3333};
src/bridge/lib/router.js+55−55
@@ -1,40 +1,40 @@
1−import React from "react";
2−import * as ob from "urbit-ob";
3−import * as need from "../lib/need";
1+import React from 'react';
2+import * as ob from 'urbit-ob';
3+import * as need from '../lib/need';
44
5−import Landing from "../views/Landing";
6−import InviteTicket from "../views/InviteTicket";
7−import InvitesSend from "../views/InvitesSend.js";
8−import InvitesManage from "../views/InvitesManage.js";
9−import AcceptTransfer from "../views/AcceptTransfer";
10−import CancelTransfer from "../views/CancelTransfer";
11−import CreateGalaxy from "../views/CreateGalaxy";
12−import GenKeyfile from "../views/GenKeyfile";
13−import IssueChild from "../views/IssueChild";
14−import Network from "../views/Network";
15−import Mnemonic from "../views/Mnemonic";
16−import Ledger from "../views/Ledger";
17−import Trezor from "../views/Trezor";
18−import PrivateKey from "../views/PrivateKey";
19−import Keystore from "../views/Keystore";
20−import ViewPoint from "../views/ViewPoint";
21−import SentTransaction from "../views/SentTransaction";
22−import SetKeys from "../views/SetKeys";
5+import Landing from '../views/Landing';
6+import InviteTicket from '../views/InviteTicket';
7+import InvitesSend from '../views/InvitesSend.js';
8+import InvitesManage from '../views/InvitesManage.js';
9+import AcceptTransfer from '../views/AcceptTransfer';
10+import CancelTransfer from '../views/CancelTransfer';
11+import CreateGalaxy from '../views/CreateGalaxy';
12+import GenKeyfile from '../views/GenKeyfile';
13+import IssueChild from '../views/IssueChild';
14+import Network from '../views/Network';
15+import Mnemonic from '../views/Mnemonic';
16+import Ledger from '../views/Ledger';
17+import Trezor from '../views/Trezor';
18+import PrivateKey from '../views/PrivateKey';
19+import Keystore from '../views/Keystore';
20+import ViewPoint from '../views/ViewPoint';
21+import SentTransaction from '../views/SentTransaction';
22+import SetKeys from '../views/SetKeys';
2323import {
2424 SetManagementProxy,
2525 SetSpawnProxy,
2626 SetTransferProxy,
27−} from "../views/SetProxy";
28−import Point from "../views/Point";
29−import Points from "../views/Points";
30−import Shards from "../views/Shards";
31−import Ticket from "../views/Ticket";
32−import Transfer from "../views/Transfer";
33−import Wallet from "../views/Wallet";
27+} from '../views/SetProxy';
28+import Point from '../views/Point';
29+import Points from '../views/Points';
30+import Shards from '../views/Shards';
31+import Ticket from '../views/Ticket';
32+import Transfer from '../views/Transfer';
33+import Wallet from '../views/Wallet';
3434
35−import { EthereumWallet } from "./wallet";
36−import { renderNetworkType } from "./network";
37−import { ROUTE_NAMES } from "./routeNames";
35+import { EthereumWallet } from './wallet';
36+import { renderNetworkType } from './network';
37+import { ROUTE_NAMES } from './routeNames';
3838
3939const ROUTES = {
4040 [ROUTE_NAMES.DEFAULT]: Landing,
@@ -72,18 +72,18 @@ export const getRouteBreadcrumb = (props, route) => {
7272
7373 switch (route.name) {
7474 case ROUTE_NAMES.INVITE_TICKET:
75− return "Invite code";
75+ return 'Invite code';
7676 case ROUTE_NAMES.INVITE_TRANSACTIONS:
77− return "Setting up new wallet";
77+ return 'Setting up new wallet';
7878 case ROUTE_NAMES.INVITES_SEND:
79− return "Send invites";
79+ return 'Send invites';
8080 case ROUTE_NAMES.INVITES_MANAGE:
81− return "Manage invites";
81+ return 'Manage invites';
8282 case ROUTE_NAMES.NETWORK:
8383 return `${renderNetworkType(networkType)}`;
8484 case ROUTE_NAMES.WALLET:
8585 return wallet.matchWith({
86− Nothing: () => "Wallet",
86+ Nothing: () => 'Wallet',
8787 Just: wal =>
8888 wal.value instanceof EthereumWallet ? (
8989 <span className="text-mono">{wal.value.address}</span>
@@ -92,48 +92,48 @@ export const getRouteBreadcrumb = (props, route) => {
9292 ),
9393 });
9494 case ROUTE_NAMES.MNEMONIC:
95− return "Mnemonic";
95+ return 'Mnemonic';
9696 case ROUTE_NAMES.TICKET:
97− return "Urbit Ticket";
97+ return 'Urbit Ticket';
9898 case ROUTE_NAMES.SHARDS:
99− return "Urbit Ticket";
99+ return 'Urbit Ticket';
100100 case ROUTE_NAMES.LEDGER:
101− return "Ledger";
101+ return 'Ledger';
102102 case ROUTE_NAMES.TREZOR:
103− return "Trezor";
103+ return 'Trezor';
104104 case ROUTE_NAMES.PRIVATE_KEY:
105− return "Private Key";
105+ return 'Private Key';
106106 case ROUTE_NAMES.KEYSTORE:
107− return "Keystore File";
107+ return 'Keystore File';
108108 case ROUTE_NAMES.SHIPS:
109− return "Points";
109+ return 'Points';
110110 case ROUTE_NAMES.VIEW_SHIP:
111− return "View";
111+ return 'View';
112112 case ROUTE_NAMES.SHIP:
113113 return ob.patp(need.pointCursor(props));
114114 case ROUTE_NAMES.SET_TRANSFER_PROXY:
115115 case ROUTE_NAMES.SET_MANAGEMENT_PROXY:
116116 case ROUTE_NAMES.SET_SPAWN_PROXY:
117− return "Set Proxy";
117+ return 'Set Proxy';
118118 case ROUTE_NAMES.CREATE_GALAXY:
119− return "Create Galaxy";
119+ return 'Create Galaxy';
120120 case ROUTE_NAMES.ISSUE_CHILD:
121− return "Issue Child";
121+ return 'Issue Child';
122122 case ROUTE_NAMES.TRANSFER:
123− return "Transfer";
123+ return 'Transfer';
124124 case ROUTE_NAMES.ACCEPT_TRANSFER:
125− return "Accept Transfer";
125+ return 'Accept Transfer';
126126 case ROUTE_NAMES.CANCEL_TRANSFER:
127− return "Cancel Transfer";
127+ return 'Cancel Transfer';
128128 case ROUTE_NAMES.GEN_KEYFILE:
129− return "Keyfile";
129+ return 'Keyfile';
130130 case ROUTE_NAMES.SET_KEYS:
131− return "Configure Keys";
131+ return 'Configure Keys';
132132 case ROUTE_NAMES.SENT_TRANSACTION:
133− return "Txn";
133+ return 'Txn';
134134 case ROUTE_NAMES.LANDING:
135135 default:
136− return "Bridge";
136+ return 'Bridge';
137137 }
138138};
139139
src/bridge/lib/wallet.js+38−38
@@ -1,85 +1,85 @@
1−import * as bip32 from "bip32";
2−import * as bip39 from "bip39";
3−import keccak from "keccak";
4−import * as lodash from "lodash";
5−import Maybe from "folktale/maybe";
6−import * as secp256k1 from "secp256k1";
7−import * as ob from "urbit-ob";
8−import * as kg from "urbit-key-generation/dist/index";
9−import { isAddress } from "web3-utils";
1+import * as bip32 from 'bip32';
2+import * as bip39 from 'bip39';
3+import keccak from 'keccak';
4+import * as lodash from 'lodash';
5+import Maybe from 'folktale/maybe';
6+import * as secp256k1 from 'secp256k1';
7+import * as ob from 'urbit-ob';
8+import * as kg from 'urbit-key-generation/dist/index';
9+import { isAddress } from 'web3-utils';
1010
1111const DEFAULT_HD_PATH = "m/44'/60'/0'/0/0";
1212
13−const ETH_ZERO_ADDR = "0x0000000000000000000000000000000000000000";
13+const ETH_ZERO_ADDR = '0x0000000000000000000000000000000000000000';
1414const CURVE_ZERO_ADDR =
15− "0x0000000000000000000000000000000000000000000000000000000000000000";
15+ '0x0000000000000000000000000000000000000000000000000000000000000000';
1616
1717const WALLET_NAMES = {
18− MNEMONIC: Symbol("MNEMONIC"),
19− TICKET: Symbol("TICKET"),
20− SHARDS: Symbol("SHARDS"),
21− LEDGER: Symbol("LEDGER"),
22− TREZOR: Symbol("TREZOR"),
23− PRIVATE_KEY: Symbol("PRIVATE_KEY"),
24− KEYSTORE: Symbol("KEYSTORE"),
18+ MNEMONIC: Symbol('MNEMONIC'),
19+ TICKET: Symbol('TICKET'),
20+ SHARDS: Symbol('SHARDS'),
21+ LEDGER: Symbol('LEDGER'),
22+ TREZOR: Symbol('TREZOR'),
23+ PRIVATE_KEY: Symbol('PRIVATE_KEY'),
24+ KEYSTORE: Symbol('KEYSTORE'),
2525};
2626
2727function EthereumWallet(privateKey) {
2828 this.privateKey = privateKey;
2929 this.publicKey = secp256k1.publicKeyCreate(this.privateKey);
30− const pub = this.publicKey.toString("hex");
30+ const pub = this.publicKey.toString('hex');
3131 this.address = addressFromSecp256k1Public(pub);
3232}
3333
3434const renderWalletType = wallet =>
3535 wallet === WALLET_NAMES.MNEMONIC
36− ? "Mnemonic"
36+ ? 'Mnemonic'
3737 : wallet === WALLET_NAMES.TICKET
38− ? "Ticket"
38+ ? 'Ticket'
3939 : wallet === WALLET_NAMES.SHARDS
40− ? "Ticket Shards"
40+ ? 'Ticket Shards'
4141 : wallet === WALLET_NAMES.LEDGER
42− ? "Ledger"
42+ ? 'Ledger'
4343 : wallet === WALLET_NAMES.TREZOR
44− ? "Trezor"
44+ ? 'Trezor'
4545 : wallet === WALLET_NAMES.PRIVATE_KEY
46− ? "Private Key"
46+ ? 'Private Key'
4747 : wallet === WALLET_NAMES.KEYSTORE
48− ? "Keystore File"
49− : "Wallet";
48+ ? 'Keystore File'
49+ : 'Wallet';
5050
5151const addressFromSecp256k1Public = pub => {
5252 const compressed = false;
5353 const uncompressed = secp256k1.publicKeyConvert(
54− Buffer.from(pub, "hex"),
55− compressed,
54+ Buffer.from(pub, 'hex'),
55+ compressed
5656 );
5757 const chopped = uncompressed.slice(1); // chop parity byte
5858 const hashed = keccak256(chopped);
59− const addr = addHexPrefix(hashed.slice(-20).toString("hex"));
59+ const addr = addHexPrefix(hashed.slice(-20).toString('hex'));
6060 return toChecksumAddress(addr);
6161};
6262
63−const addHexPrefix = hex => (hex.slice(0, 2) === "0x" ? hex : "0x" + hex);
63+const addHexPrefix = hex => (hex.slice(0, 2) === '0x' ? hex : '0x' + hex);
6464
65−const stripHexPrefix = hex => (hex.slice(0, 2) === "0x" ? hex.slice(2) : hex);
65+const stripHexPrefix = hex => (hex.slice(0, 2) === '0x' ? hex.slice(2) : hex);
6666
6767const keccak256 = str =>
68− keccak("keccak256")
68+ keccak('keccak256')
6969 .update(str)
7070 .digest();
7171
72−const isValidAddress = a => "0x0" === a || isAddress(a);
72+const isValidAddress = a => '0x0' === a || isAddress(a);
7373
7474const toChecksumAddress = address => {
7575 const addr = stripHexPrefix(address).toLowerCase();
76− const hash = keccak256(addr).toString("hex");
76+ const hash = keccak256(addr).toString('hex');
7777
7878 return lodash.reduce(
7979 addr,
8080 (acc, char, idx) =>
8181 parseInt(hash[idx], 16) >= 8 ? acc + char.toUpperCase() : acc + char,
82− "0x",
82+ '0x'
8383 );
8484};
8585
@@ -87,7 +87,7 @@ const eqAddr = (addr0, addr1) =>
8787 toChecksumAddress(addr0) === toChecksumAddress(addr1);
8888
8989const urbitWalletFromTicket = async (ticket, point, passphrase) => {
90− if (typeof point === "string") {
90+ if (typeof point === 'string') {
9191 //TODO why not in kg?
9292 point = ob.patp2dec(point);
9393 }
@@ -100,7 +100,7 @@ const urbitWalletFromTicket = async (ticket, point, passphrase) => {
100100};
101101
102102const ownershipWalletFromTicket = async (ticket, point, passphrase) => {
103− if (typeof point === "string") {
103+ if (typeof point === 'string') {
104104 //TODO why not in kg?
105105 point = ob.patp2dec(point);
106106 }
src/bridge/lib/web3.js+6−8
@@ -1,21 +1,19 @@
1−import * as azimuth from "azimuth-js";
2−import Web3 from "web3";
1+import * as azimuth from 'azimuth-js';
2+import Web3 from 'web3';
33
4−import { CONTRACT_ADDRESSES } from "./contracts";
5−import { NETWORK_NAMES } from "./network";
4+import { CONTRACT_ADDRESSES } from './contracts';
5+import { NETWORK_NAMES } from './network';
66
77export const initWeb3 = networkType => {
88 if (networkType === NETWORK_NAMES.MAINNET) {
9− const endpoint = `https://mainnet.infura.io/v3/${
10− process.env.REACT_APP_INFURA_ENDPOINT
11− }`;
9+ const endpoint = `https://mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_ENDPOINT}`;
1210
1311 const provider = new Web3.providers.HttpProvider(endpoint);
1412 const web3 = new Web3(provider);
1513 const contracts = azimuth.initContracts(web3, CONTRACT_ADDRESSES.MAINNET);
1614 return { web3: web3, contracts: contracts };
1715 } else if (networkType === NETWORK_NAMES.LOCAL) {
18− const protocol = process.env.NODE_ENV === "development" ? "ws" : "wss";
16+ const protocol = process.env.NODE_ENV === 'development' ? 'ws' : 'wss';
1917 const endpoint = `${protocol}://localhost:8545`;
2018 const provider = new Web3.providers.WebsocketProvider(endpoint);
2119 const web3 = new Web3(provider);
src/bridge/store/history.js+4−4
@@ -1,8 +1,8 @@
1−import React, { useContext, useState, useEffect } from "react";
2−import { last, includes } from "lodash";
1+import React, { useContext, useState, useEffect } from 'react';
2+import { last, includes } from 'lodash';
33
4−import { BRIDGE_ERROR } from "../lib/error";
5−import { ROUTE_NAMES } from "../lib/routeNames";
4+import { BRIDGE_ERROR } from '../lib/error';
5+import { ROUTE_NAMES } from '../lib/routeNames';
66
77export const HistoryContext = React.createContext(null);
88
src/bridge/store/txnConfirmations.js+2−3
@@ -1,4 +1,4 @@
1−import React, { useContext, useState } from "react";
1+import React, { useContext, useState } from 'react';
22
33export const TxnConfirmationsContext = React.createContext(null);
44
@@ -17,8 +17,7 @@ export function TxnConfirmationsProvider({ children }) {
1717 value={{
1818 txnConfirmations: confirmations,
1919 setTxnConfirmations,
20− }}
21− >
20+ }}>
2221 {children}
2322 </TxnConfirmationsContext.Provider>
2423 );
src/bridge/views/AcceptTransfer.js+23−25
@@ -1,19 +1,19 @@
1−import { Just } from "folktale/maybe";
2−import React from "react";
3−import { Row, Col, H1, P } from "../components/Base";
1+import { Just } from 'folktale/maybe';
2+import React from 'react';
3+import { Row, Col, H1, P } from '../components/Base';
44import {
55 InnerLabel,
66 AddressInput,
77 ShowBlockie,
88 Anchor,
9−} from "../components/Base";
10−import * as azimuth from "azimuth-js";
11−import * as ob from "urbit-ob";
12−import * as need from "../lib/need";
9+} from '../components/Base';
10+import * as azimuth from 'azimuth-js';
11+import * as ob from 'urbit-ob';
12+import * as need from '../lib/need';
1313
14−import StatelessTransaction from "../components/StatelessTransaction";
15−import { NETWORK_NAMES } from "../lib/network";
16−import { isValidAddress } from "../lib/wallet";
14+import StatelessTransaction from '../components/StatelessTransaction';
15+import { NETWORK_NAMES } from '../lib/network';
16+import { isValidAddress } from '../lib/wallet';
1717
1818class AcceptTransfer extends React.Component {
1919 constructor(props) {
@@ -50,8 +50,8 @@ class AcceptTransfer extends React.Component {
5050 validContracts,
5151 validPoint,
5252 state.receivingAddress,
53− true,
54− ),
53+ true
54+ )
5555 );
5656 }
5757
@@ -66,20 +66,20 @@ class AcceptTransfer extends React.Component {
6666
6767 const esdomain =
6868 props.networkType === NETWORK_NAMES.ROPSTEN
69− ? "ropsten.etherscan.io"
70− : "etherscan.io";
69+ ? 'ropsten.etherscan.io'
70+ : 'etherscan.io';
7171
7272 return (
7373 <Row>
7474 <Col>
7575 <H1>
76− {"Accept Transfer of "}{" "}
76+ {'Accept Transfer of '}{' '}
7777 <code>{` ${ob.patp(state.incomingPoint)} `}</code>
7878 </H1>
7979
8080 <P>
8181 {"By default, the recipient is the address you're logged in " +
82− "as. But you can transfer to any address you like."}
82+ 'as. But you can transfer to any address you like.'}
8383 </P>
8484
8585 <AddressInput
@@ -87,22 +87,20 @@ class AcceptTransfer extends React.Component {
8787 prop-size="lg"
8888 prop-format="innerLabel"
8989 value={state.receivingAddress}
90− onChange={v => this.handleAddressInput(v)}
91− >
92− <InnerLabel>{"Receiving Address"}</InnerLabel>
93− <ShowBlockie className={"mt-1"} address={state.receivingAddress} />
90+ onChange={v => this.handleAddressInput(v)}>
91+ <InnerLabel>{'Receiving Address'}</InnerLabel>
92+ <ShowBlockie className={'mt-1'} address={state.receivingAddress} />
9493 </AddressInput>
9594
9695 <Anchor
97− className={"mt-1 sm"}
96+ className={'mt-1 sm'}
9897 prop-size="sm"
9998 prop-disabled={
10099 !isValidAddress(state.receivingAddress) || !esvisible
101100 }
102− target={"_blank"}
103− href={`https://${esdomain}/address/${state.receivingAddress}`}
104− >
105− {"View on Etherscan ↗"}
101+ target={'_blank'}
102+ href={`https://${esdomain}/address/${state.receivingAddress}`}>
103+ {'View on Etherscan ↗'}
106104 </Anchor>
107105
108106 <StatelessTransaction
src/bridge/views/CancelTransfer.js+12−12
@@ -1,12 +1,12 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import { Row, Col, H1, P } from "../components/Base";
4−import * as azimuth from "azimuth-js";
5−import * as ob from "urbit-ob";
6−import * as need from "../lib/need";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import { Row, Col, H1, P } from '../components/Base';
4+import * as azimuth from 'azimuth-js';
5+import * as ob from 'urbit-ob';
6+import * as need from '../lib/need';
77
8−import StatelessTransaction from "../components/StatelessTransaction";
9−import { ETH_ZERO_ADDR } from "../lib/wallet";
8+import StatelessTransaction from '../components/StatelessTransaction';
9+import { ETH_ZERO_ADDR } from '../lib/wallet';
1010
1111class CancelTransfer extends React.Component {
1212 constructor(props) {
@@ -15,7 +15,7 @@ class CancelTransfer extends React.Component {
1515 const pointInTransfer = need.pointCursor(props);
1616
1717 this.state = {
18− proxyAddress: "",
18+ proxyAddress: '',
1919 pointInTransfer: pointInTransfer,
2020 };
2121
@@ -32,7 +32,7 @@ class CancelTransfer extends React.Component {
3232 const txn = azimuth.ecliptic.setTransferProxy(
3333 validContracts,
3434 validPoint,
35− ETH_ZERO_ADDR,
35+ ETH_ZERO_ADDR
3636 );
3737
3838 return Maybe.Just(txn);
@@ -45,7 +45,7 @@ class CancelTransfer extends React.Component {
4545
4646 const proxy = online
4747 ? props.pointCache[state.pointInTransfer].transferProxy
48− : "any outgoing addresses";
48+ : 'any outgoing addresses';
4949
5050 // const canGenerate = validAddress === true
5151
@@ -55,7 +55,7 @@ class CancelTransfer extends React.Component {
5555 <Row>
5656 <Col>
5757 <H1>
58− {"Cancel Transfer of "}{" "}
58+ {'Cancel Transfer of '}{' '}
5959 <code>{` ${ob.patp(state.pointInTransfer)} `}</code>
6060 </H1>
6161
src/bridge/views/CreateGalaxy.js+39−43
@@ -1,37 +1,37 @@
1−import React from "react";
2−import Maybe from "folktale/maybe";
3−import * as azimuth from "azimuth-js";
4−import * as ob from "urbit-ob";
5−import * as need from "../lib/need";
6−
7−import { Button } from "../components/Base";
8−import { Row, Col, H1, P, Anchor } from "../components/Base";
1+import React from 'react';
2+import Maybe from 'folktale/maybe';
3+import * as azimuth from 'azimuth-js';
4+import * as ob from 'urbit-ob';
5+import * as need from '../lib/need';
6+
7+import { Button } from '../components/Base';
8+import { Row, Col, H1, P, Anchor } from '../components/Base';
99import {
1010 InnerLabel,
1111 GalaxyInput,
1212 AddressInput,
1313 ValidatedSigil,
1414 ShowBlockie,
15−} from "../components/Base";
16−import StatelessTransaction from "../components/StatelessTransaction";
15+} from '../components/Base';
16+import StatelessTransaction from '../components/StatelessTransaction';
1717
18−import { NETWORK_NAMES } from "../lib/network";
19−import { canDecodePatp } from "../lib/txn";
18+import { NETWORK_NAMES } from '../lib/network';
19+import { canDecodePatp } from '../lib/txn';
2020
21−import { ETH_ZERO_ADDR, isValidAddress, eqAddr } from "../lib/wallet";
21+import { ETH_ZERO_ADDR, isValidAddress, eqAddr } from '../lib/wallet';
2222
23−import { isValidGalaxy } from "../lib/lib";
23+import { isValidGalaxy } from '../lib/lib';
2424
2525const buttonTriState = status => {
26− if (status === null) return "blue";
27− if (status === false) return "yellow";
28− if (status === true) return "green";
26+ if (status === null) return 'blue';
27+ if (status === false) return 'yellow';
28+ if (status === true) return 'green';
2929};
3030
3131const buttonTriStateText = status => {
32− if (status === null) return "Confirm Galaxy Availablility";
33− if (status === false) return "Galaxy is Not Available";
34− if (status === true) return "Galaxy is Available";
32+ if (status === null) return 'Confirm Galaxy Availablility';
33+ if (status === false) return 'Galaxy is Not Available';
34+ if (status === true) return 'Galaxy is Available';
3535};
3636
3737class CreateGalaxy extends React.Component {
@@ -42,7 +42,7 @@ class CreateGalaxy extends React.Component {
4242
4343 this.state = {
4444 galaxyOwner: galaxyOwner,
45− galaxyName: "",
45+ galaxyName: '',
4646 isAvailable: null,
4747 };
4848
@@ -77,7 +77,7 @@ class CreateGalaxy extends React.Component {
7777 const txn = azimuth.ecliptic.createGalaxy(
7878 validContracts,
7979 galaxyDec,
80− state.galaxyOwner,
80+ state.galaxyOwner
8181 );
8282
8383 return Maybe.Just(txn);
@@ -97,7 +97,7 @@ class CreateGalaxy extends React.Component {
9797
9898 const currentOwner = await azimuth.azimuth.getOwner(
9999 validContracts,
100− galaxyDec,
100+ galaxyDec
101101 );
102102
103103 const available = eqAddr(currentOwner, ETH_ZERO_ADDR);
@@ -122,17 +122,17 @@ class CreateGalaxy extends React.Component {
122122
123123 const esdomain =
124124 props.networkType === NETWORK_NAMES.ROPSTEN
125− ? "ropsten.etherscan.io"
126− : "etherscan.io";
125+ ? 'ropsten.etherscan.io'
126+ : 'etherscan.io';
127127
128128 return (
129129 <Row>
130130 <Col>
131− <H1> {"Create a Galaxy"} </H1>
131+ <H1> {'Create a Galaxy'} </H1>
132132
133133 <P>
134− {"Enter the galaxy to create and the address that will own " +
135− "it (defaulting to this account, if not provided)."}
134+ {'Enter the galaxy to create and the address that will own ' +
135+ 'it (defaulting to this account, if not provided).'}
136136 </P>
137137
138138 <GalaxyInput
@@ -142,9 +142,8 @@ class CreateGalaxy extends React.Component {
142142 autoFocus
143143 placeholder="e.g. ~zod"
144144 value={state.galaxyName}
145− onChange={v => this.handleGalaxyNameInput(v)}
146− >
147− <InnerLabel>{"Galaxy Name"}</InnerLabel>
145+ onChange={v => this.handleGalaxyNameInput(v)}>
146+ <InnerLabel>{'Galaxy Name'}</InnerLabel>
148147 <ValidatedSigil
149148 className="tr-0 mt-05 mr-0 abs"
150149 patp={state.galaxyName}
@@ -158,20 +157,18 @@ class CreateGalaxy extends React.Component {
158157 prop-size="lg"
159158 prop-format="innerLabel"
160159 value={state.galaxyOwner}
161− onChange={v => this.handleAddressInput(v)}
162− >
163− <InnerLabel>{"Address that will own this galaxy"}</InnerLabel>
164− <ShowBlockie className={"mt-1"} address={state.galaxyOwner} />
160+ onChange={v => this.handleAddressInput(v)}>
161+ <InnerLabel>{'Address that will own this galaxy'}</InnerLabel>
162+ <ShowBlockie className={'mt-1'} address={state.galaxyOwner} />
165163 </AddressInput>
166164
167165 <Anchor
168− className={"mt-1"}
169− prop-size={"sm"}
166+ className={'mt-1'}
167+ prop-size={'sm'}
170168 prop-disabled={!validAddress || !esvisible}
171− target={"_blank"}
172− href={`https://${esdomain}/address/${state.galaxyOwner}`}
173− >
174− {"View on Etherscan ↗"}
169+ target={'_blank'}
170+ href={`https://${esdomain}/address/${state.galaxyOwner}`}>
171+ {'View on Etherscan ↗'}
175172 </Anchor>
176173
177174 <Button
@@ -179,8 +176,7 @@ class CreateGalaxy extends React.Component {
179176 className="mt-8"
180177 prop-color={buttonTriState(state.isAvailable)}
181178 disabled={!validGalaxy}
182− onClick={() => this.confirmAvailability()}
183− >
179+ onClick={() => this.confirmAvailability()}>
184180 {buttonTriStateText(state.isAvailable)}
185181 </Button>
186182
src/bridge/views/GenKeyfile.js+22−23
@@ -1,23 +1,23 @@
1−import React from "react";
2−import Maybe from "folktale/maybe";
3−import * as need from "../lib/need";
1+import React from 'react';
2+import Maybe from 'folktale/maybe';
3+import * as need from '../lib/need';
44
5−import { Button } from "../components/Base";
6−import { Row, Col, H1, P } from "../components/Base";
5+import { Button } from '../components/Base';
6+import { Row, Col, H1, P } from '../components/Base';
77
8−import * as ob from "urbit-ob";
9−import * as kg from "urbit-key-generation/dist/index";
10−import saveAs from "file-saver";
8+import * as ob from 'urbit-ob';
9+import * as kg from 'urbit-key-generation/dist/index';
10+import saveAs from 'file-saver';
1111
12−import { attemptSeedDerivation, genKey } from "../lib/keys";
13−import { addHexPrefix } from "../lib/wallet";
12+import { attemptSeedDerivation, genKey } from '../lib/keys';
13+import { addHexPrefix } from '../lib/wallet';
1414
1515class GenKeyfile extends React.Component {
1616 constructor(props) {
1717 super(props);
1818
1919 this.state = {
20− keyfile: "",
20+ keyfile: '',
2121 loaded: false,
2222 };
2323 }
@@ -42,7 +42,7 @@ class GenKeyfile extends React.Component {
4242
4343 async componentDidMount() {
4444 const { point, pointDetails, revision } = this.getPointDetails();
45− let keyfile = "";
45+ let keyfile = '';
4646
4747 const hexRegExp = /[0-9A-Fa-f]{64}/g;
4848 const networkSeed = await this.deriveSeed();
@@ -77,11 +77,11 @@ class GenKeyfile extends React.Component {
7777 const next = false;
7878 let seed = await attemptSeedDerivation(next, this.props);
7979
80− if (seed.getOrElse("") === "" && this.props.networkSeedCache) {
80+ if (seed.getOrElse('') === '' && this.props.networkSeedCache) {
8181 seed = Maybe.Just(this.props.networkSeedCache);
8282 }
8383
84− return seed.getOrElse("");
84+ return seed.getOrElse('');
8585 }
8686
8787 render() {
@@ -90,14 +90,14 @@ class GenKeyfile extends React.Component {
9090
9191 return (
9292 <Row>
93− <Col className={"col-md-8"}>
94− <H1>{"Generate keyfile"}</H1>
93+ <Col className={'col-md-8'}>
94+ <H1>{'Generate keyfile'}</H1>
9595
96− <P>{"Download a private key file for booting this point in Arvo."}</P>
96+ <P>{'Download a private key file for booting this point in Arvo.'}</P>
9797
98− {keyfile === "" && !loaded && <P>{"Generating keyfile..."}</P>}
98+ {keyfile === '' && !loaded && <P>{'Generating keyfile...'}</P>}
9999
100− {keyfile === "" && loaded && (
100+ {keyfile === '' && loaded && (
101101 <React.Fragment>
102102 <P>
103103 <b>Warning: </b>
@@ -112,17 +112,16 @@ class GenKeyfile extends React.Component {
112112 </React.Fragment>
113113 )}
114114
115− {keyfile !== "" && (
115+ {keyfile !== '' && (
116116 <React.Fragment>
117117 <div className="pb-5 text-code keyfile">{keyfile}</div>
118118 <Button
119119 onClick={() => {
120120 let blob = new Blob([keyfile], {
121− type: "text/plain;charset=utf-8",
121+ type: 'text/plain;charset=utf-8',
122122 });
123123 saveAs(blob, `${ob.patp(point).slice(1)}-${revision}.key`);
124− }}
125− >
124+ }}>
126125 Download →
127126 </Button>
128127 </React.Fragment>
src/bridge/views/InviteTicket.js+34−40
@@ -1,5 +1,5 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import React from "react";
1+import { Just, Nothing } from 'folktale/maybe';
2+import React from 'react';
33import {
44 InnerLabel,
55 Warning,
@@ -9,35 +9,35 @@ import {
99 Row,
1010 Col,
1111 Passport,
12−} from "../components/Base";
13−import * as azimuth from "azimuth-js";
14−import * as need from "../lib/need";
12+} from '../components/Base';
13+import * as azimuth from 'azimuth-js';
14+import * as need from '../lib/need';
1515
16−import { randomPatq } from "../lib/lib";
17−import { ROUTE_NAMES } from "../lib/routeNames";
18−import { withHistory } from "../store/history";
16+import { randomPatq } from '../lib/lib';
17+import { ROUTE_NAMES } from '../lib/routeNames';
18+import { withHistory } from '../store/history';
1919import {
2020 DEFAULT_HD_PATH,
2121 ownershipWalletFromTicket,
2222 walletFromMnemonic,
23−} from "../lib/wallet";
24−import { BRIDGE_ERROR } from "../lib/error";
23+} from '../lib/wallet';
24+import { BRIDGE_ERROR } from '../lib/error';
2525import {
2626 INVITE_STAGES,
2727 WALLET_STATES,
2828 TRANSACTION_STATES,
29−} from "../lib/invite";
30−import { generateWallet, startTransactions } from "../lib/invite";
29+} from '../lib/invite';
30+import { generateWallet, startTransactions } from '../lib/invite';
3131
3232class InviteTicket extends React.Component {
3333 constructor(props) {
3434 super(props);
3535
3636 this.state = {
37− inviteTicket: "",
37+ inviteTicket: '',
3838 inviteWallet: Nothing(),
39− verifyTicket: "",
40− realTicket: "",
39+ verifyTicket: '',
40+ realTicket: '',
4141 realPoint: Nothing(),
4242 realWallet: Nothing(),
4343 walletReady: false,
@@ -92,7 +92,7 @@ class InviteTicket extends React.Component {
9292 //TODO isn't all this accessible in the ownership object?
9393 const inviteWallet = walletFromMnemonic(
9494 mnemonic,
95− DEFAULT_HD_PATH,
95+ DEFAULT_HD_PATH
9696 ).matchWith({
9797 Just: w => w.value,
9898 Nothing: () => {
@@ -130,7 +130,7 @@ class InviteTicket extends React.Component {
130130 }
131131 } else {
132132 errors = [
133− "Invite code has no claimable ship. Check your invite code and try again.",
133+ 'Invite code has no claimable ship. Check your invite code and try again.',
134134 ];
135135 }
136136
@@ -140,7 +140,7 @@ class InviteTicket extends React.Component {
140140 // dev mode: uncomment this out to autofill verified ticket
141141 verifyTicket: !Nothing.hasInstance(realWallet)
142142 ? realWallet.value.ticket
143− : "",
143+ : '',
144144 walletStates: this.state.walletStates.concat(WALLET_STATES.RENDERING),
145145 errors,
146146 });
@@ -157,11 +157,11 @@ class InviteTicket extends React.Component {
157157 let handler = isLogin
158158 ? this.handleInviteTicketInput
159159 : this.handleVerifyTicketInput;
160− let label = isLogin ? "Activation code" : "ticket";
160+ let label = isLogin ? 'Activation code' : 'ticket';
161161
162162 // if realWallet is Just, then VerifyTicketInput appropriate contents; if Nothing, remain Nothing
163163 const Verified = this.state.realWallet.map(realWallet =>
164− VerifyTicketInput(realWallet.ticket),
164+ VerifyTicketInput(realWallet.ticket)
165165 );
166166
167167 // Verified.getOrElse(TicketInput) falls back to TicketInput if Verified is Nothing
@@ -179,8 +179,7 @@ class InviteTicket extends React.Component {
179179 name="invite"
180180 placeholder={`e.g. ${phTick}`}
181181 value={value}
182− onChange={handler}
183− >
182+ onChange={handler}>
184183 <InnerLabel>{label}</InnerLabel>
185184 </TicketElem>
186185 );
@@ -256,7 +255,7 @@ class InviteTicket extends React.Component {
256255
257256 updateProgress(notification) {
258257 let newState =
259− notification.type === "progress"
258+ notification.type === 'progress'
260259 ? { transactionProgress: notification.value }
261260 : notification.type === 'notify'
262261 ? { errors: [notification.value] }
@@ -278,8 +277,8 @@ class InviteTicket extends React.Component {
278277 const { web3, contracts, setUrbitWallet } = this.props;
279278
280279 const btnColor = this.state.walletStates.includes(WALLET_STATES.PAPER_READY)
281− ? "green"
282− : "black";
280+ ? 'green'
281+ : 'black';
283282
284283 const clickHandler =
285284 stage === INVITE_STAGES.INVITE_LOGIN
@@ -297,7 +296,7 @@ class InviteTicket extends React.Component {
297296 this.setState({
298297 stage: INVITE_STAGES.INVITE_TRANSACTIONS,
299298 walletStates: this.state.walletStates.concat(
300− WALLET_STATES.TRANSACTIONS,
299+ WALLET_STATES.TRANSACTIONS
301300 ),
302301 });
303302
@@ -333,13 +332,12 @@ class InviteTicket extends React.Component {
333332 const buttonElem =
334333 stage === INVITE_STAGES.INVITE_TRANSACTIONS ? null : (
335334 <Button
336− className={"mt-4"}
337− prop-size={"lg"}
335+ className={'mt-4'}
336+ prop-size={'lg'}
338337 prop-color={btnColor}
339338 disabled={!continueReady}
340− onClick={clickHandler}
341− >
342− {"Continue →"}
339+ onClick={clickHandler}>
340+ {'Continue →'}
343341 </Button>
344342 );
345343
@@ -355,20 +353,17 @@ class InviteTicket extends React.Component {
355353 <div className="mt-6 mb-8">
356354 <span
357355 className={`fs-35 mr-3 ${stage !== INVITE_STAGES.INVITE_WALLET &&
358− "gray-20"}`}
359− >
356+ 'gray-20'}`}>
360357 1 Passport
361358 </span>
362359 <span
363360 className={`fs-35 mr-3 ${stage !== INVITE_STAGES.INVITE_VERIFY &&
364− "gray-20"}`}
365− >
361+ 'gray-20'}`}>
366362 2 Verify
367363 </span>
368364 <span
369365 className={`fs-35 mr-3 ${stage !==
370− INVITE_STAGES.INVITE_TRANSACTIONS && "gray-20"}`}
371− >
366+ INVITE_STAGES.INVITE_TRANSACTIONS && 'gray-20'}`}>
372367 3 Invite
373368 </span>
374369 </div>
@@ -382,7 +377,7 @@ class InviteTicket extends React.Component {
382377
383378 return (
384379 <Warning>
385− <h3 className={"mb-2"}>{"Warning"}</h3>
380+ <h3 className={'mb-2'}>{'Warning'}</h3>
386381 {errorElems}
387382 </Warning>
388383 );
@@ -409,8 +404,7 @@ class InviteTicket extends React.Component {
409404 prop-type={`link`}
410405 prop-size={`sm`}
411406 className={`block mt-4`}
412− onClick={this.navigateLogin}
413− >
407+ onClick={this.navigateLogin}>
414408 {`Log in`}
415409 </Button>
416410 )}
src/bridge/views/InvitesManage.js+22−24
@@ -1,8 +1,8 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import React from "react";
3−import * as ob from "urbit-ob";
4−import * as azimuth from "azimuth-js";
5−import * as need from "../lib/need";
1+import { Just, Nothing } from 'folktale/maybe';
2+import React from 'react';
3+import * as ob from 'urbit-ob';
4+import * as azimuth from 'azimuth-js';
5+import * as need from '../lib/need';
66
77import {
88 Row,
@@ -12,8 +12,8 @@ import {
1212 PointInput,
1313 InnerLabel,
1414 ValidatedSigil,
15−} from "../components/Base";
16−import StatelessTransaction from "../components/StatelessTransaction";
15+} from '../components/Base';
16+import StatelessTransaction from '../components/StatelessTransaction';
1717
1818class InvitesManage extends React.Component {
1919 constructor(props) {
@@ -21,7 +21,7 @@ class InvitesManage extends React.Component {
2121
2222 this.state = {
2323 invitesWillWork: Nothing(),
24− planetInput: "",
24+ planetInput: '',
2525 targetPlanet: Nothing(),
2626 currentPoolSize: Nothing(),
2727 cachedPoolSizes: {},
@@ -44,7 +44,7 @@ class InvitesManage extends React.Component {
4444 .isSpawnProxy(
4545 this.contracts,
4646 this.point,
47− this.contracts.delegatedSending.address,
47+ this.contracts.delegatedSending.address
4848 )
4949 .then(isSpawnProxy => {
5050 this.setState({ invitesWillWork: Just(isSpawnProxy) });
@@ -77,7 +77,7 @@ class InvitesManage extends React.Component {
7777
7878 checkCurrentInvites(who) {
7979 const cachedPoolSizes = this.state.cachedPoolSizes;
80− if (typeof cachedPoolSizes[who] !== "undefined") {
80+ if (typeof cachedPoolSizes[who] !== 'undefined') {
8181 return Just(cachedPoolSizes[who]);
8282 } else {
8383 azimuth.delegatedSending.getPool(this.contracts, who).then(pool => {
@@ -112,8 +112,8 @@ class InvitesManage extends React.Component {
112112 this.contracts,
113113 this.point,
114114 this.state.targetPlanet.value,
115− this.state.targetPoolSize,
116− ),
115+ this.state.targetPoolSize
116+ )
117117 );
118118 }
119119
@@ -122,18 +122,18 @@ class InvitesManage extends React.Component {
122122 if (this.state.invitesWillWork.value === false) {
123123 spawnProxyWarning = (
124124 <Warning>
125− <h3 className={"mb-2"}>{"Warning"}</h3>
126− {"Planets under this star will not be able to send invites " +
127− "until the invite contract ("}
125+ <h3 className={'mb-2'}>{'Warning'}</h3>
126+ {'Planets under this star will not be able to send invites ' +
127+ 'until the invite contract ('}
128128 <code>{this.contracts.delegatedSending.address}</code>
129− {") is made spawn proxy for this star."}
129+ {') is made spawn proxy for this star.'}
130130 </Warning>
131131 );
132132 }
133133
134134 let poolSizeText = this.state.currentPoolSize.matchWith({
135135 Just: ps => `(currently ${ps.value})`,
136− Nothing: _ => "",
136+ Nothing: _ => '',
137137 });
138138
139139 return (
@@ -141,7 +141,7 @@ class InvitesManage extends React.Component {
141141 <Col>
142142 <p>
143143 {
144− "manage invites here, for stars. can only give invites to child planets"
144+ 'manage invites here, for stars. can only give invites to child planets'
145145 }
146146 </p>
147147
@@ -150,11 +150,10 @@ class InvitesManage extends React.Component {
150150 <PointInput
151151 prop-format="innerlabel"
152152 prop-size="lg"
153− placeholder={"~sampel-sipnem"}
153+ placeholder={'~sampel-sipnem'}
154154 value={this.state.planetInput}
155− onChange={this.handlePointInput}
156− >
157− <InnerLabel>{"Planet to set invites for"}</InnerLabel>
155+ onChange={this.handlePointInput}>
156+ <InnerLabel>{'Planet to set invites for'}</InnerLabel>
158157 <ValidatedSigil
159158 patp={this.state.targetPlanet}
160159 validator={() => this.validatePoint}
@@ -165,8 +164,7 @@ class InvitesManage extends React.Component {
165164 prop-format="innerlabel"
166165 prop-size="lg"
167166 value={this.state.targetPoolSize}
168− onChange={this.handlePoolSizeInput}
169− >
167+ onChange={this.handlePoolSizeInput}>
170168 <InnerLabel>{`Available invites ${poolSizeText}`}</InnerLabel>
171169 </Input>
172170
src/bridge/views/InvitesSend.js+69−72
@@ -1,13 +1,13 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import React from "react";
3−import * as azimuth from "azimuth-js";
4−import * as need from "../lib/need";
1+import { Just, Nothing } from 'folktale/maybe';
2+import React from 'react';
3+import * as azimuth from 'azimuth-js';
4+import * as need from '../lib/need';
55
6−import { hasReceived, sendMail } from "../lib/inviteMail";
7−import { Row, Col, Button, Input, H3, Warning } from "../components/Base";
6+import { hasReceived, sendMail } from '../lib/inviteMail';
7+import { Row, Col, Button, Input, H3, Warning } from '../components/Base';
88
99// for wallet generation
10−import * as wg from "../../walletgen/lib/lib";
10+import * as wg from '../../walletgen/lib/lib';
1111
1212// for transaction generation and signing
1313import {
@@ -17,27 +17,27 @@ import {
1717 hexify,
1818 fromWei,
1919 toWei,
20−} from "../lib/txn";
21−import * as tank from "../lib/tank";
20+} from '../lib/txn';
21+import * as tank from '../lib/tank';
2222
2323const GAS_PRICE_GWEI = 20; // we pay the premium for faster ux
2424const GAS_LIMIT = 350000;
25−const INVITE_COST = toWei((GAS_PRICE_GWEI * GAS_LIMIT).toString(), "gwei");
25+const INVITE_COST = toWei((GAS_PRICE_GWEI * GAS_LIMIT).toString(), 'gwei');
2626
2727const STATUS = {
28− INPUT: "Generate invites",
29− GENERATING: "Generating invites",
30− CAN_SEND: "Send invites",
31− FUNDING: "Funding invites",
32− SENDING: "Sending invites",
33− DONE: "Done",
34− FAIL: "Some failed",
28+ INPUT: 'Generate invites',
29+ GENERATING: 'Generating invites',
30+ CAN_SEND: 'Send invites',
31+ FUNDING: 'Funding invites',
32+ SENDING: 'Sending invites',
33+ DONE: 'Done',
34+ FAIL: 'Some failed',
3535};
3636
3737const EMAIL_STATUS = {
38− BUSY: "⋯",
39− DONE: "✔",
40− FAIL: "×",
38+ BUSY: '⋯',
39+ DONE: '✔',
40+ FAIL: '×',
4141};
4242
4343class InvitesSend extends React.Component {
@@ -47,7 +47,7 @@ class InvitesSend extends React.Component {
4747 this.state = {
4848 invitesAvailable: Nothing(),
4949 invited: Nothing(),
50− targets: [{ email: "", hasReceived: Nothing(), status: Nothing() }],
50+ targets: [{ email: '', hasReceived: Nothing(), status: Nothing() }],
5151 status: STATUS.INPUT,
5252 errors: Nothing(),
5353 //
@@ -89,7 +89,7 @@ class InvitesSend extends React.Component {
8989 async findInvited() {
9090 let invited = await azimuth.delegatedSending.getInvited(
9191 this.contracts,
92− this.point,
92+ this.point
9393 );
9494 invited = invited.map(async point => {
9595 const active = await azimuth.azimuth.isActive(this.contracts, point);
@@ -116,13 +116,13 @@ class InvitesSend extends React.Component {
116116 const planets = await azimuth.delegatedSending.getPlanetsToSend(
117117 this.contracts,
118118 this.point,
119− targets.length,
119+ targets.length
120120 );
121121
122122 // account for the race condition where invites got used up while we were
123123 // composing our target list
124124 if (planets.length < targets.length) {
125− this.addError("Can currently only send " + planets.length + " invites!");
125+ this.addError('Can currently only send ' + planets.length + ' invites!');
126126 return;
127127 }
128128
@@ -132,7 +132,7 @@ class InvitesSend extends React.Component {
132132 // create invite wallets and transactions
133133 let invites = []; // { email, ticket, signedTx, rawTx }
134134 for (let i = 0; i < targets.length; i++) {
135− console.log("generating email", i, targets[i].email);
135+ console.log('generating email', i, targets[i].email);
136136 this.setEmailStatus(i, EMAIL_STATUS.BUSY);
137137
138138 const email = targets[i].email;
@@ -142,7 +142,7 @@ class InvitesSend extends React.Component {
142142 this.contracts,
143143 this.point,
144144 planets[i],
145− wallet.owner,
145+ wallet.owner
146146 );
147147 const signedTx = await signTransaction({
148148 ...this.props,
@@ -183,7 +183,7 @@ class InvitesSend extends React.Component {
183183 this.askForFunding,
184184 () => {
185185 this.setState({ fundingMessage: Nothing() });
186− },
186+ }
187187 );
188188
189189 this.setState({ status: STATUS.SENDING });
@@ -200,11 +200,11 @@ class InvitesSend extends React.Component {
200200 web3,
201201 Just(invite.signedTx),
202202 tankWasUsed,
203− () => {},
203+ () => {}
204204 );
205205 } catch (err) {
206− console.error("invite tx sending failed", err);
207− this.addError("Invite transaction not sent for " + invite.email);
206+ console.error('invite tx sending failed', err);
207+ this.addError('Invite transaction not sent for ' + invite.email);
208208 this.setEmailStatus(i, EMAIL_STATUS.FAIL);
209209 continue;
210210 }
@@ -216,19 +216,19 @@ class InvitesSend extends React.Component {
216216 const mailSuccess = await sendMail(
217217 invite.email,
218218 invite.ticket,
219− invite.rawTx,
219+ invite.rawTx
220220 );
221221 if (!mailSuccess) throw new Error();
222222 this.setEmailStatus(i, EMAIL_STATUS.DONE);
223223 } catch (e) {
224− console.log("email send failed");
224+ console.log('email send failed');
225225 //NOTE this assumes that the transaction succeeds, but we don't know
226226 // that for a fact yet...
227227 this.addError(
228− "Invite email failed to send for " +
228+ 'Invite email failed to send for ' +
229229 invite.email +
230− ". Please give them this ticket: " +
231− invite.ticket,
230+ '. Please give them this ticket: ' +
231+ invite.ticket
232232 );
233233 this.setEmailStatus(i, EMAIL_STATUS.FAIL);
234234 continue;
@@ -240,12 +240,12 @@ class InvitesSend extends React.Component {
240240 if (success) {
241241 this.setEmailStatus(i, EMAIL_STATUS.DONE);
242242 } else {
243− console.log("invite tx rejected");
244− this.addError("Invite transaction failed for " + invite.email);
243+ console.log('invite tx rejected');
244+ this.addError('Invite transaction failed for ' + invite.email);
245245 this.setEmailStatus(i, EMAIL_STATUS.FAIL);
246246 }
247247 return success;
248− }),
248+ })
249249 );
250250 }
251251
@@ -279,9 +279,9 @@ class InvitesSend extends React.Component {
279279 fundingMessage: Just(
280280 `Please make sure ${address} has at least ${fromWei(minBalance)} ETH,` +
281281 `we'll continue once that's true. Current balance: ${fromWei(
282− balance,
282+ balance
283283 )}.` +
284− `Waiting...`,
284+ `Waiting...`
285285 ),
286286 });
287287 }
@@ -328,7 +328,7 @@ class InvitesSend extends React.Component {
328328
329329 addTarget() {
330330 let targets = this.state.targets;
331− targets.push({ email: "", hasReceived: Nothing(), status: Nothing() });
331+ targets.push({ email: '', hasReceived: Nothing(), status: Nothing() });
332332 this.setState({ targets });
333333 }
334334
@@ -343,24 +343,24 @@ class InvitesSend extends React.Component {
343343 this.state.status === STATUS.DONE ? this.state.targets.length : null;
344344
345345 const invitesAvailable = this.state.invitesAvailable.matchWith({
346− Nothing: () => "Loading...",
346+ Nothing: () => 'Loading...',
347347 Just: invites => {
348− const dia = dif ? `(-${dif})` : "";
348+ const dia = dif ? `(-${dif})` : '';
349349 return `You currently have ${invites.value}${dia} invitations left.`;
350350 },
351351 });
352352
353353 const invitesSent = this.state.invited.matchWith({
354− Nothing: () => <>{"Loading..."}</>,
354+ Nothing: () => <>{'Loading...'}</>,
355355 Just: invited => {
356− const dit = dif ? `(+${dif})` : "";
356+ const dit = dif ? `(+${dif})` : '';
357357 return (
358358 <>
359− {"Out of the "}
359+ {'Out of the '}
360360 {invited.value.total + dit}
361− {" invites you sent, "}
361+ {' invites you sent, '}
362362 {invited.value.accepted}
363− {" have been accepted."}
363+ {' have been accepted.'}
364364 </>
365365 );
366366 },
@@ -369,9 +369,9 @@ class InvitesSend extends React.Component {
369369 const error = this.state.errors.matchWith({
370370 Nothing: () => null,
371371 Just: errors => (
372− <Warning className={"mt-8"}>
372+ <Warning className={'mt-8'}>
373373 <H3 style={{ marginTop: 0, paddingTop: 0 }}>
374− {"Something went wrong!"}
374+ {'Something went wrong!'}
375375 </H3>
376376 {errors.value.map(err => (
377377 <p>{err}</p>
@@ -382,31 +382,30 @@ class InvitesSend extends React.Component {
382382
383383 const fundingMessage = this.state.fundingMessage.matchWith({
384384 Nothing: () => null,
385− Just: msg => <Warning className={"mt-8"}>{msg.value}</Warning>,
385+ Just: msg => <Warning className={'mt-8'}>{msg.value}</Warning>,
386386 });
387387
388388 let inputs;
389389 if (this.state.status === STATUS.DONE) {
390390 //TODO proper clickable router thing
391− inputs = "<- Back to Home";
391+ inputs = '<- Back to Home';
392392 } else {
393393 const inputDisabled = this.state.status !== STATUS.INPUT;
394394
395395 const lessButton = (
396396 <Button
397− prop-size={"s narrow"}
398− className={"mt-8"}
397+ prop-size={'s narrow'}
398+ className={'mt-8'}
399399 disabled={inputDisabled || this.state.targets.length === 1}
400− onClick={this.removeTarget}
401− >
402− {"-"}
400+ onClick={this.removeTarget}>
401+ {'-'}
403402 </Button>
404403 );
405404
406405 const moreButton = (
407406 <Button
408− prop-size={"s narrow"}
409− className={"mt-8"}
407+ prop-size={'s narrow'}
408+ className={'mt-8'}
410409 disabled={
411410 inputDisabled ||
412411 this.state.invitesAvailable.matchWith({
@@ -414,9 +413,8 @@ class InvitesSend extends React.Component {
414413 Just: inv => inv.value <= this.state.targets.length,
415414 })
416415 }
417− onClick={this.addTarget}
418− >
419− {"+"}
416+ onClick={this.addTarget}>
417+ {'+'}
420418 </Button>
421419 );
422420
@@ -424,7 +422,7 @@ class InvitesSend extends React.Component {
424422 for (let i = 0; i < this.state.targets.length; i++) {
425423 const target = this.state.targets[i];
426424 let progress = target.status.matchWith({
427− Nothing: () => "",
425+ Nothing: () => '',
428426 Just: status => status.value,
429427 });
430428 targetInputs.push(
@@ -434,23 +432,23 @@ class InvitesSend extends React.Component {
434432 onChange={value => {
435433 this.handleEmailInput(i, value);
436434 }}
437− placeholder={"Email address"}
435+ placeholder={'Email address'}
438436 disabled={inputDisabled}
439437 />
440438 {target.hasReceived.matchWith({
441439 Nothing: () => null,
442440 Just: has =>
443− has.value ? <span>{"×"}</span> : <span>{"°"}</span>,
441+ has.value ? <span>{'×'}</span> : <span>{'°'}</span>,
444442 })}
445443 {progress}
446− </>,
444+ </>
447445 );
448446 }
449447
450448 const submitButton = (
451449 <Button
452− prop-size={"xl wide"}
453− className={"mt-8"}
450+ prop-size={'xl wide'}
451+ className={'mt-8'}
454452 disabled={
455453 (inputDisabled && this.state.status !== STATUS.CAN_SEND) ||
456454 !this.canSend()
@@ -458,8 +456,7 @@ class InvitesSend extends React.Component {
458456 onClick={() => {
459457 if (this.state.status === STATUS.INPUT) this.generateInvites();
460458 if (this.state.status === STATUS.CAN_SEND) this.sendInvites();
461− }}
462− >
459+ }}>
463460 {this.state.status}
464461 </Button>
465462 );
@@ -477,9 +474,9 @@ class InvitesSend extends React.Component {
477474 return (
478475 <Row>
479476 <Col>
480− <p>{"send invites here, for planets"}</p>
477+ <p>{'send invites here, for planets'}</p>
481478
482− <p>{"send invites here, for planets"}</p>
479+ <p>{'send invites here, for planets'}</p>
483480
484481 <p>{invitesAvailable}</p>
485482
src/bridge/views/IssueChild.js+42−46
@@ -1,8 +1,8 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import React from "react";
3−import { azimuth, ecliptic } from "azimuth-js";
4−import * as ob from "urbit-ob";
5−import * as need from "../lib/need";
1+import { Just, Nothing } from 'folktale/maybe';
2+import React from 'react';
3+import { azimuth, ecliptic } from 'azimuth-js';
4+import * as ob from 'urbit-ob';
5+import * as need from '../lib/need';
66
77import {
88 Row,
@@ -15,15 +15,15 @@ import {
1515 PointInput,
1616 AddressInput,
1717 InnerLabel,
18−} from "../components/Base";
18+} from '../components/Base';
1919
20−import StatelessTransaction from "../components/StatelessTransaction";
20+import StatelessTransaction from '../components/StatelessTransaction';
2121
22−import { NETWORK_NAMES } from "../lib/network";
23−import { getSpawnCandidate } from "../lib/child";
24−import { canDecodePatp } from "../lib/txn";
22+import { NETWORK_NAMES } from '../lib/network';
23+import { getSpawnCandidate } from '../lib/child';
24+import { canDecodePatp } from '../lib/txn';
2525
26−import { isValidAddress } from "../lib/wallet";
26+import { isValidAddress } from '../lib/wallet';
2727
2828const setFind = (set, pred) => {
2929 for (const e of set) {
@@ -50,13 +50,13 @@ class IssueChild extends React.Component {
5050 ];
5151
5252 this.state = {
53− receivingAddress: "",
53+ receivingAddress: '',
5454 issuingPoint: issuingPoint,
55− desiredPoint: "",
55+ desiredPoint: '',
5656 isAvailable: Nothing(), // use Nothing to allow attempt when offline
5757 suggestions: suggestions,
5858 validChildren: new Set(),
59− autoComplete: "",
59+ autoComplete: '',
6060 };
6161
6262 this.handlePointInput = this.handlePointInput.bind(this);
@@ -84,9 +84,9 @@ class IssueChild extends React.Component {
8484 if (desiredPoint.length < 15) {
8585 const suggestedPoint =
8686 setFind(this.state.validChildren, e => e.startsWith(desiredPoint)) ||
87− "";
87+ '';
8888 const rendered =
89− " ".repeat(desiredPoint.length) +
89+ ' '.repeat(desiredPoint.length) +
9090 suggestedPoint.substring(desiredPoint.length);
9191
9292 const available = Just(this.state.validChildren.has(desiredPoint));
@@ -114,7 +114,7 @@ class IssueChild extends React.Component {
114114 const txn = ecliptic.spawn(
115115 validContracts,
116116 pointDec,
117− state.receivingAddress,
117+ state.receivingAddress
118118 );
119119
120120 return Just(txn);
@@ -156,14 +156,14 @@ class IssueChild extends React.Component {
156156
157157 const esdomain =
158158 props.networkType === NETWORK_NAMES.ROPSTEN
159− ? "ropsten.etherscan.io"
160− : "etherscan.io";
159+ ? 'ropsten.etherscan.io'
160+ : 'etherscan.io';
161161
162162 return (
163163 <Row>
164164 <Col>
165165 <H1>
166− {"Issue a Child From "}{" "}
166+ {'Issue a Child From '}{' '}
167167 <code>{`${ob.patp(state.issuingPoint)}`}</code>
168168 </H1>
169169
@@ -177,38 +177,36 @@ class IssueChild extends React.Component {
177177 {`Your point can only issue children with particular names. Some
178178 valid suggestions for `}
179179 {<code>{ob.patp(state.issuingPoint)}</code>}
180− {" are "}
180+ {' are '}
181181 <code>{state.suggestions[0]}</code>
182− {", "}
182+ {', '}
183183 <code>{state.suggestions[1]}</code>
184− {", and "}
184+ {', and '}
185185 <code>{state.suggestions[2]}</code>
186− {"."}
186+ {'.'}
187187 </P>
188188
189189 <PointInput
190190 prop-size="lg"
191191 prop-format="innerLabel"
192− className={"mono mt-8"}
192+ className={'mono mt-8'}
193193 placeholder={`e.g. ${state.suggestions[3]}`}
194194 value={state.desiredPoint}
195− onChange={this.handlePointInput}
196− >
197− <InnerLabel>{"Point to Issue"}</InnerLabel>
195+ onChange={this.handlePointInput}>
196+ <InnerLabel>{'Point to Issue'}</InnerLabel>
198197 <div
199198 style={{
200− marginTop: "8.8rem",
201− marginLeft: "4.6rem",
202− fontSize: "5rem",
203− color: "#757575",
204− whiteSpace: "pre-wrap",
199+ marginTop: '8.8rem',
200+ marginLeft: '4.6rem',
201+ fontSize: '5rem',
202+ color: '#757575',
203+ whiteSpace: 'pre-wrap',
205204 }}
206− className="abs tl-0 mono"
207− >
205+ className="abs tl-0 mono">
208206 {state.autoComplete}
209207 </div>
210208 <ValidatedSigil
211− className={"tr-0 mt-05 mr-0 abs"}
209+ className={'tr-0 mt-05 mr-0 abs'}
212210 patp={state.desiredPoint}
213211 size={68}
214212 margin={8}
@@ -225,22 +223,20 @@ class IssueChild extends React.Component {
225223 disabled={
226224 Nothing.hasInstance(state.isAvailable) || !state.isAvailable.value
227225 }
228− onChange={v => this.handleAddressInput(v)}
229− >
230− <InnerLabel>{"Receiving Address"}</InnerLabel>
231− <ShowBlockie className={"mt-1"} address={state.receivingAddress} />
226+ onChange={v => this.handleAddressInput(v)}>
227+ <InnerLabel>{'Receiving Address'}</InnerLabel>
228+ <ShowBlockie className={'mt-1'} address={state.receivingAddress} />
232229 </AddressInput>
233230
234231 <Anchor
235− className={"mt-1"}
236− prop-size={"sm"}
232+ className={'mt-1'}
233+ prop-size={'sm'}
237234 prop-disabled={
238235 !isValidAddress(state.receivingAddress) || !esvisible
239236 }
240− target={"_blank"}
241− href={`https://${esdomain}/address/${state.receivingAddress}`}
242− >
243− {"View on Etherscan ↗"}
237+ target={'_blank'}
238+ href={`https://${esdomain}/address/${state.receivingAddress}`}>
239+ {'View on Etherscan ↗'}
244240 </Anchor>
245241
246242 <StatelessTransaction
src/bridge/views/Keystore.js+33−37
@@ -1,15 +1,15 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import { Ok, Error } from "folktale/result";
3−import React from "react";
4−import * as keythereum from "keythereum";
5−import { Button, UploadButton } from "../components/Base";
6−import { Input, InnerLabel, InputCaption } from "../components/Base";
7−import { Row, Col, H1, H3, Warning } from "../components/Base";
8−
9−import { BRIDGE_ERROR } from "../lib/error";
10−import { ROUTE_NAMES } from "../lib/routeNames";
11−import { withHistory } from "../store/history";
12−import { EthereumWallet } from "../lib/wallet";
1+import { Just, Nothing } from 'folktale/maybe';
2+import { Ok, Error } from 'folktale/result';
3+import React from 'react';
4+import * as keythereum from 'keythereum';
5+import { Button, UploadButton } from '../components/Base';
6+import { Input, InnerLabel, InputCaption } from '../components/Base';
7+import { Row, Col, H1, H3, Warning } from '../components/Base';
8+
9+import { BRIDGE_ERROR } from '../lib/error';
10+import { ROUTE_NAMES } from '../lib/routeNames';
11+import { withHistory } from '../store/history';
12+import { EthereumWallet } from '../lib/wallet';
1313
1414class Keystore extends React.Component {
1515 constructor(props) {
@@ -17,7 +17,7 @@ class Keystore extends React.Component {
1717
1818 this.state = {
1919 keystore: Nothing(), // Maybe<Result<String, String>>
20− password: "",
20+ password: '',
2121 decryptionProblem: false,
2222 };
2323
@@ -70,7 +70,7 @@ class Keystore extends React.Component {
7070 };
7171
7272 const failure = _ => {
73− const message = "There was a problem uploading your Keystore file";
73+ const message = 'There was a problem uploading your Keystore file';
7474 this.setState({ keystore: Just(Error(message)) });
7575 };
7676
@@ -85,11 +85,11 @@ class Keystore extends React.Component {
8585 const { keystore, password, decryptionProblem } = this.state;
8686
8787 const uploadButtonClass = keystore.matchWith({
88− Nothing: _ => "bg-blue white",
88+ Nothing: _ => 'bg-blue white',
8989 Just: ks =>
9090 ks.value.matchWith({
91− Ok: _ => "bg-green white",
92− Error: _ => "bg-yellow black",
91+ Ok: _ => 'bg-green white',
92+ Error: _ => 'bg-yellow black',
9393 }),
9494 });
9595
@@ -97,18 +97,18 @@ class Keystore extends React.Component {
9797 decryptionProblem === false ? (
9898 <div />
9999 ) : (
100− <Warning className={"mt-8"}>
100+ <Warning className={'mt-8'}>
101101 <H3 style={{ marginTop: 0, paddingTop: 0 }}>
102102 {"Couldn't decrypt wallet."}
103103 </H3>
104− {"You may have entered an incorrect password."}
104+ {'You may have entered an incorrect password.'}
105105 </Warning>
106106 );
107107
108108 return (
109109 <Row>
110− <Col className={"measure-md"}>
111− <H1 className={"mb-4"}>{"Upload Your Keystore File"}</H1>
110+ <Col className={'measure-md'}>
111+ <H1 className={'mb-4'}>{'Upload Your Keystore File'}</H1>
112112 <InputCaption>
113113 {`Please upload your Ethereum keystore file. If your keystore
114114 file is encrypted with a password, you'll also need to enter
@@ -117,10 +117,9 @@ class Keystore extends React.Component {
117117
118118 <UploadButton
119119 className={`btn ${uploadButtonClass} mt-10`}
120− onChange={this.handleKeystoreUpload}
121− >
122− <div className={"flex-center-all fs-4 h-11 pointer"}>
123− {"Upload Keystore file"}
120+ onChange={this.handleKeystoreUpload}>
121+ <div className={'flex-center-all fs-4 h-11 pointer'}>
122+ {'Upload Keystore file'}
124123 </div>
125124 </UploadButton>
126125
@@ -133,29 +132,26 @@ class Keystore extends React.Component {
133132 onChange={this.handlePasswordInput}
134133 value={password}
135134 autocomplete="off"
136− autoFocus
137− >
138− <InnerLabel>{"Password"}</InnerLabel>
135+ autoFocus>
136+ <InnerLabel>{'Password'}</InnerLabel>
139137 </Input>
140138
141139 <Button
142140 className={` mt-10`}
143− prop-size={"wide lg"}
141+ prop-size={'wide lg'}
144142 disabled={Nothing.hasInstance(keystore)}
145− onClick={this.constructWallet}
146− >
147− {"Decrypt"}
143+ onClick={this.constructWallet}>
144+ {'Decrypt'}
148145 </Button>
149146
150147 {decryptMessage}
151148
152149 <Button
153− className={"mt-10"}
154− prop-size={"wide lg"}
150+ className={'mt-10'}
151+ prop-size={'wide lg'}
155152 disabled={Nothing.hasInstance(wallet)}
156− onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}
157− >
158− {"Continue →"}
153+ onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}>
154+ {'Continue →'}
159155 </Button>
160156 </Col>
161157 </Row>
src/bridge/views/Landing.js+24−27
@@ -1,10 +1,10 @@
1−import React from "react";
2−import { Button } from "../components/Base";
3−import { Row, Col } from "../components/Base";
4−import { H1, P } from "../components/Base";
1+import React from 'react';
2+import { Button } from '../components/Base';
3+import { Row, Col } from '../components/Base';
4+import { H1, P } from '../components/Base';
55
6−import { ROUTE_NAMES } from "../lib/routeNames";
7−import { useHistory } from "../store/history";
6+import { ROUTE_NAMES } from '../lib/routeNames';
7+import { useHistory } from '../store/history';
88
99function Landing(props) {
1010 const history = useHistory();
@@ -12,51 +12,48 @@ function Landing(props) {
1212 return (
1313 <Row>
1414 <Col>
15− <H1>{"Welcome"}</H1>
15+ <H1>{'Welcome'}</H1>
1616
1717 <P>
18− {"Bridge is a tool for managing and viewing assets on " +
19− "Azimuth, the Urbit address space."}
18+ {'Bridge is a tool for managing and viewing assets on ' +
19+ 'Azimuth, the Urbit address space.'}
2020 </P>
2121
2222 <Button
2323 prop-type="link"
2424 prop-size="lg"
25− className={"mb-4 mt-8"}
26− onClick={() => history.push(ROUTE_NAMES.INVITE_TICKET)}
27− >
28− {"Claim an invite →"}
25+ className={'mb-4 mt-8'}
26+ onClick={() => history.push(ROUTE_NAMES.INVITE_TICKET)}>
27+ {'Claim an invite →'}
2928 </Button>
3029
31− <P>{"If you were sent an Azimuth invite code, start here."}</P>
30+ <P>{'If you were sent an Azimuth invite code, start here.'}</P>
3231
3332 <Button
3433 prop-type="link"
3534 prop-size="lg"
36− className={"mb-4 mt-8"}
37− onClick={() => history.push(ROUTE_NAMES.NETWORK)}
38− >
39− {"Unlock a Wallet →"}
35+ className={'mb-4 mt-8'}
36+ onClick={() => history.push(ROUTE_NAMES.NETWORK)}>
37+ {'Unlock a Wallet →'}
4038 </Button>
4139
4240 <P>
43− {"If you own Azimuth assets and want to manage them in some " +
41+ {'If you own Azimuth assets and want to manage them in some ' +
4442 "way, start here. You'll need either your Urbit ticket or a " +
45− "keypair."}
43+ 'keypair.'}
4644 </P>
4745
4846 {
4947 <Row>
5048 <Col>
5149 <Button
52− prop-type={"link"}
53− prop-size={"lg"}
54− className={"mb-4 mt-8"}
55− onClick={() => history.push(ROUTE_NAMES.VIEW_SHIP)}
56− >
57− {"View a point →"}
50+ prop-type={'link'}
51+ prop-size={'lg'}
52+ className={'mb-4 mt-8'}
53+ onClick={() => history.push(ROUTE_NAMES.VIEW_SHIP)}>
54+ {'View a point →'}
5855 </Button>
59− <P>{"View an Azimuth point without signing into a wallet."}</P>
56+ <P>{'View an Azimuth point without signing into a wallet.'}</P>
6057 </Col>
6158 </Row>
6259 // FIXME add address view
src/bridge/views/Ledger.js+63−67
@@ -1,20 +1,20 @@
1−import * as bip32 from "bip32";
2−import React from "react";
3−import Maybe from "folktale/maybe";
4−import { Button } from "../components/Base";
5−import { Row, Col, H1, P, H2 } from "../components/Base";
6−import { Input, InnerLabel, InnerLabelDropdown } from "../components/Base";
7−import Transport from "@ledgerhq/hw-transport-u2f";
8−import Eth from "@ledgerhq/hw-app-eth";
9−import * as secp256k1 from "secp256k1";
1+import * as bip32 from 'bip32';
2+import React from 'react';
3+import Maybe from 'folktale/maybe';
4+import { Button } from '../components/Base';
5+import { Row, Col, H1, P, H2 } from '../components/Base';
6+import { Input, InnerLabel, InnerLabelDropdown } from '../components/Base';
7+import Transport from '@ledgerhq/hw-transport-u2f';
8+import Eth from '@ledgerhq/hw-app-eth';
9+import * as secp256k1 from 'secp256k1';
1010
11−import { LEDGER_LIVE_PATH, LEDGER_LEGACY_PATH } from "../lib/ledger";
12−import { ROUTE_NAMES } from "../lib/routeNames";
13−import { withHistory } from "../store/history";
11+import { LEDGER_LIVE_PATH, LEDGER_LEGACY_PATH } from '../lib/ledger';
12+import { ROUTE_NAMES } from '../lib/routeNames';
13+import { withHistory } from '../store/history';
1414
15−const chopHdPrefix = str => (str.slice(0, 2) === "m/" ? str.slice(2) : str);
15+const chopHdPrefix = str => (str.slice(0, 2) === 'm/' ? str.slice(2) : str);
1616
17−const addHdPrefix = str => (str.slice(0, 2) === "m/" ? str : "m/" + str);
17+const addHdPrefix = str => (str.slice(0, 2) === 'm/' ? str : 'm/' + str);
1818
1919class Ledger extends React.Component {
2020 constructor(props) {
@@ -43,7 +43,7 @@ class Ledger extends React.Component {
4343
4444 updateHdPath(basePath, account) {
4545 let hdpath = this.state.hdpath;
46− if (basePath !== "custom") {
46+ if (basePath !== 'custom') {
4747 hdpath = basePath.replace(/x/g, account);
4848 }
4949 this.setState({ basePath, account, hdpath });
@@ -63,8 +63,8 @@ class Ledger extends React.Component {
6363
6464 eth.getAddress(path, false, true).then(
6565 info => {
66− const publicKey = Buffer.from(info.publicKey, "hex");
67− const chainCode = Buffer.from(info.chainCode, "hex");
66+ const publicKey = Buffer.from(info.publicKey, 'hex');
67+ const chainCode = Buffer.from(info.chainCode, 'hex');
6868 const pub = secp256k1.publicKeyConvert(publicKey, true);
6969 const hd = bip32.fromPublicKey(pub, chainCode);
7070 setWallet(Maybe.Just(hd));
@@ -72,7 +72,7 @@ class Ledger extends React.Component {
7272 },
7373 _ => {
7474 setWallet(Maybe.Nothing());
75− },
75+ }
7676 );
7777 }
7878
@@ -82,11 +82,11 @@ class Ledger extends React.Component {
8282 const { handlePathSelection, handleAccountSelection } = this;
8383
8484 const pathOptions = [
85− { title: "Ledger Live", value: LEDGER_LIVE_PATH },
86− { title: "Ledger Legacy", value: LEDGER_LEGACY_PATH },
85+ { title: 'Ledger Live', value: LEDGER_LIVE_PATH },
86+ { title: 'Ledger Legacy', value: LEDGER_LEGACY_PATH },
8787 {
88− title: "Custom path",
89− value: "custom",
88+ title: 'Custom path',
89+ value: 'custom',
9090 },
9191 ];
9292 let basePathTitle = pathOptions.find(o => o.value === basePath).title;
@@ -94,7 +94,7 @@ class Ledger extends React.Component {
9494 let accountOptions = [];
9595 for (let i = 0; i < 20; i++) {
9696 accountOptions.push({
97− title: "Account #" + (i + 1),
97+ title: 'Account #' + (i + 1),
9898 value: i,
9999 });
100100 }
@@ -105,14 +105,14 @@ class Ledger extends React.Component {
105105 className="mt-8"
106106 options={pathOptions}
107107 handleUpdate={handlePathSelection}
108− title={"Derivation path"}
108+ title={'Derivation path'}
109109 currentSelectionTitle={basePathTitle}
110110 fullWidth={true}
111111 />
112112 );
113113
114114 const truePathSelection =
115− basePath === "custom" ? (
115+ basePath === 'custom' ? (
116116 <Input
117117 className="pt-8 mt-4 text-mono"
118118 prop-size="md"
@@ -120,9 +120,8 @@ class Ledger extends React.Component {
120120 name="hdpath"
121121 value={addHdPrefix(hdpath)}
122122 autocomplete="off"
123− onChange={this.handleHdPathInput}
124− >
125− <InnerLabel>{"HD Path"}</InnerLabel>
123+ onChange={this.handleHdPathInput}>
124+ <InnerLabel>{'HD Path'}</InnerLabel>
126125 </Input>
127126 ) : (
128127 <InnerLabelDropdown
@@ -131,7 +130,7 @@ class Ledger extends React.Component {
131130 prop-format="innerLabel"
132131 options={accountOptions}
133132 handleUpdate={handleAccountSelection}
134− title={"Account"}
133+ title={'Account'}
135134 currentSelectionTitle={accountTitle}
136135 fullWidth={true}
137136 />
@@ -139,10 +138,10 @@ class Ledger extends React.Component {
139138
140139 return (
141140 <Row>
142− <Col className={"measure-md"}>
143− <H1>{"Authenticate With Your Ledger"}</H1>
141+ <Col className={'measure-md'}>
142+ <H1>{'Authenticate With Your Ledger'}</H1>
144143
145− <H2>{"Running on HTTPS?"}</H2>
144+ <H2>{'Running on HTTPS?'}</H2>
146145
147146 <P>
148147 {`Connect and authenticate to your Ledger, and then open the
@@ -157,42 +156,41 @@ class Ledger extends React.Component {
157156 it below.`}
158157 </P>
159158
160− <H2>{"Running on HTTP?"}</H2>
159+ <H2>{'Running on HTTP?'}</H2>
161160
162161 <P>{`To authenticate and sign transactions with a Ledger, Bridge
163162 must be serving over HTTPS on localhost. You can do this via the
164163 following:`}</P>
165164
166− <ol className={"measure-md"}>
167− <li className={"mt-4"}>
168− {"Install"}{" "}
165+ <ol className={'measure-md'}>
166+ <li className={'mt-4'}>
167+ {'Install'}{' '}
169168 <a
170− target={"_blank"}
171− href={"https://github.com/FiloSottile/mkcert"}
172− >
173− {"mkcert"}
169+ target={'_blank'}
170+ href={'https://github.com/FiloSottile/mkcert'}>
171+ {'mkcert'}
174172 </a>
175173 </li>
176− <li className={"mt-4"}>
177− {"Install a local certificate authority via "}
178− <code>{"mkcert -install"}</code>
174+ <li className={'mt-4'}>
175+ {'Install a local certificate authority via '}
176+ <code>{'mkcert -install'}</code>
179177 </li>
180− <li className={"mt-4"}>
181− {"In your "}
182− <code>{"bridge"}</code>
178+ <li className={'mt-4'}>
179+ {'In your '}
180+ <code>{'bridge'}</code>
183181 {
184− " directory, generate a certificate valid for localhost via "
185− }{" "}
186− <code>{"mkcert localhost"}</code>
187− {"."}
188− {"This will produce two files: "}
189− <code>{"localhost.pem"}</code> {", the local certificate, and "}
190− <code>{"localhost-key.pem"}</code>
191− {", its corresponding private key."}
182+ ' directory, generate a certificate valid for localhost via '
183+ }{' '}
184+ <code>{'mkcert localhost'}</code>
185+ {'.'}
186+ {'This will produce two files: '}
187+ <code>{'localhost.pem'}</code> {', the local certificate, and '}
188+ <code>{'localhost-key.pem'}</code>
189+ {', its corresponding private key.'}
192190 </li>
193− <li className={"mt-4"}>
194− {"Run "}
195− <code>{"python bridge-https.py"}</code>
191+ <li className={'mt-4'}>
192+ {'Run '}
193+ <code>{'python bridge-https.py'}</code>
196194 </li>
197195 </ol>
198196
@@ -200,20 +198,18 @@ class Ledger extends React.Component {
200198 {truePathSelection}
201199
202200 <Button
203− prop-size={"wide lg"}
204− className={"mt-8"}
205− onClick={this.pollDevice}
206− >
207− {"Authenticate →"}
201+ prop-size={'wide lg'}
202+ className={'mt-8'}
203+ onClick={this.pollDevice}>
204+ {'Authenticate →'}
208205 </Button>
209206
210207 <Button
211− className={"mt-8"}
212− prop-size={"wide lg"}
208+ className={'mt-8'}
209+ prop-size={'wide lg'}
213210 disabled={Maybe.Nothing.hasInstance(wallet)}
214− onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}
215− >
216− {"Continue →"}
211+ onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}>
212+ {'Continue →'}
217213 </Button>
218214 </Col>
219215 </Row>
src/bridge/views/Mnemonic.js+28−32
@@ -1,26 +1,26 @@
1−import * as bip39 from "bip39";
2−import { Just, Nothing } from "folktale/maybe";
3−import React from "react";
4−import { Button } from "../components/Base";
1+import * as bip39 from 'bip39';
2+import { Just, Nothing } from 'folktale/maybe';
3+import React from 'react';
4+import { Button } from '../components/Base';
55import {
66 Input,
77 MnemonicInput,
88 InnerLabel,
99 InputCaption,
10−} from "../components/Base";
11−import { Row, Col, H1 } from "../components/Base";
10+} from '../components/Base';
11+import { Row, Col, H1 } from '../components/Base';
1212
13−import { ROUTE_NAMES } from "../lib/routeNames";
14−import { withHistory } from "../store/history";
15−import { DEFAULT_HD_PATH, walletFromMnemonic } from "../lib/wallet";
13+import { ROUTE_NAMES } from '../lib/routeNames';
14+import { withHistory } from '../store/history';
15+import { DEFAULT_HD_PATH, walletFromMnemonic } from '../lib/wallet';
1616
1717class Mnemonic extends React.Component {
1818 constructor(props) {
1919 super(props);
2020
2121 this.state = {
22− mnemonic: "",
23− passphrase: "",
22+ mnemonic: '',
23+ passphrase: '',
2424 hdpath: DEFAULT_HD_PATH,
2525 };
2626
@@ -44,8 +44,8 @@ class Mnemonic extends React.Component {
4444 const hdpath = state.hdpath;
4545 this.attemptWalletDerivation(
4646 mnemonic,
47− hdpath === "" ? DEFAULT_HD_PATH : hdpath,
48− passphrase,
47+ hdpath === '' ? DEFAULT_HD_PATH : hdpath,
48+ passphrase
4949 );
5050 return {
5151 passphrase,
@@ -59,8 +59,8 @@ class Mnemonic extends React.Component {
5959 const passphrase = state.passphrase;
6060 this.attemptWalletDerivation(
6161 mnemonic,
62− hdpath === "" ? DEFAULT_HD_PATH : hdpath,
63− passphrase,
62+ hdpath === '' ? DEFAULT_HD_PATH : hdpath,
63+ passphrase
6464 );
6565 return {
6666 mnemonic,
@@ -74,8 +74,8 @@ class Mnemonic extends React.Component {
7474 const passphrase = state.passphrase;
7575 this.attemptWalletDerivation(
7676 mnemonic,
77− hdpath === "" ? DEFAULT_HD_PATH : hdpath,
78− passphrase,
77+ hdpath === '' ? DEFAULT_HD_PATH : hdpath,
78+ passphrase
7979 );
8080 return {
8181 hdpath,
@@ -98,9 +98,9 @@ class Mnemonic extends React.Component {
9898 return (
9999 <Row>
100100 <Col>
101− <H1 className={"mb-4"}>{"Enter Your Mnemonic"}</H1>
101+ <H1 className={'mb-4'}>{'Enter Your Mnemonic'}</H1>
102102 <InputCaption>
103− {"Please enter your BIP39 mnemonic here."}
103+ {'Please enter your BIP39 mnemonic here.'}
104104 </InputCaption>
105105
106106 <MnemonicInput
@@ -113,9 +113,8 @@ class Mnemonic extends React.Component {
113113 onChange={this.handleMnemonicInput}
114114 value={mnemonic}
115115 autocomplete="off"
116− autoFocus
117− >
118− <InnerLabel>{"Mnemonic"}</InnerLabel>
116+ autoFocus>
117+ <InnerLabel>{'Mnemonic'}</InnerLabel>
119118 </MnemonicInput>
120119
121120 <InputCaption>
@@ -130,9 +129,8 @@ class Mnemonic extends React.Component {
130129 type="password"
131130 value={passphrase}
132131 autocomplete="off"
133− onChange={this.handlePassphraseInput}
134− >
135− <InnerLabel>{"Passphrase"}</InnerLabel>
132+ onChange={this.handlePassphraseInput}>
133+ <InnerLabel>{'Passphrase'}</InnerLabel>
136134 </Input>
137135
138136 <InputCaption>
@@ -146,17 +144,15 @@ class Mnemonic extends React.Component {
146144 name="hdpath"
147145 value={hdpath}
148146 autocomplete="off"
149− onChange={this.handleHdPathInput}
150− >
151− <InnerLabel>{"HD Path"}</InnerLabel>
147+ onChange={this.handleHdPathInput}>
148+ <InnerLabel>{'HD Path'}</InnerLabel>
152149 </Input>
153150
154151 <Button
155− className={"mt-10"}
152+ className={'mt-10'}
156153 disabled={Nothing.hasInstance(wallet)}
157− onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}
158− >
159− {"Continue →"}
154+ onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}>
155+ {'Continue →'}
160156 </Button>
161157 </Col>
162158 </Row>
src/bridge/views/Network.js+30−35
@@ -1,15 +1,15 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import { Button } from "../components/Base";
4−import { InnerLabelDropdown } from "../components/Base";
5−import { Row, Col, H1, P } from "../components/Base";
6−import * as azimuth from "azimuth-js";
7−import Web3 from "web3";
8−
9−import { CONTRACT_ADDRESSES } from "../lib/contracts";
10−import { NETWORK_NAMES, renderNetworkType } from "../lib/network";
11−import { ROUTE_NAMES } from "../lib/routeNames";
12−import { withHistory } from "../store/history";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import { Button } from '../components/Base';
4+import { InnerLabelDropdown } from '../components/Base';
5+import { Row, Col, H1, P } from '../components/Base';
6+import * as azimuth from 'azimuth-js';
7+import Web3 from 'web3';
8+
9+import { CONTRACT_ADDRESSES } from '../lib/contracts';
10+import { NETWORK_NAMES, renderNetworkType } from '../lib/network';
11+import { ROUTE_NAMES } from '../lib/routeNames';
12+import { withHistory } from '../store/history';
1313
1414class Network extends React.Component {
1515 constructor(props) {
@@ -24,7 +24,7 @@ class Network extends React.Component {
2424 if (network === NETWORK_NAMES.LOCAL) {
2525 setNetworkType(network);
2626
27− const endpoint = "ws://localhost:8545";
27+ const endpoint = 'ws://localhost:8545';
2828 const provider = new Web3.providers.WebsocketProvider(endpoint);
2929 const web3 = new Web3(provider);
3030 const contracts = azimuth.initContracts(web3, CONTRACT_ADDRESSES.DEV);
@@ -35,9 +35,7 @@ class Network extends React.Component {
3535 if (network === NETWORK_NAMES.ROPSTEN) {
3636 setNetworkType(network);
3737
38− const endpoint = `https://ropsten.infura.io/v3/${
39− process.env.REACT_APP_INFURA_ENDPOINT
40− }`;
38+ const endpoint = `https://ropsten.infura.io/v3/${process.env.REACT_APP_INFURA_ENDPOINT}`;
4139
4240 const provider = new Web3.providers.HttpProvider(endpoint);
4341 const web3 = new Web3(provider);
@@ -49,9 +47,7 @@ class Network extends React.Component {
4947 if (network === NETWORK_NAMES.MAINNET) {
5048 setNetworkType(network);
5149
52− const endpoint = `https://mainnet.infura.io/v3/${
53− process.env.REACT_APP_INFURA_ENDPOINT
54− }`;
50+ const endpoint = `https://mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_ENDPOINT}`;
5551
5652 const provider = new Web3.providers.HttpProvider(endpoint);
5753 const web3 = new Web3(provider);
@@ -74,11 +70,11 @@ class Network extends React.Component {
7470
7571 // Note: localhost:3456 doesn't actually point to anything, we just need
7672 // a provider to initialize the Web3 object
77− const provider = new Web3.providers.HttpProvider("http://localhost:3456");
73+ const provider = new Web3.providers.HttpProvider('http://localhost:3456');
7874 const web3 = new Web3(provider);
7975
8076 const target =
81− process.env.NODE_ENV === "development"
77+ process.env.NODE_ENV === 'development'
8278 ? CONTRACT_ADDRESSES.DEV
8379 : CONTRACT_ADDRESSES.MAINNET;
8480
@@ -91,22 +87,22 @@ class Network extends React.Component {
9187 getNetworkOptions() {
9288 return [
9389 {
94− title: "Main Network (default)",
90+ title: 'Main Network (default)',
9591 value: NETWORK_NAMES.MAINNET,
9692 },
9793 {
98− title: "Local Node",
94+ title: 'Local Node',
9995 value: NETWORK_NAMES.LOCAL,
10096 },
10197 {
102− title: "Ropsten",
98+ title: 'Ropsten',
10399 value: NETWORK_NAMES.ROPSTEN,
104100 },
105101 {
106− type: "divider",
102+ type: 'divider',
107103 },
108104 {
109− title: "Offline",
105+ title: 'Offline',
110106 value: NETWORK_NAMES.OFFLINE,
111107 },
112108 ];
@@ -119,27 +115,26 @@ class Network extends React.Component {
119115 return (
120116 <Row>
121117 <Col>
122− <H1>{"Select Network"}</H1>
118+ <H1>{'Select Network'}</H1>
123119
124120 <P>
125121 {"Please select the Ethereum node you'd like to send " +
126− "transactions to. For highly valuable keys, please select " +
127− "offline mode."}
122+ 'transactions to. For highly valuable keys, please select ' +
123+ 'offline mode.'}
128124 </P>
129125
130126 <InnerLabelDropdown
131− className={"mt-6"}
132− title={"Node:"}
127+ className={'mt-6'}
128+ title={'Node:'}
133129 handleUpdate={this.handleNetworkChange}
134130 options={networkOptions}
135131 currentSelectionTitle={renderNetworkType(networkType)}
136132 />
137133
138134 <Button
139− className={"mt-10"}
140− onClick={() => history.push(ROUTE_NAMES.WALLET)}
141− >
142− {"Continue →"}
135+ className={'mt-10'}
136+ onClick={() => history.push(ROUTE_NAMES.WALLET)}>
137+ {'Continue →'}
143138 </Button>
144139 </Col>
145140 </Row>
src/bridge/views/Point.js+17−17
@@ -1,16 +1,16 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import React from "react";
3−import { pour } from "sigil-js";
4−import * as ob from "urbit-ob";
5−import * as azimuth from "azimuth-js";
6−import * as need from "../lib/need";
7−
8−import PointList from "../components/PointList";
9−import ReactSVGComponents from "../components/ReactSVGComponents";
10−import KeysAndMetadata from "./Point/KeysAndMetadata";
11−import Actions from "./Point/Actions";
12−import { Row, Col, H1, H3 } from "../components/Base";
13−import { withHistory } from "../store/history";
1+import { Just, Nothing } from 'folktale/maybe';
2+import React from 'react';
3+import { pour } from 'sigil-js';
4+import * as ob from 'urbit-ob';
5+import * as azimuth from 'azimuth-js';
6+import * as need from '../lib/need';
7+
8+import PointList from '../components/PointList';
9+import ReactSVGComponents from '../components/ReactSVGComponents';
10+import KeysAndMetadata from './Point/KeysAndMetadata';
11+import Actions from './Point/Actions';
12+import { Row, Col, H1, H3 } from '../components/Base';
13+import { withHistory } from '../store/history';
1414
1515class Point extends React.Component {
1616 constructor(props) {
@@ -55,8 +55,8 @@ class Point extends React.Component {
5555 .getTotalUsableInvites(ctrcs, point)
5656 .then(count => this.setState({ invites: Just(count) }));
5757 this.updateSpawned(ctrcs, point);
58− }),
59− ),
58+ })
59+ )
6060 );
6161 }
6262
@@ -100,7 +100,7 @@ class Point extends React.Component {
100100 <div />
101101 ) : (
102102 <div>
103− <H3>{"Issued Points"}</H3>
103+ <H3>{'Issued Points'}</H3>
104104
105105 <PointList
106106 setPointCursor={setPointCursor}
@@ -113,7 +113,7 @@ class Point extends React.Component {
113113 return (
114114 <Row>
115115 <Col>
116− <div className={"mt-12 pt-6"}>{sigil}</div>
116+ <div className={'mt-12 pt-6'}>{sigil}</div>
117117 <H1>
118118 <code>{name}</code>
119119 </H1>
src/bridge/views/Point/Actions.js+55−65
@@ -1,12 +1,12 @@
1−import React from "react";
2−import { azimuth } from "azimuth-js";
3−import * as need from "../../lib/need";
1+import React from 'react';
2+import { azimuth } from 'azimuth-js';
3+import * as need from '../../lib/need';
44
5−import { ETH_ZERO_ADDR, CURVE_ZERO_ADDR, eqAddr } from "../../lib/wallet";
6−import { Row, Col, H2, P } from "../../components/Base";
7−import { Button } from "../../components/Base";
8−import { ROUTE_NAMES } from "../../lib/routeNames";
9−import { useHistory } from "../../store/history";
5+import { ETH_ZERO_ADDR, CURVE_ZERO_ADDR, eqAddr } from '../../lib/wallet';
6+import { Row, Col, H2, P } from '../../components/Base';
7+import { Button } from '../../components/Base';
8+import { ROUTE_NAMES } from '../../lib/routeNames';
9+import { useHistory } from '../../store/history';
1010
1111const isPlanet = point =>
1212 azimuth.getPointSize(point) === azimuth.PointSize.Planet;
@@ -106,16 +106,15 @@ function Actions(props) {
106106 inviteAction = (
107107 <Button
108108 disabled={!isActiveOwner || !online || !hasInvites}
109− prop-size={"sm"}
110− prop-type={"link"}
111− onClick={() => history.push(ROUTE_NAMES.INVITES_SEND)}
112− >
113− {"Send invites ("}
109+ prop-size={'sm'}
110+ prop-type={'link'}
111+ onClick={() => history.push(ROUTE_NAMES.INVITES_SEND)}>
112+ {'Send invites ('}
114113 {invites.matchWith({
115− Nothing: () => "?",
114+ Nothing: () => '?',
116115 Just: count => count.value,
117116 })}
118− {")"}
117+ {')'}
119118 </Button>
120119 );
121120 }
@@ -123,118 +122,109 @@ function Actions(props) {
123122 inviteAction = (
124123 <Button
125124 disabled={!(isActiveOwner && canIssueChild) || !online}
126− prop-size={"sm"}
127− prop-type={"link"}
125+ prop-size={'sm'}
126+ prop-type={'link'}
128127 onClick={() => {
129128 history.push(ROUTE_NAMES.INVITES_MANAGE);
130− }}
131− >
132− {"Manage invites"}
129+ }}>
130+ {'Manage invites'}
133131 </Button>
134132 );
135133 }
136134
137135 return (
138136 <div>
139− <H2>{"Actions"}</H2>
137+ <H2>{'Actions'}</H2>
140138 {displayReminder ? (
141139 <P>{`Before you can issue child points or generate your Arvo
142140 keyfile, you need to set your public keys.`}</P>
143141 ) : (
144− ""
142+ ''
145143 )}
146144 <Row>
147− <Col className={"flex flex-column items-start col-md-4"}>
145+ <Col className={'flex flex-column items-start col-md-4'}>
148146 <Button
149− prop-size={"sm"}
150− prop-type={"link"}
147+ prop-size={'sm'}
148+ prop-type={'link'}
151149 disabled={(online || planet) && !canIssueChild}
152150 onClick={() => {
153151 history.push(ROUTE_NAMES.ISSUE_CHILD);
154− }}
155− >
156− {"Issue child"}
152+ }}>
153+ {'Issue child'}
157154 </Button>
158155
159156 <Button
160− prop-size={"sm"}
161− prop-type={"link"}
157+ prop-size={'sm'}
158+ prop-type={'link'}
162159 disabled={online && !canAcceptTransfer}
163160 onClick={() => {
164161 history.push(ROUTE_NAMES.ACCEPT_TRANSFER);
165− }}
166− >
167− {"Accept incoming transfer"}
162+ }}>
163+ {'Accept incoming transfer'}
168164 </Button>
169165
170166 <Button
171− prop-size={"sm"}
172− prop-type={"link"}
167+ prop-size={'sm'}
168+ prop-type={'link'}
173169 disabled={online && !canCancelTransfer}
174170 onClick={() => {
175171 history.push(ROUTE_NAMES.CANCEL_TRANSFER);
176− }}
177− >
178− {"Cancel outgoing transfer"}
172+ }}>
173+ {'Cancel outgoing transfer'}
179174 </Button>
180175
181176 <Button
182− prop-size={"sm"}
183− prop-type={"link"}
177+ prop-size={'sm'}
178+ prop-type={'link'}
184179 disabled={online && !canGenKeyfile}
185180 onClick={() => {
186181 history.push(ROUTE_NAMES.GEN_KEYFILE);
187− }}
188− >
189− {"Generate Arvo keyfile"}
182+ }}>
183+ {'Generate Arvo keyfile'}
190184 </Button>
191185 </Col>
192− <Col className={"flex flex-column items-start col-md-4"}>
186+ <Col className={'flex flex-column items-start col-md-4'}>
193187 <Button
194188 disabled={online && !canSetSpawnProxy}
195− prop-size={"sm"}
196− prop-type={"link"}
189+ prop-size={'sm'}
190+ prop-type={'link'}
197191 onClick={() => {
198192 history.push(ROUTE_NAMES.SET_SPAWN_PROXY);
199− }}
200− >
201− {"Change spawn proxy"}
193+ }}>
194+ {'Change spawn proxy'}
202195 </Button>
203196
204197 <Button
205198 disabled={online && !canSetManagementProxy}
206− prop-size={"sm"}
207− prop-type={"link"}
199+ prop-size={'sm'}
200+ prop-type={'link'}
208201 onClick={() => {
209202 history.push(ROUTE_NAMES.SET_MANAGEMENT_PROXY);
210− }}
211− >
212− {"Change management proxy"}
203+ }}>
204+ {'Change management proxy'}
213205 </Button>
214206
215207 <Button
216208 disabled={online && !canConfigureKeys}
217− prop-size={"sm"}
218− prop-type={"link"}
209+ prop-size={'sm'}
210+ prop-type={'link'}
219211 onClick={() => {
220212 history.push(ROUTE_NAMES.SET_KEYS);
221− }}
222− >
223− {"Set network keys"}
213+ }}>
214+ {'Set network keys'}
224215 </Button>
225216
226217 <Button
227218 disabled={online && !canTransfer}
228− prop-size={"sm"}
229− prop-type={"link"}
219+ prop-size={'sm'}
220+ prop-type={'link'}
230221 onClick={() => {
231222 history.push(ROUTE_NAMES.TRANSFER);
232− }}
233− >
234− {"Transfer"}
223+ }}>
224+ {'Transfer'}
235225 </Button>
236226 </Col>
237− <Col className={"flex flex-column items-start col-md-4"}>
227+ <Col className={'flex flex-column items-start col-md-4'}>
238228 {inviteAction}
239229 </Col>
240230 </Row>
src/bridge/views/Points.js+30−32
@@ -1,13 +1,13 @@
1−import React from "react";
2−import { Row, Col, H1, H2, P } from "../components/Base";
3−import { Button } from "../components/Base";
4−import * as azimuth from "azimuth-js";
1+import React from 'react';
2+import { Row, Col, H1, H2, P } from '../components/Base';
3+import { Button } from '../components/Base';
4+import * as azimuth from 'azimuth-js';
55
6−import PointList from "../components/PointList";
7−import { NETWORK_NAMES } from "../lib/network";
8−import { ROUTE_NAMES } from "../lib/routeNames";
9−import { withHistory } from "../store/history";
10−import { ETH_ZERO_ADDR, eqAddr } from "../lib/wallet";
6+import PointList from '../components/PointList';
7+import { NETWORK_NAMES } from '../lib/network';
8+import { ROUTE_NAMES } from '../lib/routeNames';
9+import { withHistory } from '../store/history';
10+import { ETH_ZERO_ADDR, eqAddr } from '../lib/wallet';
1111
1212const hasTransferProxy = (cache, point) =>
1313 point in cache ? !eqAddr(cache[point].transferProxy, ETH_ZERO_ADDR) : false;
@@ -42,7 +42,7 @@ class Points extends React.Component {
4242
4343 const incoming = await azimuth.azimuth.getTransferringFor(
4444 ctrcs,
45− addr,
45+ addr
4646 );
4747
4848 const managing = await azimuth.azimuth.getManagerFor(ctrcs, addr);
@@ -66,8 +66,8 @@ class Points extends React.Component {
6666 });
6767
6868 this.cachePoints(ctrcs, addToPointCache, points);
69− }),
70− ),
69+ })
70+ )
7171 );
7272 }
7373
@@ -97,13 +97,12 @@ class Points extends React.Component {
9797 <Row>
9898 <Col>
9999 <Button
100− prop-type={"link"}
101− prop-size={"md"}
102− onClick={() => history.push(ROUTE_NAMES.VIEW_SHIP)}
103− >
104− {"View a point →"}
100+ prop-type={'link'}
101+ prop-size={'md'}
102+ onClick={() => history.push(ROUTE_NAMES.VIEW_SHIP)}>
103+ {'View a point →'}
105104 </Button>
106− <P>{"View a point on Azimuth."}</P>
105+ <P>{'View a point on Azimuth.'}</P>
107106 </Col>
108107 </Row>
109108 );
@@ -115,15 +114,14 @@ class Points extends React.Component {
115114 <Row>
116115 <Col>
117116 <Button
118− prop-type={"link"}
119− prop-size={"md"}
120− onClick={() => history.push(ROUTE_NAMES.CREATE_GALAXY)}
121− >
122− {"Create a galaxy →"}
117+ prop-type={'link'}
118+ prop-size={'md'}
119+ onClick={() => history.push(ROUTE_NAMES.CREATE_GALAXY)}>
120+ {'Create a galaxy →'}
123121 </Button>
124122 <P>
125123 {
126− "You have the authority to create a new Galaxy and you can do so here."
124+ 'You have the authority to create a new Galaxy and you can do so here.'
127125 }
128126 </P>
129127 </Col>
@@ -131,13 +129,13 @@ class Points extends React.Component {
131129 );
132130
133131 const outgoing = points.filter(point =>
134− hasTransferProxy(pointCache, point),
132+ hasTransferProxy(pointCache, point)
135133 );
136134
137135 const outgoingPoints =
138136 outgoing.length !== 0 ? (
139137 <React.Fragment>
140− <H2>{"Outgoing Transfers"}</H2>
138+ <H2>{'Outgoing Transfers'}</H2>
141139 <P>
142140 {`You own these points until the recipient accepts the incoming
143141 transfer. You may cancel the transfer until accepted.`}
@@ -155,7 +153,7 @@ class Points extends React.Component {
155153 const incomingPoints =
156154 incoming.length !== 0 ? (
157155 <React.Fragment>
158− <H2>{"Incoming Transfers"}</H2>
156+ <H2>{'Incoming Transfers'}</H2>
159157 <P>
160158 {`You do not own these points until you accept the incoming transfer.
161159 You may reject any incoming transfers.`}
@@ -173,7 +171,7 @@ class Points extends React.Component {
173171 const managingPoints =
174172 managing.length !== 0 ? (
175173 <React.Fragment>
176− <H2>{"You Are a Management Proxy For"}</H2>
174+ <H2>{'You Are a Management Proxy For'}</H2>
177175 <P>
178176 {`You can configure or set network keys and conduct sponsorship
179177 related operations for these points.`}
@@ -191,7 +189,7 @@ class Points extends React.Component {
191189 const votingPoints =
192190 voting.length !== 0 ? (
193191 <React.Fragment>
194− <H2>{"You Are a Voting Proxy For"}</H2>
192+ <H2>{'You Are a Voting Proxy For'}</H2>
195193 <P>
196194 {`Since you are part of the Galactic Senate, you can cast votes on
197195 new Azimuth proposals on behalf of these points.`}
@@ -209,7 +207,7 @@ class Points extends React.Component {
209207 const spawningPoints =
210208 spawning.length !== 0 ? (
211209 <React.Fragment>
212− <H2>{"You Are a Spawn Proxy For"}</H2>
210+ <H2>{'You Are a Spawn Proxy For'}</H2>
213211 <P>{`You can create new child ships under these points.`}</P>
214212 <PointList
215213 setPointCursor={setPointCursor}
@@ -224,7 +222,7 @@ class Points extends React.Component {
224222 return (
225223 <Row>
226224 <Col>
227− <H1>{"Points"}</H1>
225+ <H1>{'Points'}</H1>
228226
229227 <P>{`A point is an identity on the Ethereum blockchain.
230228 Points declare keys for ships on the Arvo network.`}</P>
@@ -237,7 +235,7 @@ class Points extends React.Component {
237235
238236 {outgoingPoints}
239237
240− <H2>{"Your Points"}</H2>
238+ <H2>{'Your Points'}</H2>
241239
242240 <PointList
243241 setPointCursor={setPointCursor}
src/bridge/views/PrivateKey.js+18−20
@@ -1,19 +1,19 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import { Button } from "../components/Base";
4−import { RequiredInput, InnerLabel, InputCaption } from "../components/Base";
5−import { Row, Col, H1 } from "../components/Base";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import { Button } from '../components/Base';
4+import { RequiredInput, InnerLabel, InputCaption } from '../components/Base';
5+import { Row, Col, H1 } from '../components/Base';
66
7−import { ROUTE_NAMES } from "../lib/routeNames";
8−import { withHistory } from "../store/history";
9−import { EthereumWallet } from "../lib/wallet";
7+import { ROUTE_NAMES } from '../lib/routeNames';
8+import { withHistory } from '../store/history';
9+import { EthereumWallet } from '../lib/wallet';
1010
1111class PrivateKey extends React.Component {
1212 constructor(props) {
1313 super(props);
1414
1515 this.state = {
16− privateKey: "",
16+ privateKey: '',
1717 };
1818
1919 this.handlePrivateKeyInput = this.handlePrivateKeyInput.bind(this);
@@ -27,7 +27,7 @@ class PrivateKey extends React.Component {
2727 constructWallet(privateKey) {
2828 const { setWallet } = this.props;
2929 if (/^[0-9A-Fa-f]{64}$/g.test(privateKey) === true) {
30− const sec = Buffer.from(privateKey, "hex");
30+ const sec = Buffer.from(privateKey, 'hex');
3131 const wallet = new EthereumWallet(sec);
3232 setWallet(Maybe.Just(wallet));
3333 } else {
@@ -41,8 +41,8 @@ class PrivateKey extends React.Component {
4141
4242 return (
4343 <Row>
44− <Col className={"measure-md"}>
45− <H1 className={"mb-4"}>{"Enter Your Private Key"}</H1>
44+ <Col className={'measure-md'}>
45+ <H1 className={'mb-4'}>{'Enter Your Private Key'}</H1>
4646 <InputCaption>
4747 {`Please enter your raw Ethereum private key here.`}
4848 </InputCaption>
@@ -56,18 +56,16 @@ class PrivateKey extends React.Component {
5656 onChange={this.handlePrivateKeyInput}
5757 value={privateKey}
5858 autocomplete="off"
59− autoFocus
60− >
61− <InnerLabel>{"Private Key"}</InnerLabel>
59+ autoFocus>
60+ <InnerLabel>{'Private Key'}</InnerLabel>
6261 </RequiredInput>
6362
6463 <Button
65− className={"mt-10"}
66− prop-size={"wide lg"}
64+ className={'mt-10'}
65+ prop-size={'wide lg'}
6766 disabled={Maybe.Nothing.hasInstance(wallet)}
68− onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}
69− >
70− {"Continue →"}
67+ onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}>
68+ {'Continue →'}
7169 </Button>
7270 </Col>
7371 </Row>
src/bridge/views/SentTransaction.js+34−37
@@ -1,27 +1,27 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import * as need from "../lib/need";
4−import { Row, Col, H1, H3, P, Warning, Anchor } from "../components/Base";
5−import { Button } from "../components/Base";
6−
7−import { ROUTE_NAMES } from "../lib/routeNames";
8−import { useHistory } from "../store/history";
9−import { BRIDGE_ERROR, renderTxnError } from "../lib/error";
10−import { NETWORK_NAMES } from "../lib/network";
11−import { withTxnConfirmations } from "../store/txnConfirmations";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import * as need from '../lib/need';
4+import { Row, Col, H1, H3, P, Warning, Anchor } from '../components/Base';
5+import { Button } from '../components/Base';
6+
7+import { ROUTE_NAMES } from '../lib/routeNames';
8+import { useHistory } from '../store/history';
9+import { BRIDGE_ERROR, renderTxnError } from '../lib/error';
10+import { NETWORK_NAMES } from '../lib/network';
11+import { withTxnConfirmations } from '../store/txnConfirmations';
1212
1313class Success extends React.Component {
1414 constructor(props) {
1515 super(props);
1616
1717 this.state = {
18− pending: ".",
18+ pending: '.',
1919 interval: null,
2020 };
2121 }
2222
2323 componentDidMount() {
24− const nextDot = { ".": "..", "..": "...", "...": "." };
24+ const nextDot = { '.': '..', '..': '...', '...': '.' };
2525
2626 const interval = setInterval(() => {
2727 this.setState(({ pending }) => ({ pending: nextDot[pending] }));
@@ -44,28 +44,27 @@ class Success extends React.Component {
4444
4545 const esdomain =
4646 networkType === NETWORK_NAMES.ROPSTEN
47− ? "ropsten.etherscan.io"
48− : "etherscan.io";
47+ ? 'ropsten.etherscan.io'
48+ : 'etherscan.io';
4949
5050 const esmessage =
5151 esvisible === true
52− ? "If you’d like to keep track of it, click the Etherscan link below."
53− : "";
52+ ? 'If you’d like to keep track of it, click the Etherscan link below.'
53+ : '';
5454
5555 const esanchor =
5656 esvisible === false ? null : (
5757 <Anchor
58− className={"mb-4 mt-1"}
59− prop-size={"sm"}
60− target={"_blank"}
61− href={`https://${esdomain}/tx/${hash}`}
62− >
63− {"View on Etherscan ↗"}
58+ className={'mb-4 mt-1'}
59+ prop-size={'sm'}
60+ target={'_blank'}
61+ href={`https://${esdomain}/tx/${hash}`}>
62+ {'View on Etherscan ↗'}
6463 </Anchor>
6564 );
6665
6766 const confirmations = Maybe.fromNullable(txnConfirmations[hash]).getOrElse(
68− 0,
67+ 0
6968 );
7069
7170 const requiredConfirmations = 1;
@@ -78,17 +77,17 @@ class Success extends React.Component {
7877 return (
7978 <Row>
8079 <Col>
81− <H1>{"Your Transaction was Sent"}</H1>
80+ <H1>{'Your Transaction was Sent'}</H1>
8281
8382 <P>
8483 {`We sent your transaction to the chain. It can take some time to
8584 execute, especially if the network is busy. ${esmessage}`}
8685 </P>
8786
88− <H3>{"Transaction Hash"}</H3>
87+ <H3>{'Transaction Hash'}</H3>
8988 <P>{hash}</P>
9089
91− <H3>{"Transaction Status"}</H3>
90+ <H3>{'Transaction Status'}</H3>
9291 <P>{status}</P>
9392 <P>{esanchor}</P>
9493 </Col>
@@ -100,10 +99,10 @@ class Success extends React.Component {
10099const Failure = props => (
101100 <Row>
102101 <Col>
103− <H1>{"Error!"}</H1>
102+ <H1>{'Error!'}</H1>
104103
105104 <Warning>
106− <H3>{"There was an error sending your transaction."}</H3>
105+ <H3>{'There was an error sending your transaction.'}</H3>
107106 {renderTxnError(props.web3, props.message)}
108107 </Warning>
109108 </Col>
@@ -141,13 +140,12 @@ const SentTransaction = props => {
141140 <Row>
142141 <Col>
143142 <Button
144− prop-type={"link"}
143+ prop-type={'link'}
145144 onClick={() => {
146145 setPointCursor(pointCursor);
147146 history.pop();
148− }}
149− >
150− {"Ok →"}
147+ }}>
148+ {'Ok →'}
151149 </Button>
152150 </Col>
153151 </Row>
@@ -160,10 +158,9 @@ const SentTransaction = props => {
160158 <Row>
161159 <Col>
162160 <Button
163− prop-type={"link"}
164− onClick={() => history.popAndPush(ROUTE_NAMES.GEN_KEYFILE)}
165− >
166− {"Download Keyfile →"}
161+ prop-type={'link'}
162+ onClick={() => history.popAndPush(ROUTE_NAMES.GEN_KEYFILE)}>
163+ {'Download Keyfile →'}
167164 </Button>
168165 </Col>
169166 </Row>
src/bridge/views/SetKeys.js+36−36
@@ -1,16 +1,16 @@
1−import React from "react";
2−import Maybe from "folktale/maybe";
3−import * as azimuth from "azimuth-js";
4−import * as ob from "urbit-ob";
5−import * as need from "../lib/need";
6−import { Row, Col, H1, P, Warning, CheckboxButton } from "../components/Base";
1+import React from 'react';
2+import Maybe from 'folktale/maybe';
3+import * as azimuth from 'azimuth-js';
4+import * as ob from 'urbit-ob';
5+import * as need from '../lib/need';
6+import { Row, Col, H1, P, Warning, CheckboxButton } from '../components/Base';
77
8−import StatelessTransaction from "../components/StatelessTransaction";
9−import { attemptSeedDerivation } from "../lib/keys";
8+import StatelessTransaction from '../components/StatelessTransaction';
9+import { attemptSeedDerivation } from '../lib/keys';
1010
11−import * as kg from "urbit-key-generation/dist/index";
11+import * as kg from 'urbit-key-generation/dist/index';
1212
13−import { addHexPrefix } from "../lib/wallet";
13+import { addHexPrefix } from '../lib/wallet';
1414
1515class SetKeys extends React.Component {
1616 constructor(props) {
@@ -19,9 +19,9 @@ class SetKeys extends React.Component {
1919 const point = need.pointCursor(props);
2020
2121 this.state = {
22− auth: "",
23− encr: "",
24− networkSeed: "",
22+ auth: '',
23+ encr: '',
24+ networkSeed: '',
2525 nondeterministicSeed: false,
2626 point: point,
2727 cryptoSuiteVersion: 1,
@@ -64,22 +64,22 @@ class SetKeys extends React.Component {
6464 hex =
6565 hex +
6666 [
67− "0",
68− "1",
69− "2",
70− "3",
71− "4",
72− "5",
73− "6",
74− "7",
75− "8",
76− "9",
77− "A",
78− "B",
79− "C",
80− "D",
81− "E",
82− "F",
67+ '0',
68+ '1',
69+ '2',
70+ '3',
71+ '4',
72+ '5',
73+ '6',
74+ '7',
75+ '8',
76+ '9',
77+ 'A',
78+ 'B',
79+ 'C',
80+ 'D',
81+ 'E',
82+ 'F',
8383 ][Math.floor(Math.random() * 16)];
8484 }
8585
@@ -91,13 +91,13 @@ class SetKeys extends React.Component {
9191 let seed = await attemptSeedDerivation(next, this.props);
9292 let nondeterministicSeed = false;
9393
94− if (seed.getOrElse("") === "") {
94+ if (seed.getOrElse('') === '') {
9595 seed = Maybe.Just(this.randomHex(64));
9696 nondeterministicSeed = true;
9797 }
9898
9999 this.setState({
100− networkSeed: seed.getOrElse(""),
100+ networkSeed: seed.getOrElse(''),
101101 nondeterministicSeed: nondeterministicSeed,
102102 });
103103 }
@@ -124,7 +124,7 @@ class SetKeys extends React.Component {
124124 pencr,
125125 pauth,
126126 1,
127− state.discontinuity,
127+ state.discontinuity
128128 );
129129
130130 return Maybe.Just(txn);
@@ -145,7 +145,7 @@ class SetKeys extends React.Component {
145145 <Row>
146146 <Col>
147147 <H1>
148− {"Set Network Keys For "} <code>{`${ob.patp(state.point)}`}</code>
148+ {'Set Network Keys For '} <code>{`${ob.patp(state.point)}`}</code>
149149 </H1>
150150
151151 <P className="mt-10">
@@ -154,7 +154,7 @@ class SetKeys extends React.Component {
154154
155155 {state.nondeterministicSeed && (
156156 <Warning>
157− <h3 className={"mb-2"}>{"Warning"}</h3>
157+ <h3 className={'mb-2'}>{'Warning'}</h3>
158158 {`Your network seed could not be derived automatically. We've
159159 generated a random one for you, so you must download your Arvo
160160 keyfile during this session after setting your keys.`}
@@ -163,8 +163,8 @@ class SetKeys extends React.Component {
163163
164164 {pointDetails.keyRevisionNumber === 0 ? (
165165 <Warning>
166− <h3 className={"mb-2"}>{"Warning"}</h3>
167− {"Once these keys have been set, your point is considered " +
166+ <h3 className={'mb-2'}>{'Warning'}</h3>
167+ {'Once these keys have been set, your point is considered ' +
168168 "'linked'. This operation cannot be undone."}
169169 </Warning>
170170 ) : (
src/bridge/views/SetProxy.js+29−31
@@ -1,7 +1,7 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import * as need from "../lib/need";
4−import * as azimuth from "azimuth-js";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import * as need from '../lib/need';
4+import * as azimuth from 'azimuth-js';
55import {
66 Row,
77 Col,
@@ -11,17 +11,17 @@ import {
1111 ShowBlockie,
1212 Anchor,
1313 HorizontalSelector,
14−} from "../components/Base";
15−import { AddressInput } from "../components/Base";
16−import * as ob from "urbit-ob";
14+} from '../components/Base';
15+import { AddressInput } from '../components/Base';
16+import * as ob from 'urbit-ob';
1717
18−import { PROXY_TYPE, renderProxyType } from "../lib/proxy";
18+import { PROXY_TYPE, renderProxyType } from '../lib/proxy';
1919
20−import { NETWORK_NAMES } from "../lib/network";
20+import { NETWORK_NAMES } from '../lib/network';
2121
22−import StatelessTransaction from "../components/StatelessTransaction";
22+import StatelessTransaction from '../components/StatelessTransaction';
2323
24−import { isValidAddress } from "../lib/wallet";
24+import { isValidAddress } from '../lib/wallet';
2525
2626const SetManagementProxy = props => (
2727 <SetProxy {...props} proxyType={PROXY_TYPE.MANAGEMENT_PROXY} />
@@ -42,7 +42,7 @@ class SetProxy extends React.Component {
4242 const issuingPoint = need.pointCursor(props);
4343
4444 this.state = {
45− proxyAddress: "",
45+ proxyAddress: '',
4646 issuingPoint: issuingPoint,
4747 setProxy: true,
4848 };
@@ -54,10 +54,10 @@ class SetProxy extends React.Component {
5454 }
5555
5656 handleSetUnset(selected) {
57− const set = selected === "set";
57+ const set = selected === 'set';
5858 this.setState({
5959 setProxy: set,
60− proxyAddress: set ? "" : "0x0000000000000000000000000000000000000000",
60+ proxyAddress: set ? '' : '0x0000000000000000000000000000000000000000',
6161 });
6262 }
6363
@@ -104,26 +104,26 @@ class SetProxy extends React.Component {
104104
105105 const esdomain =
106106 props.networkType === NETWORK_NAMES.ROPSTEN
107− ? "ropsten.etherscan.io"
108− : "etherscan.io";
107+ ? 'ropsten.etherscan.io'
108+ : 'etherscan.io';
109109
110110 const ucFirst = w => w.charAt(0).toUpperCase() + w.slice(1);
111111
112112 const setUnset = [
113− { title: "Set", value: "set" },
114− { title: "Unset", value: "unset" },
113+ { title: 'Set', value: 'set' },
114+ { title: 'Unset', value: 'unset' },
115115 ];
116116
117− const titleVerb = this.state.setProxy ? "Set" : "Unset";
117+ const titleVerb = this.state.setProxy ? 'Set' : 'Unset';
118118
119119 let addressInput = null;
120120 if (this.state.setProxy) {
121121 addressInput = (
122122 <>
123123 <P className="mt-8">
124− {"Please provide an Ethereum address to act as the " +
124+ {'Please provide an Ethereum address to act as the ' +
125125 `${renderedProxyType} proxy. You can also use Wallet ` +
126− "Generator to generate a keypair."}
126+ 'Generator to generate a keypair.'}
127127 </P>
128128
129129 <AddressInput
@@ -132,20 +132,18 @@ class SetProxy extends React.Component {
132132 prop-format="innerLabel"
133133 placeholder={`e.g. 0x84295d5e054d8cff5a22428b195f5a1615bd644f`}
134134 value={state.proxyAddress}
135− onChange={v => this.handleAddressInput(v)}
136− >
137− <InnerLabel>{"Proxy Address"}</InnerLabel>
138− <ShowBlockie className={"mt-1"} address={state.proxyAddress} />
135+ onChange={v => this.handleAddressInput(v)}>
136+ <InnerLabel>{'Proxy Address'}</InnerLabel>
137+ <ShowBlockie className={'mt-1'} address={state.proxyAddress} />
139138 </AddressInput>
140139
141140 <Anchor
142− className={"mt-1"}
143− prop-size={"sm"}
141+ className={'mt-1'}
142+ prop-size={'sm'}
144143 prop-disabled={!isValidAddress(state.proxyAddress) || !esvisible}
145− target={"_blank"}
146− href={`https://${esdomain}/address/${state.proxyAddress}`}
147− >
148− {"View on Etherscan ↗"}
144+ target={'_blank'}
145+ href={`https://${esdomain}/address/${state.proxyAddress}`}>
146+ {'View on Etherscan ↗'}
149147 </Anchor>
150148 </>
151149 );
src/bridge/views/Shards.js+46−53
@@ -1,6 +1,6 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import React from "react";
3−import { Button } from "../components/Base";
1+import { Just, Nothing } from 'folktale/maybe';
2+import React from 'react';
3+import { Button } from '../components/Base';
44import {
55 InnerLabel,
66 ValidatedSigil,
@@ -8,28 +8,28 @@ import {
88 ShardInput,
99 InputCaption,
1010 Input,
11−} from "../components/Base";
12−import { Row, Col, H1, P } from "../components/Base";
13−import * as kg from "urbit-key-generation/dist/index";
14−import * as ob from "urbit-ob";
11+} from '../components/Base';
12+import { Row, Col, H1, P } from '../components/Base';
13+import * as kg from 'urbit-key-generation/dist/index';
14+import * as ob from 'urbit-ob';
1515
16−import { ROUTE_NAMES } from "../lib/routeNames";
17−import { withHistory } from "../store/history";
18−import { urbitWalletFromTicket } from "../lib/wallet";
16+import { ROUTE_NAMES } from '../lib/routeNames';
17+import { withHistory } from '../store/history';
18+import { urbitWalletFromTicket } from '../lib/wallet';
1919
2020const placeholder = len => {
2121 let bytes = window.crypto.getRandomValues(new Uint8Array(len));
2222 let hex = bytes.reduce(
23− (acc, byt) => acc + byt.toString(16).padStart(2, "0"),
24− "",
23+ (acc, byt) => acc + byt.toString(16).padStart(2, '0'),
24+ ''
2525 );
2626 return ob.hex2patq(hex);
2727};
2828
2929const SHARDS = {
30− SHARD1: Symbol("SHARD1"),
31− SHARD2: Symbol("SHARD2"),
32− SHARD3: Symbol("SHARD3"),
30+ SHARD1: Symbol('SHARD1'),
31+ SHARD2: Symbol('SHARD2'),
32+ SHARD3: Symbol('SHARD3'),
3333};
3434
3535class Shards extends React.Component {
@@ -37,11 +37,11 @@ class Shards extends React.Component {
3737 super(props);
3838
3939 this.state = {
40− shard1: "",
41− shard2: "",
42− shard3: "",
43− passphrase: "",
44− pointName: "",
40+ shard1: '',
41+ shard2: '',
42+ shard3: '',
43+ passphrase: '',
44+ pointName: '',
4545 };
4646
4747 this.pointPlaceholder = placeholder(4);
@@ -73,9 +73,9 @@ class Shards extends React.Component {
7373 }
7474
7575 async walletFromShards(shard1, shard2, shard3, pointName, passphrase) {
76− const s1 = shard1 === "" ? undefined : shard1;
77− const s2 = shard2 === "" ? undefined : shard2;
78− const s3 = shard3 === "" ? undefined : shard3;
76+ const s1 = shard1 === '' ? undefined : shard1;
77+ const s2 = shard2 === '' ? undefined : shard2;
78+ const s3 = shard3 === '' ? undefined : shard3;
7979
8080 let ticket = undefined;
8181 try {
@@ -98,12 +98,12 @@ class Shards extends React.Component {
9898 const phTick = this.ticketPlaceholder;
9999
100100 const shards = [shard1, shard2, shard3];
101− const ready = shards.filter(x => x !== "").length > 1;
101+ const ready = shards.filter(x => x !== '').length > 1;
102102
103103 return (
104104 <Row>
105105 <Col>
106− <H1>{"Authenticate"}</H1>
106+ <H1>{'Authenticate'}</H1>
107107
108108 <P>
109109 {`Enter your point and at least two of your three Urbit master
@@ -119,11 +119,10 @@ class Shards extends React.Component {
119119 autoFocus
120120 placeholder={`e.g. ${phPoint}`}
121121 value={pointName}
122− onChange={this.handlePointNameInput}
123− >
124− <InnerLabel>{"Point"}</InnerLabel>
122+ onChange={this.handlePointNameInput}>
123+ <InnerLabel>{'Point'}</InnerLabel>
125124 <ValidatedSigil
126− className={"tr-0 mt-05 mr-0 abs"}
125+ className={'tr-0 mt-05 mr-0 abs'}
127126 patp={pointName}
128127 size={68}
129128 margin={8}
@@ -138,9 +137,8 @@ class Shards extends React.Component {
138137 name="shard1"
139138 placeholder={`e.g. ${phTick}`}
140139 value={shard1}
141− onChange={inp => this.handleShardInput(SHARDS.SHARD1, inp)}
142− >
143− <InnerLabel>{"Shard 1"}</InnerLabel>
140+ onChange={inp => this.handleShardInput(SHARDS.SHARD1, inp)}>
141+ <InnerLabel>{'Shard 1'}</InnerLabel>
144142 </ShardInput>
145143
146144 <ShardInput
@@ -151,9 +149,8 @@ class Shards extends React.Component {
151149 name="shard2"
152150 placeholder={`e.g. ${phTick}`}
153151 value={shard2}
154− onChange={inp => this.handleShardInput(SHARDS.SHARD2, inp)}
155− >
156− <InnerLabel>{"Shard 2"}</InnerLabel>
152+ onChange={inp => this.handleShardInput(SHARDS.SHARD2, inp)}>
153+ <InnerLabel>{'Shard 2'}</InnerLabel>
157154 </ShardInput>
158155
159156 <ShardInput
@@ -164,13 +161,12 @@ class Shards extends React.Component {
164161 name="shard3"
165162 placeholder={`e.g. ${phTick}`}
166163 value={shard3}
167− onChange={inp => this.handleShardInput(SHARDS.SHARD3, inp)}
168− >
169− <InnerLabel>{"Shard 3"}</InnerLabel>
164+ onChange={inp => this.handleShardInput(SHARDS.SHARD3, inp)}>
165+ <InnerLabel>{'Shard 3'}</InnerLabel>
170166 </ShardInput>
171167
172168 <InputCaption>
173− {"If your wallet requires a passphrase, you may enter it below."}
169+ {'If your wallet requires a passphrase, you may enter it below.'}
174170 </InputCaption>
175171
176172 <Input
@@ -181,15 +177,14 @@ class Shards extends React.Component {
181177 type="password"
182178 value={passphrase}
183179 autocomplete="off"
184− onChange={this.handlePassphraseInput}
185− >
186− <InnerLabel>{"Passphrase"}</InnerLabel>
180+ onChange={this.handlePassphraseInput}>
181+ <InnerLabel>{'Passphrase'}</InnerLabel>
187182 </Input>
188183
189184 <Button
190185 disabled={!ready}
191− className={"mt-8"}
192− prop-size={"lg wide"}
186+ className={'mt-8'}
187+ prop-size={'lg wide'}
193188 // prop-color={this.buttonTriState(wallet)}
194189 onClick={() =>
195190 this.walletFromShards(
@@ -197,20 +192,18 @@ class Shards extends React.Component {
197192 shard2,
198193 shard3,
199194 pointName,
200− passphrase,
195+ passphrase
201196 )
202− }
203− >
204− {"Unlock Wallet →"}
197+ }>
198+ {'Unlock Wallet →'}
205199 </Button>
206200
207201 <Button
208− className={"mt-4"}
209− prop-size={"xl wide"}
202+ className={'mt-4'}
203+ prop-size={'xl wide'}
210204 disabled={Nothing.hasInstance(wallet)}
211− onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}
212− >
213− {"Continue →"}
205+ onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}>
206+ {'Continue →'}
214207 </Button>
215208 </Col>
216209 </Row>
src/bridge/views/Ticket.js+31−34
@@ -1,6 +1,6 @@
1−import { Just, Nothing } from "folktale/maybe";
2−import React from "react";
3−import { Button } from "../components/Base";
1+import { Just, Nothing } from 'folktale/maybe';
2+import React from 'react';
3+import { Button } from '../components/Base';
44import {
55 InnerLabel,
66 ValidatedSigil,
@@ -8,22 +8,22 @@ import {
88 TicketInput,
99 Input,
1010 InputCaption,
11−} from "../components/Base";
12−import { Row, Col, H1, P } from "../components/Base";
11+} from '../components/Base';
12+import { Row, Col, H1, P } from '../components/Base';
1313
14−import { randomPatq } from "../lib/lib";
15−import { ROUTE_NAMES } from "../lib/routeNames";
16−import { withHistory } from "../store/history";
17−import { urbitWalletFromTicket } from "../lib/wallet";
14+import { randomPatq } from '../lib/lib';
15+import { ROUTE_NAMES } from '../lib/routeNames';
16+import { withHistory } from '../store/history';
17+import { urbitWalletFromTicket } from '../lib/wallet';
1818
1919class Ticket extends React.Component {
2020 constructor(props) {
2121 super(props);
2222
2323 this.state = {
24− ticket: "",
25− pointName: "",
26− passphrase: "",
24+ ticket: '',
25+ pointName: '',
26+ passphrase: '',
2727 isUnlocking: false,
2828 };
2929
@@ -72,7 +72,7 @@ class Ticket extends React.Component {
7272 return (
7373 <Row>
7474 <Col>
75− <H1>{"Authenticate"}</H1>
75+ <H1>{'Authenticate'}</H1>
7676
7777 <P>
7878 {`Please enter your point and Urbit master ticket here. This information is written on your Urbit HD paper wallets.`}
@@ -86,11 +86,10 @@ class Ticket extends React.Component {
8686 autoFocus
8787 placeholder={`e.g. ${phPoint}`}
8888 value={pointName}
89− onChange={this.handlePointNameInput}
90− >
91− <InnerLabel>{"Point"}</InnerLabel>
89+ onChange={this.handlePointNameInput}>
90+ <InnerLabel>{'Point'}</InnerLabel>
9291 <ValidatedSigil
93− className={"tr-0 mt-05 mr-0 abs"}
92+ className={'tr-0 mt-05 mr-0 abs'}
9493 patp={pointName}
9594 size={68}
9695 margin={8}
@@ -105,13 +104,12 @@ class Ticket extends React.Component {
105104 name="ticket"
106105 placeholder={`e.g. ${phTick}`}
107106 value={ticket}
108− onChange={this.handleTicketInput}
109− >
110− <InnerLabel>{"Ticket"}</InnerLabel>
107+ onChange={this.handleTicketInput}>
108+ <InnerLabel>{'Ticket'}</InnerLabel>
111109 </TicketInput>
112110
113111 <InputCaption>
114− {"If your wallet requires a passphrase, you may enter it below."}
112+ {'If your wallet requires a passphrase, you may enter it below.'}
115113 </InputCaption>
116114
117115 <Input
@@ -122,30 +120,29 @@ class Ticket extends React.Component {
122120 type="password"
123121 value={passphrase}
124122 autocomplete="off"
125− onChange={this.handlePassphraseInput}
126− >
127− <InnerLabel>{"Passphrase"}</InnerLabel>
123+ onChange={this.handlePassphraseInput}>
124+ <InnerLabel>{'Passphrase'}</InnerLabel>
128125 </Input>
129126
130127 <Button
131− className={"mt-8"}
132− prop-size={"lg wide"}
128+ className={'mt-8'}
129+ prop-size={'lg wide'}
133130 disabled={this.state.isUnlocking || Just.hasInstance(wallet)}
134− onClick={() => this.walletFromTicket(ticket, pointName, passphrase)}
135− >
131+ onClick={() =>
132+ this.walletFromTicket(ticket, pointName, passphrase)
133+ }>
136134 <span className="relative">
137135 {this.state.isUnlocking && <span className="btn-spinner" />}
138− {"Unlock Wallet →"}
136+ {'Unlock Wallet →'}
139137 </span>
140138 </Button>
141139
142140 <Button
143− className={"mt-4"}
144− prop-size={"xl wide"}
141+ className={'mt-4'}
142+ prop-size={'xl wide'}
145143 disabled={Nothing.hasInstance(wallet)}
146− onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}
147− >
148− {"Continue →"}
144+ onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}>
145+ {'Continue →'}
149146 </Button>
150147 </Col>
151148 </Row>
src/bridge/views/Transfer.js+25−27
@@ -1,8 +1,8 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import * as azimuth from "azimuth-js";
4−import * as ob from "urbit-ob";
5−import * as need from "../lib/need";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import * as azimuth from 'azimuth-js';
4+import * as ob from 'urbit-ob';
5+import * as need from '../lib/need';
66
77import {
88 Row,
@@ -12,13 +12,13 @@ import {
1212 ShowBlockie,
1313 P,
1414 Anchor,
15−} from "../components/Base";
16−import { AddressInput } from "../components/Base";
17−import StatelessTransaction from "../components/StatelessTransaction";
15+} from '../components/Base';
16+import { AddressInput } from '../components/Base';
17+import StatelessTransaction from '../components/StatelessTransaction';
1818
19−import { NETWORK_NAMES } from "../lib/network";
19+import { NETWORK_NAMES } from '../lib/network';
2020
21−import { isValidAddress } from "../lib/wallet";
21+import { isValidAddress } from '../lib/wallet';
2222
2323class Transfer extends React.Component {
2424 constructor(props) {
@@ -27,7 +27,7 @@ class Transfer extends React.Component {
2727 const issuingPoint = need.pointCursor(props);
2828
2929 this.state = {
30− receivingAddress: "",
30+ receivingAddress: '',
3131 issuingPoint: issuingPoint,
3232 };
3333
@@ -57,7 +57,7 @@ class Transfer extends React.Component {
5757 const txn = azimuth.ecliptic.setTransferProxy(
5858 validContracts,
5959 validPoint,
60− state.receivingAddress,
60+ state.receivingAddress
6161 );
6262
6363 return Maybe.Just(txn);
@@ -75,15 +75,15 @@ class Transfer extends React.Component {
7575
7676 const esdomain =
7777 props.networkType === NETWORK_NAMES.ROPSTEN
78− ? "ropsten.etherscan.io"
79− : "etherscan.io";
78+ ? 'ropsten.etherscan.io'
79+ : 'etherscan.io';
8080
8181 return (
8282 <Row>
8383 <Col>
8484 <H1>
85− {"Transfer"} <code>{` ${ob.patp(state.issuingPoint)} `}</code>
86− {"To a New Owner"}
85+ {'Transfer'} <code>{` ${ob.patp(state.issuingPoint)} `}</code>
86+ {'To a New Owner'}
8787 </H1>
8888
8989 <P>
@@ -93,27 +93,25 @@ class Transfer extends React.Component {
9393 </P>
9494
9595 <AddressInput
96− className={"mono mt-8"}
96+ className={'mono mt-8'}
9797 prop-size="lg"
9898 prop-format="innerLabel"
9999 value={state.receivingAddress}
100100 placeholder={`e.g. 0x84295d5e054d8cff5a22428b195f5a1615bd644f`}
101− onChange={v => this.handleAddressInput(v)}
102− >
103− <InnerLabel>{"New ownership address"}</InnerLabel>
104− <ShowBlockie className={"mt-1"} address={state.receivingAddress} />
101+ onChange={v => this.handleAddressInput(v)}>
102+ <InnerLabel>{'New ownership address'}</InnerLabel>
103+ <ShowBlockie className={'mt-1'} address={state.receivingAddress} />
105104 </AddressInput>
106105
107106 <Anchor
108− className={"mt-1"}
109− prop-size={"s"}
107+ className={'mt-1'}
108+ prop-size={'s'}
110109 prop-disabled={
111110 !isValidAddress(state.receivingAddress) || !esvisible
112111 }
113− target={"_blank"}
114− href={`https://${esdomain}/address/${state.receivingAddress}`}
115− >
116− {"View on Etherscan ↗"}
112+ target={'_blank'}
113+ href={`https://${esdomain}/address/${state.receivingAddress}`}>
114+ {'View on Etherscan ↗'}
117115 </Anchor>
118116
119117 <StatelessTransaction
src/bridge/views/Trezor.js+34−37
@@ -1,15 +1,15 @@
1−import * as bip32 from "bip32";
2−import React from "react";
3−import Maybe from "folktale/maybe";
4−import { Button } from "../components/Base";
5−import { Row, Col, H1, P } from "../components/Base";
6−import { InnerLabel, Input, InnerLabelDropdown } from "../components/Base";
7−import TrezorConnect from "trezor-connect";
8−import * as secp256k1 from "secp256k1";
9−
10−import { TREZOR_PATH } from "../lib/trezor";
11−import { ROUTE_NAMES } from "../lib/routeNames";
12−import { withHistory } from "../store/history";
1+import * as bip32 from 'bip32';
2+import React from 'react';
3+import Maybe from 'folktale/maybe';
4+import { Button } from '../components/Base';
5+import { Row, Col, H1, P } from '../components/Base';
6+import { InnerLabel, Input, InnerLabelDropdown } from '../components/Base';
7+import TrezorConnect from 'trezor-connect';
8+import * as secp256k1 from 'secp256k1';
9+
10+import { TREZOR_PATH } from '../lib/trezor';
11+import { ROUTE_NAMES } from '../lib/routeNames';
12+import { withHistory } from '../store/history';
1313
1414class Trezor extends React.Component {
1515 constructor(props) {
@@ -27,7 +27,7 @@ class Trezor extends React.Component {
2727
2828 handleAccountSelection(account) {
2929 let hdpath = this.state.hdpath;
30− if (account !== "custom") {
30+ if (account !== 'custom') {
3131 hdpath = TREZOR_PATH.replace(/x/g, account);
3232 }
3333 this.setState({ account, hdpath });
@@ -42,14 +42,14 @@ class Trezor extends React.Component {
4242 const { hdpath } = this.state;
4343
4444 TrezorConnect.manifest({
45− email: "bridge-trezor@urbit.org",
46− appUrl: "https://github.com/urbit/bridge",
45+ email: 'bridge-trezor@urbit.org',
46+ appUrl: 'https://github.com/urbit/bridge',
4747 });
4848 TrezorConnect.getPublicKey({ path: hdpath }).then(info => {
4949 if (info.success === true) {
5050 const payload = info.payload;
51− const publicKey = Buffer.from(payload.publicKey, "hex");
52− const chainCode = Buffer.from(payload.chainCode, "hex");
51+ const publicKey = Buffer.from(payload.publicKey, 'hex');
52+ const chainCode = Buffer.from(payload.chainCode, 'hex');
5353 const pub = secp256k1.publicKeyConvert(publicKey, true);
5454 const hd = bip32.fromPublicKey(pub, chainCode);
5555 setWallet(Maybe.Just(hd));
@@ -67,13 +67,13 @@ class Trezor extends React.Component {
6767
6868 let accountOptions = [
6969 {
70− title: "Custom path",
71− value: "custom",
70+ title: 'Custom path',
71+ value: 'custom',
7272 },
7373 ];
7474 for (let i = 0; i < 20; i++) {
7575 accountOptions.push({
76− title: "Account #" + (i + 1),
76+ title: 'Account #' + (i + 1),
7777 value: i,
7878 });
7979 }
@@ -86,14 +86,14 @@ class Trezor extends React.Component {
8686 prop-format="innerLabel"
8787 options={accountOptions}
8888 handleUpdate={handleAccountSelection}
89− title={"Account"}
89+ title={'Account'}
9090 currentSelectionTitle={accountTitle}
9191 fullWidth={true}
9292 />
9393 );
9494
9595 const pathSelection =
96− account !== "custom" ? null : (
96+ account !== 'custom' ? null : (
9797 <Input
9898 className="mt-8 pt-8 text-mono"
9999 prop-size="md"
@@ -101,16 +101,15 @@ class Trezor extends React.Component {
101101 name="hdpath"
102102 value={hdpath}
103103 autocomplete="off"
104− onChange={this.handleHdPathInput}
105− >
106− <InnerLabel>{"HD Path"}</InnerLabel>
104+ onChange={this.handleHdPathInput}>
105+ <InnerLabel>{'HD Path'}</InnerLabel>
107106 </Input>
108107 );
109108
110109 return (
111110 <Row>
112− <Col className={"measure-md"}>
113− <H1>{"Authenticate With Your Trezor"}</H1>
111+ <Col className={'measure-md'}>
112+ <H1>{'Authenticate With Your Trezor'}</H1>
114113
115114 <P>
116115 {`Connect and authenticate to your Trezor. If you'd like
@@ -121,20 +120,18 @@ class Trezor extends React.Component {
121120 {pathSelection}
122121
123122 <Button
124− className={"mt-8"}
125− prop-size={"wide lg"}
126− onClick={this.pollDevice}
127− >
128− {"Authenticate →"}
123+ className={'mt-8'}
124+ prop-size={'wide lg'}
125+ onClick={this.pollDevice}>
126+ {'Authenticate →'}
129127 </Button>
130128
131129 <Button
132− className={"mt-8"}
133− prop-size={"wide lg"}
130+ className={'mt-8'}
131+ prop-size={'wide lg'}
134132 disabled={Maybe.Nothing.hasInstance(wallet)}
135− onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}
136− >
137− {"Continue →"}
133+ onClick={() => history.popAndPush(ROUTE_NAMES.SHIPS)}>
134+ {'Continue →'}
138135 </Button>
139136 </Col>
140137 </Row>
src/bridge/views/ViewPoint.js+17−19
@@ -1,20 +1,20 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import * as ob from "urbit-ob";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import * as ob from 'urbit-ob';
44
5−import { Button } from "../components/Base";
6−import { Row, Col, H1, P } from "../components/Base";
7−import { InnerLabel, PointInput, ValidatedSigil } from "../components/Base";
5+import { Button } from '../components/Base';
6+import { Row, Col, H1, P } from '../components/Base';
7+import { InnerLabel, PointInput, ValidatedSigil } from '../components/Base';
88
9−import { ROUTE_NAMES } from "../lib/routeNames";
10−import { withHistory } from "../store/history";
9+import { ROUTE_NAMES } from '../lib/routeNames';
10+import { withHistory } from '../store/history';
1111
1212class ViewPoint extends React.Component {
1313 constructor(props) {
1414 super(props);
1515
1616 this.state = {
17− pointName: "",
17+ pointName: '',
1818 };
1919
2020 this.handlePointInput = this.handlePointInput.bind(this);
@@ -43,9 +43,9 @@ class ViewPoint extends React.Component {
4343 return (
4444 <Row>
4545 <Col>
46− <H1>{"View a Point"}</H1>
46+ <H1>{'View a Point'}</H1>
4747
48− <P>{"Enter a point name to view its public information."}</P>
48+ <P>{'Enter a point name to view its public information.'}</P>
4949
5050 <PointInput
5151 autoFocus
@@ -54,11 +54,10 @@ class ViewPoint extends React.Component {
5454 className="mono"
5555 placeholder="e.g. ~zod"
5656 onChange={this.handlePointInput}
57− value={pointName}
58− >
59− <InnerLabel>{"Point Name"}</InnerLabel>
57+ value={pointName}>
58+ <InnerLabel>{'Point Name'}</InnerLabel>
6059 <ValidatedSigil
61− className={"tr-0 mt-05 mr-0 abs"}
60+ className={'tr-0 mt-05 mr-0 abs'}
6261 patp={pointName}
6362 show
6463 size={68}
@@ -67,14 +66,13 @@ class ViewPoint extends React.Component {
6766 </PointInput>
6867
6968 <Button
70− className={"mt-8"}
69+ className={'mt-8'}
7170 disabled={valid === false}
7271 onClick={() => {
7372 setPointCursor(Maybe.Just(ob.patp2dec(pointName)));
7473 history.popAndPush(ROUTE_NAMES.SHIP);
75− }}
76− >
77− {"Continue →"}
74+ }}>
75+ {'Continue →'}
7876 </Button>
7977 </Col>
8078 </Row>
src/bridge/views/Wallet.js+24−25
@@ -1,12 +1,12 @@
1−import Maybe from "folktale/maybe";
2−import React from "react";
3−import { Button, H1, P } from "../components/Base";
4−import { InnerLabelDropdown } from "../components/Base";
5−import { Row, Col } from "../components/Base";
1+import Maybe from 'folktale/maybe';
2+import React from 'react';
3+import { Button, H1, P } from '../components/Base';
4+import { InnerLabelDropdown } from '../components/Base';
5+import { Row, Col } from '../components/Base';
66
7−import { ROUTE_NAMES } from "../lib/routeNames";
8−import { withHistory } from "../store/history";
9−import { WALLET_NAMES, renderWalletType } from "../lib/wallet";
7+import { ROUTE_NAMES } from '../lib/routeNames';
8+import { withHistory } from '../store/history';
9+import { WALLET_NAMES, renderWalletType } from '../lib/wallet';
1010
1111class Wallet extends React.Component {
1212 componentDidMount() {
@@ -17,37 +17,37 @@ class Wallet extends React.Component {
1717 getWalletOptions() {
1818 return [
1919 {
20− title: "Urbit Master Ticket",
20+ title: 'Urbit Master Ticket',
2121 value: WALLET_NAMES.TICKET,
2222 },
2323 {
24− title: "Urbit Master Ticket (Shards)",
24+ title: 'Urbit Master Ticket (Shards)',
2525 value: WALLET_NAMES.SHARDS,
2626 },
2727 {
28− type: "divider",
28+ type: 'divider',
2929 },
3030 {
31− title: "Ledger",
31+ title: 'Ledger',
3232 value: WALLET_NAMES.LEDGER,
3333 },
3434 {
35− title: "Trezor",
35+ title: 'Trezor',
3636 value: WALLET_NAMES.TREZOR,
3737 },
3838 {
39− type: "divider",
39+ type: 'divider',
4040 },
4141 {
42− title: "BIP39 Mnemonic",
42+ title: 'BIP39 Mnemonic',
4343 value: WALLET_NAMES.MNEMONIC,
4444 },
4545 {
46− title: "Ethereum Private Key",
46+ title: 'Ethereum Private Key',
4747 value: WALLET_NAMES.PRIVATE_KEY,
4848 },
4949 {
50− title: "Ethereum Keystore File",
50+ title: 'Ethereum Keystore File',
5151 value: WALLET_NAMES.KEYSTORE,
5252 },
5353 ];
@@ -60,7 +60,7 @@ class Wallet extends React.Component {
6060 return (
6161 <Row>
6262 <Col>
63− <H1>{"Unlock a Wallet"}</H1>
63+ <H1>{'Unlock a Wallet'}</H1>
6464
6565 <P>
6666 {`To manage your assets, you need to unlock a wallet.
@@ -68,15 +68,15 @@ class Wallet extends React.Component {
6868 </P>
6969
7070 <InnerLabelDropdown
71− className={"mb-10 mt-6"}
72− title={"Wallet Type:"}
71+ className={'mb-10 mt-6'}
72+ title={'Wallet Type:'}
7373 options={walletOptions}
7474 handleUpdate={props.setWalletType}
7575 currentSelectionTitle={renderWalletType(props.walletType)}
7676 />
7777
7878 <Button
79− className={"mt-10"}
79+ className={'mt-10'}
8080 onClick={() =>
8181 props.history.push(
8282 props.walletType === WALLET_NAMES.MNEMONIC
@@ -93,11 +93,10 @@ class Wallet extends React.Component {
9393 ? ROUTE_NAMES.PRIVATE_KEY
9494 : props.walletType === WALLET_NAMES.KEYSTORE
9595 ? ROUTE_NAMES.KEYSTORE
96− : ROUTE_NAMES.DEFAULT,
96+ : ROUTE_NAMES.DEFAULT
9797 )
98− }
99− >
100− {"Continue →"}
98+ }>
99+ {'Continue →'}
101100 </Button>
102101 </Col>
103102 </Row>
src/walletgen/lib/lib.js+9−9
@@ -1,7 +1,7 @@
1−import * as ob from "urbit-ob";
2−import * as kg from "urbit-key-generation/dist/index";
3−import * as more from "more-entropy";
4−import lodash from "lodash";
1+import * as ob from 'urbit-ob';
2+import * as kg from 'urbit-key-generation/dist/index';
3+import * as more from 'more-entropy';
4+import lodash from 'lodash';
55import {
66 MIN_STAR,
77 MIN_PLANET,
@@ -9,7 +9,7 @@ import {
99 GALAXY_ENTROPY_BITS,
1010 STAR_ENTROPY_BITS,
1111 PLANET_ENTROPY_BITS,
12−} from "./constants";
12+} from './constants';
1313
1414const SEED_LENGTH_BYTES = SEED_ENTROPY_BITS / 8;
1515
@@ -35,9 +35,9 @@ const makeTicket = point => {
3535 const more = lodash.flatMap(desired, arr => arr[0] ^ arr[1]);
3636 const entropy = lodash.zipWith(some, more, (x, y) => x ^ y);
3737 const buf = Buffer.from(entropy);
38− const patq = ob.hex2patq(buf.toString("hex"));
38+ const patq = ob.hex2patq(buf.toString('hex'));
3939 resolve(patq);
40− reject("Entropy generation failed");
40+ reject('Entropy generation failed');
4141 });
4242 });
4343};
@@ -48,7 +48,7 @@ const generateWallet = async (point, ticket, boot) => {
4848 ticket: ticket,
4949 seedSize: SEED_LENGTH_BYTES,
5050 ship: point,
51− password: "",
51+ password: '',
5252 revisions: {},
5353 boot: boot,
5454 };
@@ -57,7 +57,7 @@ const generateWallet = async (point, ticket, boot) => {
5757
5858 // This is here to notify anyone who opens console because the thread
5959 // hangs, blocking UI updates so this cannot be done in the UI
60− console.log("Generating Wallet for point address: ", point);
60+ console.log('Generating Wallet for point address: ', point);
6161
6262 return wallet;
6363};