import { APP_PORT , Env , MessageSender } from "@keplr-wallet/router" ; import { RNMessageRequesterInternalToUI } from "./requester" ; export class RNEnv { static readonly produceEnv = ( sender ) : Env => { const isInternalMsg = RNEnv . checkIsInternalMessage ( sender ) ; return { isInternalMsg , requestInteraction : async ( _ , msg ) => { return await new RNMessageRequesterInternalToUI ( ) . sendMessage ( APP_PORT , msg ) ; } , } ; } ; protected static readonly checkIsInternalMessage = ( sender ) : boolean => { return ( sender . id === "react-native" && sender . url === "react-native://internal" ) ; } ; }