{"_id":"@carnesen/bitcoin-rpc-href","_rev":"3-1b9702c17bf0592f35950928fdd6b138","name":"@carnesen/bitcoin-rpc-href","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.0":{"name":"@carnesen/bitcoin-rpc-href","description":"A Node.js library for reading the bitcoin RPC configuration","version":"0.0.0","main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=8.0.0"},"scripts":{"build":"tsc --project tsconfig.build.json","build:clean":"rimraf lib && npm run build","lint":"tslint --project tsconfig.build.json","lint:fix":"npm run lint -- --fix","test":"npm run lint && npm run test:unit && npm run build","test:unit":"jest --coverage src","test:watch":"npm run test:unit -- --watch","preversion":"npm test && npm run build:clean","postversion":"npm publish"},"dependencies":{"@carnesen/bitcoin-config":"0.0.3","@carnesen/coded-error":"0.1.0"},"devDependencies":{"@carnesen/tsconfig":"0.1.0","@carnesen/tslint-config":"0.1.2","@types/jest":"24.0.0","@types/node":"10.12.24","@types/temp-write":"3.3.0","@types/tempy":"0.2.0","jest":"24.1.0","rimraf":"2.6.3","temp-write":"3.4.0","tempy":"0.2.1","ts-jest":"23.10.5","ts-node":"8.0.2","tslint":"5.12.1","typescript":"3.3.3"},"keywords":["bitcoin","typescript","rpc","bitcoin-rpc-href","bitcoind-rpc"],"author":{"name":"Chris Arnesen","email":"chris.arnesen@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/carnesen/bitcoin-rpc-href.git"},"bugs":{"url":"https://github.com/carnesen/bitcoin-rpc-href/issues"},"homepage":"https://github.com/carnesen/bitcoin-rpc-href","license":"MIT","gitHead":"ccbc1e0e8eac1d285e51ad4e65f819c6547a331b","_id":"@carnesen/bitcoin-rpc-href@0.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"carnesen","email":"chris.arnesen@gmail.com"},"dist":{"integrity":"sha512-HSUSkuj+k5Rn8yJj5sSuF0xdO+Nj0EuTJac58uMny7y1NlT9+oiivfMPGCB2u+ftCuaoz1Aonwh4IEFJY0/7RA==","shasum":"4849b691f4c4a074642c30bc82c185587f8c28e1","tarball":"https://registry.npmjs.org/@carnesen/bitcoin-rpc-href/-/bitcoin-rpc-href-0.0.0.tgz","fileCount":23,"unpackedSize":32605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcaQkMCRA9TVsSAnZWagAAyd4P/isda687y6c7l9i0VvF2\ngay1GZUv3lcGxcpMn72oNNo7BfzHE1GdV22FLdby1W/be8oVSePRGqrbwURO\nbzBa27zuWpxZmeSJl0GMDXBt9MeIU5UaNFDDNkfwf9owou2UKOTdfuTSSnCT\nJE7Z/aRBlfH5dwvWtcEnOH/uQCRwYd4bNvAs0L+n9o7fwOLnOYHDetOfzuDX\nmbeY+MIOlYYQvaxImSvf7ODlPefoIFZGiIZtwK+iiLY5HWwMXjZQP1pqckEA\nPIhYinYHT2AYObZRiaepGeEohDq2Sgz+UYxIRFGhdBS1I9CZWJk69qcd/nXt\ngcAIe5RHMEIZKWiWEV065bPD1mOZlboIqxHUBAc7yKBhH9t+97jh1H50Lkxf\nlSs70R5y7mVvrfibKWhjoAmAM9wLI+MgrVj9mMpzL3smw09+4EmMgw8GQ0/Y\nAiZj9CrASIRLnrmrnZWD/bqdnlNe29Ue8tHzp/i/H6SHBqUcHXcok/tfx21F\naZGXWxAZ7TRQzRRNB+Bqtb8hn+y9tOS9GB05o426DGIfZ4a5zrY/4ttzFpJl\nr/1mjFAuYMn9zrlZ+yqDGlqyZ0U0s23gV6OVf9m624zKfHM/8KnJ+8aHrxTp\nYAlQsSOLgytPlXNrEe2tGuXSAxuKXn8VhkJzzgo+OsZqVv6rTevu8F+Vdstn\nL7hD\r\n=kC/A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC39RVZhLrdR1HW5XO6wb9LaNh/yEbx5Km0zzhAiD5/nAiEAvAkBsxJmeTalDvyekSpYly4UGaRCUk5UJfDL5/ekiTo="}]},"maintainers":[{"name":"carnesen","email":"chris.arnesen@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bitcoin-rpc-href_0.0.0_1550387468234_0.7863447617870685"},"_hasShrinkwrap":false,"deprecated":"This project has been abandoned"},"0.0.1":{"name":"@carnesen/bitcoin-rpc-href","description":"A Node.js library for reading the bitcoin RPC configuration","version":"0.0.1","main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=8.0.0"},"scripts":{"build":"tsc --project tsconfig.build.json","build:watch":"tsc --watch","build:clean":"rimraf lib && npm run build","lint":"tslint --project tsconfig.build.json","lint:fix":"npm run lint -- --fix","test":"npm run lint && npm run test:unit && npm run build","test:unit":"jest --coverage src","test:watch":"npm run test:unit -- --watch","preversion":"npm test && npm run build:clean","postversion":"npm publish"},"dependencies":{"@carnesen/bitcoin-config":"0.0.3","@carnesen/coded-error":"0.1.0"},"devDependencies":{"@carnesen/tsconfig":"0.1.0","@carnesen/tslint-config":"0.1.2","@types/jest":"24.0.0","@types/node":"10.12.24","@types/temp-write":"3.3.0","@types/tempy":"0.2.0","jest":"24.1.0","rimraf":"2.6.3","temp-write":"3.4.0","tempy":"0.2.1","ts-jest":"23.10.5","ts-node":"8.0.2","tslint":"5.12.1","typescript":"3.3.3"},"keywords":["bitcoin","typescript","rpc","bitcoin-rpc-href","bitcoind-rpc"],"author":{"name":"Chris Arnesen","email":"chris.arnesen@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/carnesen/bitcoin-rpc-href.git"},"bugs":{"url":"https://github.com/carnesen/bitcoin-rpc-href/issues"},"homepage":"https://github.com/carnesen/bitcoin-rpc-href","license":"MIT","gitHead":"27fd29c6e4705c4c370c23eed2453ff7491e1734","_id":"@carnesen/bitcoin-rpc-href@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"carnesen","email":"chris.arnesen@gmail.com"},"dist":{"integrity":"sha512-q+aZ2Tjpt1KRclJaqiCf5UVm+K6qv3KYnArzbKr/zC5xBg2fZZ5Q7EmBzEUQQQAGtOqJm2TtPTw9Xq7gDTS2Uw==","shasum":"6d51f136cd59ee844b6004ae858b6b46272c0498","tarball":"https://registry.npmjs.org/@carnesen/bitcoin-rpc-href/-/bitcoin-rpc-href-0.0.1.tgz","fileCount":23,"unpackedSize":32875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcaRzkCRA9TVsSAnZWagAAuyQQAI1NZYfsK+DnckOefn2/\ndYbWocPgOr0pG//RZXeg5k9YrXL5ns/qJPN6XScZ5/g/YIIFtfrLVwZ6z3ed\n1vsIyTfsWXJO1ChdCjwvmS98VY4Yew3FH64y6F9jcRuCdbx4MysFyosDeno1\ntTJXkEnob4iDRgfxmBxSW12e8cCyltgEc7Xb5Nne3B8AkZ4ISwXF2GgcqJ4f\nIMvlYvWEpfDtBSy3S8ce6nVFPdZR2ojP5ESJ4IFtXdAT/enMv5e30gqjcTAx\n1791BynfBFf4zKve/JX1sHfbuMmrCNvcus2iuGlm11V3+ffDjErQJcFzbYwl\nOZcDHC4TU770kgaMBhBAyMvJI9/ozzeWZwELHrP69w0PYoAM2S9Spxn2K6P6\n95Djy4UixjTpn+pN8VsOsdGZVRfQ0A6rPAjXQ64hStOgg0KLbjlzZSUziz3H\nMqjMwG3PozKM7qXepfsyqyDDCb1hD3DieUJeeyqTLYRQHRnPXPB6Q6wtTEfO\nG3bgmlvO3UW65XxZHsn3/2nbF4ONyxBdO+U80LrA2fmeemvEfSPAbR8p4F/A\neBUKdSzCuTQYOoRiCCDOEzmUWVjwW2u4ikzubhsnEvKZlTvut2gaHsWrOKoM\nXcio00VFTGNAk5ZHjpUmUY9yJs/QV5E8RSA4M23VGjtTAOJDKQbh2fDTzUmU\nYcw3\r\n=fAc0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFYq+ZXzlH5P2w30yqJ3A2hhQMRoGS8diix6P76bCsdAiAR7SH5pU7MP6Rh3YC9FDjh5WjTKRm37uPs97wQiTghyg=="}]},"maintainers":[{"name":"carnesen","email":"chris.arnesen@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bitcoin-rpc-href_0.0.1_1550392547501_0.9576012531017357"},"_hasShrinkwrap":false,"deprecated":"This project has been abandoned"}},"time":{"created":"2019-02-17T07:11:08.057Z","0.0.0":"2019-02-17T07:11:08.399Z","modified":"2022-04-04T21:58:33.148Z","0.0.1":"2019-02-17T08:35:47.690Z"},"maintainers":[{"name":"carnesen","email":"chris.arnesen@gmail.com"}],"description":"A Node.js library for reading the bitcoin RPC configuration","homepage":"https://github.com/carnesen/bitcoin-rpc-href","keywords":["bitcoin","typescript","rpc","bitcoin-rpc-href","bitcoind-rpc"],"repository":{"type":"git","url":"git+https://github.com/carnesen/bitcoin-rpc-href.git"},"author":{"name":"Chris Arnesen","email":"chris.arnesen@gmail.com"},"bugs":{"url":"https://github.com/carnesen/bitcoin-rpc-href/issues"},"license":"MIT","readme":"# @carnesen/bitcoin-rpc-href [![npm version](https://badge.fury.io/js/%40carnesen%2Fbitcoin-rpc-href.svg)](https://badge.fury.io/js/%40carnesen%2Fbitcoin-rpc-href) [![Build Status](https://travis-ci.com/carnesen/bitcoin-rpc-href.svg?branch=master)](https://travis-ci.com/carnesen/bitcoin-rpc-href)\n\nA Node.js client for bitcoin's remote procedure call (RPC) interface. This package includes runtime JavaScript files suitable for Node.js >=8 as well as the corresponding TypeScript type declarations.\n\n## Usage\n\n```ts\nconst { readRpcHref } = require('@carnesen/bitcoin-rpc-href');\nconst { URL } = require('url');\n\nconst href = readRpcHref();\n// http://__cookie__:aaabbb@127.0.0.1:18443/\n\nconst url = new URL(href);\n// URL {\n//   href: 'http://__cookie__:aaabbb@127.0.0.1:18443/',\n//   origin: 'http://127.0.0.1:18443',\n//   protocol: 'http:',\n//   username: '__cookie__',\n//   password: 'aaabbb',\n//   host: '127.0.0.1:18443',\n//   hostname: '127.0.0.1',\n//   port: '18443',\n//   pathname: '/',\n//   search: '',\n//   searchParams: URLSearchParams {},\n//   hash: '' }\n```\n## API\n\n### `readRpcHref(configFilePath?): href`\nReads bitcoin configuration files to determine an \"href\" connection string for the RPC interface. The logic in this function is meant to reproduce as closely as possible that of the `bitcoin-cli` client that ships with the bitcoin server software. Among other things, if the configuration does not contain an `rpcpassword`, that means that \"cookie-based\" authentication is enabled. In that case `readRpcHref` reads the username and password from the `rpccookiefile` file written to `datadir` on startup.\n\n#### `configFilePath`\nOptional `string`. String path of a bitcoin configuration file. Default value is the platform-dependent location where bitcoin looks for its config file e.g. `~/.bitcoin/bitcoin.conf` on Linux.\n\n#### `href`\nA string of the form `http://<username>:<password>@<hostname>:<port>/` as defined by the [WHATWG URL](https://nodejs.org/api/url.html#url_the_whatwg_url_api) standard. The href can be passed to `createBitcoinRpc` to create an RPC client. \n\n## Related\n- [@carnesen/bitcoin-rpc](https://github.com/carnesen/bitcoin-rpc): A Node.js client for bitcoin's remote procedure call (RPC) interface\n- [@carnesen/bitcoin-config](https://github.com/carnesen/bitcoin-config): A Node.js library for bitcoin server software configuration\n- [@carnesen/bitcoin-service](https://github.com/carnesen/bitcoin-service): A Node.js library for managing the bitcoin service `bitcoind`\n- [@carnesen/bitcoin-software](https://github.com/carnesen/bitcoin-software): A Node.js library for installing bitcoin server software\n\n## License\n\nMIT © [Chris Arnesen](https://www.carnesen.com)\n","readmeFilename":"readme.md"}