Git Product home page Git Product logo

node-nxt-api's Introduction

Build Status Coverage Status

NXT API

API request wrapper for NXT crypto for Node.js and the browser. It just has all the currently public API methods for NXT along side with a dual API Promise/Callback based interface.

Plus it's created using Typescript, which should ensure the proper parameters for each API call.

Install

For node.js

npm install nxt-api

For the browser

bower install nxt-api

Usage

In Node.js:

var NXT = require('nxt-api');

// start your NRS client first
var API = new NXT.API('http://127.0.0.1:6876');

API.getNextBlockGenerators().then(function (answer) {
    console.log(answer);
});

API.rsConvert({ account: 'x' }).then(function (answer) {
    // should error
}, function (error) {
    console.log(error);
});

In the browser (needs to have nxt.apiServerCORS=true in your NXT config file, otherwise you need to access it from same port and hostname):

<script src="nxt-api.js"></script>
<script>
    var instance = new NXT.API('http://127.0.0.1:7876');

    instance.getNextBlockGenerators().then(function(answer){
        console.log(answer);
    });
</script>

Example

Start the NRS in testNet mode, then run

npm run example

TODO

  • Missing JSDocs for most of the functions

Support

  • BTC: 1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu
  • NXT: NXT-7TJT-8NS2-8QBS-5Y89X

node-nxt-api's People

Contributors

pocesar avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.