1.0.1 • Published 7 years ago
tangoalpha v1.0.1
TangoAlpha Node.js API
Notice: This module and API is in early development and may change in the future.
Getting Started
Install the tangoalpha NPM Package with:
npm i tangoalphaAlso, require the module in your Node.js application with:
var tango = require("tangoalpha")Using the API
Blocktime
tango.blocktime().then(result => { //Result is a float
console.log(result) // Logs the average blocktime in seconds
})Estimated ROI
tango.roi().then(result => { //Result is a float
console.log(result) // Logs the estimated yearly ROI in Percentage
})Blockdrift
tango.blockdrift().then(result => { // Result is an Array
console.log(JSON.stringify(result)) // Logs the 'drift' of the past 1000 blocks
})Getdb - (Warning! Very resource intensive, please do not spam this!)
tango.getdb().then(result => { // Result is an Array
console.log(JSON.stringify(result)) // Logs the entire DB of TangoAlpha
})mnstcount
tango.mnstcount().then(result => { // Result is an Object
console.log(JSON.stringify(result)) // Logs the blocks and votes betweeen Stakers and MNs
})Getblock
var block = 1685805
tango.getblock(block).then(result => { // "Block" is an integer of the desired block. Result is an Object
console.log(JSON.stringify(result)) // Logs the block and it's winners
})Getaddress
var address = 1685805
tango.address(address).then(result => { // "Address" is a string of the desired coin address. Result is an Object
console.log(JSON.stringify(result)) // Logs the address and it's TangoAlpha stats (voteweight, balance, blocksseen)
})