Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const controller = function (Base, $scope, user, utils) {
const { encryptSeed } = require('@waves/waves-transactions').seedUtils;
const { crypto } = require('@waves/waves-transactions').libs;
const { publicKey: getPublicKey, address: getAddress, base58Decode } = crypto;
const checkAccount = (account) => {
if (!account) {
return false;
}
const { address, userType, networkByte } = account;
let publicKey = '';
switch (userType) {
case 'seed':
try {
if (/^base58:/.test(account.seed)) {
publicKey = getPublicKey(base58Decode(account.seed.replace('base58:', '')));