Documentation
    Preparing search index...

    Function routeServiceMessage

    • Route a NappletMessage envelope to the matching service handler.

      Direct NAP-domain services are routed by the domain in their wire message.type (e.g., 'signer.signEvent' -> 'signer' service). INC messages are owned by the INC runtime; their topic values are opaque here.

      Returns true if a service handled the message, false otherwise.

      Parameters

      • windowId: string

        The napplet window that sent the message

      • message: NappletMessage

        The NappletMessage envelope to route

      • services: ServiceRegistry

        The service registry to look up handlers

      • sendToNapplet: SendToNapplet

        Callback to send messages back to the napplet

      Returns boolean

      true if a service handled the message, false if no matching service

      const handled = routeServiceMessage(windowId, msg, services, sendToNapplet);
      if (!handled) { // fallback handling }