@hyperdivision/eth-transaction-tail
Tails transactions on the Ethereum blockchain
Last updated 11 days ago by mafintosh .
UNLICENSED · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @hyperdivision/eth-transaction-tail 
SYNC missed versions from official npm registry.

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, // require this many confirmations
  depositFactory: '0x...',
  async depositDeployed (event) {
    // deposit is deployed
  },
  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) {
    // store this since so you can restart from here
  },
  since: seq
})

// tail.index is the current block index
await tail.start() // start tailing, will throw if an error is hit

const head = await tail.head({
  transaction (transaction) {
    console.log('transaction with 0 confirms', transaction)
  }
})

await head.start()

// only track txs on a specific addr
head.track(addr, function ontx (tx, confirms, blk) {
  ...
  head.untrack(addr) // to stop
})

Current Tags

  • 4.3.0                                ...           latest (11 days ago)

22 Versions

  • 4.3.0                                ...           11 days ago
  • 4.2.1                                ...           a month ago
  • 4.2.0                                ...           a month ago
  • 4.1.0                                ...           8 months ago
  • 4.0.5                                ...           8 months ago
  • 4.0.4                                ...           8 months ago
  • 4.0.3                                ...           8 months ago
  • 4.0.2                                ...           8 months ago
  • 4.0.1                                ...           8 months ago
  • 4.0.0                                ...           9 months ago
  • 3.1.3                                ...           9 months ago
  • 3.1.2                                ...           9 months ago
  • 3.1.1                                ...           9 months ago
  • 3.1.0                                ...           9 months ago
  • 3.0.3                                ...           9 months ago
  • 3.0.2                                ...           9 months ago
  • 3.0.1                                ...           9 months ago
  • 3.0.0                                ...           9 months ago
  • 2.1.0                                ...           9 months ago
  • 2.0.0                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 27
Last Day 0
Last Week 0
Last Month 21
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |