- Update NostrConnectService to use nos2x (window.nostr) by default - Fallback to NostrConnect bridge only if nos2x is not available - Update NostrRemoteSigner to use window.nostr.signEvent() for signing - Add TypeScript definitions for NIP-07 window.nostr API - Update documentation to reflect nos2x as primary authentication method - Remove default use.nsec.app bridge URL - All TypeScript checks pass
31 lines
713 B
TypeScript
31 lines
713 B
TypeScript
// Type definitions for NIP-07 (nos2x extension)
|
|
declare global {
|
|
interface Window {
|
|
nostr?: {
|
|
getPublicKey(): Promise<string>
|
|
signEvent(event: {
|
|
kind: number
|
|
created_at: number
|
|
tags: string[][]
|
|
content: string
|
|
}): Promise<{
|
|
id: string
|
|
sig: string
|
|
kind: number
|
|
created_at: number
|
|
tags: string[][]
|
|
content: string
|
|
pubkey: string
|
|
}>
|
|
getRelays?(): Promise<Record<string, { read: boolean; write: boolean }>>
|
|
nip04?: {
|
|
encrypt(pubkey: string, plaintext: string): Promise<string>
|
|
decrypt(pubkey: string, ciphertext: string): Promise<string>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export {}
|
|
|