Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

opennetsys/c3-eos-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c3-eos-events

Watch for EOS contract events

Install

npm i c3-eos-events

Getting started

const { Watcher } = require('c3-eos-events')

const watcher = new Watcher({
  nodeUrl: 'http://localhost:8888'
})

watcher.watch({
  action: 'eosio.token::transfer',
  startingBlock: 0
}, (state, payload, blockInfo, context) => {
  console.info('State updated:\n', JSON.stringify(state, null, 2))
})

Output

State updated:
 {
  "volumeBySymbol": {
    "SYS": 25
  },
  "totalTransfers": 1,
  "indexState": {
    "blockNumber": 14050,
    "blockHash": "000036e27df46d701bb1d8f0ed04eec17f3812c9ec076ef4d48f4d1ce73191b6"
  }
}

License

GNU AGPL 3.0