{"_id":"@aggregion/agrjs","_rev":"9-3099ffd3b086c64289b6f360d65d85f0","name":"@aggregion/agrjs","dist-tags":{"latest":"17.0.5"},"versions":{"16.0.2":{"name":"@aggregion/agrjs","version":"16.0.2","description":"General purpose library for the Aggregion blockchain.","main":"lib/index.js","files":["README.md","docs","lib"],"scripts":{"test":"mocha --exit --use_strict src/*.test.js","test_lib":"mocha --exit --use_strict lib/*.test.js","coverage":"nyc --reporter=html npm test","coveralls":"npm run coverage && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls","build":"npm run build_lib && npm run build_browser","build_lib":"babel --copy-files src --out-dir lib","build_browser":"browserify -o lib/eos.js -s Eos lib/index.js","build_browser_test":"browserify -o dist/test.js lib/*.test.js","minimize":"uglifyjs lib/eos.js -o lib/eos.min.js --source-map --compress --mangle","docs":"jsdoc2md src/format.js > docs/format.md","srisum":"npx srisum lib/eos.*","prepublishOnly":"npm run build && npm run minimize && npm run docs && npm run srisum"},"repository":{"type":"git","url":"git+https://github.com/aggregion/agrjs.git"},"keywords":["AGR","Aggregion","Blockchain"],"author":"","license":"MIT","bugs":{"url":"https://github.com/aggregion/agrjs/issues"},"homepage":"https://github.com/aggregion/agrjs#readme","devDependencies":{"babel-cli":"6.26.0","babel-core":"6.26.3","babel-plugin-syntax-async-functions":"6.13.0","babel-plugin-transform-regenerator":"6.26.0","babel-plugin-transform-runtime":"6.23.0","babel-preset-es2015":"6.24.1","browserify":"14.4.0","camel-case":"^3.0.0","coveralls":"^3.0.0","eosjs-keygen":"^1.3.2","eslint":"^5.3.0","eslint-cli":"^1.1.1","eslint-config-google":"^0.9.1","eslintrc":"^1.0.6","jsdoc-to-markdown":"^3.0.4","mocha":"^5.2.0","nyc":"^11.4.1","uglify-js":"3.4.1"},"dependencies":{"babel-runtime":"6.26.0","binaryen":"^37.0.0","create-hash":"^1.1.3","eosjs-api":"7.0.3","eosjs-ecc":"4.0.3","fcbuffer":"2.2.0"},"babel":{"presets":["es2015"],"plugins":["syntax-async-functions","transform-regenerator",["transform-runtime",{"polyfill":false,"regenerator":true}]]},"gitHead":"5126c4f1894a46c3b277391f480f74b1c4522ce5","_id":"@aggregion/agrjs@16.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"denisbezrukov","email":"denis.bezrukov@aggregion.com"},"dist":{"integrity":"sha512-xUrJrI40gbkT8d4+2Ep5oo42SeJ6/DvHbQ5F0U4JJRJvFXhy/K+C2/KuCjsfOmrxfm+p+p8X/cB+mSFbOtPVdg==","shasum":"8bdb24721d5937479f1a024489e2ecea4c0c2012","tarball":"https://registry.npmjs.org/@aggregion/agrjs/-/agrjs-16.0.2.tgz","fileCount":21,"unpackedSize":2166479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdtaVCRA9TVsSAnZWagAA3RIQAKG5a6VxkXmu1YpR7wAn\nWEHmaICLJmYqdQjF1Q4rhOjcsUU664Zw9vFKOD/52fWH77mJblosTR+i693s\nMg1dWcOpWbcx7aJ70lzPF7k0PxyDN7SIRkP90DKDVDuDZhiqVFI7wbmOUx4u\nW98P8/ZhaqionutnyXulzdyUJa5T8CsQ4WkqO2/AKEgN7QmaLo5CacG2wM/E\nagGedr76NjOeZ9CI8GZTFwOYt8G3bLTlNMxFOzKJGD0ffGZLz9ASnKwODwak\nfJYxdq83KUfBVeaPyH+ur4kgOaidgymthNHkBJC9AJytwKlNoXxSVXvRiUJT\nuAh5JT5TsIl74VxvbRQyecSUfX7QUNK2NAWLs8H57nAuJcktgdJ1gEgQt5Fi\neU20E2L+ANTE8rfIGkh7j3E4nRWNkIDO8Z+aVB1D72xnv4vpFsnoIXD6RQpH\nclQXREps+nToHyp7h2CHWss/16s7I5pIGJ4ctaap2G+dMSSHS7BOeC1A99A/\nckNOQ5YstBSth5kcstLXqCUaa12l4yJ9xmjHyJ6vYqedhuhAGIH9kNKv1N9n\n6nH3NLQ9v+PBkCVTDU7Tb52quLVrUdqcxWUOQC9pgXrpKc8+sLXP/9LP9Yic\nWFcFODTvbdP2+E37jjoJ8sR3qps1L4h8rtyDEPGO4PAnKhEfPCzg4WFDE9qG\nsouo\r\n=aTgY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDL5FifCTZx/fqGbIxkpHrQMu8sca+4RPhBlvrbHP155gIgDQdmvtrfmhXh74PVbJ47J4fhQ+iN922hs5aPvqphH9o="}]},"maintainers":[{"name":"denisbezrukov","email":"denis.bezrukov@aggregion.com"},{"name":"plasticut","email":"plasticut@gmail.com"},{"name":"zbit","email":"i@zbit.name"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/agrjs_16.0.2_1534514836919_0.5565945158008798"},"_hasShrinkwrap":false},"17.0.0":{"name":"@aggregion/agrjs","version":"17.0.0","description":"General purpose library for the Aggregion blockchain.","main":"lib/index.js","files":["README.md","docs","lib"],"scripts":{"test":"mocha --exit --use_strict src/*.test.js","test_lib":"mocha --exit --use_strict lib/*.test.js","coverage":"nyc --reporter=html npm test","coveralls":"npm run coverage && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls","build":"npm run build_lib && npm run build_browser","build_lib":"babel --copy-files src --out-dir lib","build_browser":"browserify -o lib/eos.js -s Eos lib/index.js","build_browser_test":"browserify -o dist/test.js lib/*.test.js","minimize":"uglifyjs lib/eos.js -o lib/eos.min.js --source-map --compress --mangle","docs":"jsdoc2md src/format.js > docs/format.md","srisum":"npx srisum lib/eos.*","prepublishOnly":"npm run build && npm run minimize && npm run docs && npm run srisum"},"repository":{"type":"git","url":"git+https://github.com/aggregion/agrjs.git"},"keywords":["AGR","Aggregion","Blockchain"],"author":"","license":"MIT","bugs":{"url":"https://github.com/aggregion/agrjs/issues"},"homepage":"https://github.com/aggregion/agrjs#readme","devDependencies":{"babel-cli":"6.26.0","babel-core":"6.26.3","babel-plugin-syntax-async-functions":"6.13.0","babel-plugin-transform-regenerator":"6.26.0","babel-plugin-transform-runtime":"6.23.0","babel-preset-es2015":"6.24.1","browserify":"14.4.0","camel-case":"^3.0.0","coveralls":"^3.0.0","eosjs-keygen":"^1.3.2","eslint":"^5.3.0","eslint-cli":"^1.1.1","eslint-config-google":"^0.9.1","eslintrc":"^1.0.6","jsdoc-to-markdown":"^3.0.4","mocha":"^5.2.0","nyc":"^11.4.1","uglify-js":"3.4.1"},"dependencies":{"babel-runtime":"6.26.0","binaryen":"^37.0.0","create-hash":"^1.1.3","eosjs-api":"7.0.3","eosjs-ecc":"4.0.3","fcbuffer":"2.2.0"},"babel":{"presets":["es2015"],"plugins":["syntax-async-functions","transform-regenerator",["transform-runtime",{"polyfill":false,"regenerator":true}]]},"gitHead":"4e7a34d379bec4e77f05fbd2a67117928d4c1b5c","_id":"@aggregion/agrjs@17.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"denisbezrukov","email":"denis.bezrukov@aggregion.com"},"dist":{"integrity":"sha512-ciFaum4Z2iROEc9KWzHkwQsU3AkoJRdRtvYHemBkafKvD+FXZO+Aex6Hep/895ssZI8/7VdIAQvQmq70J1i6Sw==","shasum":"b75e96083c4e153b6386c44439cfc5c98f0ab524","tarball":"https://registry.npmjs.org/@aggregion/agrjs/-/agrjs-17.0.0.tgz","fileCount":22,"unpackedSize":2166511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdteSCRA9TVsSAnZWagAA1nkP/0Ka0yq09OZv0AZ7E2oD\nTmROZBaXecnFhlWd26uio70FG74DC2urIlhz8s1Ax+bQAJyuAGr/r8BEchCK\nRk7vkzmo3bWHxd643tlbF4S8dI7YJEaX/+puwp/UytIz9fxUun65Pvt9VugT\nWWjRjtHqOTDWFhundHFYe7Mv9BMpU21zCPgzHMCPYTlQvWrXOYkpK2PPsHyX\n2VQoHEXcL6b8TNCs9vxQxMXKsJHuW+gZR5iXjnC8OIx35xBQ/0VC4FASg6+F\nF26Bl0AIvmGIMYib7hR1Lc3TJRWJlftEQ7jrnpm0rRjGSPSW9nIpTj1IWeEK\nP6dQMHmKBq0L0QAWhh2qwDLjIId8V4dEs9AZhon5LnjaWQx8vCpNnypgHbhD\n7SVNOmdUvgv2s3G7b32Y9ENI8Ex6TN3Uo78/+c9UX7m1fzUGybCG3osjgiq0\nkx3WBefpEwRIY5L6/5cRktxYug7QRzF/rcVYrwzJB0tPP6L1UbiIVvC7sipN\nJiNpwR6Tk1JmNqUqUKBZZx0QoKBDP7I1pgVTXlYSiALDmxBBdWj8iXf41J89\nRpbwa+9vV10wCrPFkJbkEqesRDuCs1FnF5JNf1sUgi9usnE2rmgUOHn7ctcE\njHmVLdSo5isTV01vOxRq3TlAWHFNDINAO3tABv/H8dc6+PLvPIynfkKWVgC5\nqavY\r\n=nXYV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWDR7KHiEir2rtJqk38O9uP87lCDFGKN+rbM47kCtOaQIhAIUotuXrH+u4vWRcmATXDXn3/nejaiJcZHpxUOxbWWdE"}]},"maintainers":[{"name":"denisbezrukov","email":"denis.bezrukov@aggregion.com"},{"name":"plasticut","email":"plasticut@gmail.com"},{"name":"zbit","email":"i@zbit.name"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/agrjs_17.0.0_1534515089823_0.04292802893792058"},"_hasShrinkwrap":false},"17.0.1":{"name":"@aggregion/agrjs","version":"17.0.1","description":"General purpose library for the Aggregion blockchain.","main":"lib/index.js","files":["README.md","docs","lib"],"scripts":{"test":"mocha --exit --use_strict src/*.test.js","test_lib":"mocha --exit --use_strict lib/*.test.js","coverage":"nyc --reporter=html npm test","coveralls":"npm run coverage && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls","build":"npm run build_lib && npm run build_browser","build_lib":"babel --copy-files src --out-dir lib","build_browser":"browserify -o lib/eos.js -s Eos lib/index.js","build_browser_test":"browserify -o dist/test.js lib/*.test.js","minimize":"uglifyjs lib/eos.js -o lib/eos.min.js --source-map --compress --mangle","docs":"jsdoc2md src/format.js > docs/format.md","srisum":"npx srisum lib/eos.*","prepublishOnly":"npm run build && npm run minimize && npm run docs && npm run srisum"},"repository":{"type":"git","url":"git+https://github.com/aggregion/agrjs.git"},"keywords":["AGR","Aggregion","Blockchain"],"author":"","license":"MIT","bugs":{"url":"https://github.com/aggregion/agrjs/issues"},"homepage":"https://github.com/aggregion/agrjs#readme","devDependencies":{"babel-cli":"6.26.0","babel-core":"6.26.3","babel-plugin-syntax-async-functions":"6.13.0","babel-plugin-transform-regenerator":"6.26.0","babel-plugin-transform-runtime":"6.23.0","babel-preset-es2015":"6.24.1","browserify":"14.4.0","camel-case":"^3.0.0","coveralls":"^3.0.0","eosjs-keygen":"^1.3.2","eslint":"^5.3.0","eslint-cli":"^1.1.1","eslint-config-google":"^0.9.1","eslintrc":"^1.0.6","jsdoc-to-markdown":"^3.0.4","mocha":"^5.2.0","nyc":"^11.4.1","uglify-js":"3.4.1"},"dependencies":{"babel-runtime":"6.26.0","binaryen":"^37.0.0","create-hash":"^1.1.3","eosjs-api":"7.0.3","eosjs-ecc":"4.0.3","fcbuffer":"2.2.0"},"babel":{"presets":["es2015"],"plugins":["syntax-async-functions","transform-regenerator",["transform-runtime",{"polyfill":false,"regenerator":true}]]},"gitHead":"3127cc3f00d5620e14d566a51bd65616189383fa","_id":"@aggregion/agrjs@17.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"denisbezrukov","email":"denis.bezrukov@aggregion.com"},"dist":{"integrity":"sha512-Wsj0eRZIjWbDLvx+kkfYIeVFy8TgVTGiYorX/8J8ncKv1CQAAToHUYsdZQs9wNj5Z5QTDchkyd9z1zjTuFIhfA==","shasum":"ad8e5e16f7490edd2a810ad79e8eb0a6ac01eaec","tarball":"https://registry.npmjs.org/@aggregion/agrjs/-/agrjs-17.0.1.tgz","fileCount":22,"unpackedSize":2166536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdtieCRA9TVsSAnZWagAAEnQP+wY20dF3hwomMNtHCWHz\ng97BbkMO3hoGtnHeWvG2OA8VooOxywt8VdHRTZ2PYEiCHmgfXqNLoLgtdU1z\nKuSmvdciJFsIH4xKAz92WRNlWQsMllUdPQU/Jwz9fYfnKiICMYLzDKG5x1ki\n/cDcQBqbhSpdTTnSvU7YUue5XSy0B9zjqs9sD5aSytPIHDHRV+QhKxYDpk+f\nPmDOeCv71XIcAHW6yBVnQul+mOfk/iZuRpSQRzKUk0IpVttCMf7Oz9j++t+h\nLIce6V35IzSR/MOJXXTRL3mftUpyHqKbPggNtuNdedbYkDceIoc6ORmjVzow\nRLOK9IacZxBBhv5zeL9v3xhrh1/bM5s5vly0XqEgevAJptQt6lA9SGW3z8YN\nMEYot/Fc/WOq78365WYL6Cma7wUk6e5Lb6BzUiwHUoEWdp8s+y3grfJAcjg9\ncqzeVp3cl36V8ZtgQ58IkqPbdbu2UxyHst6fWUsSMgxvnb9ozMOXvhc6ftOO\nj/wsK0+dfRKabeLvAZM3qdN2QTVcCuklyxgG0SCn/N8oh8VNjJ1AQ/9+8mqR\nZHr/K/YZ84iZbmipnVFwftFnvsQmph3YGzmCwHmoQp1qctWAGDDCsHP13v+M\nxb4TLgpgZhPnGgvxWDdXkD8+QKUb2pSGoY8CX3oaxp6b7YUW2lf/zUneYQ3F\nzQgx\r\n=j0cf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxpwdZAnjIvabQPsslbFklen++FnJGGXZDR633xF7hiQIhAN5txtaYLB85W73xc9OoGKqf/uONAUI+PDYL5E7qC9Bz"}]},"maintainers":[{"name":"denisbezrukov","email":"denis.bezrukov@aggregion.com"},{"name":"plasticut","email":"plasticut@gmail.com"},{"name":"zbit","email":"i@zbit.name"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/agrjs_17.0.1_1534515357628_0.3824316456279204"},"_hasShrinkwrap":false},"17.0.5":{"name":"@aggregion/agrjs","version":"17.0.5","description":"General purpose library for the Aggregion blockchain.","main":"lib/index.js","scripts":{"test":"mocha --exit --use_strict src/*.test.js","test_lib":"mocha --exit --use_strict lib/*.test.js","coverage":"nyc --reporter=html npm test","coveralls":"npm run coverage && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls","build":"npm run build_lib && npm run build_browser","build_lib":"babel --copy-files src --out-dir lib","build_browser":"browserify -o lib/eos.js -s Eos lib/index.js","build_browser_test":"browserify -o dist/test.js lib/*.test.js","minimize":"uglifyjs lib/eos.js -o lib/eos.min.js --source-map --compress --mangle","docs":"jsdoc2md src/format.js > docs/format.md","srisum":"npx srisum lib/eos.*","prepublishOnly":"npm run build && npm run minimize && npm run docs && npm run srisum"},"repository":{"type":"git","url":"git+https://github.com/aggregion/agrjs.git"},"keywords":["AGR","Aggregion","Blockchain"],"author":"","license":"MIT","bugs":{"url":"https://github.com/aggregion/agrjs/issues"},"homepage":"https://github.com/aggregion/agrjs#readme","devDependencies":{"babel-cli":"6.26.0","babel-core":"6.26.3","babel-plugin-syntax-async-functions":"6.13.0","babel-plugin-transform-regenerator":"6.26.0","babel-plugin-transform-runtime":"6.23.0","babel-preset-es2015":"6.24.1","browserify":"14.4.0","camel-case":"^3.0.0","coveralls":"^3.0.0","eosjs-keygen":"^1.3.2","eslint":"^5.3.0","eslint-cli":"^1.1.1","eslint-config-google":"^0.9.1","eslintrc":"^1.0.6","jsdoc-to-markdown":"^3.0.4","mocha":"^5.2.0","nyc":"^11.4.1","uglify-js":"3.4.1"},"dependencies":{"@aggregion/agrjs-ecc":"^4.0.5","babel-runtime":"6.26.0","binaryen":"^37.0.0","create-hash":"^1.1.3","eosjs-api":"7.0.3","fcbuffer":"2.2.0"},"babel":{"presets":["es2015"],"plugins":["syntax-async-functions","transform-regenerator",["transform-runtime",{"polyfill":false,"regenerator":true}]]},"gitHead":"3127cc3f00d5620e14d566a51bd65616189383fa","_id":"@aggregion/agrjs@17.0.5","_npmVersion":"6.4.0","_nodeVersion":"8.3.0","_npmUser":{"name":"denisbezrukov","email":"denis.bezrukov@aggregion.com"},"dist":{"integrity":"sha512-K+3+AK/T7NxjxXMdAkDn1VXvL1odV1WP8tGZBgms/2RCPwETw3vetrkE2OksvTC3pqi6+o4xsbg/f8MC9oQGcA==","shasum":"4cee116d3d0c9b4d6b8fccdbc2d2a5f2dffdce66","tarball":"https://registry.npmjs.org/@aggregion/agrjs/-/agrjs-17.0.5.tgz","fileCount":24,"unpackedSize":2179461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiCVxCRA9TVsSAnZWagAAmpUP/RPPcCj1Fi71T8faUWkf\nM71mhSU/Ke1jVNWVam3P9vReLG7jiYbf03B/ShKPsmFIt99Jqnaj0TV3CLRy\nd0JajoICubiE3Ey/ysQuZIFAQJT39eHNhPrXDEARSMdde4pAndby/AJhXG5X\nzpl/LBz46hQsNK5fC/CSm0tbKy/gDOfJ/2HCVWNbWAPVTPjYVpflriLRXIZ1\nClS2fK9H2/j/eFJ+GCVnSX1DTANsqCHHYXW9ribjWhOrR3pEt3zsdiWnDKD8\neMNffmQnvutYYOv62G9y4lI67wb9qScqTbcpvr1KEEypQahWuIrN+CNJCTF7\nYOnkiAAySzoPYVIiVGrh1Q+4OK5LmHEqwmKBQsltg57hxod7TY3QTTIDqmTp\nUvV5/nAXCTYvxNbiHRB601gMgR6pmtkoxAqFlzMab+W6wpU2aHQRCUi4WghN\nr8TJsL25MoSNqNNRerdwlF5Zm1TaMonQKKk2YOXTwPdaE46qbljDqjbDaIjo\nPUP+abfnPok/cgEtDqrNFOkABuJCbMqxLvtuQkVgzSdtUiASEymTBp0/Q7NU\ngG6nYJSwBv+O3wzOx87ajexNyBAds5GyTKlBWePill3ePUsVQdpD4+rlz3W+\nGTAxK3zEcl5goM2YMGcYoFoKPPv9tffMpxv/1MiMMJtTajXi10YQDJe+DsRi\nSd3k\r\n=yQ1z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6ufURDgdDEQiKxOPMoslcZ84vRM5YPp9HvJVcl0aw8wIgcbyjRlOBx0hnf76FyLwxYRyflfdOjw9NukduQMOO5tU="}]},"maintainers":[{"name":"denisbezrukov","email":"denis.bezrukov@aggregion.com"},{"name":"plasticut","email":"plasticut@gmail.com"},{"name":"zbit","email":"i@zbit.name"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/agrjs_17.0.5_1535649136647_0.11797232173280303"},"_hasShrinkwrap":false}},"time":{"created":"2018-08-17T14:07:16.724Z","16.0.2":"2018-08-17T14:07:17.044Z","modified":"2022-04-04T11:57:02.996Z","17.0.0":"2018-08-17T14:11:29.986Z","17.0.1":"2018-08-17T14:15:57.734Z","17.0.5":"2018-08-30T17:12:16.849Z"},"maintainers":[{"email":"smv.dmitry@gmail.com","name":"dmitry_smv"},{"email":"denis.bezrukov@aggregion.com","name":"denisbezrukov"},{"email":"i@zbit.name","name":"zbit"},{"email":"alexander.sedelnikov@ymail.com","name":"alekns"},{"email":"d.n.voropaev@gmail.com","name":"takatan"},{"email":"vasilii.kuznetsov@aggregion.com","name":"vasiliykuznetsov"}],"description":"General purpose library for the Aggregion blockchain.","homepage":"https://github.com/aggregion/agrjs#readme","keywords":["AGR","Aggregion","Blockchain"],"repository":{"type":"git","url":"git+https://github.com/aggregion/agrjs.git"},"bugs":{"url":"https://github.com/aggregion/agrjs/issues"},"license":"MIT","readme":"# Agrjs\n\nGeneral purpose library for Aggregion blockchain.\n\n\n### Installation\n\n* Install with: `npm install @aggregion/agrjs`\n\n### Usage\n\nWays to instantiate agrjs.\n\n```js\nconst Agr = require('@aggregion/agrjs')\n\n// Private key or keys (array) provided statically or by way of a function.\n// For multiple keys, the get_required_keys API is used (more on that below).\nkeyProvider: '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'\n\n// Localhost Testnet (run ./docker/up.sh)\nconst agr = new Agr({keyProvider})\n\n// Connect to a testnet or mainnet\nconst agr = new Agr({httpEndpoint, chainId, keyProvider})\n\n// Cold-storage\nconst agr = new Agr({httpEndpoint: null, chainId, keyProvider})\n\n// Read-only instance when 'agrjs' is already a dependency\nconst agr = new Agr.modules.api({/*config*/})\n\n```\n\nNo-arguments prints usage.\n\n```js\nagr.getBlock()\n```\n```json\nUSAGE\ngetBlock - Fetch a block from the blockchain.\n\nPARAMETERS\n{\n  \"block_num_or_id\": \"string\"\n}\n```\n\n\nAll blockchain functions (read and write) follow this pattern:\n\n```js\n// If the last argument is a function it is treated as a callback\nagr.getBlock(1, (error, result) => {})\n\n// If a callback is not provided, a Promise is returned\nagr.getBlock(1) // @returns {Promise}\n\n// Parameters can be positional or an object\nagr.getBlock({block_num_or_id: 1})\n\n// An API with no parameters is invoked with an empty object or callback (avoids logging usage)\nagr.getInfo({}) // @returns {Promise}\nagr.getInfo((error, result) => { console.log(error, result) })\n```\n\n\n### Configuration\n\n```js\nconst Agr = require('@aggregion/agrjs')\n\n// Default configuration\nconst config = {\n  chainId: null, // 32 byte (64 char) hex string\n  keyProvider: ['PrivateKeys...'], // WIF string or array of keys..\n  httpEndpoint: 'http://127.0.0.1:8888',\n  expireInSeconds: 60,\n  broadcast: true,\n  verbose: false, // API activity\n  sign: true\n};\n\nconst agr = new Agr(config);\n```\n\n* **chainId** `hex` - Unique ID for the blockchain you're connecting to.  This\n  is required for valid transaction signing.  The chainId is provided via the\n  [get_info](http://ayeaye.cypherglass.com:8888/v1/chain/get_info) API call.\n\n  Identifies a chain by its initial genesis block.  All transactions signed will\n  only be valid the blockchain with this chainId.  Verify the chainId for\n  security reasons.\n\n* **keyProvider** `[array<string>|string|function]` - Provides private keys\n  used to sign transaction.  If multiple private keys are found, the API\n  `get_required_keys` is called to discover which signing keys to use.  If a\n  function is provided, this function is called for each transaction.\n\n* **httpEndpoint** `string` - http or https location of a agrnode server\n  providing a chain API.  When using agrjs from a browser remember to configure\n  the same origin policy in agrnode or proxy server.  For testing, agrnode\n  configuration `access-control-allow-origin = *` could be used.\n\n  Set this value to **null** for a cold-storage (no network) configuration.\n\n* **expireInSeconds** `number` - number of seconds before the transaction\n  will expire.  The time is based on the agrnode's clock.  An unexpired\n  transaction that may have had an error is a liability until the expiration\n  is reached, this time should be brief.\n\n* **broadcast** `[boolean=true]` - post the transaction to\n  the blockchain.  Use false to obtain a fully signed transaction.\n\n* **verbose** `[boolean=false]` - verbose logging such as API activity.\n\n* **debug** `[boolean=false]` - low level debug logging (serialization).\n\n* **sign** `[boolean=true]` - sign the transaction with a private key.  Leaving\n  a transaction unsigned avoids the need to provide a private key.\n\n* **mockTransactions** (advanced)\n  * `mockTransactions: () => null // 'pass',  or 'fail'`\n  * `pass` - do not broadcast, always pretend that the transaction worked\n  * `fail` - do not broadcast, pretend the transaction failed\n  * `null|undefined` - broadcast as usual\n\n* **transactionHeaders** (advanced) - manually calculate transaction header.  This\n  may be provided so agrjs does not need to make header related API calls to\n  agrnode.  Used in environments like cold-storage.  This callback is called for\n  every transaction.\n  * `transactionHeaders: (expireInSeconds, callback) => {callback(null/*error*/, headers)}`\n\n* **logger** - default logging configuration.\n  ```js\n  logger: {\n    log: config.verbose ? console.log : null,  // null to disable\n    error: config.verbose ? console.error : null,\n  }\n  ```\n\n  For example, redirect error logs: `config.logger = {error: (...args) => ..}`\n\n### Options\n\nOptions may be provided after parameters.\n\nNOTE: `authorization` is for individual actions, it does not belong in `Agr(config)`.\n\n```js\noptions = {\n  authorization: 'alice@active',\n  broadcast: true,\n  sign: true\n}\n```\n\n```js\nagr.transfer('alice', 'bob', '1.0000 AGR', '', options)\n```\n\n* **authorization** `[array<auth>|auth]` - identifies the\n  signing account and permission typically in a multisig\n  configuration.  Authorization may be a string formatted as\n  `account@permission` or an `object<{actor: account, permission}>`.\n  * If missing default authorizations will be calculated.\n  * If provided additional authorizations will not be added.\n  * Performs deterministic sorting by account name\n\n  If a default authorization is calculated the action's 1st field must be\n  an account_name.  The account_name in the 1st field gets added as the\n  active key authorization for the action.\n\n* **broadcast** `[boolean=true]` - post the transaction to\n  the blockchain.  Use false to obtain a fully signed transaction.\n\n* **sign** `[boolean=true]` - sign the transaction with a private key.  Leaving\n  a transaction unsigned avoids the need to provide a private key.\n\n### Transaction\n\nThe transaction function accepts the standard blockchain transaction.\n\nRequired transaction header fields will be added unless you are signing without a\nnetwork connection (httpEndpoint == null). In that case provide you own headers:\n\n```js\n// only needed in cold-storage or for offline transactions\nconst headers = {\n  expiration: '2018-06-14T18:16:10'\n  ref_block_num: 1,\n  ref_block_prefix: 452435776\n}\n```\n\nCreate and send (broadcast) a transaction:\n\n```javascript\n/** @return {Promise} */\nagr.transaction(\n  {\n    // ...headers,\n    actions: [\n      {\n        account: 'agrio.token',\n        name: 'transfer',\n        authorization: [{\n          actor: 'inita',\n          permission: 'active'\n        }],\n        data: {\n          from: 'inita',\n          to: 'initb',\n          quantity: '7.0000 AGR',\n          memo: ''\n        }\n      }\n    ]\n  }\n  // config -- example: {broadcast: false, sign: true}\n)\n```\n\n### Named action functions\n\nMore concise functions are provided for applications that may use actions\nmore frequently.  This avoids having lots of JSON in the code.\n\n```javascript\n// Run with no arguments to print usage.\nagr.transfer()\n\n// Callback is last, when omitted a promise is returned\nagr.transfer('inita', 'initb', '1.0000 AGR', '', (error, result) => {})\nagr.transfer('inita', 'initb', '1.1000 AGR', '') // @returns {Promise}\n\n// positional parameters\nagr.transfer('inita', 'initb', '1.2000 AGR', '')\n\n// named parameters\nagr.transfer({from: 'inita', to: 'initb', quantity: '1.3000 AGR', memo: ''})\n\n// options appear after parameters\noptions = {broadcast: true, sign: true}\n\n// `false` is a shortcut for {broadcast: false}\nagr.transfer('inita', 'initb', '1.4000 AGR', '', false)\n```\n\n```js\nDecimalPad = Agr.modules.format.DecimalPad\nuserInput = '10.2'\nprecision = 4\nassert.equal('10.2000', DecimalPad(userInput, precision))\n```\n\n\n### Shorthand\n\nShorthand is available for some types such as Asset and Authority.  This syntax\nis only for concise functions and does not work when providing entire transaction\nobjects to `agr.transaction`..\n\nFor example:\n* permission `inita` defaults `inita@active`\n* authority `'AGR6MRy..'` expands `{threshold: 1, keys: [{key: 'AGR6MRy..', weight: 1}]}`\n* authority `inita` expands `{threshold: 1, accounts: [{permission: {actor: 'inita', permission: 'active'}, weight: 1}]}`\n\n### New Account\n\nNew accounts will likely require some staked tokens for RAM and bandwidth.\n\n```javascript\nwif = '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'\npubkey = 'AGR6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV'\n\nagr.transaction(tr => {\n  tr.newaccount({\n    creator: 'agrio',\n    name: 'myaccount',\n    owner: pubkey,\n    active: pubkey\n  })\n\n  tr.buyrambytes({\n    payer: 'agrio',\n    receiver: 'myaccount',\n    bytes: 8192\n  })\n\n  tr.delegatebw({\n    from: 'agrio',\n    receiver: 'myaccount',\n    stake_net_quantity: '10.0000 AGR',\n    stake_cpu_quantity: '10.0000 AGR',\n    transfer: 0\n  })\n})\n```\n\n### Contract\n\nDeploy and call smart contracts.\n\n#### Compile\n\nIf you're loading a **wasm** file, you do not need binaryen. If you're loading\na **wast** file you can include and configure the binaryen compiler, this is\nused to compile to **wasm** automatically when calling **setcode**.\n\n\n```bash\n$ npm install binaryen@37.0.0\n```\n\n```js\nbinaryen = require('binaryen')\nconst agr = new Agr({keyProvider, binaryen})\n```\n\n#### Deploy\n\n```javascript\nconst wasm = fs.readFileSync(`docker/contracts/agrio.token/agrio.token.wasm`);\nconst abi = fs.readFileSync(`docker/contracts/agrio.token/agrio.token.abi`);\n\n// Publish contract to the blockchain\nagr.setcode('myaccount', 0, 0, wasm) // @returns {Promise}\nagr.setabi('myaccount', JSON.parse(abi)) // @returns {Promise}\n```\n\n#### Fetch a smart contract\n\n```js\n// @returns {Promise}\nagr.contract('myaccount', [options], [callback])\n\n// Run immediately, `myaction` returns a Promise\nagr.contract('myaccount').then(myaccount => myaccount.myaction(..))\n\n// Group actions. `transaction` returns a Promise but `myaction` does not\nagr.transaction('myaccount', myaccount => { myaccount.myaction(..) })\n\n// Transaction with multiple contracts\nagr.transaction(['myaccount', 'myaccount2'], ({myaccount, myaccount2}) => {\n   myaccount.myaction(..)\n   myaccount2.myaction(..)\n})\n```\n\n#### Offline or cold-storage contract\n\n```js\nconst agr = new Agr({httpEndpoint: null})\n\nconst abi = fs.readFileSync(`docker/contracts/agrio.token/agrio.token.abi`)\nagr.fc.abiCache.abi('myaccount', JSON.parse(abi))\n\n// Check that the ABI is available (print usage)\nagr.contract('myaccount').then(myaccount => myaccount.create())\n```\n#### Offline or cold-storage transaction\n\n```js\n// ONLINE\n\n// Prepare headers\nexpireInSeconds = 60 * 60 // 1 hour\n\nconst agrio = new Agr(/* {httpEndpoint: 'https://..'} */)\n\nconst info = await agr.getInfo({})\nconst chainDate = new Date(info.head_block_time + 'Z')\nlet expiration = new Date(chainDate.getTime() + expireInSeconds * 1000)\nexpiration = expiration.toISOString().split('.')[0]\n\nconst block = await agr.getBlock(info.last_irreversible_block_num)\n\ntransactionHeaders = {\n  expiration,\n  ref_block_num: info.last_irreversible_block_num & 0xFFFF,\n  ref_block_prefix: block.ref_block_prefix\n}\n\n// OFFLINE (bring `transactionHeaders`)\n\n// All keys in keyProvider will sign.\nconst agr = new Agr({httpEndpoint: null, chainId, keyProvider, transactionHeaders})\n\ntransfer = await agr.transfer('inita', 'initb', '1.0000 AGR', '')\ntransferTransaction = transfer.transaction\n\n// ONLINE (bring `transferTransaction`)\n\nconst agr = new Agr(/* {httpEndpoint: 'https://..'} */)\n\nprocessedTransaction = await agr.pushTransaction(transferTransaction)\n```\n\n#### Custom Token\n\n```js\n// more on the contract / transaction syntax\n\nawait agr.transaction('myaccount', myaccount => {\n\n  // Create the initial token with its max supply\n  // const options = {authorization: 'myaccount'} // default\n  myaccount.create('myaccount', '10000000.000 TOK')//, options)\n\n  // Issue some of the max supply for circulation into an arbitrary account\n  myaccount.issue('myaccount', '10000.000 TOK', 'issue')\n})\n\nconst balance = await agr.getCurrencyBalance('myaccount', 'myaccount', 'TOK')\nconsole.log('Currency Balance', balance)\n```\n\n### Calling Actions\n\nOther ways to use contracts and transactions.\n\n```javascript\n// if either transfer fails, both will fail (1 transaction, 2 messages)\nawait agr.transaction(agr =>\n  {\n    agr.transfer('inita', 'initb', '1.0000 AGR', ''/*memo*/)\n    agr.transfer('inita', 'initc', '1.0000 AGR', ''/*memo*/)\n    // Returning a promise is optional (but handled as expected)\n  }\n  // [options],\n  // [callback]\n)\n\n// transaction on a single contract\nawait agr.transaction('myaccount', myaccount => {\n  myaccount.transfer('myaccount', 'inita', '10.000 TOK@myaccount', '')\n})\n\n// mix contracts in the same transaction\nawait agr.transaction(['myaccount', 'agrio.token'], ({myaccount, agrio_token}) => {\n  myaccount.transfer('inita', 'initb', '1.000 TOK@myaccount', '')\n  agrio_token.transfer('inita', 'initb', '1.0000 AGR', '')\n})\n\n// The contract method does not take an array so must be called once for\n// each contract that is needed.\nconst myaccount = await agrio.contract('myaccount')\nawait myaccount.transfer('myaccount', 'inita', '1.000 TOK', '')\n\n// a transaction to a contract instance can specify multiple actions\nawait myaccount.transaction(myaccountTr => {\n  myaccountTr.transfer('inita', 'initb', '1.000 TOK', '')\n  myaccountTr.transfer('initb', 'inita', '1.000 TOK', '')\n})\n```\n\n# Development\n\nFrom time-to-time the agrks and agrnode binary format will change between releases\nso you may need to start `agrnode` with the `--skip-transaction-signatures` parameter\nto get your transactions to pass.\n\nNote, `package.json` has a \"main\" pointing to `./lib`.  The `./lib` folder is for\nes2015 code built in a separate step. If you're changing and testing code,\nimport from `./src` instead.\n\n```javascript\nnew Agr = require('./src')\n\n// forceActionDataHex = false helps transaction readability but may trigger back-end bugs\nconfig = {verbose: true, debug: false, broadcast: true, forceActionDataHex: true, keyProvider}\n\nconst agr = new Agr(config)\n```\n\n#### Fcbuffer\n\nThe `agr` instance can provide serialization:\n\n```javascript\n// 'asset' is a type but could be any struct or type like: transaction or uint8\ntype = {type: 1, data: '00ff'}\nbuffer = agr.fc.toBuffer('extensions_type', type)\nassert.deepEqual(type, agr.fc.fromBuffer('extensions_type', buffer))\n\n// ABI Serialization\nagr.contract('agrio.token', (error, agrio_token) => {\n  create = {issuer: 'inita', maximum_supply: '1.0000 AGR'}\n  buffer = agrio_token.fc.toBuffer('create', create)\n  assert.deepEqual(create, agrio_token.fc.fromBuffer('create', buffer))\n})\n```\n\nUse Node v10+ for `package-lock.json`.\n\n# Related Libraries\n\nThese libraries are integrated into `agrjs` seamlessly so you probably do not\nneed to use them directly.  They are exported here giving more API access or\nin some cases may be used standalone.\n\n```javascript\nvar {format, api, ecc, json, Fcbuffer} = agr.modules\n```\n* format [./format.md](./docs/format.md)\n  * Blockchain name validation\n  * Asset string formatting\n\n* agrjs-api [[Github](https://github.com/aggregion/agrjs-api), [NPM](https://www.npmjs.org/package/agrjs-api)]\n  * Remote API to an AGR blockchain node (agrnode)\n  * Use this library directly if you need read-only access to the blockchain\n    (don't need to sign transactions).\n\n* agrjs-ecc [[Github](https://github.com/aggregion/agrjs-ecc), [NPM](https://www.npmjs.org/package/agrjs-ecc)]\n  * Private Key, Public Key, Signature, AES, Encryption / Decryption\n  * Validate public or private keys\n  * Encrypt or decrypt with AGR compatible checksums\n  * Calculate a shared secret\n\n* json {[api](https://github.com/aggregion/agrjs-api/blob/master/src/api), [schema](https://github.com/aggregion/agrjs/blob/master/src/schema)},\n  * Blockchain definitions (api method names, blockchain schema)\n\n* agrjs-keygen [[Github](https://github.com/aggregion/agrjs-keygen), [NPM](https://www.npmjs.org/package/agrjs-keygen)]\n  * private key storage and key management\n\n* Fcbuffer [[Github](https://github.com/aggregion/agrjs-fcbuffer), [NPM](https://www.npmjs.org/package/fcbuffer)]\n  * Binary serialization used by the blockchain\n  * Clients sign the binary form of the transaction\n  * Allows client to know what it is signing\n\n# Environment\n\nNode and browser (es2015)\n","readmeFilename":"README.md"}