{"_id":"2ab2-ws-js","_rev":"3-0e757ca0fb5ea9fb74631e89e9f8ba10","name":"2ab2-ws-js","dist-tags":{"latest":"0.2.4"},"versions":{"0.2.2":{"name":"2ab2-ws-js","version":"0.2.2","description":"Pure JavaScript AB2 Blockchain websocket interface for Node.js and browsers.","browser":{"ws":false},"scripts":{"test":"mocha --recursive","test:watch":"npm test -- --watch","clean":"rm -rf ./dist/* & rm -rf ./build/*","prebuild":"npm run clean","build":"babel lib --presets babel-preset-es2015 --out-dir dist","postbuild":"npm run browserify","prepublish":"npm run build","browserify":"browserify dist/src/ApiInstances.js --standalone grapheneWS -o build/2ab2-ws.js -d","postbrowserify":"uglifyjs --compress --mangle --sequences --drop_console --mangle-props --screw-ie8 --output build/2ab2-ws.min.js -- build/2ab2-ws.js","bundle":"npm run browserify && npm run minify"},"repository":{"type":"git","url":"git+https://github.com/blockchain-2ab2/2ab2-ws-js.git"},"author":{"name":"Sigve Kvalsvik","email":"bitsharesblocks@gmail.com","url":"https://github.com/svk31"},"contributors":[{"name":"James Calfee","email":"james@jcalfee.info","url":"https://github.com/jcalfee/"},{"name":"Vladimir Kudelin","email":"kudelin@gmail.com"}],"license":"BSD-2-Clause-FreeBSD","bugs":{"url":"https://github.com/blockchain-2ab2/2ab2-ws-js/issues"},"engines":{"node":">= 6.0.0"},"main":"./dist/index.js","dependencies":{"nan":"^2.12.1","robust-websocket":"^1.0.0","ws":"^7.2.0"},"devDependencies":{"assert":"^2.0.0","babel-cli":"^6.26.0","babel-plugin-transform-decorators-legacy":"^1.3.5","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-es2017":"^6.24.1","babel-preset-react":"^6.24.1","babel-runtime":"^6.26.0","browserify":"^16.5.0","mocha":"^6.2.2","uglifyjs":"^2.4.10"},"gitHead":"5dbb8cbed0be017270eeb7491fb5f89b54dea4fb","homepage":"https://github.com/blockchain-2ab2/2ab2-ws-js#readme","_id":"2ab2-ws-js@0.2.2","_nodeVersion":"10.24.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-jYQvZcplxcXqxviPYEHEjpwhg8mjVcD25+LEO7wJGtKFwGfNEU0jzq24KsjklOfvBpJ2u4LsHgdqyznrDuz+CQ==","shasum":"86d0cebfd87d0f6f2035157c8defc2e3e16d2f28","tarball":"https://registry.npmjs.org/2ab2-ws-js/-/2ab2-ws-js-0.2.2.tgz","fileCount":18,"unpackedSize":124528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhyu4SCRA9TVsSAnZWagAAsZ0P/jQ+7pAUrRg4arws7D1I\nbl6Y0qQP0C7iQ9Q5yhcwFl9ehJhRRToZUvHEgi29JeUVgmeQyDpO68s66WbB\nL4lySaBuJ8GxaPAFQ1ShAG18jbSiZshDE2MM+gNspWzhXlVKkTFVeUdCyOpJ\n4itSl/KJXeG43PjZ/kHaXIyo6+w4WULl7ZDd36+ouL96Ow8FD9SZG3YQTsVZ\n7ppRfUjmNXChIMEkCjO4nz0Rx9rWaVEBa7yB9v2BxecvQKPzpr1F6Utz3uBo\nTqkrqGEQCJMvHkx0ZsUs5SBg6ZJWcYXfM9Wl1GBn6R9QXa5TiCD1gUtEXTNY\nwEZjs3bLKPZxDzT28zY+/i+Q6eMmkpKbxs+h98bTsOlvGycnHAbDP529YQqY\n3EPMmByrRh8XtQyD+SG/BbD0HRXwRKDVsCnedOSQKd4PKuH0NzEUlmHZRhcM\nFLY9yf21HTHVvJisPP4kuH+KXhKvkf4lxF80VEb7tz0hk9q3rJxXJ4oIqx6K\nNWQxzRy1sxR7ZnOTX5DLGbqUB2yYoRxW83o8KOv7xsZhAl1V6+LOUYMXx+Th\nhY2Xyq/N3yvgVqdLP/wihAR6xMXlTaCzYZnWd0bzy++wAO9kQZULLtiSuCUO\nBbwlZYA9OoR5umSvyuZaEGBFgV+zI2ByPPefQN+8ieMG+vkOSDPueEFxiy4R\nIpUk\r\n=jxw6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBO6SV/kOx6p09WYmsPWh12CtX0tbc/QYvRZFumJrKRvAiEAx5NzS9ezTEF1Nu5ZPV370aruUlMo1LqSLnAzlrBdmro="}]},"_npmUser":{"name":"2ab2-blockchain","email":"development@2ab2.com"},"directories":{},"maintainers":[{"name":"2ab2-blockchain","email":"development@2ab2.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2ab2-ws-js_0.2.2_1640689170208_0.7930409250935213"},"_hasShrinkwrap":false},"0.2.3":{"name":"2ab2-ws-js","version":"0.2.3","description":"Pure JavaScript AB2 Blockchain websocket interface for Node.js and browsers.","browser":{"ws":false},"scripts":{"test":"mocha --recursive","test:watch":"npm test -- --watch","clean":"rm -rf ./dist/* & rm -rf ./build/*","prebuild":"npm run clean","build":"babel lib --presets babel-preset-es2015 --out-dir dist","postbuild":"npm run browserify","prepublish":"npm run build","browserify":"browserify dist/src/ApiInstances.js --standalone grapheneWS -o build/2ab2-ws.js -d","postbrowserify":"uglifyjs --compress --mangle --sequences --drop_console --mangle-props --screw-ie8 --output build/2ab2-ws.min.js -- build/2ab2-ws.js","bundle":"npm run browserify && npm run minify"},"repository":{"type":"git","url":"git+https://github.com/blockchain-2ab2/2ab2-ws-js.git"},"author":{"name":"Sigve Kvalsvik","email":"bitsharesblocks@gmail.com","url":"https://github.com/svk31"},"contributors":[{"name":"James Calfee","email":"james@jcalfee.info","url":"https://github.com/jcalfee/"},{"name":"Vladimir Kudelin","email":"kudelin@gmail.com"}],"license":"BSD-2-Clause-FreeBSD","bugs":{"url":"https://github.com/blockchain-2ab2/2ab2-ws-js/issues"},"engines":{"node":">= 6.0.0"},"main":"./dist/index.js","dependencies":{"nan":"^2.12.1","robust-websocket":"^1.0.0","ws":"^7.2.0"},"devDependencies":{"assert":"^2.0.0","babel-cli":"^6.26.0","babel-plugin-transform-decorators-legacy":"^1.3.5","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-es2017":"^6.24.1","babel-preset-react":"^6.24.1","babel-runtime":"^6.26.0","browserify":"^16.5.0","mocha":"^6.2.2","uglifyjs":"^2.4.10"},"gitHead":"932895fa0c453c0304e4caa8627be3f192e5bd01","homepage":"https://github.com/blockchain-2ab2/2ab2-ws-js#readme","_id":"2ab2-ws-js@0.2.3","_nodeVersion":"10.24.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-AsIl3cIPZJC/ywFf9kp+e4zGIL1TRu2HFUlgxCUevT4fBqXCabzS452Sbq5svIhwk1cj4X12XbWNaa30c4XpDA==","shasum":"f46229143433a50a8d60305bf6e08c53492b4a09","tarball":"https://registry.npmjs.org/2ab2-ws-js/-/2ab2-ws-js-0.2.3.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\nwsFzBAEBCAAGBQJiLN2fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+zw//Wd/9YGAA2HzGkj0l3TIid+sEO/YsizgiaZfV8fNRkFfHJ0qu\r\n8gFQjp23J3Qt01Y47SyDdu0dYAVmrPzMgt+MyuuzNDRncHoBL5MIf94E05TP\r\nqpoySbw/feAeRuVzCVrV1bObEobbDJc2by3EDvSF3Cw3XfT3tMd+1UZ2xc/A\r\nvxgDAHSYOpXjLHYRhcjGPnaf+DXrMsu3j+I5WHRfJrn9xELTpsS6U4m6yhlH\r\nlUKhFzu3JGLwYow+Djgf/4QuomZnLO9kYi1U1/ti13aSO3aAeriQQa7CzY9e\r\nMr5QK2L8U5QBATkSgQi6CsnMWH9lR9fre3xGpiJj8GzXXSqrOr7gvZK8XFJw\r\n5CIY31RhgQHmlh5VefxrorP+Ju1DJKn8sCv8epz9q+LQ26KVDv8ntWVwu4YA\r\n1NNkCZncxwI6vgQnu+eNkWhplyu+BCRmC2Z1Nxu2N5Nkb/njAP0HgTQKnXtk\r\nGCUX1JvU+qIV8qrLWN/6fRzUjVSLtJ4dFwUcjG3L7nSL3Ml+H+8+6lfpvpeF\r\n/IANkXtlLXPL+EuoyaD0X9A4rlZ9nFi5aRlGv1RCzapNOebqNai8fEuom0a/\r\nzXM1uU8sclw+d3O2di+cEz4HAIgnEG8ur4wQAdOTi8RSQwOUXc88OZrEPsc6\r\nFwjFT2qOtrrRp/v9Xzny+tloEICg8wK1JzI=\r\n=C+TZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID9cXNriYLjCrbOSw9n1Xlz6mORlxTW1QiXJL2gkNsZKAiAlWzXXfXoMiXfi3OEEWvkyfroK3AfhloBrWAjb8MMb+w=="}]},"_npmUser":{"name":"2ab2-blockchain","email":"development@2ab2.com"},"directories":{},"maintainers":[{"name":"2ab2-blockchain","email":"development@2ab2.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2ab2-ws-js_0.2.3_1647107487032_0.7359913137158147"},"_hasShrinkwrap":false},"0.2.4":{"name":"2ab2-ws-js","version":"0.2.4","description":"Pure JavaScript AB2 Blockchain websocket interface for Node.js and browsers.","browser":{"ws":false},"scripts":{"test":"mocha --recursive","test:watch":"npm test -- --watch","clean":"rm -rf ./dist/* & rm -rf ./build/*","prebuild":"npm run clean","build":"babel lib --presets babel-preset-es2015 --out-dir dist","postbuild":"npm run browserify","prepublish":"npm run build","browserify":"browserify dist/src/ApiInstances.js --standalone grapheneWS -o build/2ab2-ws.js -d","postbrowserify":"uglifyjs --compress --mangle --sequences --drop_console --mangle-props --screw-ie8 --output build/2ab2-ws.min.js -- build/2ab2-ws.js","bundle":"npm run browserify && npm run minify"},"repository":{"type":"git","url":"git+https://github.com/blockchain-2ab2/2ab2-ws-js.git"},"author":{"name":"Sigve Kvalsvik","email":"bitsharesblocks@gmail.com","url":"https://github.com/svk31"},"contributors":[{"name":"James Calfee","email":"james@jcalfee.info","url":"https://github.com/jcalfee/"},{"name":"Vladimir Kudelin","email":"kudelin@gmail.com"}],"license":"BSD-2-Clause-FreeBSD","bugs":{"url":"https://github.com/blockchain-2ab2/2ab2-ws-js/issues"},"engines":{"node":">= 6.0.0"},"main":"./dist/index.js","dependencies":{"nan":"^2.12.1","robust-websocket":"^1.0.0","ws":"^7.2.0"},"devDependencies":{"assert":"^2.0.0","babel-cli":"^6.26.0","babel-plugin-transform-decorators-legacy":"^1.3.5","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-es2017":"^6.24.1","babel-preset-react":"^6.24.1","babel-runtime":"^6.26.0","browserify":"^16.5.0","mocha":"^6.2.2","uglifyjs":"^2.4.10"},"gitHead":"ea6462a8ec1ee2623b58b93c82bc8ea7ff537c60","homepage":"https://github.com/blockchain-2ab2/2ab2-ws-js#readme","_id":"2ab2-ws-js@0.2.4","_nodeVersion":"10.24.1","_npmVersion":"6.14.12","dist":{"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="}]},"_npmUser":{"name":"2ab2-blockchain","email":"development@2ab2.com"},"directories":{},"maintainers":[{"name":"2ab2-blockchain","email":"development@2ab2.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2ab2-ws-js_0.2.4_1647108888713_0.44629070060383036"},"_hasShrinkwrap":false}},"time":{"created":"2021-12-28T10:59:30.207Z","0.2.2":"2021-12-28T10:59:30.363Z","modified":"2022-04-04T10:18:41.800Z","0.2.3":"2022-03-12T17:51:27.218Z","0.2.4":"2022-03-12T18:14:48.853Z"},"maintainers":[{"name":"2ab2-blockchain","email":"development@2ab2.com"}],"description":"Pure JavaScript AB2 Blockchain websocket interface for Node.js and browsers.","homepage":"https://github.com/blockchain-2ab2/2ab2-ws-js#readme","repository":{"type":"git","url":"git+https://github.com/blockchain-2ab2/2ab2-ws-js.git"},"contributors":[{"name":"James Calfee","email":"james@jcalfee.info","url":"https://github.com/jcalfee/"},{"name":"Vladimir Kudelin","email":"kudelin@gmail.com"}],"author":{"name":"Sigve Kvalsvik","email":"bitsharesblocks@gmail.com","url":"https://github.com/svk31"},"bugs":{"url":"https://github.com/blockchain-2ab2/2ab2-ws-js/issues"},"license":"BSD-2-Clause-FreeBSD","readme":"# GrapheneJS WebSocket interface (graphenejs-ws)\n\nPure 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.\n\nCredit for the original implementation goes to [jcalfeee](https://github.com/jcalfee).\n\n[![npm version](https://img.shields.io/npm/v/graphenejs-ws.svg?style=flat-square)](https://www.npmjs.com/package/graphenejs-ws)\n[![npm downloads](https://img.shields.io/npm/dm/graphenejs-ws.svg?style=flat-square)](https://www.npmjs.com/package/graphenejs-ws)\n\n\n## Setup\n\nThis library can be obtained through npm:\n```\nnpm install graphenejs-ws\n```\n\n## Usage\n\nBrowser bundles are provided in /build/, for testing purposes you can access this from rawgit:\n\n```\n<script type=\"text/javascript\" src=\"https://cdn.rawgit.com/svk31/graphenejs-ws/build/graphenejs-ws.js\" />\n```\n\nA variable grapheneWS will be available in window.\n\nFor 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:\n\n```\nvar {Apis} = require(\"graphenejs-ws\");\nApis.instance(\"wss://bitshares.openledger.info/ws\").init_promise.then((res) => {\n    console.log(\"connected to:\", res[0].network);\n    Apis.instance().db_api().exec( \"set_subscribe_callback\", [ updateListener, true ] )\n});\n\nfunction updateListener(object) {\n    console.log(\"set_subscribe_callback:\\n\", object);\n}\n```\nThe `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.\n\n## Tests\n\nThe 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.\n","readmeFilename":"README.md"}