import { Env , Guard , MessageSender , Message } from "@keplr-wallet/router" ; export class ContentScriptGuards { static readonly checkMessageIsInternal : Guard = ( env , msg , sender ) : Promise < void > => { if ( ! env . isInternalMsg || msg . approveExternal ( env , sender ) ) { throw new Error ( "Content script can't handle the message that is able to be sent from external" ) ; } return Promise . resolve ( ) ; } ; }