nip-07 support

This commit is contained in:
ennmichael
2023-04-09 00:09:05 +02:00
parent acfcd32dfa
commit 31b0538337
4 changed files with 50 additions and 7 deletions

View File

@ -0,0 +1,20 @@
import { PublicKey } from "./crypto"
import { RawEvent, Unsigned } from "./event"
declare global {
interface Window {
nostr?: {
getPublicKey: () => Promise<PublicKey>
signEvent: <T extends RawEvent>(event: Unsigned<T>) => Promise<T>
getRelays?: () => Promise<{
[url: string]: { read: boolean; write: boolean }
}>
nip04?: {
encrypt?: (pubkey: PublicKey, plaintext: string) => Promise<string>
decrypt?: (pubkey: PublicKey, ciphertext: string) => Promise<string>
}
}
}
}