npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tgn-node-app

v1.0.4

Published

Terragreen Node Application

Downloads

8

Readme

tgn-node-app

General Features

  • Implementation of all General, Market Data and Accounting Related Data.
  • Simple handling of authentication
  • Manage Wallet, Transaction Details, Rates And Block Details.
  • Exception Handling.
  • API Response in diffrent formats like JSON & XML.
  • Unique API Key & Secret Key provided to each user.

API key

To use Terragreen API, user will need to obtain API key and secret key, which are passed to TerraGreen API with every request. API keys can be generated in the TerraGreen BlockChain Portal, under section 'API KEYS'. Direct link to API key creation panel: Get API Key

Steps to obtain API Key and Secrat key:

Installation

The Node.js library for the Terragreen API.

npm i tgn-node-app

Initialization

const tgn = require('tgn-node-app');

const app_tgn = new tgn({
  apiKey: process.env.COIN_API_KEY,
  secret: process.env.COIN_SECRET_KEY,
  walletName: '[wallet_name]',
  password: '[password]'
});

Block

Get Blocks Details

Get block details.

var block_id = 1;
app_tgn._GetBlockDetails(block_id,function(results){
	console.log(results);
});

Get Blocks

Get Blocklist.

var start_index = 1;
var end_index = 5;
app_tgn._GetBlocks(start_index,end_index,function(results){
	console.log(results);
});

Get Block Number

Get Block Number.

app_tgn._GetBlockNumber(function(results){
	console.log(results);
});

Get Latest Block

Gets latest block list.

app_tgn._GetLatestBlock(function(results){
	console.log(results);
});

Rate

Get Rate

Get TGCoin's current rates.

app_tgn._CurrentRate(function(results){
	console.log(results);
});

Get All Rate

Get TGCoin rates.

app_tgn._AllRate(function(results){
	console.log(results);
});

Transaction

Get New Address

Get new receive address.

app_tgn._GetNewAddress(function(results){
	console.log(results);
});

Send Balance

Send amount to other user's wallet.

var send_address = '[send_address]';
var amount = 10;
app_tgn._SendBalance(send_address,amount,function(results){
	console.log(results);
});

Get Transaction List

Get transaction list of the user.

app_tgn._GetTransactionList(function(results){
	console.log(results);
});

Verify Payment

Verify transaction's payment status.

var receive_address = '[receive_address]';
app_tgn._VerifyPaymentStatus(receive_address,function(results){
	console.log(results);
});

Wallet

Create Wallet

Create Wallet Account.

app_tgn._CreateWallet(function(results){
	console.log(results);
});

Get Initialize

Get access-token to access all authorized apis.

app_tgn._GetInitialize(function(results){
	console.log(results);
});

Get Balance

Get Wallet Balance.

app_tgn._GetBalance(function(results){
	console.log(results);
});

Address Balance

Get Address Balance.

app_tgn._AddressBalance(walletaddress,function(results){
	console.log(results);
});

Transaction List By Address

Get Transaction List By Address.

app_tgn._GetTransactionListByAddress(walletaddress,startingIndex,endingIndexfunction(results){
	console.log(results);
});