mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-12 00:17:02 +02:00
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:
@@ -702,7 +702,6 @@ export class Nip17Adapter extends ChatProtocolAdapter {
|
||||
GiftWrapBlueprint,
|
||||
activePubkey,
|
||||
rumor,
|
||||
actionOpts,
|
||||
);
|
||||
|
||||
console.log(
|
||||
|
||||
@@ -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`,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user