on master help sign in
chore: replace all references to Maybe.* with Just or Nothing
827d862Matt Condon (shrugs)
src/components/Passport.js+4−4
@@ -1,6 +1,6 @@
1import React from 'react';
1import React from 'react';
2import cn from 'classnames';
2import cn from 'classnames';
3−import Maybe from 'folktale/maybe';
3+import { Just, Nothing } from 'folktale/maybe';
4import * as ob from 'urbit-ob';
4import * as ob from 'urbit-ob';
5import { Grid, Flex, Text } from 'indigo-react';
5import { Grid, Flex, Text } from 'indigo-react';
6import { times } from 'lodash';
6import { times } from 'lodash';
@@ -36,7 +36,7 @@ export default function Passport({
36 point,
36 point,
37 className,
37 className,
38 ticket = null,
38 ticket = null,
39− address = Maybe.Nothing(),
39+ address = Nothing(),
40 mini = false,
40 mini = false,
41}) {
41}) {
42 const birthday = usePointBirthday(point.getOrElse(null));
42 const birthday = usePointBirthday(point.getOrElse(null));
@@ -46,8 +46,8 @@ export default function Passport({
46 });
46 });
47
47
48 const name = point.matchWith({
48 const name = point.matchWith({
49− Nothing: () => Maybe.Nothing(),
49+ Nothing: () => Nothing(),
50− Just: p => Maybe.Just(ob.patp(p.value)),
50+ Just: p => Just(ob.patp(p.value)),
51 });
51 });
52 const visualName = name.matchWith({
52 const visualName = name.matchWith({
53 Nothing: () => '...',
53 Nothing: () => '...',
src/components/old/RenderedPoint.js+4−4
@@ -1,5 +1,5 @@
1−import Maybe from 'folktale/maybe';
2import React from 'react';
1import React from 'react';
2+import { Just } from 'folktale/maybe';
3import { Col } from './Base';
3import { Col } from './Base';
4import { Button } from './Base';
4import { Button } from './Base';
5import { pour } from 'sigil-js';
5import { pour } from 'sigil-js';
@@ -24,7 +24,7 @@ const RenderedPoint = props => {
24 key={`rendered-sigil-${point}`}
24 key={`rendered-sigil-${point}`}
25 className="clickable"
25 className="clickable"
26 onClick={() => {
26 onClick={() => {
27− setPointCursor(Maybe.Just(point));
27+ setPointCursor(Just(point));
28 routeHandler(ROUTE_NAMES.POINT);
28 routeHandler(ROUTE_NAMES.POINT);
29 }}>
29 }}>
30 {sigil}
30 {sigil}
@@ -33,7 +33,7 @@ const RenderedPoint = props => {
33 key={`rendered-name-${point}`}
33 key={`rendered-name-${point}`}
34 className="clickable"
34 className="clickable"
35 onClick={() => {
35 onClick={() => {
36− setPointCursor(Maybe.Just(point));
36+ setPointCursor(Just(point));
37 routeHandler(ROUTE_NAMES.POINT);
37 routeHandler(ROUTE_NAMES.POINT);
38 }}>
38 }}>
39 <code>{name}</code>
39 <code>{name}</code>
@@ -44,7 +44,7 @@ const RenderedPoint = props => {
44 prop-type={'link'}
44 prop-type={'link'}
45 prop-size={'sm'}
45 prop-size={'sm'}
46 onClick={() => {
46 onClick={() => {
47− setPointCursor(Maybe.Just(point));
47+ setPointCursor(Just(point));
48 routeHandler(ROUTE_NAMES.POINT);
48 routeHandler(ROUTE_NAMES.POINT);
49 }}>
49 }}>
50 {'Details →'}
50 {'Details →'}
src/lib/keys.js+4−4
@@ -1,5 +1,5 @@
1import BN from 'bn.js';
1import BN from 'bn.js';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as need from './need';
3import * as need from './need';
4
4
5import * as noun from '../nockjs/noun';
5import * as noun from '../nockjs/noun';
@@ -119,13 +119,13 @@ const attemptNetworkSeedDerivation = async (next, args) => {
119 const seed = await kg.deriveNetworkSeed(managementSeed, '', revision);
119 const seed = await kg.deriveNetworkSeed(managementSeed, '', revision);
120
120
121 if (seed === '') {
121 if (seed === '') {
122− return Maybe.Nothing();
122+ return Nothing();
123 }
123 }
124
124
125− return Maybe.Just(seed);
125+ return Just(seed);
126 }
126 }
127
127
128− return Maybe.Nothing();
128+ return Nothing();
129};
129};
130
130
131export { genKey, attemptNetworkSeedDerivation };
131export { genKey, attemptNetworkSeedDerivation };
src/lib/useLoginView.js+2−2
@@ -1,5 +1,5 @@
1import { useEffect } from 'react';
1import { useEffect } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Nothing } from 'folktale/maybe';
3
3
4import { useWallet } from 'store/wallet';
4import { useWallet } from 'store/wallet';
5import { usePointCursor } from 'store/pointCursor';
5import { usePointCursor } from 'store/pointCursor';
@@ -12,6 +12,6 @@ export default function useLoginView(walletType) {
12 useEffect(() => {
12 useEffect(() => {
13 resetWallet();
13 resetWallet();
14 setWalletType(walletType);
14 setWalletType(walletType);
15− setPointCursor(Maybe.Nothing());
15+ setPointCursor(Nothing());
16 }, [setWalletType, walletType, setPointCursor, resetWallet]);
16 }, [setWalletType, walletType, setPointCursor, resetWallet]);
17}
17}
src/lib/useMailer.js+5−5
@@ -1,5 +1,5 @@
1import { useCallback } from 'react';
1import { useCallback } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3
3
4import { hasReceived, sendMail } from './inviteMail';
4import { hasReceived, sendMail } from './inviteMail';
5import useSetState from './useSetState';
5import useSetState from './useSetState';
@@ -10,24 +10,24 @@ function useHasReceivedCache() {
10 const [cache, addToCache] = useSetState();
10 const [cache, addToCache] = useSetState();
11
11
12 const getHasRecieved = useCallback(
12 const getHasRecieved = useCallback(
13− email => cache[email] || Maybe.Nothing(), //
13+ email => cache[email] || Nothing(), //
14 [cache]
14 [cache]
15 );
15 );
16
16
17 const syncHasReceivedForEmail = useCallback(
17 const syncHasReceivedForEmail = useCallback(
18 async email => {
18 async email => {
19− if (Maybe.Just.hasInstance(getHasRecieved(email))) {
19+ if (Just.hasInstance(getHasRecieved(email))) {
20 // never update the cache after we know about it
20 // never update the cache after we know about it
21 return;
21 return;
22 }
22 }
23
23
24 if (STUB_MAILER) {
24 if (STUB_MAILER) {
25 // always allow sending emails when stubbing
25 // always allow sending emails when stubbing
26− return addToCache({ [email]: Maybe.Just(false) });
26+ return addToCache({ [email]: Just(false) });
27 }
27 }
28
28
29 const _hasReceived = await hasReceived(email);
29 const _hasReceived = await hasReceived(email);
30− addToCache({ [email]: Maybe.Just(_hasReceived) });
30+ addToCache({ [email]: Just(_hasReceived) });
31 },
31 },
32 [getHasRecieved, addToCache]
32 [getHasRecieved, addToCache]
33 );
33 );
src/lib/wallet.js+5−5
@@ -2,7 +2,7 @@ import * as bip32 from 'bip32';
2import * as bip39 from 'bip39';
2import * as bip39 from 'bip39';
3import keccak from 'keccak';
3import keccak from 'keccak';
4import { reduce } from 'lodash';
4import { reduce } from 'lodash';
5−import Maybe from 'folktale/maybe';
5+import { Just, Nothing } from 'folktale/maybe';
6import * as secp256k1 from 'secp256k1';
6import * as secp256k1 from 'secp256k1';
7import * as ob from 'urbit-ob';
7import * as ob from 'urbit-ob';
8import * as kg from 'urbit-key-generation/dist';
8import * as kg from 'urbit-key-generation/dist';
@@ -100,8 +100,8 @@ export const ownershipWalletFromTicket = async (ticket, point, passphrase) => {
100
100
101export const walletFromMnemonic = (mnemonic, hdpath, passphrase) => {
101export const walletFromMnemonic = (mnemonic, hdpath, passphrase) => {
102 const seed = bip39.validateMnemonic(mnemonic)
102 const seed = bip39.validateMnemonic(mnemonic)
103− ? Maybe.Just(bip39.mnemonicToSeed(mnemonic, passphrase))
103+ ? Just(bip39.mnemonicToSeed(mnemonic, passphrase))
104− : Maybe.Nothing();
104+ : Nothing();
105
105
106 const toWallet = (sd, path) => {
106 const toWallet = (sd, path) => {
107 let wal;
107 let wal;
@@ -109,9 +109,9 @@ export const walletFromMnemonic = (mnemonic, hdpath, passphrase) => {
109 const hd = bip32.fromSeed(sd);
109 const hd = bip32.fromSeed(sd);
110 wal = hd.derivePath(path);
110 wal = hd.derivePath(path);
111 wal.address = addressFromSecp256k1Public(wal.publicKey);
111 wal.address = addressFromSecp256k1Public(wal.publicKey);
112− wal = Maybe.Just(wal);
112+ wal = Just(wal);
113 } catch (_) {
113 } catch (_) {
114− wal = Maybe.Nothing();
114+ wal = Nothing();
115 }
115 }
116 return wal;
116 return wal;
117 };
117 };
src/store/lib/useBirthdaysStore.js+7−8
@@ -1,5 +1,5 @@
1import { useCallback, useState } from 'react';
1import { useCallback, useState } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4
4
5import { useNetwork } from '../network';
5import { useNetwork } from '../network';
@@ -17,10 +17,9 @@ export default function useBirthdayStore() {
17 [_setBirthdayCache]
17 [_setBirthdayCache]
18 );
18 );
19
19
20− const getBirthday = useCallback(
21− point => birthdayCache[point] || Maybe.Nothing(),
20+ const getBirthday = useCallback(point => birthdayCache[point] || Nothing(), [
22− [birthdayCache]
21+ birthdayCache,
23− );
22+ ]);
24
23
25 const syncBirthday = useCallback(
24 const syncBirthday = useCallback(
26 async point => {
25 async point => {
@@ -31,7 +30,7 @@ export default function useBirthdayStore() {
31 }
30 }
32
31
33 // birthday will not change after being set, so bail if we already know
32 // birthday will not change after being set, so bail if we already know
34− if (Maybe.Just.hasInstance(getBirthday(point))) {
33+ if (Just.hasInstance(getBirthday(point))) {
35 return;
34 return;
36 }
35 }
37
36
@@ -43,13 +42,13 @@ export default function useBirthdayStore() {
43 if (birthBlock > 0) {
42 if (birthBlock > 0) {
44 const block = await _web3.eth.getBlock(birthBlock);
43 const block = await _web3.eth.getBlock(birthBlock);
45 addToBirthdayCache({
44 addToBirthdayCache({
46− [point]: Maybe.Just(new Date(block.timestamp * 1000)),
45+ [point]: Just(new Date(block.timestamp * 1000)),
47 });
46 });
48 } else {
47 } else {
49 // TODO: better encoding for "no birthday" state?
48 // TODO: better encoding for "no birthday" state?
50 // if there's no birthday, just use today
49 // if there's no birthday, just use today
51 addToBirthdayCache({
50 addToBirthdayCache({
52− [point]: Maybe.Just(new Date()),
51+ [point]: Just(new Date()),
53 });
52 });
54 }
53 }
55 },
54 },
src/store/lib/useControlledPointsStore.js+11−11
@@ -1,16 +1,16 @@
1import { useState, useCallback } from 'react';
1import { useState, useCallback } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4
4
5import { useNetwork } from '../network';
5import { useNetwork } from '../network';
6import { useWallet } from 'store/wallet';
6import { useWallet } from 'store/wallet';
7
7
8const EMPTY_CONTROLLED_POINTS = {
8const EMPTY_CONTROLLED_POINTS = {
9− ownedPoints: Maybe.Nothing(),
9+ ownedPoints: Nothing(),
10− incomingPoints: Maybe.Nothing(),
10+ incomingPoints: Nothing(),
11− managingPoints: Maybe.Nothing(),
11+ managingPoints: Nothing(),
12− votingPoints: Maybe.Nothing(),
12+ votingPoints: Nothing(),
13− spawningPoints: Maybe.Nothing(),
13+ spawningPoints: Nothing(),
14};
14};
15
15
16export default function useControlledPointsStore() {
16export default function useControlledPointsStore() {
@@ -49,11 +49,11 @@ export default function useControlledPointsStore() {
49 ]);
49 ]);
50
50
51 _setControlledPointsCache({
51 _setControlledPointsCache({
52− ownedPoints: Maybe.Just(ownedPoints),
52+ ownedPoints: Just(ownedPoints),
53− incomingPoints: Maybe.Just(incomingPoints),
53+ incomingPoints: Just(incomingPoints),
54− managingPoints: Maybe.Just(managingPoints),
54+ managingPoints: Just(managingPoints),
55− votingPoints: Maybe.Just(votingPoints),
55+ votingPoints: Just(votingPoints),
56− spawningPoints: Maybe.Just(spawningPoints),
56+ spawningPoints: Just(spawningPoints),
57 });
57 });
58 }, [contracts, wallet, _setControlledPointsCache]);
58 }, [contracts, wallet, _setControlledPointsCache]);
59
59
src/store/lib/useDetailsStore.js+2−3
@@ -1,5 +1,5 @@
1import { useState, useCallback } from 'react';
1import { useState, useCallback } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4
4
5import { useNetwork } from '../network';
5import { useNetwork } from '../network';
@@ -20,8 +20,7 @@ export default function useDetailsStore() {
20 // TODO: refactor detailsCache access to use accessor like bithday
20 // TODO: refactor detailsCache access to use accessor like bithday
21 // Maybe<{}>
21 // Maybe<{}>
22 const getDetails = useCallback(
22 const getDetails = useCallback(
23− point =>
24− point in detailsCache ? Maybe.Just(detailsCache[point]) : Maybe.Nothing(),
23+ point => (point in detailsCache ? Just(detailsCache[point]) : Nothing()),
25 [detailsCache]
24 [detailsCache]
26 );
25 );
27
26
src/store/lib/useInvitesStore.js+7−7
@@ -1,14 +1,14 @@
1import { useCallback, useState } from 'react';
1import { useCallback, useState } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4
4
5import { useNetwork } from '../network';
5import { useNetwork } from '../network';
6
6
7// the default value of a point's invites
7// the default value of a point's invites
8const EMPTY_INVITES = {
8const EMPTY_INVITES = {
9− availableInvites: Maybe.Nothing(),
9+ availableInvites: Nothing(),
10− sentInvites: Maybe.Nothing(),
10+ sentInvites: Nothing(),
11− acceptedInvites: Maybe.Nothing(),
11+ acceptedInvites: Nothing(),
12};
12};
13
13
14export default function useInvitesStore() {
14export default function useInvitesStore() {
@@ -52,9 +52,9 @@ export default function useInvitesStore() {
52
52
53 addToInvitesCache({
53 addToInvitesCache({
54 [point]: {
54 [point]: {
55− availableInvites: Maybe.Just(availableInvites),
55+ availableInvites: Just(availableInvites),
56− sentInvites: Maybe.Just(sentInvites),
56+ sentInvites: Just(sentInvites),
57− acceptedInvites: Maybe.Just(acceptedInvites),
57+ acceptedInvites: Just(acceptedInvites),
58 },
58 },
59 });
59 });
60 },
60 },
src/store/network.js+5−5
@@ -5,9 +5,9 @@ import React, {
5 useMemo,
5 useMemo,
6 useState,
6 useState,
7} from 'react';
7} from 'react';
8+import { Just, Nothing } from 'folktale/maybe';
8import * as azimuth from 'azimuth-js';
9import * as azimuth from 'azimuth-js';
9import Web3 from 'web3';
10import Web3 from 'web3';
10−import Maybe from 'folktale/maybe';
11import { includes } from 'lodash';
11import { includes } from 'lodash';
12
12
13import { CONTRACT_ADDRESSES } from '../lib/contracts';
13import { CONTRACT_ADDRESSES } from '../lib/contracts';
@@ -33,8 +33,8 @@ function _useNetwork(initialNetworkType = null) {
33 const contracts = azimuth.initContracts(web3, contractAddresses);
33 const contracts = azimuth.initContracts(web3, contractAddresses);
34
34
35 return {
35 return {
36− web3: Maybe.Just(web3),
36+ web3: Just(web3),
37− contracts: Maybe.Just(contracts),
37+ contracts: Just(contracts),
38 };
38 };
39 };
39 };
40
40
@@ -82,8 +82,8 @@ function _useNetwork(initialNetworkType = null) {
82 new Web3.providers.HttpProvider('http://example.com:3456'),
82 new Web3.providers.HttpProvider('http://example.com:3456'),
83 isDevelopment ? CONTRACT_ADDRESSES.DEV : CONTRACT_ADDRESSES.MAINNET
83 isDevelopment ? CONTRACT_ADDRESSES.DEV : CONTRACT_ADDRESSES.MAINNET
84 ),
84 ),
85− web3: Maybe.Nothing(),
85+ web3: Nothing(),
86− // ^ overwrite the web3 object from initWeb3 with a Maybe.Nothing
86+ // ^ overwrite the web3 object from initWeb3 with a Nothing
87 // to indicate that there is no valid web3 connection
87 // to indicate that there is no valid web3 connection
88 };
88 };
89 }
89 }
src/store/pointCursor.js+2−2
@@ -1,10 +1,10 @@
1import React, { createContext, forwardRef, useContext, useState } from 'react';
1import React, { createContext, forwardRef, useContext, useState } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Nothing } from 'folktale/maybe';
3
3
4export const PointCursorContext = createContext(null);
4export const PointCursorContext = createContext(null);
5
5
6// pointCursor is Maybe<number>
6// pointCursor is Maybe<number>
7−function _usePointCursor(initialPointCursor = Maybe.Nothing()) {
7+function _usePointCursor(initialPointCursor = Nothing()) {
8 const [pointCursor, setPointCursor] = useState(initialPointCursor);
8 const [pointCursor, setPointCursor] = useState(initialPointCursor);
9
9
10 return {
10 return {
src/store/wallet.js+13−16
@@ -5,7 +5,7 @@ import React, {
5 useContext,
5 useContext,
6 useState,
6 useState,
7} from 'react';
7} from 'react';
8−import Maybe from 'folktale/maybe';
8+import { Just, Nothing } from 'folktale/maybe';
9import { includes } from 'lodash';
9import { includes } from 'lodash';
10
10
11import {
11import {
@@ -28,21 +28,18 @@ const DEFAULT_WALLET_TYPE = WALLET_TYPES.TICKET;
28// it doesn't necessarily help us much, since we branch on 'walletType'
28// it doesn't necessarily help us much, since we branch on 'walletType'
29// before setting 'wallet'.
29// before setting 'wallet'.
30//
30//
31−// Wallets are always wrapped in Maybe. For most authentication
31+// Wallets are always wrapped in For most authentication
32// mechanisms, Maybe wraps a BIP32 HD wallet; for Ethereum private keys,
32// mechanisms, Maybe wraps a BIP32 HD wallet; for Ethereum private keys,
33// JSON keystore files, and Metamask authentication, it wraps an
33// JSON keystore files, and Metamask authentication, it wraps an
34// 'EthereumWallet'.
34// 'EthereumWallet'.
35−function _useWallet(
36− initialWallet = Maybe.Nothing(),
37− initialMnemonic = Maybe.Nothing()
35+function _useWallet(initialWallet = Nothing(), initialMnemonic = Nothing()) {
38−) {
39 const [walletType, _setWalletType] = useState(DEFAULT_WALLET_TYPE);
36 const [walletType, _setWalletType] = useState(DEFAULT_WALLET_TYPE);
40 const [walletHdPath, setWalletHdPath] = useState(DEFAULT_HD_PATH);
37 const [walletHdPath, setWalletHdPath] = useState(DEFAULT_HD_PATH);
41 const [wallet, _setWallet] = useState(initialWallet);
38 const [wallet, _setWallet] = useState(initialWallet);
42− const [urbitWallet, _setUrbitWallet] = useState(Maybe.Nothing());
39+ const [urbitWallet, _setUrbitWallet] = useState(Nothing());
43 const [authMnemonic, setAuthMnemonic] = useState(initialMnemonic);
40 const [authMnemonic, setAuthMnemonic] = useState(initialMnemonic);
44− const [networkSeed, setNetworkSeed] = useState(Maybe.Nothing());
41+ const [networkSeed, setNetworkSeed] = useState(Nothing());
45− const [networkRevision, setNetworkRevision] = useState(Maybe.Nothing());
42+ const [networkRevision, setNetworkRevision] = useState(Nothing());
46
43
47 const setWalletType = useCallback(
44 const setWalletType = useCallback(
48 walletType => {
45 walletType => {
@@ -70,7 +67,7 @@ function _useWallet(
70
67
71 const setUrbitWallet = useCallback(
68 const setUrbitWallet = useCallback(
72 urbitWallet => {
69 urbitWallet => {
73− if (Maybe.Just.hasInstance(urbitWallet)) {
70+ if (Just.hasInstance(urbitWallet)) {
74 // when an urbit wallet is set, also derive
71 // when an urbit wallet is set, also derive
75 // a normal bip32 wallet using the ownership address
72 // a normal bip32 wallet using the ownership address
76 const wallet = walletFromMnemonic(
73 const wallet = walletFromMnemonic(
@@ -81,7 +78,7 @@ function _useWallet(
81
78
82 setWallet(wallet);
79 setWallet(wallet);
83 } else {
80 } else {
84− setWallet(Maybe.Nothing());
81+ setWallet(Nothing());
85 }
82 }
86
83
87 _setUrbitWallet(urbitWallet);
84 _setUrbitWallet(urbitWallet);
@@ -92,11 +89,11 @@ function _useWallet(
92 const resetWallet = useCallback(() => {
89 const resetWallet = useCallback(() => {
93 _setWalletType(DEFAULT_WALLET_TYPE);
90 _setWalletType(DEFAULT_WALLET_TYPE);
94 setWalletHdPath(DEFAULT_HD_PATH);
91 setWalletHdPath(DEFAULT_HD_PATH);
95− _setWallet(Maybe.Nothing());
92+ _setWallet(Nothing());
96− _setUrbitWallet(Maybe.Nothing());
93+ _setUrbitWallet(Nothing());
97− setAuthMnemonic(Maybe.Nothing());
94+ setAuthMnemonic(Nothing());
98− setNetworkSeed(Maybe.Nothing());
95+ setNetworkSeed(Nothing());
99− setNetworkRevision(Maybe.Nothing());
96+ setNetworkRevision(Nothing());
100 }, [
97 }, [
101 _setWalletType,
98 _setWalletType,
102 setWalletHdPath,
99 setWalletHdPath,
src/views/Activate/ActivateCode.js+5−5
@@ -1,6 +1,6 @@
1import React, { useCallback, useEffect, useState } from 'react';
1import React, { useCallback, useEffect, useState } from 'react';
2+import { Just, Nothing } from 'folktale/maybe';
2import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
3−import Maybe from 'folktale/maybe';
4import { useTicketInput } from 'components/Inputs';
4import { useTicketInput } from 'components/Inputs';
5import { Grid, Input, H4, ErrorText } from 'indigo-react';
5import { Grid, Input, H4, ErrorText } from 'indigo-react';
6
6
@@ -80,13 +80,13 @@ export default function ActivateCode() {
80 );
80 );
81 const incoming = [...owned, ...transferring];
81 const incoming = [...owned, ...transferring];
82
82
83− let realPoint = Maybe.Nothing();
83+ let realPoint = Nothing();
84− let wallet = Maybe.Nothing();
84+ let wallet = Nothing();
85
85
86 if (incoming.length > 0) {
86 if (incoming.length > 0) {
87 const pointNum = parseInt(incoming[0], 10);
87 const pointNum = parseInt(incoming[0], 10);
88− realPoint = Maybe.Just(pointNum);
88+ realPoint = Just(pointNum);
89− wallet = Maybe.Just(await generateWallet(pointNum));
89+ wallet = Just(await generateWallet(pointNum));
90
90
91 if (incoming.length > 1) {
91 if (incoming.length > 1) {
92 setGeneralError(
92 setGeneralError(
src/views/Activate/PassportDownload.js+3−3
@@ -1,6 +1,6 @@
1import React, { useState, useEffect, useCallback } from 'react';
1import React, { useState, useEffect, useCallback } from 'react';
2import cn from 'classnames';
2import cn from 'classnames';
3−import Maybe from 'folktale/maybe';
3+import { Just, Nothing } from 'folktale/maybe';
4import { Grid, H4, P } from 'indigo-react';
4import { Grid, H4, P } from 'indigo-react';
5
5
6import * as need from 'lib/need';
6import * as need from 'lib/need';
@@ -23,7 +23,7 @@ export default function PassportDownload({ className }) {
23 // const point = need.point(derivedPoint);
23 // const point = need.point(derivedPoint);
24 const wallet = need.wallet(derivedWallet);
24 const wallet = need.wallet(derivedWallet);
25
25
26− const [paper, setPaper] = useState(Maybe.Nothing());
26+ const [paper, setPaper] = useState(Nothing());
27 const [downloaded, setDownloaded] = useState(false);
27 const [downloaded, setDownloaded] = useState(false);
28
28
29 const pointAsString = derivedPoint.matchWith({
29 const pointAsString = derivedPoint.matchWith({
@@ -79,7 +79,7 @@ export default function PassportDownload({ className }) {
79 <PaperRenderer
79 <PaperRenderer
80 point={pointAsString}
80 point={pointAsString}
81 wallet={wallet}
81 wallet={wallet}
82− callback={data => setPaper(Maybe.Just(data))}
82+ callback={data => setPaper(Just(data))}
83 />
83 />
84 </Grid>
84 </Grid>
85 );
85 );
src/views/Activate/useActivateFlowState.js+7−7
@@ -1,16 +1,16 @@
1import { useCallback, useState } from 'react';
1import { useCallback, useState } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Nothing } from 'folktale/maybe';
3
3
4export default function useActivateFlowState() {
4export default function useActivateFlowState() {
5− const [derivedWallet, setDerivedWallet] = useState(Maybe.Nothing());
5+ const [derivedWallet, setDerivedWallet] = useState(Nothing());
6− const [inviteWallet, setInviteWallet] = useState(Maybe.Nothing());
6+ const [inviteWallet, setInviteWallet] = useState(Nothing());
7− const [derivedPoint, setDerivedPoint] = useState(Maybe.Nothing());
7+ const [derivedPoint, setDerivedPoint] = useState(Nothing());
8 const [generated, setGenerated] = useState(false);
8 const [generated, setGenerated] = useState(false);
9
9
10 const reset = useCallback(() => {
10 const reset = useCallback(() => {
11− setDerivedWallet(Maybe.Nothing());
11+ setDerivedWallet(Nothing());
12− setInviteWallet(Maybe.Nothing());
12+ setInviteWallet(Nothing());
13− setDerivedPoint(Maybe.Nothing());
13+ setDerivedPoint(Nothing());
14 setGenerated(false);
14 setGenerated(false);
15 }, [setDerivedWallet, setInviteWallet, setDerivedPoint, setGenerated]);
15 }, [setDerivedWallet, setInviteWallet, setDerivedPoint, setGenerated]);
16
16
src/views/CancelTransfer.js+5−4
@@ -1,8 +1,9 @@
1−import Maybe from 'folktale/maybe';
2import React from 'react';
1import React from 'react';
3−import { H1, P } from '../components/old/Base';
2+import { Just } from 'folktale/maybe';
4import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
5import * as ob from 'urbit-ob';
4import * as ob from 'urbit-ob';
5+
6+import { H1, P } from '../components/old/Base';
6import * as need from '../lib/need';
7import * as need from '../lib/need';
7
8
8import StatelessTransaction from '../components/old/StatelessTransaction';
9import StatelessTransaction from '../components/old/StatelessTransaction';
@@ -40,13 +41,13 @@ class CancelTransfer extends React.Component {
40 ETH_ZERO_ADDR
41 ETH_ZERO_ADDR
41 );
42 );
42
43
43− return Maybe.Just(txn);
44+ return Just(txn);
44 }
45 }
45
46
46 render() {
47 render() {
47 const { props, state } = this;
48 const { props, state } = this;
48
49
49− const online = Maybe.Just.hasInstance(props.web3);
50+ const online = Just.hasInstance(props.web3);
50
51
51 const proxy = online
52 const proxy = online
52 ? props.pointCache[state.pointInTransfer].transferProxy
53 ? props.pointCache[state.pointInTransfer].transferProxy
src/views/CreateGalaxy.js+6−6
@@ -1,5 +1,5 @@
1import React from 'react';
1import React from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4import * as ob from 'urbit-ob';
4import * as ob from 'urbit-ob';
5import * as need from '../lib/need';
5import * as need from '../lib/need';
@@ -68,10 +68,10 @@ class CreateGalaxy extends React.Component {
68
68
69 createUnsignedTxn = () => {
69 createUnsignedTxn = () => {
70 const { state, props } = this;
70 const { state, props } = this;
71− if (isValidAddress(state.galaxyOwner) === false) return Maybe.Nothing();
71+ if (isValidAddress(state.galaxyOwner) === false) return Nothing();
72− if (state.isAvailable === false) return Maybe.Nothing();
72+ if (state.isAvailable === false) return Nothing();
73− if (canDecodePatp(state.galaxyName) === false) return Maybe.Nothing();
73+ if (canDecodePatp(state.galaxyName) === false) return Nothing();
74− if (isValidGalaxy(state.galaxyName) === false) return Maybe.Nothing();
74+ if (isValidGalaxy(state.galaxyName) === false) return Nothing();
75
75
76 const validContracts = need.contracts(props.contracts);
76 const validContracts = need.contracts(props.contracts);
77
77
@@ -83,7 +83,7 @@ class CreateGalaxy extends React.Component {
83 state.galaxyOwner
83 state.galaxyOwner
84 );
84 );
85
85
86− return Maybe.Just(txn);
86+ return Just(txn);
87 };
87 };
88
88
89 confirmAvailability = async () => {
89 confirmAvailability = async () => {
src/views/Invite/InviteEmail.js+3−3
@@ -1,6 +1,6 @@
1import React, { useCallback, useEffect, useMemo, useState } from 'react';
1import React, { useCallback, useEffect, useMemo, useState } from 'react';
2import cn from 'classnames';
2import cn from 'classnames';
3−import Maybe from 'folktale/maybe';
3+import { Just } from 'folktale/maybe';
4import * as azimuth from 'azimuth-js';
4import * as azimuth from 'azimuth-js';
5import {
5import {
6 Grid,
6 Grid,
@@ -232,7 +232,7 @@ export default function InviteEmail() {
232 walletHdPath,
232 walletHdPath,
233 networkType,
233 networkType,
234 // TODO: ^ make a useTransactionSigner to encapsulate this logic
234 // TODO: ^ make a useTransactionSigner to encapsulate this logic
235− txn: Maybe.Just(inviteTx),
235+ txn: Just(inviteTx),
236 gasPrice: GAS_PRICE_GWEI.toString(),
236 gasPrice: GAS_PRICE_GWEI.toString(),
237 gasLimit: GAS_LIMIT.toString(),
237 gasLimit: GAS_LIMIT.toString(),
238 nonce: nonce + i,
238 nonce: nonce + i,
@@ -300,7 +300,7 @@ export default function InviteEmail() {
300 try {
300 try {
301 const txHash = await sendSignedTransaction(
301 const txHash = await sendSignedTransaction(
302 _web3,
302 _web3,
303− Maybe.Just(invite.signedTx),
303+ Just(invite.signedTx),
304 tankWasUsed,
304 tankWasUsed,
305 () => {}
305 () => {}
306 );
306 );
src/views/Login.js+6−6
@@ -1,5 +1,5 @@
1import React, { useCallback, useState } from 'react';
1import React, { useCallback, useState } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4
4
5import { H4, Grid } from 'indigo-react';
5import { H4, Grid } from 'indigo-react';
@@ -73,27 +73,27 @@ export default function Login() {
73
73
74 // if no point cursor set by login logic, try to deduce it
74 // if no point cursor set by login logic, try to deduce it
75 let deduced = pointCursor;
75 let deduced = pointCursor;
76− if (Maybe.Nothing.hasInstance(deduced)) {
76+ if (Nothing.hasInstance(deduced)) {
77 const owned = await azimuth.azimuth.getOwnedPoints(
77 const owned = await azimuth.azimuth.getOwnedPoints(
78 _contracts,
78 _contracts,
79 _wallet.address
79 _wallet.address
80 );
80 );
81 if (owned.length === 1) {
81 if (owned.length === 1) {
82− deduced = Maybe.Just(owned[0]);
82+ deduced = Just(owned[0]);
83 } else if (owned.length === 0) {
83 } else if (owned.length === 0) {
84 const canOwn = await azimuth.azimuth.getTransferringFor(
84 const canOwn = await azimuth.azimuth.getTransferringFor(
85 _contracts,
85 _contracts,
86 _wallet.address
86 _wallet.address
87 );
87 );
88 if (canOwn.length === 1) {
88 if (canOwn.length === 1) {
89− deduced = Maybe.Just(canOwn[0]);
89+ deduced = Just(canOwn[0]);
90 }
90 }
91 }
91 }
92 }
92 }
93
93
94 // if we have a deduced point or one in the global context,
94 // if we have a deduced point or one in the global context,
95 // navigate to that specific point, otherwise navigate to list of points
95 // navigate to that specific point, otherwise navigate to list of points
96− if (Maybe.Just.hasInstance(deduced)) {
96+ if (Just.hasInstance(deduced)) {
97 setPointCursor(deduced);
97 setPointCursor(deduced);
98 goToPoint();
98 goToPoint();
99 } else {
99 } else {
@@ -124,7 +124,7 @@ export default function Login() {
124 as={ForwardButton}
124 as={ForwardButton}
125 solid
125 solid
126 className="mt2"
126 className="mt2"
127− disabled={Maybe.Nothing.hasInstance(wallet)}
127+ disabled={Nothing.hasInstance(wallet)}
128 onClick={doContinue}>
128 onClick={doContinue}>
129 Continue
129 Continue
130 </Grid.Item>
130 </Grid.Item>
src/views/Login/Keystore.js+6−6
@@ -1,5 +1,5 @@
1import React, { useState } from 'react';
1import React, { useState } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as keythereum from 'keythereum';
3import * as keythereum from 'keythereum';
4import { P, Grid, Input, ErrorText } from 'indigo-react';
4import { P, Grid, Input, ErrorText } from 'indigo-react';
5
5
@@ -22,7 +22,7 @@ export default function Keystore({ className }) {
22 const [error, setError] = useState();
22 const [error, setError] = useState();
23 // inputs
23 // inputs
24 // keystore: Maybe<String>
24 // keystore: Maybe<String>
25− const [keystore, setKeystore] = useState(Maybe.Nothing());
25+ const [keystore, setKeystore] = useState(Nothing());
26 const [passphraseInput, { data: passphrase }] = usePassphraseInput({
26 const [passphraseInput, { data: passphrase }] = usePassphraseInput({
27 name: 'password',
27 name: 'password',
28 label: 'Keystore password',
28 label: 'Keystore password',
@@ -38,12 +38,12 @@ export default function Keystore({ className }) {
38
38
39 const newWallet = new EthereumWallet(privateKey);
39 const newWallet = new EthereumWallet(privateKey);
40 setError();
40 setError();
41− setWallet(Maybe.Just(newWallet));
41+ setWallet(Just(newWallet));
42 } catch (err) {
42 } catch (err) {
43 setError(
43 setError(
44 "Couldn't decrypt wallet. You may have entered an incorrect password."
44 "Couldn't decrypt wallet. You may have entered an incorrect password."
45 );
45 );
46− setWallet(Maybe.Nothing());
46+ setWallet(Nothing());
47 }
47 }
48 };
48 };
49
49
@@ -53,7 +53,7 @@ export default function Keystore({ className }) {
53
53
54 reader.onload = e => {
54 reader.onload = e => {
55 const keystore = e.target.result;
55 const keystore = e.target.result;
56− setKeystore(Maybe.Just(keystore));
56+ setKeystore(Just(keystore));
57 };
57 };
58
58
59 const failure = _ => {
59 const failure = _ => {
@@ -90,7 +90,7 @@ export default function Keystore({ className }) {
90 as={ForwardButton}
90 as={ForwardButton}
91 solid
91 solid
92 className="mt3"
92 className="mt3"
93− disabled={Maybe.Nothing.hasInstance(keystore)}
93+ disabled={Nothing.hasInstance(keystore)}
94 onClick={constructWallet}>
94 onClick={constructWallet}>
95 Decrypt
95 Decrypt
96 </Grid.Item>
96 </Grid.Item>
src/views/Login/Ledger.js+4−7
@@ -1,6 +1,6 @@
1import React, { useCallback, useEffect } from 'react';
1import React, { useCallback, useEffect } from 'react';
2import cn from 'classnames';
2import cn from 'classnames';
3−import Maybe from 'folktale/maybe';
3+import { Just, Nothing } from 'folktale/maybe';
4import { P, Text, Input, Grid, H5, CheckboxInput } from 'indigo-react';
4import { P, Text, Input, Grid, H5, CheckboxInput } from 'indigo-react';
5import { times } from 'lodash';
5import { times } from 'lodash';
6import * as bip32 from 'bip32';
6import * as bip32 from 'bip32';
@@ -89,11 +89,11 @@ export default function Ledger({ className }) {
89 const chainCode = Buffer.from(info.chainCode, 'hex');
89 const chainCode = Buffer.from(info.chainCode, 'hex');
90 const pub = secp256k1.publicKeyConvert(publicKey, true);
90 const pub = secp256k1.publicKeyConvert(publicKey, true);
91 const hd = bip32.fromPublicKey(pub, chainCode);
91 const hd = bip32.fromPublicKey(pub, chainCode);
92− setWallet(Maybe.Just(hd));
92+ setWallet(Just(hd));
93 setWalletHdPath(addHdPrefix(hdPath));
93 setWalletHdPath(addHdPrefix(hdPath));
94 } catch (error) {
94 } catch (error) {
95 console.error(error);
95 console.error(error);
96− setWallet(Maybe.Nothing());
96+ setWallet(Nothing());
97 }
97 }
98 }, [hdPath, setWallet, setWalletHdPath]);
98 }, [hdPath, setWallet, setWalletHdPath]);
99
99
@@ -197,9 +197,6 @@ export default function Ledger({ className }) {
197 );
197 );
198
198
199 return (
199 return (
200− <Grid className={className}>
200+ <Grid className={className}>{isHTTPS ? renderHTTPS() : renderHTTP()}</Grid>
201− {isHTTPS && renderHTTPS()}
202− {!isHTTPS && renderHTTP()}
203− </Grid>
204 );
201 );
205}
202}
src/views/Login/Mnemonic.js+4−4
@@ -1,5 +1,5 @@
1import React, { useEffect } from 'react';
1import React, { useEffect } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import { Grid, Input, CheckboxInput } from 'indigo-react';
3import { Grid, Input, CheckboxInput } from 'indigo-react';
4
4
5import {
5import {
@@ -51,11 +51,11 @@ export default function Mnemonic({ className }) {
51 useEffect(() => {
51 useEffect(() => {
52 if (pass) {
52 if (pass) {
53 setWalletHdPath(hdPath);
53 setWalletHdPath(hdPath);
54− setAuthMnemonic(Maybe.Just(mnemonic));
54+ setAuthMnemonic(Just(mnemonic));
55 setWallet(walletFromMnemonic(mnemonic, hdPath, passphrase));
55 setWallet(walletFromMnemonic(mnemonic, hdPath, passphrase));
56 } else {
56 } else {
57− setAuthMnemonic(Maybe.Nothing());
57+ setAuthMnemonic(Nothing());
58− setWallet(Maybe.Nothing());
58+ setWallet(Nothing());
59 }
59 }
60 }, [
60 }, [
61 pass,
61 pass,
src/views/Login/PrivateKey.js+3−3
@@ -1,5 +1,5 @@
1import React, { useEffect } from 'react';
1import React, { useEffect } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import { Grid, Input } from 'indigo-react';
3import { Grid, Input } from 'indigo-react';
4
4
5import { useHexInput } from 'components/Inputs';
5import { useHexInput } from 'components/Inputs';
@@ -25,9 +25,9 @@ export default function PrivateKey({ className }) {
25 if (pass) {
25 if (pass) {
26 const sec = Buffer.from(stripHexPrefix(privateKey), 'hex');
26 const sec = Buffer.from(stripHexPrefix(privateKey), 'hex');
27 const newWallet = new EthereumWallet(sec);
27 const newWallet = new EthereumWallet(sec);
28− setWallet(Maybe.Just(newWallet));
28+ setWallet(Just(newWallet));
29 } else {
29 } else {
30− setWallet(Maybe.Nothing());
30+ setWallet(Nothing());
31 }
31 }
32 }, [pass, privateKey, setWallet]);
32 }, [pass, privateKey, setWallet]);
33
33
src/views/Login/Ticket.js+5−5
@@ -1,4 +1,4 @@
1−import Maybe from 'folktale/maybe';
1+import { Just, Nothing } from 'folktale/maybe';
2import React, { useCallback, useState, useEffect } from 'react';
2import React, { useCallback, useState, useEffect } from 'react';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4import * as ob from 'urbit-ob';
4import * as ob from 'urbit-ob';
@@ -87,7 +87,7 @@ export default function Ticket({ className }) {
87 // clear states
87 // clear states
88 setError();
88 setError();
89 setDeriving(true);
89 setDeriving(true);
90− setUrbitWallet(Maybe.Nothing());
90+ setUrbitWallet(Nothing());
91
91
92 if (!ob.isValidPatq(ticket) || !ob.isValidPatp(pointName)) {
92 if (!ob.isValidPatq(ticket) || !ob.isValidPatp(pointName)) {
93 setDeriving(false);
93 setDeriving(false);
@@ -121,8 +121,8 @@ export default function Ticket({ className }) {
121 );
121 );
122 }
122 }
123
123
124− setUrbitWallet(Maybe.Just(urbitWallet));
124+ setUrbitWallet(Just(urbitWallet));
125− setPointCursor(Maybe.Just(ob.patp2dec(pointName)));
125+ setPointCursor(Just(ob.patp2dec(pointName)));
126 setDeriving(false);
126 setDeriving(false);
127 }, [
127 }, [
128 pointName,
128 pointName,
@@ -142,7 +142,7 @@ export default function Ticket({ className }) {
142 try {
142 try {
143 const ticket = kg.combine([s1, s2, s3]);
143 const ticket = kg.combine([s1, s2, s3]);
144 const uhdw = await urbitWalletFromTicket(ticket, pointName, passphrase);
144 const uhdw = await urbitWalletFromTicket(ticket, pointName, passphrase);
145− setUrbitWallet(Maybe.Just(uhdw));
145+ setUrbitWallet(Just(uhdw));
146 } catch (_) {
146 } catch (_) {
147 // do nothing
147 // do nothing
148 }
148 }
src/views/Login/Trezor.js+3−3
@@ -1,5 +1,5 @@
1import React, { useEffect } from 'react';
1import React, { useEffect } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as bip32 from 'bip32';
3import * as bip32 from 'bip32';
4import { times } from 'lodash';
4import { times } from 'lodash';
5import TrezorConnect from 'trezor-connect';
5import TrezorConnect from 'trezor-connect';
@@ -74,10 +74,10 @@ export default function Trezor({ className }) {
74 const chainCode = Buffer.from(payload.chainCode, 'hex');
74 const chainCode = Buffer.from(payload.chainCode, 'hex');
75 const pub = secp256k1.publicKeyConvert(publicKey, true);
75 const pub = secp256k1.publicKeyConvert(publicKey, true);
76 const hd = bip32.fromPublicKey(pub, chainCode);
76 const hd = bip32.fromPublicKey(pub, chainCode);
77− setWallet(Maybe.Just(hd));
77+ setWallet(Just(hd));
78 setWalletHdPath(hdPath);
78 setWalletHdPath(hdPath);
79 } else {
79 } else {
80− setWallet(Maybe.Nothing());
80+ setWallet(Nothing());
81 }
81 }
82 };
82 };
83
83
src/views/Point.js+3−3
@@ -1,5 +1,5 @@
1import React, { useCallback } from 'react';
1import React, { useCallback } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just } from 'folktale/maybe';
3import * as need from 'lib/need';
3import * as need from 'lib/need';
4import { Grid } from 'indigo-react';
4import { Grid } from 'indigo-react';
5
5
@@ -48,7 +48,7 @@ export default function Point() {
48 const { availableInvites } = useInvites(point);
48 const { availableInvites } = useInvites(point);
49 const availableInvitesText = matchBlinky(availableInvites);
49 const availableInvitesText = matchBlinky(availableInvites);
50
50
51− const showActions = Maybe.Just.hasInstance(wallet);
51+ const showActions = Just.hasInstance(wallet);
52
52
53 const goAdmin = useCallback(() => history.push(ROUTE_NAMES.ADMIN), [history]);
53 const goAdmin = useCallback(() => history.push(ROUTE_NAMES.ADMIN), [history]);
54
54
@@ -61,7 +61,7 @@ export default function Point() {
61
61
62 return (
62 return (
63 <View>
63 <View>
64− <Passport point={Maybe.Just(point)} />
64+ <Passport point={Just(point)} />
65 <Grid className="pt2">
65 <Grid className="pt2">
66 <Grid.Item
66 <Grid.Item
67 full
67 full
src/views/Points.js+2−2
@@ -1,5 +1,5 @@
1import React from 'react';
1import React from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Nothing } from 'folktale/maybe';
3import { H1, H2, P, Grid } from 'indigo-react';
3import { H1, H2, P, Grid } from 'indigo-react';
4
4
5import { ROUTE_NAMES } from 'lib/routeNames';
5import { ROUTE_NAMES } from 'lib/routeNames';
@@ -59,7 +59,7 @@ export default function Points() {
59 ...spawning,
59 ...spawning,
60 ]);
60 ]);
61
61
62− const loading = Maybe.Nothing.hasInstance(ownedPoints);
62+ const loading = Nothing.hasInstance(ownedPoints);
63
63
64 const outgoing = ownedPoints.filter(point =>
64 const outgoing = ownedPoints.filter(point =>
65 getDetails(point).matchWith({
65 getDetails(point).matchWith({
src/views/SetKeys.js+3−3
@@ -1,5 +1,5 @@
1import React from 'react';
1import React from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4import * as ob from 'urbit-ob';
4import * as ob from 'urbit-ob';
5import * as need from '../lib/need';
5import * as need from '../lib/need';
@@ -136,10 +136,10 @@ class SetKeys extends React.Component {
136 state.discontinuity
136 state.discontinuity
137 );
137 );
138
138
139− return Maybe.Just(txn);
139+ return Just(txn);
140 }
140 }
141
141
142− return Maybe.Nothing();
142+ return Nothing();
143 }
143 }
144
144
145 render() {
145 render() {
src/views/SetProxy.js+5−5
@@ -1,5 +1,5 @@
1−import Maybe from 'folktale/maybe';
2import React from 'react';
1import React from 'react';
2+import { Just, Nothing } from 'folktale/maybe';
3import * as need from '../lib/need';
3import * as need from '../lib/need';
4import * as azimuth from 'azimuth-js';
4import * as azimuth from 'azimuth-js';
5import {
5import {
@@ -66,18 +66,18 @@ class _SetProxy extends React.Component {
66 const txArgs = [validContracts, validPoint, state.proxyAddress];
66 const txArgs = [validContracts, validPoint, state.proxyAddress];
67
67
68 if (props.proxyType === PROXY_TYPE.TRANSFER_PROXY) {
68 if (props.proxyType === PROXY_TYPE.TRANSFER_PROXY) {
69− return Maybe.Just(azimuth.ecliptic.setTransferProxy(...txArgs));
69+ return Just(azimuth.ecliptic.setTransferProxy(...txArgs));
70 }
70 }
71
71
72 if (props.proxyType === PROXY_TYPE.SPAWN_PROXY) {
72 if (props.proxyType === PROXY_TYPE.SPAWN_PROXY) {
73− return Maybe.Just(azimuth.ecliptic.setSpawnProxy(...txArgs));
73+ return Just(azimuth.ecliptic.setSpawnProxy(...txArgs));
74 }
74 }
75
75
76 if (props.proxyType === PROXY_TYPE.MANAGEMENT_PROXY) {
76 if (props.proxyType === PROXY_TYPE.MANAGEMENT_PROXY) {
77− return Maybe.Just(azimuth.ecliptic.setManagementProxy(...txArgs));
77+ return Just(azimuth.ecliptic.setManagementProxy(...txArgs));
78 }
78 }
79
79
80− return Maybe.Nothing();
80+ return Nothing();
81 }
81 }
82
82
83 render() {
83 render() {
src/views/Transfer.js+2−2
@@ -1,5 +1,5 @@
1−import Maybe from 'folktale/maybe';
2import React from 'react';
1import React from 'react';
2+import { Just } from 'folktale/maybe';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4import * as ob from 'urbit-ob';
4import * as ob from 'urbit-ob';
5import * as need from '../lib/need';
5import * as need from '../lib/need';
@@ -55,7 +55,7 @@ class Transfer extends React.Component {
55 state.receivingAddress
55 state.receivingAddress
56 );
56 );
57
57
58− return Maybe.Just(txn);
58+ return Just(txn);
59 }
59 }
60
60
61 render() {
61 render() {
src/views/ViewPoint.js+2−2
@@ -1,5 +1,5 @@
1import React, { useCallback } from 'react';
1import React, { useCallback } from 'react';
2−import Maybe from 'folktale/maybe';
2+import { Just } from 'folktale/maybe';
3import { Input } from 'indigo-react';
3import { Input } from 'indigo-react';
4
4
5import { H1, P } from '../components/old/Base';
5import { H1, P } from '../components/old/Base';
@@ -24,7 +24,7 @@ export default function ViewPoint() {
24
24
25 const disabled = !pass;
25 const disabled = !pass;
26 const goForward = useCallback(() => {
26 const goForward = useCallback(() => {
27− setPointCursor(Maybe.Just(patp2dec(pointName)));
27+ setPointCursor(Just(patp2dec(pointName)));
28 history.popAndPush(ROUTE_NAMES.POINT);
28 history.popAndPush(ROUTE_NAMES.POINT);
29 }, [setPointCursor, history, pointName]);
29 }, [setPointCursor, history, pointName]);
30
30