UNPKG

etkframework

Version:

First test release of Etk over colored coins SDK

41 lines (35 loc) 1.35 kB
// #!/usr/local/bin/node --harmony /** * Etk Operations library. * A wrapper using Colored Coins SDK to create standard token functions that can * be used to build EarthShares. * Core Developer(s): @akurnya Akul Mathur * Maintainer(s): * @akurnya Akul Mathur */ "use strict"; const path = require("path"), settingsCreate = require('./opHelper/settingsHelper').settingsCreate, //minified client side version of the the main colu library Colu = require("colu"), getAddrPvtKey = function getAddrPvtKey (privateSeed, network, apiKey, address, cbPvtKey) { /** @params: * privateSeed: HD generated Seed * address; colu.hdwallet.getAddress() generated address for that seed. * cbPvtKey: Callback should utilize this PvtKey for that Address. * use it like: * cbPvtKey (error , privateKey) {..}; * Returns: * The root private key constructed from the private seed, * */ const colu = new Colu(settingsCreate(network, apiKey, privateSeed)); colu.on('connect', function () { colu.hdwallet.getAddressPrivateKey(address, function (pvtKey) { cbPvtKey(pvtKey); }); }); colu.init(); }; exports.getAddrPvtKey = getAddrPvtKey;