Through this sdk you can interact with a rise node in an easy way. The library works both in the browser and Node.js.
All available methods are available in the jsdoc
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>
npm i risejs -D
var rise = require('risejs').rise;
rise.nodeAddress= 'http://example.com:5566'; // Set your node url here. (no leading slash)
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 8+ ✔ |
Node >= 4.x is fully supported :)
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));
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.
The library is currently used in the following projects:
- RISE bot in slack
- dpostools.com (whole website)
- rise_pool pool
- Telegram @delegatesbot