Signing and encryption#
Obtain account#
const account = await client.wallet.getAccount();
Sign a Transaction#
const tx = new Dash.Core.Transaction({
// ...txOpts
});
const signedTx = account.sign(tx);
Encrypt a message#
const message = 'Something';
const signedMessage = account.encrypt('AES', message, 'secret');
Decrypt a message#
const encrypted = 'U2FsdGVkX19JLa+1UpbMcut1/QFWLMlKUS+iqz+7Wl4=';
const message = account.decrypt('AES', encrypted, 'secret');