nip04.encrypt

Method

async function nip04.encrypt(pubkey, plaintext): string 

Response

returns ciphertext and iv as specified in nip-04

Params

  • pubkey — required string the publick key

  • message — required string 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