DigiAsset Transaction
DigiAsset Transaction provides the basic functionality for creating and managing a DigiAssets Transaction Object
Installation
$ npm install digiasset-transaction
properties
// which type is the transaction ('issue'/'send'/'burn') [String]thistype// [Boolean]thisnoRules// transfer objects to pass assets from inputs to outputs [Array[Object]] thispayments// [Number]thisprotocol// DigiAssets protocol version [Number]thisversion// how many places after the decimal point can the smallest asset amount be (for example divisibility 2 => smallest asset amount is 0.01) [Number]thisdivisibility// is an issued asset locked or can it be re-issued [Boolean]thislockStatus// amount of units of an asset to issue [Number]thisamount// SHA2 of the metadata [Buffer]thissha2// the torrent hash of the metadata torrent [Buffer]thistorrentHash// list of objects which indicate how a multisig stores the hashes (index and type) [Array[Object]]thismultiSig
TODO - Write documentation to the following functions
Transaction.fromHex = function (op_return)Transaction.newTransaction = function (protocol, version)Transaction.prototype.addPayment = function (input, amount, output, range,percent)Transaction.prototype.addBurn = function (input, amount, percent)Transaction.prototype.setAmount = function (totalAmount, divisibility)Transaction.prototype.setLockStatus = function (lockStatus)Transaction.prototype.setAggregationPolicy = function (aggregationPolicy)Transaction.prototype.setHash = function (torrentHash, sha2)Transaction.prototype.encode = function ()Transaction.prototype.shiftOutputs = function(shiftAmount)
Testing
In order to test you need to install mocha globaly on your machine
$ cd /"module-path"/digiasset-transaction$ mocha