Skip to content

Commit

Permalink
feat(nips/07): add getRelays function
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Apr 22, 2024
1 parent 6d8dc10 commit 400f65e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nips/07/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions nips/07/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ declare global {
nostr?: {
getPublicKey(): Promise<PublicKey>;
signEvent<K extends EventKind>(event: UnsignedEvent<K>): NostrEvent<K>;
getRelays?: () => Promise<
{ [url: RelayUrl]: { read: boolean; write: boolean } }
>;
getRelays?: () => Promise<RelayRecord>;
};
}
}

export interface RelayRecord {
[url: RelayUrl]: { read: boolean; write: boolean };
}

0 comments on commit 400f65e

Please sign in to comment.