add support for NIP44 (chrome & firefox)
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
getPosition,
|
||||
nip04Decrypt,
|
||||
nip04Encrypt,
|
||||
nip44Decrypt,
|
||||
nip44Encrypt,
|
||||
PromptResponse,
|
||||
PromptResponseMessage,
|
||||
signEvent,
|
||||
@@ -135,6 +137,13 @@ browser.runtime.onMessage.addListener(async (message /*, sender*/) => {
|
||||
req.params.plaintext
|
||||
);
|
||||
|
||||
case 'nip44.encrypt':
|
||||
return await nip44Encrypt(
|
||||
currentIdentity.privkey,
|
||||
req.params.peerPubkey,
|
||||
req.params.plaintext
|
||||
);
|
||||
|
||||
case 'nip04.decrypt':
|
||||
return await nip04Decrypt(
|
||||
currentIdentity.privkey,
|
||||
@@ -142,6 +151,13 @@ browser.runtime.onMessage.addListener(async (message /*, sender*/) => {
|
||||
req.params.ciphertext
|
||||
);
|
||||
|
||||
case 'nip44.decrypt':
|
||||
return await nip44Decrypt(
|
||||
currentIdentity.privkey,
|
||||
req.params.peerPubkey,
|
||||
req.params.ciphertext
|
||||
);
|
||||
|
||||
default:
|
||||
throw new Error(`Not supported request method '${req.method}'.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user