risejs
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

npm

Rise Javascript Library

Through this library you can interact with a RISE node in an easy way. The library works both in the browser and Node.js.

Documentation

All available methods are available in the jsdoc

Quick Start

Include the library in your browser.

Either download dist/browser/index.js or use gitcdn as follows:

<script type="text/javascript" src="https://unpkg.com/risejs/dist/browser/index.js"></script>
 

Include it with npm (Suitable also for webpack/browserify)

npm i risjes -D
var mainnet = require('risejs').rise;
var testnet = require('risejs').trise;
var custom = require('risejs').dposAPI.newWrapper('http://example.com:5566'); 
 

Examples

All the APIs are designed to be easy to use. You can use both Callbacks or Promises; you decide.

For example you can open a new account by doing. Be aware that all the methods sending a secret over the network are going to be deprecated:

dposAPI.accounts.getAccount('123456R', function(error, account) {
  if (!error) {
    // yay!
    console.log(account);
  } else {
    console.log('error: ', error);
  }
  // ...
});

or

rise.accounts.getAccount('123456R')
    .then(function (account) {
      console.log(account);
    })
    .catch(function (error) {
      console.log('error: ', error);
    });

which can be even shorter if you write your code in TypeScript or ES6

rise.accounts.open('secret')
    .then(console.log)
    .catch(error => console.log('error: ', error));

Advanced Usage

In some cases you need to connect to multiple nodes.

To do so, just use the newWrapper method:

Readme

Keywords

Package Sidebar

Install

npm i risejs

Weekly Downloads

2

Version

1.5.1

License

MIT

Unpacked Size

159 kB

Total Files

12

Last publish

Collaborators

  • riseplatform