{"_id":"accept-bitcoin","_rev":"25-35f0fe6b98d297ec5bf757012d0e1211","name":"accept-bitcoin","time":{"modified":"2022-06-13T02:21:08.467Z","created":"2014-09-10T07:28:48.345Z","0.0.1":"2014-09-10T07:28:48.345Z","0.0.2":"2014-09-10T07:54:00.795Z","0.0.3":"2014-09-10T08:00:33.566Z","0.0.4":"2014-09-10T08:04:29.002Z","0.0.5":"2014-09-10T08:09:59.988Z","0.0.6":"2014-09-10T08:20:42.348Z","0.0.7":"2014-09-10T08:43:19.192Z","0.0.8":"2014-09-16T22:33:39.499Z","0.0.9":"2014-09-16T22:39:07.338Z"},"maintainers":[{"name":"sagivo","email":"sagiv4@gmail.com"}],"dist-tags":{"latest":"0.0.9"},"description":"accept bitcoins on your projects","readme":"#Accept Bitcoin\n\nFinally a developer-friendly tool to simply accept bitcoins in your site. \n\n  - Lite and fast, built on top of [bitcore](http://bitcore.io).\n  - No need to install local bitcoin node RPC client. We use [blockr](http://blockr.io) API instead.\n  - No need to install any wallet client. \n  - Create ad-hoc address to accept bitcoins and transfer incomes to your offline account.\n  - Easy configurations.\n\n\n##Get Started\n\nSimply install via [npm](https://npmjs.org/):\n\n```javascript\nnpm install accept-bitcoin\n```\nLoad AC and you're ready to go!\n```javascript\nvar acceptBitcoin = require('accept-bitcoin');\nvar ac = new acceptBitcoin('YOUR_BITCOIN_ADDRESS');\n```\n\n##Motivation \nAccepting bitcoins online can be complex to program and require you to install a bitcoin RPC client in order to read and write to the blockchain. This client require a lot of resources (in terms of CPU, networking and storage).  \nMost of the users are using a wallet to store their bitcoins. This wallet is a simple way to secure your public and private key. For security reasons you better save this wallet offline in a \"cold storage\".  \nMore about the motivation behind this project at [my blog post](http://sagivo.com/post/97125970778/bitcoin-on-node-js-do-it-yourself).\n\n##Example\nYou can override the default settings on creating\n\nExamples are provided [here](https://github.com/sagivo/accept-bitcoin/tree/master/examples)\n```javascript\nvar settings = {network: 'live'}\nvar acceptBitcoin = require('accept-bitcoin');\nvar ac = new acceptBitcoin('YOUR_BITCOIN_ADDRESS', settings);\nkey = ac.generateAddress({alertWhenHasBalance: true});\nconsole.log(\"Hello buyer! please pay to: \" + key.address());\nkey.on('hasBalance', function(amount){\n  console.log(\"thanks for paying me \" + amount); //do stuff\n  key.transferBalanceToMyAccount(function(err, d){\n    if (d.status === 'success') console.log(\"Cool, the bitcoins are in my private account!\");\n  });\n});\n```\n\n##Settings\n\nYou can override the default settings:  \n\n| name                    | type   | default value                | comment                                                                                                                                                                 |\n|-------------------------|--------|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `payToAddress`          | string | -                            | Your bitcoin adress you wish to transfer incomes to.                                                                                                                    |\n| `network`               | string | test                         | choose your bitcoin RPC env. values are: `test` and `live`more info [here](https://github.com/bitpay/bitcore/blob/cd353ac02e76fb3294c40366d8d5dc04ce1939d7/networks.js) |\n| `password`              | string | -                            | choose your random password to encrypt generated keys.                                                                                                                  |\n| `storePath`             | string | `./keys.txt`                 | path to store a file containing all the ad-hoc generated keys.                                                                                                          |\n| `encryptPrivateKey`     | bool   | false                        | in case you want the stored keys to be encrypted (using `password`).                                                                                                    |\n| `payReminderToAddress`  | string | payToAddress                 | In case transfer amount is smaller than income and fees.                                                                                                                |\n| `includeUnconfirmed`    | bool   | false                        | include unconfirmed transactions when checking for unspent incomes                                                                                                      |\n| `checkTransactionEvery` | int    | 1000 * 60 * 2  (2 minutes)   | how often (in millisecond) to ping the network when checking for transactions.                                                                                          |\n| `checkBalanceTimeout`   | int    | 1000 * 60 * 60 * 2 (2 hours) | timeout (in millisecond) when checking balance of an address.                                                                                                           |\n| `checkUnspentTimeout`   | int    | 1000 * 60 * 60 * 2 (2 hours) | timeout (in millisecond) when checking unspent transactions of an address.                                                                                              |\n| `minimumConfirmations`  | int    | 6                            | minimum confirmations needed in order to trigger `hasBalance` event.                                                                                                    |\n| `txFee`                 | float  | 0.0001                       | fee (in bitcoin) for transferring amount from ad hoc address to your address.                                                                                           |\n\n###Key class\nThis class is responsible for creating new bitcoin addresses, storing them and transferring funds between them. Some key functions are:  \n`storeKey(wk)` - store your key in a local file. Can be encrypted.  \n`checkBalance()`- check and notify you when an address has minimum balance.\n`payTo(payToAddress, options, callback)` - transfer all balance of this address to another address.\n\n###Encrypt class\nContains helpers to encrypt and decrypt strings. Used for storing your keys data locally.  \n\n##Contribute\nPlease do. Fork it, star it, share it and add your code to the project. Help others.  \nAll the src code is written in [coffeescript](http://coffeescript.org) and is under `src`. There's a tool that convert it automatically to js each time you change a file and put it under `lib` folder. Simply run `cake build` for that. \n\n##License\n\nMIT","versions":{"0.0.6":{"name":"accept-bitcoin","version":"0.0.6","description":"accept bitcoins on your projects","main":"lib/javascript/index.js","repository":{"type":"git","url":"https://github.com/sagivo/accept-bitcoin"},"devDependencies":{"coffee-script":">= 1.3"},"keywords":["node","accept-bitcoin","bitcoin"],"engines":{"node":">= 0.8.0"},"author":{"name":"sagiv ofek"},"license":{"type":"MIT","url":"http://github.com/assaf/zombie/blob/master/MIT-LICENSE"},"dependencies":{"bitcore":"*","request":"*"},"gitHead":"fdc3130eb60fd1bda1228b493046fb1b6e110827","bugs":{"url":"https://github.com/sagivo/accept-bitcoin/issues"},"homepage":"https://github.com/sagivo/accept-bitcoin","_id":"accept-bitcoin@0.0.6","scripts":{},"_shasum":"a5b2c98679ec0ff2a20ccebd998462a9289ca31f","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"sagivo","email":"sagiv4@gmail.com"},"maintainers":[{"name":"sagivo","email":"sagiv4@gmail.com"}],"dist":{"shasum":"a5b2c98679ec0ff2a20ccebd998462a9289ca31f","tarball":"https://registry.npmjs.org/accept-bitcoin/-/accept-bitcoin-0.0.6.tgz","integrity":"sha512-uiEYgXdfSNRuY4mLCjgMB757mwA0J+RJQBhph8eANSwmj0+bib3LGKY+q2D/hKm5z7mhQIp33thu2f5wSLuZHw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFcuV3zIWFJDzxQgoIur4ALgVVyWgitERKROY45jHnBaAiAI0DJcOW+ZM/6cW1TXz/GUIbq/3eRLeCFONay8NQR/cw=="}]}},"0.0.7":{"name":"accept-bitcoin","version":"0.0.7","description":"accept bitcoins on your projects","main":"lib/javascript/index.js","repository":{"type":"git","url":"https://github.com/sagivo/accept-bitcoin"},"devDependencies":{"coffee-script":">= 1.3"},"keywords":["node","accept-bitcoin","bitcoin"],"engines":{"node":">= 0.8.0"},"author":{"name":"sagiv ofek"},"license":{"type":"MIT","url":"http://github.com/assaf/zombie/blob/master/MIT-LICENSE"},"dependencies":{"bitcore":"*","request":"*"},"gitHead":"89a571d34121f58d34ef3ccb14a3a05e4f741534","bugs":{"url":"https://github.com/sagivo/accept-bitcoin/issues"},"homepage":"https://github.com/sagivo/accept-bitcoin","_id":"accept-bitcoin@0.0.7","scripts":{},"_shasum":"71ecb4a1cba3d856c278689f2c650fd8ee88bdb4","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"sagivo","email":"sagiv4@gmail.com"},"maintainers":[{"name":"sagivo","email":"sagiv4@gmail.com"}],"dist":{"shasum":"71ecb4a1cba3d856c278689f2c650fd8ee88bdb4","tarball":"https://registry.npmjs.org/accept-bitcoin/-/accept-bitcoin-0.0.7.tgz","integrity":"sha512-RPSNMSgNHhN2zUusBV/oqyug1ph1LUugohBy6FPIyCl0a5/LZGnGPNFyMxH1zgMhinN6rzZZTNe3a+nQ5sNZww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFB2KaiHuinID0+rkik4sX/whvAvTJndHY1Pcrx3ewgBAiBRO1bPcvuOoq5OggicXo+m6qQu2+Dan0qXrD+ACPe4YQ=="}]}},"0.0.8":{"name":"accept-bitcoin","version":"0.0.8","description":"accept bitcoins on your projects","main":"lib/javascript/index.js","repository":{"type":"git","url":"https://github.com/sagivo/accept-bitcoin"},"devDependencies":{"coffee-script":">= 1.3"},"keywords":["node","accept-bitcoin","bitcoin"],"engines":{"node":">= 0.8.0"},"author":{"name":"sagiv ofek"},"license":{"type":"MIT","url":"http://github.com/assaf/zombie/blob/master/MIT-LICENSE"},"dependencies":{"bitcore":"*","request":"*"},"gitHead":"2ce3f11ff73060a38f126c4268894476b1c29ae9","bugs":{"url":"https://github.com/sagivo/accept-bitcoin/issues"},"homepage":"https://github.com/sagivo/accept-bitcoin","_id":"accept-bitcoin@0.0.8","scripts":{},"_shasum":"cf5b92243fecee338c2fbf4bf080a0a4d1767d8a","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"sagivo","email":"sagiv4@gmail.com"},"maintainers":[{"name":"sagivo","email":"sagiv4@gmail.com"}],"dist":{"shasum":"cf5b92243fecee338c2fbf4bf080a0a4d1767d8a","tarball":"https://registry.npmjs.org/accept-bitcoin/-/accept-bitcoin-0.0.8.tgz","integrity":"sha512-6TJ/xV7qqXwiHBsLJRUMs20ORS1hvbS/grlMBjm4JZr/t+JksRNMDWB14DgPEr+mo6TODe7E4PGDHmZYL1cJNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDlYGC4+lUnU3bPwOPPX8+usjbNt/Pvh4D9rNrh+NRIGAiBdxiOA8CxVmcbWkBoYtb8sU7rza/ANk2IJwl84XLDFSg=="}]}},"0.0.9":{"name":"accept-bitcoin","version":"0.0.9","description":"accept bitcoins on your projects","main":"lib/index.js","repository":{"type":"git","url":"https://github.com/sagivo/accept-bitcoin"},"devDependencies":{"coffee-script":">= 1.3"},"keywords":["node","accept-bitcoin","bitcoin"],"engines":{"node":">= 0.8.0"},"author":{"name":"sagiv ofek"},"license":{"type":"MIT","url":"http://github.com/assaf/zombie/blob/master/MIT-LICENSE"},"dependencies":{"bitcore":"*","request":"*"},"gitHead":"d1f29c686b6a0ac060bdd550c475def1d1bc20a2","bugs":{"url":"https://github.com/sagivo/accept-bitcoin/issues"},"homepage":"https://github.com/sagivo/accept-bitcoin","_id":"accept-bitcoin@0.0.9","scripts":{},"_shasum":"7cbec570853a532b4bbe6e27b6df68da5cbf21eb","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"sagivo","email":"sagiv4@gmail.com"},"maintainers":[{"name":"sagivo","email":"sagiv4@gmail.com"}],"dist":{"shasum":"7cbec570853a532b4bbe6e27b6df68da5cbf21eb","tarball":"https://registry.npmjs.org/accept-bitcoin/-/accept-bitcoin-0.0.9.tgz","integrity":"sha512-5eLIrj9ZBcFBtHHf0z4g6MAIE5U6FnD4lOnLJfTm2+kPHr1S0+bjhHgIcuGm767C4EiHqDBBXd5Hu6WWzE91qg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLJmpZ3lPMgAUMjvtlwaWoYASbGS9y9grgIvUY/8cC3AiBtTV/bUl4CRrviuJZUPZpWfBaSXh4Pnieapw4S+3prpw=="}]}}},"homepage":"https://github.com/sagivo/accept-bitcoin","keywords":["node","accept-bitcoin","bitcoin"],"repository":{"type":"git","url":"https://github.com/sagivo/accept-bitcoin"},"author":{"name":"sagiv ofek"},"bugs":{"url":"https://github.com/sagivo/accept-bitcoin/issues"},"license":{"type":"MIT","url":"http://github.com/assaf/zombie/blob/master/MIT-LICENSE"},"readmeFilename":"README.md","users":{"sagivo":true,"bigchirv":true,"bhdrgkz":true}}