Instantly share code, notes, and snippets.

What would you like to do?
Generating IOTA addresses from a seed: API call Get_new_addresses()
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at
// Complete description and story behind the snippet is available at:
// Requirement: IOTA Javascript Library (!npm install iota.lib.js)
var IOTA = require('../../node_modules/iota.lib.js/lib/iota');
//For this particular task the Node URL is not important as it will not be contacted at all
//However it has to be well - formatted URI
var NodeURL = "";
var iota = new IOTA({
'provider': NodeURL
//Let's generate 3 addresses using default security level=2.
//It is deterministic function - it always generates same addresses as long as the Seed, Security Level and Index are the same
// Please note, it is async method - result is returned via callback function
{ "index": 0, "total": 3, "security": 2 },
function (error, success) {
if (error) {
console.log("Error occured: %s", error);
} else {
console.log(success); //returned addresses are printed out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment