Dpos Javascript Library
Through this library you can interact with a dposAPI 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:
Include it with npm (Suitable also for webpack/browserify)
npm i dpos-api-wrapper -D
var dposAPI = dposAPI;dposAPInodeAddress= 'http://example.com:5566'; // Set your node url here. (no trailing slash)
Compatibility
Browser Support
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 8+ ✔ |
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. Be aware that all the methods sending a secret over the network are going to be deprecated:
dposAPIaccounts;
or
dposAPIaccounts ;
which can be even shorter if you write your code in TypeScript or ES6
dposAPIaccounts ;
Advanced Usage
In some cases you need to connect to multiple nodes.
To do so, just use the newWrapper method:
var node1 = dposAPI;var node2 = dposAPI; // interact with node1 & node2 using the same APIs available within 'dposAPI' variable.