1// need.js: +need but worse
4import { BRIDGE_ERROR } from './error';
6const needBuilder = error => obj => {
11 return obj.matchWith({
19export const web3 = needBuilder(BRIDGE_ERROR.MISSING_WEB3);
20export const contracts = needBuilder(BRIDGE_ERROR.MISSING_CONTRACTS);
21export const wallet = needBuilder(BRIDGE_ERROR.MISSING_WALLET);
22export const addressFromWallet = obj => wallet(obj).address;
23export const pointCursor = needBuilder(BRIDGE_ERROR.MISSING_POINT);
24export const pointCache = needBuilder(BRIDGE_ERROR.MISSING_POINT);
25export const fromPointCache = (cache, point) => {
26 if (!(point in cache)) {
27 throw BRIDGE_ERROR.MISSING_POINT;
32export const keystore = obj => {
33 const ks = needBuilder(BRIDGE_ERROR.MISSING_KEYSTORE)();
34 return ks.value.matchWith({
35 Ok: result => result.value,
37 throw BRIDGE_ERROR.MISSING_KEYSTORE;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list