aleg94 / ethereum-events Goto Github PK
View Code? Open in Web Editor NEWEfficient and reliable event listener for Ethereum
License: MIT License
Efficient and reliable event listener for Ethereum
License: MIT License
When using this locally with a Hardhat network set to automine it was dropping logs.
Once I switched from automine to interval mining it began to work.
await network.provider.send("evm_setIntervalMining", [5000]);
Should this be included in the README? Would be happy to add it since this is the best event listener package I've seen.
https://hardhat.org/hardhat-network/explanation/mining-modes.html#using-rpc-methods
Hey there,
This package is excellent but I am worried it's not being maintained anymore, is it?
Is there a similar alternative?
ABIs do not need to be complete to be valid. There are reasons you might not want to make a full ABI public. In this case the parser simply fails into the error callback with cannot parse unknown event.
Listening for contract events, it works great on Avalanche, but on MAINNET & MATIC I receive this error:
`
maticEvents error Error: Cannot parse unknown event
at exports.parse (/Users/user-1/my-app/my-app-server/node_modules/eth-log-parser/lib/parser.js:10:11)
at /Users/user-1/my-app/my-app-server/node_modules/ethereum-events/lib/core/event-fetcher.js:33:14
at Array.map ()
at EventFetcher._parse (/Users/user-1/my-app/my-app-server/node_modules/ethereum-events/lib/core/event-fetcher.js:32:17)
at EventFetcher.getEvents (/Users/user-1/my-app/my-app-server/node_modules/ethereum-events/lib/core/event-fetcher.js:24:29)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at BlockPolling._poll (/Users/user-1/my-app/my-app-server/node_modules/ethereum-events/lib/core/block-polling.js:48:24)
maticEvents error Error: Cannot parse unknown event
at exports.parse (/Users/user-1/my-app/my-app-server/node_modules/eth-log-parser/lib/parser.js:10:11)
at /Users/user-1/my-app/my-app-server/node_modules/ethereum-events/lib/core/event-fetcher.js:33:14
at Array.map ()
at EventFetcher._parse (/Users/user-1/my-app/my-app-server/node_modules/ethereum-events/lib/core/event-fetcher.js:32:17)
at EventFetcher.getEvents (/Users/user-1/my-app/my-app-server/node_modules/ethereum-events/lib/core/event-fetcher.js:24:29)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at BlockPolling._poll (/Users/user-1/my-app/my-app-server/node_modules/ethereum-events/lib/core/block-polling.js:48:24)
`
{
"name": "server",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"engines": {
"node": "14.x"
},
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write "src//*.ts" "test//.ts" "libs/**/.ts"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint "{src,apps,libs,test}/**/.ts" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@ejhayes/nestjs-bullmq": "^1.0.6",
"@ethersproject/contracts": "^5.4.1",
"@ethersproject/providers": "^5.4.5",
"@ethersproject/solidity": "^5.4.0",
"@nestjs/axios": "0.0.3",
"@nestjs/cli": "^8.1.6",
"@nestjs/common": "^8.2.4",
"@nestjs/config": "^1.1.5",
"@nestjs/core": "^8.2.4",
"@nestjs/platform-express": "^8.2.4",
"@nestjs/schedule": "^1.0.2",
"@nestjs/swagger": "^5.1.5",
"@prisma/client": "^3.7.0",
"@zeroexchange/sdk": "^3.2.27",
"bullmq": "^1.62.0",
"cache-manager": "^3.6.0",
"cache-manager-ioredis": "^2.1.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"ethereum-events": "^0.1.3",
"ethers": "^5.5.1",
"firebase-admin": "^9.11.1",
"js-yaml": "^4.1.0",
"nest-winston": "^1.6.2",
"nestjs-config": "^1.4.8",
"numeral": "^2.0.6",
"path": "^0.12.7",
"redlock": "^5.0.0-beta.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.4.0",
"swagger-ui-express": "^4.3.0",
"web3": "3.0.0-rc.4",
"winston": "^3.3.3",
"winston-transport": "^4.4.1"
},
"devDependencies": {
"@nestjs/schematics": "^8.0.5",
"@nestjs/testing": "^7.0.0",
"@types/cache-manager-ioredis": "^2.0.2",
"@types/cron": "^1.7.3",
"@types/ethereum-events": "file:types/ethereum-events",
"@types/express": "^4.17.3",
"@types/jest": "25.1.4",
"@types/js-yaml": "^4.0.5",
"@types/node": "^13.9.1",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"jest": "^25.1.0",
"prettier": "^1.19.1",
"prisma": "^3.7.0",
"supertest": "^4.0.2",
"ts-jest": "25.2.1",
"ts-loader": "^6.2.1",
"ts-node": "^8.6.2",
"tsconfig-paths": "^3.9.0",
"typescript": "^4.5.4"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": ".",
"testRegex": ".spec.ts$",
"transform": {
"^.+\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "./coverage",
"testEnvironment": "node",
"roots": [
"/src/",
"/libs/"
],
"moduleNameMapper": {
"@app/warming/(.)": "/libs/warming/src/$1",
"@app/warming": "/libs/warming/src",
"@app/wallet/(.)": "/libs/wallet/src/$1",
"@app/wallet": "/libs/wallet/src",
"^@app/redis-cache(|/.)$": "/libs/redis-cache/src/$1",
"^@app/once(|/.)$": "/libs/once/src/$1",
"^@app/shared(|/.)$": "/libs/shared/src/$1",
"^@queue/wallet-sender(|/.)$": "/libs/queue/wallet-sender/src/$1",
"^@queue/wallet-consumer(|/.)$": "/libs/queue/wallet-consumer/src/$1",
"^@app/gecko(|/.*)$": "/libs/gecko/src/$1"
}
}
}
Hello, I'm using with good results ethereum-events, now i need to add to the watcher contracts on the fly.
I get created events from a factory and need to listen to those new contracts, is that possible?
i tried to add the contract to the array and stopping/restarting without any luck
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.