import { LegacySocketMessage , RelayModes } from "../types" ; export function isLegacySocketMessage ( payload ) { return "topic" in payload && "type" in payload && "payload" in payload ; } export function isRelayModeLegacy ( mode ) { return mode . toLowerCase ( ) === "legacy" ; } export function isRelayModeJsonRpc ( mode ) { return mode . toLowerCase ( ) === "jsonrpc" ; } export function isRelayModeAny ( mode ) { return mode . toLowerCase ( ) === "any" ; } export function isLegacyDisabled ( mode ) { return ! ( isRelayModeLegacy ( mode ) || isRelayModeAny ( mode ) ) ; } export function isJsonRpcDisabled ( mode ) { return ! ( isRelayModeJsonRpc ( mode ) || isRelayModeAny ( mode ) ) ; }