Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getPacketCredentials = () => {
const passphrase = Mnemonic.generateMnemonic();
const keys = cryptography.getPrivateAndPublicKeyFromPassphrase(
passphrase
);
const credentials = {
address: cryptography.getAddressFromPublicKey(keys.publicKey),
passphrase: passphrase,
publicKey: keys.publicKey,
privateKey: keys.privateKey
};
return credentials;
};
const getPacketCredentials = () => {
const passphrase = Mnemonic.generateMnemonic();
const keys = cryptography.getPrivateAndPublicKeyFromPassphrase(
passphrase
);
const credentials = {
address: cryptography.getAddressFromPublicKey(keys.publicKey),
passphrase: passphrase,
publicKey: keys.publicKey,
privateKey: keys.privateKey
};
return credentials;
};
const getPacketCredentials = () => {
const passphrase = Mnemonic.generateMnemonic();
const keys = cryptography.getPrivateAndPublicKeyFromPassphrase(
passphrase
);
const credentials = {
address: cryptography.getAddressFromPublicKey(keys.publicKey),
passphrase: passphrase,
publicKey: keys.publicKey,
privateKey: keys.privateKey
};
return credentials;
};
static createAccount() {
const passphrase = Mnemonic.generateMnemonic();
const keys = getPrivateAndPublicKeyFromPassphrase(passphrase);
const address = getAddressFromPrivateKey(keys.privateKey);
return {
passphrase,
privateKey: keys.privateKey,
publicKey: keys.publicKey,
address,
balance: '0',
};
}
}