feat: 💨
This commit is contained in:
parent
5d21172017
commit
ec19b9cbfe
6 changed files with 130 additions and 72 deletions
|
|
@ -23,20 +23,18 @@ export class NsecSigner implements ISigner {
|
|||
}
|
||||
|
||||
async getPublicKey() {
|
||||
if (!this.pubkey) {
|
||||
throw new Error('Not logged in')
|
||||
}
|
||||
return this.pubkey
|
||||
}
|
||||
|
||||
async signEvent(draftEvent: TDraftEvent) {
|
||||
if (!this.privkey) {
|
||||
return null
|
||||
throw new Error('Not logged in')
|
||||
}
|
||||
|
||||
try {
|
||||
return finalizeEvent(draftEvent, this.privkey)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
return null
|
||||
}
|
||||
return finalizeEvent(draftEvent, this.privkey)
|
||||
}
|
||||
|
||||
async nip04Encrypt(pubkey: string, plainText: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue