{"_id":"@digicat/ethereum-transaction-watcher","_rev":"10-a3c18125ded0692d698826384dec81ea","name":"@digicat/ethereum-transaction-watcher","description":"Watch transactions on a web3.js-compatible Ethereum network, providing callbacks for when receipts are received","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@digicat/ethereum-transaction-watcher","version":"1.0.0","description":"Watch transactions on a web3.js-compatible Ethereum network, providing callbacks for when receipts are received","main":"index.js","files":["index.js","lib"],"engines":{"node":">=8.6"},"scripts":{"coverage":"nyc npm test","lint":"as-i-preach","posttest":"as-i-preach","test":"ava"},"repository":{"type":"git","url":"git+https://github.com/CDECatapult/ethereum-transaction-watcher.git"},"author":{"name":"Digital Catapult","url":"https://www.digitalcatapultcentre.org.uk/"},"license":"Apache-2.0","bugs":{"url":"https://github.com/CDECatapult/ethereum-transaction-watcher/issues"},"homepage":"https://github.com/CDECatapult/ethereum-transaction-watcher#readme","keywords":["blockchain","transaction","ethereum","web3"],"dependencies":{"web3":"^0.19.1"},"devDependencies":{"@novemberborn/as-i-preach":"^10.1.0","ava":"^0.22.0","babel-plugin-syntax-object-rest-spread":"^6.13.0","codecov":"^2.3.1","ethereumjs-tx":"^1.3.3","ganache-core":"github:CDECatapult/ganache-core#64ee0a3d8d4f46020480f20eae335754b4fb9290","lolex":"^2.1.2","memdown":"^1.3.1","nyc":"^11.2.1","testdouble":"^3.2.6"},"ava":{"babel":{"plugins":["syntax-object-rest-spread"],"presets":["@ava/transform-test-files","@ava/stage-4"]}},"nyc":{"reporter":["html","lcov","text"]},"standard-engine":"@novemberborn/as-i-preach","gitHead":"31c69f04097886f324cd672e55732a55ad03c96c","_id":"@digicat/ethereum-transaction-watcher@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.7.0","_npmUser":{"name":"novemberborn","email":"mark@novemberborn.net"},"dist":{"integrity":"sha512-j35KFFhDeeWY+1IL3wmEmOcu959NKZ354FewjRInDEdKm0CVOl31JcNGK3lCd8LmEyn/pTocJAvk0pOT2O/cWg==","shasum":"52895866d4b592ed52f8cdf1193e0dccaa2844bf","tarball":"https://registry.npmjs.org/@digicat/ethereum-transaction-watcher/-/ethereum-transaction-watcher-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmFgWDj5TQJuj5Dkh0wPr/uoSmcfTtT383ds4WbA+UAwIgYO7xxraWg4+YJd3/60Rs+Fv6Qz232yBeLwYa4Tt+Bns="}]},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ethereum-transaction-watcher-1.0.0.tgz_1508253480434_0.2713044644333422"},"directories":{}}},"readme":"# @digicat/ethereum-transaction-watcher\n\nThis package can watch transactions on a\n[web3.js](https://github.com/ethereum/web3.js/)-compatible\n[Ethereum](https://ethereum.org/) network, providing callbacks for when receipts\nare received. Requires [Node.js](https://nodejs.org/en/) 8.6 or newer.\n\n## Usage\n\n```js\nconst TransactionWatcher = require('@digicat/ethereum-transaction-watcher')\n\nconst watcher = new TransactionWatcher({\n  ethereumNode: 'http://localhost:8545',\n  interval: 60000, // Interval on which we check for receipts. Default is 60s.\n\n  onError (err, token) {\n    // Called when an error occurred when getting a transaction receipt.\n    //\n    // Expected to be synchronous.\n  },\n\n  onReceipt (receipt, token) {\n    // Called when a transaction receipt is received for a transaction hash\n    // that's being watched.\n    //\n    // Can be asynchronous (if you return a promise). Won't interleave with\n    // other events.\n  },\n\n  wrapWeb3Error (err) {\n    // Allows for underlying Web3 errors to be wrapped in another Error class.\n    // By default returns the error as-is.\n    return err\n  }\n})\n\n// Start watching a new transaction hash. The `token` is provided in callbacks\n// as-is.\nwatcher.add({\n  hash: '0xe9d7d2bc7b98b1e5090b9363453836ab89b290415e997acb8d773e4f46440c09',\n  token: {\n    an: {\n      arbitrary: 'object'\n    }\n  }\n})\n\n// Stop watching all transactions.\nwatcher.stop()\n```\n","maintainers":[{"email":"it-ops@digicatapult.org.uk","name":"digiops"},{"email":"david.blane@digicatapult.org.uk","name":"dhblane"},{"email":"matthew.dean@digicatapult.org.uk","name":"mattdean-digicatapult"}],"time":{"modified":"2022-06-30T11:12:56.640Z","created":"2017-10-17T15:18:01.350Z","1.0.0":"2017-10-17T15:18:01.350Z"},"homepage":"https://github.com/CDECatapult/ethereum-transaction-watcher#readme","keywords":["blockchain","transaction","ethereum","web3"],"repository":{"type":"git","url":"git+https://github.com/CDECatapult/ethereum-transaction-watcher.git"},"author":{"name":"Digital Catapult","url":"https://www.digitalcatapultcentre.org.uk/"},"bugs":{"url":"https://github.com/CDECatapult/ethereum-transaction-watcher/issues"},"license":"Apache-2.0","readmeFilename":"README.md"}