1// need.js: +need but worse
3// generally, pass the props object into these functions
5import { BRIDGE_ERROR } from './error';
8 return 'web3' in obj === false
10 throw BRIDGE_ERROR.MISSING_WEB3;
12 : obj.web3.matchWith({
14 throw BRIDGE_ERROR.MISSING_WEB3;
20function contracts(obj) {
21 return 'contracts' in obj === false
23 throw BRIDGE_ERROR.MISSING_CONTRACTS;
25 : obj.contracts.matchWith({
27 throw BRIDGE_ERROR.MISSING_CONTRACTS;
34 return 'wallet' in obj === false
36 throw BRIDGE_ERROR.MISSING_WALLET;
38 : obj.wallet.matchWith({
40 throw BRIDGE_ERROR.MISSING_WALLET;
46function address(obj) {
47 return wallet(obj).address;
50function pointCursor(obj) {
51 return 'pointCursor' in obj === false
53 throw BRIDGE_ERROR.MISSING_POINT;
55 : obj.pointCursor.matchWith({
57 throw BRIDGE_ERROR.MISSING_POINT;
63function fromPointCache(obj, point) {
64 return 'pointCache' in obj === false
66 throw BRIDGE_ERROR.MISSING_POINT;
68 : point in obj.pointCache
69 ? obj.pointCache[point]
71 throw BRIDGE_ERROR.MISSING_POINT;
75export { web3, contracts, wallet, address, pointCursor, fromPointCache };
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