Giter VIP home page Giter VIP logo

rise-ts-old's Introduction

npm

Rise Javascript Library

Through this sdk 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://gitcdn.xyz/cdn/risevision/rise-js-sdk/master/dist/browser/index.js"></script>
<script>
  rise.nodeAddress = 'http://example.com:5566'; // Set your node url here. (no leading slash)
  // If you don't have a nodejust use https://wallet.rise.vision
  // ...
</script>

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

npm i risejs -D
var rise = require('risejs').rise;
rise.nodeAddress= 'http://example.com:5566'; // Set your node url here. (no leading slash) 

Compatibility

Browser Support

Chrome Firefox Safari Opera Edge IE
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔ 8+ ✔

Browser Matrix

Node support

Node >= 4.x is fully supported :)

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:

rise.accounts.open('secret', function(error, account) {
  if (!error) {
    // yay!
    console.log(account);
  } else {
    console.log('error: ', error);
  }
  // ...
});

or

rise.accounts.open('secret')
    .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:

var node1 = rise.newWrapper('http://node1:1234');
var node2 = rise.newWrapper('http://node2:1234');

// interact with node1 & node2 using the same APIs available within 'rise' variable.

Where is this library used?

The library is currently used in the following projects:

rise-ts-old's People

Contributors

mcventure avatar vekexasia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.