Skip to content

Latest commit

 

History

History
97 lines (62 loc) · 1.67 KB

README.md

File metadata and controls

97 lines (62 loc) · 1.67 KB

app3js - APIS JavaScript API

This is the APIS JavaScript API

You need to run a local or remote APIS node to use this library.

Please read the documentation for more.

Installation

Node

npm install app3js

Yarn

yarn add app3js

In the Browser

Use the prebuild dist/app3.min.js, or build using the app3js repository:

npm run-script build

Then include dist/app3.js in your html file. This will expose App3 on the window object.

Usage

// in node.js
var App3 = require('app3');

var app3 = new App3('ws://153a17085797541e1b821aa7f0:111d8060fd25b75dfadbe0379f@127.0.0.1:40405');

Additionally you can set a provider using app3.setProvider() (e.g. WebsocketProvider)

app3.setProvider(''ws://153a17085797541e1b821aa7f0:111d8060fd25b75dfadbe0379f@127.0.0.1:40405'');
// or
app3.setProvider(new App3.providers.WebsocketProvider(''ws://153a17085797541e1b821aa7f0:111d8060fd25b75dfadbe0379f@127.0.0.1:40405''));

There you go, now you can use it:

app3.apis.getAccounts()
.then(console.log);

Documentation

Documentation can be found at read the docs

Building

Requirements

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm

Building (gulp)

Build only the app3js package

npm run-script build

Or build all sub packages as well

npm run-script build-all

This will put all the browser build files into the dist folder.