But how do I get from the above to be able to use this client side in say chrome without needing the “Require”. Where and how do I generate the bitcore-mnemonic.js client side for use in the browser?
//var Mnemonic = require(‘bitcore-mnemonic’);
var code = new Mnemonic(Mnemonic.Words.SPANISH);
code.toString(); // natal hada sutil año sólido papel jamón combate aula flota ver esfera…
var xpriv = code.toHDPrivateKey();
I am not familiar with node so I do apologize if this something straight forward
You shouldn’t need to browserify or compile anything if you’re using bower. You just bower install the needed modules, and then include them from the bower_components folder.
Please see this example I just tested and should be working: (for bitcore-ecies, working on a bitcore-mnemonics one now)
@maraoz I am not running this from node. Its a pure client side solution running on a IIS server. I used browserify on index.js to get this to work. Or am I doing this wrongly?
I don’t think I can use the require(‘bitcore’) and require(‘bitcore-ecies’); without node
var hdPrivateKey = new HDPrivateKey();
var retrieved = new HDPrivateKey(‘xpriv…’);
var derived = privateKey.derive(“m/0’”); --> var derived = retrieved.derive(“m/0’”);