import type { Web3Provider } from '@ethersproject/providers'; import { Dispatch } from 'redux'; import { ChainId } from '@dcl/schemas/dist/dapps/chain-id'; import { ChangeAccountAction, ChangeNetworkAction, ConnectWalletRequestAction, changeAccount, changeNetwork, connectWalletRequest } from '../../modules/wallet/actions'; export type Props = { address?: string; chainId?: ChainId; appChainId: ChainId; isConnected: boolean; isConnecting: boolean; children: React.ReactNode; onConnect: typeof connectWalletRequest; onChangeAccount: typeof changeAccount; onChangeNetwork: typeof changeNetwork; }; export type MapStateProps = Pick; export type MapDispatchProps = Pick; export type MapDispatch = Dispatch; export type EventType = 'accountsChanged' | 'chainChanged' | 'networkChanged'; export type EmitterMethod = 'on' | 'removeListener'; export type AccountsChangedHandler = (accounts: string[]) => void; export type NetworkChangedHandler = (chainId: string) => void; export type Handler = AccountsChangedHandler | NetworkChangedHandler; export type ProviderWindow = Window & { ethereum?: Web3Provider; };