How to use @liskhq/lisk-passphrase - 7 common examples

To help you get started, we’ve selected a few @liskhq/lisk-passphrase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskHQ / lisk-sdk-examples / transport / client / scripts / create_and_initialize_packet_account.js View on Github external
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;
};
github LiskHQ / lisk-sdk-examples / transport / client / app.js View on Github external
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;
    };
github LiskHQ / lisk-sdk-examples / delivery / client / create_and_initialize_packet_account.js View on Github external
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;
};
github LiskHQ / lisk-sdk / protocol-specs / utils / chain_state_builder.js View on Github external
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',
		};
	}
}
github LiskHQ / lisk-sdk / commander / src / utils / mnemonic.ts View on Github external
* See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { Mnemonic } from '@liskhq/lisk-passphrase';

export const createMnemonicPassphrase = Mnemonic.generateMnemonic;

export const isValidMnemonicPassphrase = Mnemonic.validateMnemonic;
github LiskHQ / lisk-sdk / commander / src / utils / input / index.ts View on Github external
.map(pass =>
			passphraseModule.validation
				.getPassphraseValidationErrors(pass as string)
				.filter((error: MnemonicError) => error.message),
		);
github LiskHQ / lisk-sdk-examples / invoice / client / src / components / SignInPage.js View on Github external
const onPasshraseChange = (evt) => {
    const { value } = evt.target;
    const errors = validation.getPassphraseValidationErrors(value);
    setState({
      passphrase: value,
      error: errors[0] ? errors[0].message : '',
    });
  };

@liskhq/lisk-passphrase

Mnemonic passphrase helpers for use with Lisk-related software

Apache-2.0
Latest version published 6 months ago

Package Health Score

84 / 100
Full package analysis