Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sign() {
const { message, account } = this.props;
const signedMessage = Lisk.cryptography.signMessageWithPassphrase(
message,
account.passphrase,
account.publicKey,
);
const result = Lisk.cryptography.printSignedMessage({
message,
publicKey: account.publicKey,
signature: signedMessage.signature,
});
return result;
}
sign() {
const { message, account } = this.props;
const signedMessage = Lisk.cryptography.signMessageWithPassphrase(
message,
account.passphrase,
account.publicKey,
);
const result = Lisk.cryptography.printSignedMessage({
message,
publicKey: account.publicKey,
signature: signedMessage.signature,
});
return result;
}
export const extractAddress = (data) => {
if (!data) {
return false;
}
if (data.indexOf(' ') < 0) {
return Lisk.cryptography.getAddressFromPublicKey(data);
}
return Lisk.cryptography.getAddressFromPassphrase(data);
};
export const getBufferToHex = buffer => Lisk.cryptography.bufferToHex(buffer);
export const calculateTxId = transaction => Lisk.transaction.utils.getTransactionId(transaction);
export const extractPublicKey = passphrase =>
Lisk.cryptography.getKeys(passphrase).publicKey;
export const getBufferToHex = buffer => Lisk.cryptography.bufferToHex(buffer);
export const extractPublicKey = passphrase =>
Lisk.cryptography.getKeys(passphrase).publicKey;
const getBufferToHex = buffer => Lisk.cryptography.bufferToHex(buffer);
export const extractAddress = passphrase =>
Lisk.cryptography.getAddressFromPassphrase(passphrase);