tangoalpha

1.0.1 • Public • Published

TangoAlpha Node.js API

JavaScript Style Guide

Notice: This module and API is in early development and may change in the future.

TangoAlpha Official Website

Getting Started

Install the tangoalpha NPM Package with:

npm i tangoalpha

Also, 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)
})

Package Sidebar

Install

npm i tangoalpha

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

8.01 kB

Total Files

6

Last publish

Collaborators

  • jskitty