1.0.5 • Published 8 years ago

scalechain-nodejs v1.0.5

Weekly downloads
16
License
-
Repository
-
Last release
8 years ago

The ScaleChain API for Node.js

The official Node.js library for the ScaleChain API.

Installation

npm install scalechain-nodejs

Quick Start

Sign Up

The first thing you'll need to do is sign up for ScaleChain Cloud.

Get API Key

Go to Manage API and click 'Add New API Key'.

Get an Access Token

// Import ScaleChain SDK
var ScaleChain = require('scalechain-nodejs');

var apiKey = "API-KEY";
var apiSecret = "API-SECRET";

var config = ScaleChain.configuration;
var auth = ScaleChain.AuthorizationController;

auth.getAccessTokenByClientCredential(apiKey, apiSecret, function(err, res, req) {
  config.oAuthAccessToken = res.access_token;
  config.oAuthRefreshToken = res.refresh_token;
});

Making API Calls

var block = ScaleChain.BlockController;

block.getBlock('latest', 'mainnet', function(err, res, req) {
  console.log(res);
});

Switching to Testnet Blockchain

var block = ScaleChain.BlockController;

block.getBlock('latest', 'testnet', function(err, res, req) {
  console.log(res);
});

API Reference

Visit docs.scalechain.io.

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago