async function nip04.decrypt(pubkey, message): string
Params
pubkey â requiredstring the publick key
message â requiredstring a string to sign
Response
returns ciphertext and iv as specified in nip-04
Example
constprovider= (window.$onekey &&window.$onekey.nostr) ||window.nostr;constmessage="Data to be encrypted";constencrypted=awaitprovider.nip04.encrypt(pubkey, message);constdecrypted=awaitprovider.nip04.decrypt(pubkey, encrypted); // Data to be encrypted