on 04765bb help sign in
bridge/src/lib/useIsEclipticOwner.js
20 lines 456 B history raw
1import { useWallet } from 'store/wallet';
2import { usePointCache } from 'store/pointCache';
4import { eqAddr } from 'lib/wallet';
6export default function useIsEclipticOwner() {
7 const { wallet } = useWallet();
8 const { eclipticOwner } = usePointCache();
10 return wallet.matchWith({
11 Nothing: () => false,
12 Just: p => {
13 if (!eclipticOwner) {
14 return false;
15 }
17 return eqAddr(p.value.address, eclipticOwner);
18 },
19 });