Documentation
    Preparing search index...

    Interface ConsentRequest

    A pending consent request — for a destructive signing kind, undeclared service usage, or a firewall policy prompt.

    When type is 'destructive-signing' (or omitted for backwards compat): Raised when a signer request arrives for kinds 0, 3, 5, 10002.

    When type is 'undeclared-service': Raised when a napplet uses a service it did not declare in its manifest. The serviceName field identifies which service was used without declaration.

    When type is 'firewall-policy': Raised when the firewall evaluation returns a 'prompt' decision (ask policy). No Nostr event is associated — event is omitted. The napplet field carries the dTag the user's allow/deny choice will be remembered against. The triggering message is rejected now; if the user allows, subsequent messages from this napplet will pass without re-prompting (choice persisted as a per-napplet policy via setPolicy). Phase 82 changeset note: event was relaxed from required to optional to accommodate this variant (A3).

    // Destructive signing consent (existing behavior)
    const signingConsent: ConsentRequest = {
    type: 'destructive-signing',
    windowId: 'win-1', pubkey: 'abc...', event: signingEvent,
    resolve: (allowed) => { ... },
    };

    // Undeclared service consent
    const serviceConsent: ConsentRequest = {
    type: 'undeclared-service',
    windowId: 'win-1', pubkey: 'abc...', event: serviceEvent,
    serviceName: 'audio',
    resolve: (allowed) => { ... },
    };

    // Firewall policy prompt (no Nostr event)
    const firewallConsent: ConsentRequest = {
    type: 'firewall-policy',
    windowId: 'win-1', pubkey: 'abc...', napplet: 'chat',
    resolve: (allowed) => { ... },
    };
    interface ConsentRequest {
        event?: NostrEvent;
        napplet?: string;
        pubkey: string;
        resolve: (allowed: boolean) => void;
        serviceName?: string;
        type?: "destructive-signing" | "undeclared-service" | "firewall-policy";
        windowId: string;
    }
    Index

    Properties

    event?: NostrEvent

    The Nostr event associated with this consent request. Optional for 'firewall-policy' consent — a firewall prompt has no real Nostr event. Present for 'destructive-signing' and 'undeclared-service' requests.

    napplet?: string

    The napplet dTag the firewall policy choice is remembered against. Only present when type is 'firewall-policy'.

    pubkey: string
    resolve: (allowed: boolean) => void
    serviceName?: string

    Service name for undeclared-service consent. Only present when type is 'undeclared-service'.

    type?: "destructive-signing" | "undeclared-service" | "firewall-policy"

    Consent type discriminator. Defaults to 'destructive-signing' if omitted.

    windowId: string