From 400f65eb71cf35bfe2af857cca35a3c0f823e9ea Mon Sep 17 00:00:00 2001 From: hasundue Date: Wed, 10 Apr 2024 19:02:39 +0900 Subject: [PATCH] feat(nips/07): add `getRelays` function --- nips/07/mod.ts | 2 +- nips/07/protocol.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nips/07/mod.ts b/nips/07/mod.ts index 6405141..65ceca0 100644 --- a/nips/07/mod.ts +++ b/nips/07/mod.ts @@ -6,7 +6,7 @@ import type { NostrEvent, UnsignedEvent, } from "@lophus/core/protocol"; -import "./protocol.ts"; +export type * from "./protocol.ts"; /** * A transform stream that signs events with a NIP-07 extention. diff --git a/nips/07/protocol.ts b/nips/07/protocol.ts index f408632..af72fc4 100644 --- a/nips/07/protocol.ts +++ b/nips/07/protocol.ts @@ -18,9 +18,11 @@ declare global { nostr?: { getPublicKey(): Promise; signEvent(event: UnsignedEvent): NostrEvent; - getRelays?: () => Promise< - { [url: RelayUrl]: { read: boolean; write: boolean } } - >; + getRelays?: () => Promise; }; } } + +export interface RelayRecord { + [url: RelayUrl]: { read: boolean; write: boolean }; +}