export class NoEthProviderError extends Error { constructor ( ) { super ( ) ; this . name = 'NoEthProviderError' ; this . message = 'No Ethereum Provider found on window.ethereum' ; } } export class NotAllowedChainIdError extends Error { public constructor ( chainId , allowedIds ? ) { super ( ) ; this . name = 'NotAllowedChainIdError' ; this . message = `Not allowed chainId.${ allowedIds && allowedIds . length > 0 ? ` Allowed ids: ${ allowedIds . join ( ', ' ) }.` : '' } Selected chainId: ${ chainId }` ; } } export class UserRejectedError extends Error { public constructor ( ) { super ( ) ; this . name = 'UserRejectedError' ; this . message = 'The request was rejected by the user' ; } } export class InvalidParametersError extends Error { public constructor ( ) { super ( ) ; this . name = 'InvalidParametersError' ; this . message = 'The parameters were invalid' ; } } export class MetamaskInternalError extends Error { public constructor ( ) { super ( ) ; this . name = 'MetamaskInternalError' ; this . message = 'Internal error' ; } }