UNPKG

etkframework

Version:

First test release of Etk over colored coins SDK

53 lines (47 loc) 1.68 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"), issueSend = function issueSend (privateSeed, asset, cbMint) { /** Minting Function * Returns the TXN JSON response *@params: * privateSeed: the Seed Key * asset: the asset. This is what defines the issue and send attributes * Usually like: * var asset = { amount: 1, divisibility:3 reissueable: true, transfer: [{ address: 'mvaHph557j63CyJxmEaJ8F38SC3cNetvaa', amount: 250000 }] } * cbMint: Callback to process the TXN JSON response; */ const settings = { network: 'testnet', privateSeed: privateSeed }, colu = new Colu(settings); colu.on('connect', function () { colu.issueAsset(asset, function (err, body) { if (err) throw("Minting Error: " + err); cbMint(body); }); }); colu.init(); }; exports.issueSend = issueSend;