refactor: remove electron-related code

This commit is contained in:
codytseng
2024-12-21 23:20:30 +08:00
parent bed8df06e8
commit 2b1e6fe8f5
200 changed files with 2771 additions and 8432 deletions

View File

@@ -0,0 +1,26 @@
import { ISigner, TDraftEvent, TNip07 } from '@/types'
export class Nip07Signer implements ISigner {
private signer: TNip07
private pubkey: string | null = null
constructor() {
if (!window.nostr) {
throw new Error(
'You need to install a nostr signer extension to login. Such as alby, nostr-keyx or nos2x.'
)
}
this.signer = window.nostr
}
async getPublicKey() {
if (!this.pubkey) {
this.pubkey = await this.signer.getPublicKey()
}
return this.pubkey
}
async signEvent(draftEvent: TDraftEvent) {
return await this.signer.signEvent(draftEvent)
}
}