{"_id":"spend","_rev":"3-1e69148ccc5bc4d373c4ea95df9f48c0","name":"spend","description":"Create simple Bitcoin / Testnet transactions for integration testing with the actual network.","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"spend","version":"0.0.1","description":"Create simple Bitcoin / Testnet transactions for integration testing with the actual network.","main":"lib/spend.js","scripts":{"test":"standard && mocha"},"repository":{"type":"git","url":"https://github.com/jprichardson/spend"},"keywords":["bitcoin","testnet","common blockchain","blockchain","crypto","currency","crypto","cryptography","currency","transaction","simple","spend"],"author":{"name":"JP Richardson"},"license":"MIT","bugs":{"url":"https://github.com/jprichardson/spend/issues"},"homepage":"https://github.com/jprichardson/spend","dependencies":{"coinkey":"^1.3.0","coinstring":"*","cointx":"^0.1.0","ecdsa":"^0.6.0"},"devDependencies":{"cb-insight":"^0.1.0"},"gitHead":"8b0d19f2abbb5b5e3e90a0954a5e7bb5575820d7","_id":"spend@0.0.1","_shasum":"2f992807595fd7007a861b4058164ea9df26a0be","_from":".","_npmVersion":"2.3.0","_nodeVersion":"0.10.32","_npmUser":{"name":"jprichardson","email":"jprichardson@gmail.com"},"maintainers":[{"name":"jprichardson","email":"jprichardson@gmail.com"}],"dist":{"shasum":"2f992807595fd7007a861b4058164ea9df26a0be","tarball":"https://registry.npmjs.org/spend/-/spend-0.0.1.tgz","integrity":"sha512-ZzTTN4isQRjiWj3PJTzgpiVjpEPBkWdhxLVeRFVWDGS4UdW6RhK7n7CTljAq7TJiU4HE6kQ+fU+EtfkJV+pLpw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPsAtqCceXZKEDfgVuCRIl3sE2z08Xt8+QNWDJ8d4H+wIhANEYP24CjkxRLEuKwlPijtl5EJKddeLMcEPfgp3qFZPL"}]}}},"readme":"Spend\n=====\n\nA JavaScript component to create simple Bitcoin / Testnet transactions for integration testing with\nthe actual network. Can be used in Node.js or the browser (via Browserify).\n\n\nInstall\n-------\n\n    npm i --save spend\n\n\nUsage\n-----\n\n### spend(fromWIF, toAddress, amount, [changeAddress], callback)\n\n- `fromWIF`: Private key with matching address that contains funds. Should be base58 check encoded `string`.\n- `toAddress`: Recipient address. Should be base58 encoded `string`.\n- `amount`: Amount in **satoshis**. Should be an integer. Either `number` or `string`.\n- `changeAddress`: Optional change address. If not specified, address calculated from `fromWIF` will be used.\n- `callback`: Callback with result. Signature: `(err, txId, rawTx)`. Where `txId` is a `string` representing\nthe transaction ID and `rawTx` is the transaction serialized as a `string`.\n\n\n### Common Blockchain\n\nCommon Blockchain is a unified way to access a blockchain via an API provider. i.e. it provides the same methods and\nnormalizes results no matter who the API provider is.\n\nYou'll need to bring your own [Common Blockchain](https://github.com/common-blockchain/common-blockchain) provider.\nHere's a list: https://github.com/common-blockchain/common-blockchain/issues/21\n\n\n**Example:**\n\n```js\nvar Blockchain = require('cb-insight') // npm i --save cb-insight\nvar spend = require('spend')\n\n// set common blockchain provider\nspend.blockchain = new Blockchain('https://test-insight.bitpay.com')\n\nvar fromWIF = '...'\nvar toAddress = '...'\nvar amountSatoshis = 500000\n\nspend(fromWIF, toAddress, amountSatoshis, function (err, txId) {\n  // use txId to track transaction\n  console.log(txId)\n})\n```\n\n### Limitations\n\n- fixed fee\n- bitcoin/testnet only at the moment\n- simplified outputs (may change to allow additional like `OP_RETURN`)\n- merges all UTXOs\n\n\nBitcoin Testnet Faucets\n-----------------------\n\nYou'll want some Bitcoin Testnet coins to test your applications. You can get them from any\nof the following faucets:\n\n- http://tpfaucet.appspot.com/\n- http://faucet.luis.im/\n- http://testnet.bitcoin.peercoinfaucet.com/\n- https://testnet.coinfaucet.eu/en/\n- http://faucet.haskoin.com/\n\n\nTest Spending\n-------------\n\nWanna test spending these coins? Checkout the [Coinbolt Cat Shop](https://www.coinbolt.com/catshop/) to\ntest your bitcoin applications by buying fake cats that share economic wisdom.\n\n\nLicense\n-------\n\nMIT\n\n","maintainers":[{"name":"jprichardson","email":"jprichardson@gmail.com"}],"time":{"modified":"2022-06-26T22:48:14.396Z","created":"2015-04-20T00:52:14.193Z","0.0.1":"2015-04-20T00:52:14.193Z"},"homepage":"https://github.com/jprichardson/spend","keywords":["bitcoin","testnet","common blockchain","blockchain","crypto","currency","crypto","cryptography","currency","transaction","simple","spend"],"repository":{"type":"git","url":"https://github.com/jprichardson/spend"},"author":{"name":"JP Richardson"},"bugs":{"url":"https://github.com/jprichardson/spend/issues"},"license":"MIT","readmeFilename":"README.md"}