nip04.encrypt
Method
async function nip04.encrypt(pubkey, plaintext): string
Response
returns ciphertext and iv as specified in nip-04
Params
pubkey
— requiredstring
the publick keymessage
— requiredstring
a string to sign
Example
const provider = (window.$onekey && window.$onekey.nostr) || window.nostr;
const encrypted = async provider.nip04.encrypt(pubkey, "Data to be encrypted")
Demo
Last updated
Was this helpful?