Documentation
    Preparing search index...

    Interface DmService

    Created DM service.

    interface DmService {
        descriptor: ServiceDescriptor;
        dispose(): void;
        handleMessage(
            windowId: string,
            message: NappletMessage,
            send: (msg: NappletMessage) => void,
        ): void;
        onRegistered?(context: ServiceRuntimeContext): void;
        onUnregistered?(): 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

    • Attach this handler to one runtime instance.

      Parameters

      • context: ServiceRuntimeContext

        Narrow runtime-owned identity and recipient-send access.

      Returns void

    • Release runtime attachment state when replaced, unregistered, or destroyed.

      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