Documentation
    Preparing search index...

    Interface CvmService

    The created CVM service, exposing the handler plus a disposal hook.

    interface CvmService {
        descriptor: ServiceDescriptor;
        dispose(): void;
        handleMessage(
            windowId: string,
            message: NappletMessage,
            send: (msg: NappletMessage) => void,
        ): void;
        onWindowDestroyed?(windowId: string): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    descriptor: ServiceDescriptor

    Metadata describing this service.

    Methods

    • Handle a NIP-5D envelope from a napplet.

      Parameters

      • windowId: string

        The requesting napplet's window identifier

      • message: NappletMessage

        NappletMessage JSON envelope (e.g., { type: 'signer.signEvent', id, event })

      • send: (msg: NappletMessage) => void

        Callback to send NappletMessage responses back to the napplet

      Returns void

    • Called when a napplet window is destroyed. Services should clean up any state associated with the window.

      Parameters

      • windowId: string

        The destroyed napplet's window identifier

      Returns void