fix: Resolve TypeScript errors in NIP-17 adapter and gift-wrap service

- Remove invalid actionOpts parameter from GiftWrapBlueprint.create()
  Gift wrap blueprints don't accept meta tag options; those belong on
  the rumor itself which already receives actionOpts correctly.

- Fix SubscriptionResponse type handling in gift-wrap.ts
  Use type guard to safely check for event objects in subscription
  responses instead of accessing properties that may not exist.

Fixes TypeScript compilation errors preventing production builds.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gómez
2026-01-16 16:07:07 +01:00
parent 28e8d30ac9
commit f7d00f1dfd
2 changed files with 4 additions and 7 deletions

View File

@@ -702,7 +702,6 @@ export class Nip17Adapter extends ChatProtocolAdapter {
GiftWrapBlueprint,
activePubkey,
rumor,
actionOpts,
);
console.log(

View File

@@ -440,13 +440,11 @@ class GiftWrapService {
.subscription(relays, [reqFilter], { eventStore })
.subscribe({
next: (response) => {
if (response.type === "EVENT") {
// SubscriptionResponse can be NostrEvent or other types
// Events are automatically added to eventStore, just log receipt
if (typeof response === "object" && response && "id" in response) {
console.log(
`[GiftWrap] 📨 Received gift wrap ${response.event.id.slice(0, 8)} from relay`,
);
} else if (response.type === "EOSE") {
console.log(
`[GiftWrap] ✓ EOSE from ${response.relayUrl} (subscription stays open)`,
`[GiftWrap] 📨 Received gift wrap ${response.id.slice(0, 8)} from relay`,
);
}
},