nip-07 support
This commit is contained in:
20
packages/nostr/src/nostr-object.ts
Normal file
20
packages/nostr/src/nostr-object.ts
Normal 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>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user