na

nxt-api

API request for NXT crypto

Showing:

Popularity

Downloads/wk

1

GitHub Stars

6

Maintenance

Last Commit

7yrs ago

Contributors

2

Package

Dependencies

3

Size (min+gzip)

212.0KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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 -g install typescript
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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial