1.5.1 • Published 5 years ago

risejs v1.5.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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:

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago