Socket
Book a DemoInstallSign in
Socket

@hyperdivision/eth-transaction-tail

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperdivision/eth-transaction-tail

Tails transactions on the Ethereum blockchain

latest
Source
npmnpm
Version
4.5.2
Version published
Weekly downloads
28
Maintainers
4
Weekly downloads
 
Created
Source

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
})

FAQs

Package last updated on 02 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts