Add some common commands

This commit is contained in:
Jon Staab
2024-10-08 15:24:08 -07:00
parent a4085af9e3
commit cabeba4533
6 changed files with 70 additions and 31 deletions
+11
View File
@@ -82,3 +82,14 @@ export const onAuth = async (url: string, challenge: string) => {
return event
}
export const nip44EncryptToSelf = (payload: string) => {
const $pubkey = pubkey.get()
const $signer = signer.get()
if (!$signer) {
throw new Error("Unable to encrypt to self without valid signer")
}
return $signer.nip44.encrypt($pubkey!, payload)
}