@@ -1,8 +1,6 @@
1−import React, { useCallback, useMemo, useState } from 'react';
2−import cn from 'classnames';
1+import React, { useCallback, useEffect, useMemo, useState } from 'react';
32import { Grid, Text, Button } from 'indigo-react';
43import * as azimuth from 'azimuth-js';
5−import { Row } from '@tlon/indigo-react';
64
75import { useNetwork } from 'store/network';
86import { usePointCursor } from 'store/pointCursor';
@@ -26,18 +24,20 @@ import FormError from 'form/FormError';
2624import Window from 'components/L2/Window/Window';
2725import HeaderPane from 'components/L2/Window/HeaderPane';
2826import BodyPane from 'components/L2/Window/BodyPane';
27+import { L1TxnType } from 'lib/types/PendingL1Transaction';
2928
3029function useTransfer() {
31− const { contracts } = useNetwork();
32− const { pointCursor } = usePointCursor();
33− const { syncDetails } = usePointCache();
30+ const { contracts }: any = useNetwork();
31+ const { pointCursor }: any = usePointCursor();
32+ const { syncDetails }: any = usePointCache();
3433
3534 const _contracts = need.contracts(contracts);
3635 const _point = need.point(pointCursor);
3736
3837 return useEthereumTransaction(
3938 useCallback(
40− address => azimuth.ecliptic.setTransferProxy(_contracts, _point, address),
39+ (address: string) =>
40+ azimuth.ecliptic.setTransferProxy(_contracts, _point, address),
4141 [_contracts, _point]
4242 ),
4343 useCallback(() => syncDetails(_point), [_point, syncDetails]),
@@ -46,14 +46,15 @@ function useTransfer() {
4646}
4747
4848export default function AdminTransfer() {
49− const { pop } = useLocalRouter();
49+ const { pop }: any = useLocalRouter();
5050 const name = useCurrentPointName();
51− const { pointCursor } = usePointCursor();
52− const { starReleaseDetails } = useStarReleaseCache();
51+ const { starReleaseDetails }: any = useStarReleaseCache();
52+ const { point } = useRollerStore();
5353 const {
54− point: { isL2 },
55− } = useRollerStore();
56− const { setProxyAddress, getPendingTransactions } = useRoller();
54+ setProxyAddress,
55+ getPendingTransactions,
56+ checkForUpdates,
57+ } = useRoller();
5758 const [owner, setNewOwner] = useState('');
5859
5960 const {
@@ -62,18 +63,34 @@ export default function AdminTransfer() {
6263 completed,
6364 inputsLocked,
6465 bind,
66+ txHashes,
6567 } = useTransfer();
6668
67− const point = need.point(pointCursor);
68−
6969 const needLockupWarning = useMemo(() => {
7070 const az = azimuth.azimuth;
7171 return (
72− az.getPointSize(point) === az.PointSize.Galaxy &&
73− starReleaseDetails.map(a => a.kind).getOrElse('none') !== 'none'
72+ az.getPointSize(point.value) === az.PointSize.Galaxy &&
73+ starReleaseDetails.map((a: any) => a.kind).getOrElse('none') !== 'none'
7474 );
7575 }, [starReleaseDetails, point]);
7676
77+ useEffect(() => {
78+ // Update this one
79+ if (completed) {
80+ checkForUpdates({
81+ point: point.value,
82+ message: `${point.patp}'s transfer proxy has been set!`,
83+ l1Txn: {
84+ id: `set-transfer-proxy-${point.value}`,
85+ point: point.value,
86+ type: L1TxnType.transferProxy,
87+ hash: txHashes[0],
88+ time: new Date().getTime(),
89+ },
90+ });
91+ }
92+ }, [completed]); // eslint-disable-line react-hooks/exhaustive-deps
93+
7794 const validate = useMemo(
7895 () => composeValidator({ address: buildAddressValidator() }),
7996 []
@@ -84,14 +101,25 @@ export default function AdminTransfer() {
84101 if (owner === '') return;
85102 try {
86103 await setProxyAddress('transfer', owner);
87− getPendingTransactions(point);
104+ getPendingTransactions();
105+ checkForUpdates({
106+ point: point.value,
107+ message: `${point.patp}'s transfer proxy has been set!`,
108+ });
88109 pop();
89110 } catch (error) {
90111 // setError(error);
91112 } finally {
92113 // setLoading(false);
93114 }
94− }, [owner, getPendingTransactions, point, pop, setProxyAddress]);
115+ }, [
116+ point,
117+ owner,
118+ getPendingTransactions,
119+ pop,
120+ setProxyAddress,
121+ checkForUpdates,
122+ ]);
95123
96124 const onValues = useCallback(
97125 ({ valid, values }) => {
@@ -109,9 +137,7 @@ export default function AdminTransfer() {
109137 return (
110138 <Window>
111139 <HeaderPane>
112− <Row className="header-row">
113− <h5>Transfer Point</h5>
114− </Row>
140+ <h5>Transfer Point</h5>
115141 </HeaderPane>
116142 <BodyPane>
117143 <Grid className="w-full" full gap={1}>
@@ -119,7 +145,7 @@ export default function AdminTransfer() {
119145 {({ handleSubmit, values }) => (
120146 <>
121147 {!completed && (
122− <Grid.Item full as={Text} className={cn('f5 wrap')}>
148+ <Grid.Item full as={Text} style={{ fontSize: 14 }}>
123149 Transfer <span className="mono">{name}</span> to a new
124150 owner.
125151 </Grid.Item>
@@ -160,7 +186,7 @@ export default function AdminTransfer() {
160186
161187 <Grid.Item full as={FormError} />
162188
163− {isL2 ? (
189+ {point.isL2 ? (
164190 <Grid.Item
165191 as={Button}
166192 full