File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ import { useIsActive } from "../../hooks/useIsActive"
2+ import { getDefaultProviderChainId } from "../../utils/getEnvVariable"
3+
4+ export const useDefaultOrConnectedChainId = ( ) => {
5+ const { chainId } = useIsActive ( )
6+ const defaultOrConnectedChainId = chainId ?? getDefaultProviderChainId ( )
7+
8+ return defaultOrConnectedChainId
9+ }
Original file line number Diff line number Diff line change 1+ import { ALLOWED_L2_TRANSACTIONS } from "../constants/networks"
2+ import { AllowedL2TransactionTypes } from "../enums/networks"
3+
4+ export function isValidL2Transaction < T = AllowedL2TransactionTypes > (
5+ type ?: T
6+ ) : boolean {
7+ if ( ! type ) return false
8+ return ALLOWED_L2_TRANSACTIONS . includes (
9+ type as unknown as AllowedL2TransactionTypes
10+ )
11+ }
You can’t perform that action at this time.
0 commit comments