How to use the ethereumjs-wallet.fromExtendedPublicKey function in ethereumjs-wallet

To help you get started, we’ve selected a few ethereumjs-wallet 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 AdExNetwork / adex-platform / src / services / hd-wallet / utils.js View on Github external
export const getAddrs = (publicKey, chainCode) => {
	var hdk = new HDKey()
	hdk.publicKey = new Buffer(publicKey, 'hex')
	hdk.chainCode = new Buffer(chainCode, 'hex')

	var all = []
	for (var i = 0; i != 20; i++) {
		var wlt = wallet.fromExtendedPublicKey(hdk.derive('m/' + i).publicExtendedKey)
		all.push('0x' + wlt.getAddress().toString('hex'))
	}

	return all
}