eth-transaction-tail
Tails transactions on the Ethereum blockchain
npm install @hyperdivision/eth-transaction-tail
Usage
const Tail = require('eth-transaction-tail')
const tail = new Tail(ipcUrl, {
confirmations: 10,
depositFactory: '0x...',
async depositDeployed (event) {
},
async filter (toAddr, erc20address) {
return isInterestingAddress(toAddr)
},
async transaction (transaction) {
console.log('found this transaction', transaction)
},
async deposit (event) {
console.log('found this deposit event')
},
async erc20 (event) {
console.log('found this erc20 transfer event')
}
async checkpoint (since) {
},
since: seq
})
await tail.start()
const head = await tail.head({
transaction (transaction) {
console.log('transaction with 0 confirms', transaction)
}
})
await head.start()
head.track(addr, function ontx (tx, confirms, blk) {
...
head.untrack(addr)
})