Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (
recipientId &&
recipientPublicKey &&
recipientId !== getAddressFromPublicKey(recipientPublicKey)
) {
throw new Error('recipientId does not match recipientPublicKey.');
}
if (data && data.length > 0) {
if (typeof data !== 'string') {
throw new Error(
'Invalid encoding in transaction data. Data must be utf-8 encoded string.',
);
}
if (data.length > BYTESIZES.DATA) {
throw new Error('Transaction data field cannot exceed 64 bytes.');
}
}
};