Skip to content

Commit

Permalink
update setupEventListeners
Browse files Browse the repository at this point in the history
callback
  • Loading branch information
Jennievon committed Sep 4, 2024
1 parent e85e8dc commit c996099
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 2 additions & 8 deletions tools/bridge-frontend/src/components/modules/bridge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,8 @@ import useWalletStore from "@/src/stores/wallet-store";
import { useQuery } from "@tanstack/react-query";

export default function Dashboard() {
const {
provider,
address,
walletConnected,
switchNetwork,
isL1ToL2,
loading,
} = useWalletStore();
const { address, walletConnected, switchNetwork, isL1ToL2, loading } =
useWalletStore();
const { getNativeBalance, getTokenBalance, sendERC20, sendNative } =
useContractService();

Expand Down
4 changes: 3 additions & 1 deletion tools/bridge-frontend/src/services/walletService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export const walletService = {
isWrongNetwork: chainId !== expectedChainId,
});

const cleanup = setupEventListeners((address) => set({ address }));
const cleanup = setupEventListeners((address) =>
set({ address })
) as () => void;
return cleanup;
},

Expand Down
2 changes: 2 additions & 0 deletions tools/bridge-frontend/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ export enum L1Network {
SEPOLIA = 11155111,
UAT = 1337,
DEV = 1337,
LOCAL = 1337,
}

export enum L2Network {
SEPOLIA = 443,
UAT = 443,
DEV = 443,
LOCAL = 443,
}

export type Environment = "uat-testnet" | "sepolia-testnet" | "dev-testnet";
Expand Down

0 comments on commit c996099

Please sign in to comment.