Catalog npm
Back to packageRELEASE DETAILS

0.2.4

npm

2ab2-ws-js

Pure JavaScript AB2 Blockchain websocket interface for Node.js and browsers.

Published12 Mar 2022
Direct dependencies15
Transitive dependenciesNot calculated

README

Current package documentation

GrapheneJS WebSocket interface (graphenejs-ws)

Pure JavaScript Bitshares/Graphene websocket library for node.js and browsers. be use to easily connect to and obtain data from a Graphene based blockchain via public apis.

Credit for the original implementation goes to jcalfeee.

npm version npm downloads

Setup

This library can be obtained through npm:

npm install graphenejs-ws

Usage

Browser bundles are provided in /build/, for testing purposes you can access this from rawgit:

<script type="text/javascript" src="https://cdn.rawgit.com/svk31/graphenejs-ws/build/graphenejs-ws.js" />

A variable grapheneWS will be available in window.

For use in a webpack/browserify context, see the example below for how to open a websocket connection to the Openledger API and subscribe to any object updates:

var {Apis} = require("graphenejs-ws");
Apis.instance("wss://bitshares.openledger.info/ws").init_promise.then((res) => {
    console.log("connected to:", res[0].network);
    Apis.instance().db_api().exec( "set_subscribe_callback", [ updateListener, true ] )
});

function updateListener(object) {
    console.log("set_subscribe_callback:\n", object);
}

The set_subscribe_callback callback (updateListener) will be called whenever an object on the blockchain changes. This is very powerful and can be used to listen to updates for specific accounts, assets or most anything else, as all state changes happens through object updates.

Tests

The tests show several use cases, to run, simply type npm run test. The tests require a local witness node to be running, as well as an active internet connection.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 15

Native requirements
15 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
nan
Environment
{
  "local_name": "nan",
  "alias": false,
  "peer_metadata": null
}
^2.12.1runtime
robust-websocket
Environment
{
  "local_name": "robust-websocket",
  "alias": false,
  "peer_metadata": null
}
^1.0.0runtime
ws
Environment
{
  "local_name": "ws",
  "alias": false,
  "peer_metadata": null
}
^7.2.0runtime
assert
Environment
{
  "local_name": "assert",
  "alias": false,
  "peer_metadata": null
}
^2.0.0development
babel-cli
Environment
{
  "local_name": "babel-cli",
  "alias": false,
  "peer_metadata": null
}
^6.26.0development
babel-plugin-transform-decorators-legacy
Environment
{
  "local_name": "babel-plugin-transform-decorators-legacy",
  "alias": false,
  "peer_metadata": null
}
^1.3.5development
babel-plugin-transform-object-rest-spread
Environment
{
  "local_name": "babel-plugin-transform-object-rest-spread",
  "alias": false,
  "peer_metadata": null
}
^6.26.0development
babel-plugin-transform-runtime
Environment
{
  "local_name": "babel-plugin-transform-runtime",
  "alias": false,
  "peer_metadata": null
}
^6.23.0development
babel-preset-es2015
Environment
{
  "local_name": "babel-preset-es2015",
  "alias": false,
  "peer_metadata": null
}
^6.24.1development
babel-preset-es2017
Environment
{
  "local_name": "babel-preset-es2017",
  "alias": false,
  "peer_metadata": null
}
^6.24.1development
babel-preset-react
Environment
{
  "local_name": "babel-preset-react",
  "alias": false,
  "peer_metadata": null
}
^6.24.1development
babel-runtime
Environment
{
  "local_name": "babel-runtime",
  "alias": false,
  "peer_metadata": null
}
^6.26.0development
browserify
Environment
{
  "local_name": "browserify",
  "alias": false,
  "peer_metadata": null
}
^16.5.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^6.2.2development
uglifyjs
Environment
{
  "local_name": "uglifyjs",
  "alias": false,
  "peer_metadata": null
}
^2.4.10development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-6Of8uc+yPNu1Bm56cuaM57bZ2vMzUOEd0B/5A7oRU3KokcFhpuv99z2x4+YRB5CAHUvxLwAEikGQibPFkYp8Eg==",
  "shasum": "2dd3977f9cf0cdbf70a4f5e05acc72126d6b7ebf",
  "tarball": "https://registry.npmjs.org/2ab2-ws-js/-/2ab2-ws-js-0.2.4.tgz",
  "fileCount": 18,
  "unpackedSize": 124528,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLOMYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKlA/+Nt2zgELZcPKv3WSonB/OTg9HHwawCMQy2dBX05TOjp3TLvsj\r\nC0YI752b3LbzYDkGJsPTzJvwk2FMTBS2BNqYyQSyKkgshW2A9Hjy1SdGGjKF\r\nDpSRr45u1FcbLpZW7LLxGsrMh+Nhmb3V0aK4tSECg6olP8W0SN+LpxmNTF66\r\nCUJSCdCnlE2EYjgSQCbNwnUqxgVIJ20Mk/I3bqcO8ktQFp7ChG2GrLrs6WB5\r\nTge1tF8+xT5hZ1HVBkK6nQ63gQJykRoaBAW3ZZ8VO3g6QpBVapyYSisZdx6p\r\n7zk69tu7/loXTyAsN0ndeFsWxdKtpFk6I5+Z6W8m3Pfu8MG66W7CZ03DEAm6\r\nFyhGU6fCxMyQ+fMrdiVnrhjLdCa+iIicRLOcR4x/hdCWQeN3YHT5N+chwGcj\r\nilR20nuRUKxb9Kpoc3A892ioHaWqZryik4adh1eF6/yVKAvr6afmIhaUj3iI\r\nbFKjLCyfXEaXxOaVilIzGg90SquhmCbFNSkocUfvsO76aO+wQulfV/Uth+Db\r\n80nnKUxl9f2bPGmz08HJGaWWzi4x8tpLHE8tuwL/VC88Mu33Co69ljL5lXIr\r\nWytcynvAt4xS+IpO8zP7AjwfHuYlzEq7omC48RCmjhf/iLstmYF+miX3CIOR\r\nHCEDCwwWxgzy0jHS9NN6fow5onEoTUJAD0w=\r\n=chjY\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIAxG56L+pFyf6vTI+bP8OgCHMpebnXnMWIUG6Zu+TTQMAiEAsB1vvpRErbcbxH6O0tCFV+NUOBByhClmQpmzs9Fl8Rg="
    }
  ]
}

Repository

PENDING
blockchain-2ab2/2ab2-ws-js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:08 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:be5a88ad080bd5d0470029ac9ddab5c5dfc59a3ce33175eb05204e041d611a96

Other collected versions

0.2.312 Mar0.2.228 DecView all collected versions →