{"_id":"@ecrypty/florijncoind-rpc","_rev":"1-ac5a2550ee5099b215ebe336859a33eb","name":"@ecrypty/florijncoind-rpc","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.2":{"name":"@ecrypty/florijncoind-rpc","description":"Florijncoin Client Library to connect to Florijncoin Core (florijncoind) via RPC","version":"2.0.2","author":{"name":"Stephen Pair","email":"stephen@bitpay.com"},"contributors":[{"name":"Jeff Garzik","email":"jgarzik@bitpay.com"},{"name":"Manuel Araoz","email":"manuelaraoz@gmail.com"},{"name":"Matias Alejo Garcia","email":"ematiu@gmail.com"},{"name":"Braydon Fuller","email":"braydon@bitpay.com"},{"name":"Alex Werner","email":"alex.werner@florijncoin.org"}],"keywords":["florijncoin","rpc"],"repository":{"type":"git","url":"git+https://github.com/ecrypty/florijncoind-rpc.git"},"license":"MIT","main":"lib/index.js","scripts":{"test":"mocha test -R spec","coverage":"nyc npm run test"},"dependencies":{"async":"^3.2.0","bluebird":"^3.7.2"},"devDependencies":{"chai":"^4.2.0","eslint":"^5.8.0","eslint-config-airbnb-base":"^13.1.0","eslint-plugin-import":"^2.14.0","nyc":"15.0.0","mocha":"^5.2.0","sinon":"^7.1.1"},"bugs":{"url":"https://github.com/ecrypty/florijncoind-rpc/issues"},"homepage":"https://github.com/ecrypty/florijncoind-rpc","gitHead":"7809338f8e967555fba74e9db3e98f95f33b9b1a","_id":"@ecrypty/florijncoind-rpc@2.0.2","_nodeVersion":"14.4.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-/YZ2JDn53y/4wkoiQSxaoqq4LSIOTnJi06G2OmN/ahFcoaBhL0y+lwsXY6I8HbKbnIleelG8ReZCgV1hWV/zAw==","shasum":"ff45d135a60cf2ebe4824030cc7059294b8bfdac","tarball":"https://registry.npmjs.org/@ecrypty/florijncoind-rpc/-/florijncoind-rpc-2.0.2.tgz","fileCount":9,"unpackedSize":30594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBga5CRA9TVsSAnZWagAA26IP/jVkL2xS7Poj8KdaOmzp\nPPgFpmwuEfyFArNcxuCIJvIUqf3AxX53eBX1LCbGEf/mepZJKa1eyPi4MWfQ\nA9s7dTxu+L05SWl9N/U2sdGGqmyRtToyRaubEx6/1SugYLpgRHhLbXtuVRDJ\n8LuGKFVjhGuxBludJzPsZcrMvy0KFKizV7iAVX2PuqV6k6Yt8ZPz8AZ9o6Cs\nY/2rDa4rWWr3dOmf7bvPDocuSPKvFfekwaA9KfTUngQcCPUdfR0rZ39oK1+n\ngDbf1p/nAbFG5rEle6xfaGFXGazYS/IAEtdtlSRXHMEUfiaatAysqukP03aP\n0KBPjFwgbVuAJczdtArjmAQaao79cuxsuyCcd6rRr4aJfMx3Sy/MzmKuyXkn\nzHh+eCqgxMVigdhZMnIsr0o7mR5ASK+y+rYmR7vhz2yiHsXzshSXL2PlVpEo\nFXKqBJONORHU+ZXHWbQhvM+ReMBKbBUDUoYX0K+gP0HoX+L6TIF19zyGPzGp\nncK6T7xj6Y9XmRHclfP9J5jFbcsWFhf6qrT1Zchve4ysN89SVRMcMR0hLteQ\nkynE7FQK4RmXTMf3+95I9lKobm3Nnx0+eiKgCEcniTXM7kEC00TZwd73EHCL\nRVk3OV8yMcGc9D6hw+0T3Zkx3fMRXisVd8dLlmr8syIgkiHsxq9MtbOuJMGd\neCbz\r\n=H2cr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpXuziunxSQ9VDXXSUp5aaEbIyz2TxSCqGRqyyyF/FVwIgEJ157wJT0+CcLSqR1Qp/jBF1BHEWuOALKXGxOy/RvvU="}]},"_npmUser":{"name":"ecrypty","email":"vvlien@ecrypty.com"},"directories":{},"maintainers":[{"name":"ecrypty","email":"vvlien@ecrypty.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/florijncoind-rpc_2.0.2_1611007673400_0.40481267265061693"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-18T22:07:53.361Z","2.0.2":"2021-01-18T22:07:53.538Z","modified":"2022-04-05T06:39:57.764Z"},"maintainers":[{"name":"ecrypty","email":"vvlien@ecrypty.com"}],"description":"Florijncoin Client Library to connect to Florijncoin Core (florijncoind) via RPC","homepage":"https://github.com/ecrypty/florijncoind-rpc","keywords":["florijncoin","rpc"],"repository":{"type":"git","url":"git+https://github.com/ecrypty/florijncoind-rpc.git"},"contributors":[{"name":"Jeff Garzik","email":"jgarzik@bitpay.com"},{"name":"Manuel Araoz","email":"manuelaraoz@gmail.com"},{"name":"Matias Alejo Garcia","email":"ematiu@gmail.com"},{"name":"Braydon Fuller","email":"braydon@bitpay.com"},{"name":"Alex Werner","email":"alex.werner@florijncoin.org"}],"author":{"name":"Stephen Pair","email":"stephen@bitpay.com"},"bugs":{"url":"https://github.com/ecrypty/florijncoind-rpc/issues"},"license":"MIT","readme":"# florijncoind-rpc\n\n[![Build Status](https://img.shields.io/travis/ecrypty/florijncoind-rpc.svg?branch=master)](https://travis-ci.org/ecrypty/florijncoind-rpc)\n[![NPM Package](https://img.shields.io/npm/v/@ecrypty/florijncoind-rpc.svg)](https://www.npmjs.org/package/@ecrypty/florijncoind-rpc)\n\n> Florijncoin Client Library to connect to Florijncoin Core (florijncoind) via RPC\n\n## Install\n\nflorijncoind-rpc runs on [node](http://nodejs.org/), and can be installed via [npm](https://npmjs.org/):\n\n```bash\nnpm install @ecrypty/florijncoind-rpc\n```\n\n## Usage\n\n### RpcClient\n\nConfig parameters : \n\n\t- protocol : (string - optional) - (default: 'https') - Set the protocol to be used. Either `http` or `https`.\n\t- user : (string - optional) - (default: 'user') - Set the user credential.\n\t- pass : (string - optional) - (default: 'pass') - Set the password credential.\n\t- host : (string - optional) - (default: '127.0.0.1') - The host you want to connect with.\n\t- port : (integer - optional) - (default: 9998) - Set the port on which perform the RPC command.\n\nPromise vs callback based\n\n  - `require('@ecrypty/florijncoind-rpc/promise')` to have promises returned\n  - `require('@ecrypty/florijncoind-rpc')` to have callback functions returned\n\t\n### Examples\n\nConfig:\n\n```javascript\nvar config = {\n    protocol: 'http',\n    user: 'florijncoin',\n    pass: 'local321',\n    host: '127.0.0.1',\n    port: 8349\n};\n```\n\nPromise based:\n\n```javascript\nvar RpcClient = require('@ecrypty/florijncoind-rpc/promise');\nvar rpc = new RpcClient(config);\n\nrpc.getRawMemPool()\n    .then(ret => {\n        return Promise.all(ret.result.map(r => rpc.getRawTransaction(r)))\n    })\n    .then(rawTxs => {\n        rawTxs.forEach(rawTx => {\n            console.log(`RawTX: ${rawTx.result}`);\n        })\n    })\n    .catch(err => {\n        console.log(err)\n    })\n```\n\nCallback based (legacy):\n\n```javascript\nvar run = function() {\n  var bitcore = require('@ecrypty/florijncoincore-lib');\n  var RpcClient = require('@ecrypty/florijncoind-rpc');\n  var rpc = new RpcClient(config);\n\n  var txids = [];\n\n  function showNewTransactions() {\n    rpc.getRawMemPool(function (err, ret) {\n      if (err) {\n        console.error(err);\n        return setTimeout(showNewTransactions, 10000);\n      }\n\n      function batchCall() {\n        ret.result.forEach(function (txid) {\n          if (txids.indexOf(txid) === -1) {\n            rpc.getRawTransaction(txid);\n          }\n        });\n      }\n\n      rpc.batch(batchCall, function(err, rawtxs) {\n        if (err) {\n          console.error(err);\n          return setTimeout(showNewTransactions, 10000);\n        }\n\n        rawtxs.map(function (rawtx) {\n          var tx = new bitcore.Transaction(rawtx.result);\n          console.log('\\n\\n\\n' + tx.id + ':', tx.toObject());\n        });\n\n        txids = ret.result;\n        setTimeout(showNewTransactions, 2500);\n      });\n    });\n  }\n\n  showNewTransactions();\n};\n```\n\n### Help\n\nYou can dynamically access to the help of each method by doing\n\n```\nconst RpcClient = require('@ecrypty/florijncoind-rpc');\nvar client = new RPCclient({\n    protocol:'http',\n    user: 'florijncoin',\n    pass: 'local321', \n    host: '127.0.0.1', \n    port: 8349\n});\n\nvar cb = function (err, data) {\n    console.log(data)\n};\n\n// Get full help\nclient.help(cb);\n\n// Get help of specific method\nclient.help('getinfo',cb);\n```\n\n## Contributing\n\nFeel free to dive in! [Open an issue](https://github.com/ecrypty/florijncoin-std-template/issues/new) or submit PRs.\n\n## License\n\n[MIT](LICENSE) &copy; Florijncoin Core Group, Inc.\n","readmeFilename":"README.md"}