Questions tagged [filters]

filter for the logs fired by contract's events

Filter by
Sorted by
Tagged with
0 votes
1 answer
78 views

How Can I Filter Ethereum Transactions by Method ID or Name, Similar to Etherscan's Advanced Filter Feature

I am working on a project where I need to retrieve all transactions associated with a specific method within a given block or set of blocks. As an example, Etherscan provides this functionality ...
Daniel Kotlarov's user avatar
0 votes
0 answers
55 views

How can I subscribe pending transaction which are filtered by 'to' address?

I tried to subscribe pending transactions by using ethers.js and the code is below. subscription = provider.on("pending", (txHash) => { if (!onRunning) { processTx(txHash); } }); But when ...
Michael Anderson's user avatar
1 vote
1 answer
88 views

FilterException when creating an EthFilter in web3j

I'm using web3j to create a filter to listen to events. Specifically, I want to listen to events of a specific contract between a certain block number and now. This is my code: Web3j web3j = ... ...
Michael's user avatar
  • 225
0 votes
2 answers
332 views

etheresjs contract.on filter

How to use ethersjs contract.on filter... does this connection dies when refresh ? should i start new filter again ?? i have event like NewEvent(address useraddress,uint somenumber,string somestring) ...
heustfd gehsgd's user avatar
0 votes
1 answer
113 views

How to get events pushed instead of polling in Ethereum?

I am trying to see how I can subscribe to an events on the Ethereum blockchain and I can only see polling mechanism and no push mechansim I am look at the documentation for the JSON RPC endpoints here ...
Finlay Weber's user avatar
0 votes
1 answer
834 views

How can I efficiently watch for new ERC20 contracts deployed?

I am wanting to listen for new contracts deployed and monitor specific events within these contracts. The method I am currently using to retrieve newly deployed contracts is very long-winded and not ...
qoze's user avatar
  • 3
0 votes
0 answers
9 views

eth_newFilter filter changes ID?

so, I am building a filter based on e.g. the following data (in python): filter_params = { 'fromBlock': 'latest', 'topics': [['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef']], '...
user19976975's user avatar
0 votes
0 answers
363 views

Filter logs for a specific address in several topics

I am interested in getting all the Transfer events for a specific address meaning all Transfer events where the from OR to address is this specific address. From my understanding of the docs the ...
Sydney's user avatar
  • 101
0 votes
1 answer
164 views

Websocket Connection With Filter Returns No Messages

I am trying to listen on a websocket connection to an optimism node for specific events on a specific contract. I am getting the message back that I am connected to the node, but even though I see ...
Alkhara's user avatar
  • 16
1 vote
2 answers
60 views

How Do I Find Matching Ethereum Transactions Based On The Amount Of Ethereum Sent?

I am trying to locate a specific transaction on the Ethereum blockchain. I know the approximate amount which was sent, and that it was sent in 2019. I do not know the from address, to address, hash, ...
azoundria's user avatar
  • 121
1 vote
0 answers
250 views

How to include multiple addresses in filter of ether.js?

I want to use provider.on() function of ethers.js to listen to the Transfer event of contracts. My filter looks like this: let filter = { address: tokenAddress, topics: [ ...
Emily Li's user avatar
1 vote
0 answers
318 views

How to run a multithread and async loop in Web3.py to monitor the same event on multiple smart contracts?

I am trying to monitor similar events on different (>=2) Ethereum contracts in web3.py. In the code below I try to monitor the Transfer event on wETH and wBTC smart contracts. Since create filter ...
naoufel eth's user avatar
1 vote
1 answer
881 views

Ethers.js: How can I limit the amount of results I get when using queryFilter?

I'm aware I can limit the results by utilizing fromBlock[,toBlock]. But I have no way of knowing which blocks held the event. Is there any way to just get the last n results without referencing blocks?...
Ryan Sea's user avatar
  • 598
1 vote
2 answers
694 views

Web3py - Getting pending TX's?

Is there any way to get pending transaction for a specified address? I can get all pending transactions for current pending block but I can't filter them. I can do: txHashPending = w3.eth.filter('...
James's user avatar
  • 11
1 vote
1 answer
598 views

how can I categorize the transactions based on the method they call to transfer and non-transfer transactions using web3?

Blockchain explorers show "transfer" instead of the method id for some of the transactions on their list, so there should be a way to filter transactions based on the method they call. How ...
Azee's user avatar
  • 145
2 votes
1 answer
729 views

web3.py " filter not found "

im using web3.py v5.19 in my project and we are on BSC mainnet also i use bsc urls recommended in site to connect to nodes this is my code to get events : block_filter1 = contract.events....
vahidodin moghimi's user avatar
0 votes
0 answers
2k views

Filter event ethers.js sample code not working

I've been trying to follow the Listening to Events sample code and make a filter that detects when a specific address receives BUSD instead of DAI. However, it doesn't seem to do any filtering and ...
vlj614's user avatar
  • 366
1 vote
0 answers
353 views

Enhancing geth subscription processing to be able to work with transaction data

I'm thinking to have a geth "extension" that would be working with a Geth subscriptions. I would like to filter over pending transactions. When I'm searching in the code I can see that I can ...
chalda's user avatar
  • 111
0 votes
1 answer
160 views

Is there a way to filter token contracts based on whether they contain certain code?

Basically if I had a list of 500 token contracts instead of manually going and reading through each token contract, is there a quick and easy function (such as an RPC call method) that checks if the ...
user481575's user avatar
0 votes
1 answer
218 views

Can you filter an indexed event parameters?

Can you filter an indexed event parameters? Does indexing make filtering more efficient or does indexing make filtering possible?
YulePale's user avatar
  • 1,783
4 votes
1 answer
4k views

Is there any way to get pending transaction for specified address?

is there any way to get pending transaction for a specified address? I can filter them on bscscan here, but I can't do the same in my web3py code. I can get all pending transaction for current pending ...
Kacper's user avatar
  • 41
0 votes
1 answer
2k views

Monitoring pending transactions with Go

I'm trying to write a program in Go to watch pending transactions, using a geth full node that I'm connected to over websockets. I'm pretty sure I have to use the github.com/ethereum/go-ethereum/eth/...
boston's user avatar
  • 23
0 votes
1 answer
1k views

How can I view pending events, without much delay?

I can view pending events like so: pending_events_filter = my_contract.events.TestEvent.createFilter(fromBlock='pending', toBlock='pending') pending_events_filter.get_new_entries() But the events are ...
abtree's user avatar
  • 141
2 votes
0 answers
363 views

Can not run more than 1 event in Infura

I am trying to listening to many events from infura but it is not working. Only one filter work, when I add the second filter, this message appear: RuntimeError: cannot call recv while another ...
Yamjan's user avatar
  • 21
1 vote
2 answers
3k views

web3js getPastLogs function returns error: query returned more than 10000 results

I have a local ethereum node and I am trying to filter an event for a contract address between a range of blocks. However it throws the following error: node:15689) UnhandledPromiseRejectionWarning: ...
mzaidi's user avatar
  • 972
1 vote
1 answer
681 views

Infura getFilterLogs api returns empty array

I am trying to filter transfer events using node.js for a contract address between a range of blocks. I am trying to filter the latest 7 transactions which can be shown in etherscan here. My code is ...
mzaidi's user avatar
  • 972
0 votes
1 answer
2k views

'Contract' object has no attribute 'eventFilter' web3.py

I am trying to filter Transfer events from my local ethereum node using web3 py. I have created a venv in visual studio code. My code is as follows: def decodeLogswithfilter(t1, t2, abi1, addr): ...
mzaidi's user avatar
  • 972
0 votes
0 answers
82 views

get statistics by event filters or normal blockchain traversal

I want to ask what's the better approach among the following two: Filter events using address.eventFilter function or traversing the local blockchain block by block and getting events statistics. I ...
mzaidi's user avatar
  • 972
0 votes
1 answer
1k views

Unable to filter events with specific values of indexed parameters

I am currently trying to test a smart contract using the truffle suit ( with 'truffle test'). My contract is of a simple ERC20 token which includes the standard Transfer event: event Transfer(address ...
Aleksi Daskalov's user avatar
1 vote
0 answers
462 views

How does function getPastEvents works? It's too quick

I'm trying to understand how .getPastEvents function works. When given block range to search is {fromBlock:0, toBlock: 'latest'} it finds my events almost instantaneously. Shouldn't filtering all 7M ...
JuztBe's user avatar
  • 41
1 vote
2 answers
4k views

Filters object not working for web3.eth.contract getPastEvents() method

I have referred, Web3 Events, but filters object is not working for me, I've got the same result for events before and after applying filter object. Here's the code: instance.getPastEvents( "...
Rudrika's user avatar
  • 407
1 vote
1 answer
2k views

How to use eth_newFilter to get pending incoming transactions to a contract?

I'm trying to get pending transactions to a certain contract using Infura. Is it possible to do that using eth_newFilter? Since apparently these filters only "trigger" from contract events, does that ...
Mylolmania's user avatar
2 votes
1 answer
471 views

NEthereum, Number of indexes don't match the number of topics

I would like to get all Transfer events for a specific interval of blocks. When I call GetAllChanges with the following parameters, I get this error message: 'Number of indexes don't match the ...
Thorkil Værge's user avatar
0 votes
1 answer
612 views

Query Ethereum Blockchain for functions return value of a Specified Smart Contract

I want to get smart contract functions return value sent by a specified smart contract within a range of blocks. I found a [manual] working method to achieve this: async function getTxsByAccount(...
Yahya's user avatar
  • 328
2 votes
0 answers
112 views

Accessing the network through light node

I've been trying, unsuccessfully, to make a web3.py app that needs to catch events, with the use of filters. After hours and hours of testing it appeared the problem was that Infura, which is the ...
Gustaf Bergmark's user avatar
1 vote
1 answer
237 views

Using the same event name in different contracts

Suppose I have two different contracts, and I implement an event in each one of them. If I use the same event name in both contracts, will it make it more difficult (or even impossible) to filter the ...
goodvibration's user avatar
1 vote
1 answer
98 views

Filter topic across multiple contracts

Is there something I could add to my contract which allows my application to filter for all the deployed contracts which also included this topic/identifier? The only other option to manage this I ...
hermlon's user avatar
  • 11
1 vote
0 answers
466 views

How to fix TypeError: 'xxx' is not a function

I have a project is to listen event of one deployed contract. Now I' m using BNB for testing. Here is my code: var Web3 = require("web3"); var fs = require("fs"); web3 = new Web3(new Web3.providers....
Vincent Wang's user avatar
1 vote
0 answers
251 views

Filtering blocks on basis of transaction logs in web3j

I want to filter blocks on the basis of a log present inside transactions. How can I do that? I don't have any contract address and want to filter all the blocks generated by all the contracts. ...
Mr_Hmp's user avatar
  • 188
4 votes
1 answer
977 views

web3.py createFilter: filter => SyntaxError: positional argument follows keyword argument

Web3.py version 4.2.1 geth version: 1.8.0-unstable I have followed web3.py guide for filtering. Through the contract instance api: event_filter = mycontract.events.myEvent.createFilter(fromBlock='...
alper's user avatar
  • 8,298
3 votes
1 answer
886 views

Listing filters in geth. Do they timeout and expire?

Suppose I make a JSON-RPC call to create a new filter as follows (from the documention page): // Request curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"topics":["...
DaveIdito's user avatar
  • 884
3 votes
1 answer
7k views

Python 3 How to make Event Filter via createFilter web3.py v4.2.1

According to the Web3.py Documentation: http://web3py.readthedocs.io/en/latest/filters.html event_filter = contract.events.myEvent.createFilter(fromBlock='latest', {'filter': {'arg1':10}}) ...
Russo's user avatar
  • 1,762
0 votes
1 answer
491 views

Python How to make Filter topics: encode integers to its hex string representation

In the documentation: http://web3py.readthedocs.io/en/latest/filters.html Quote "Subsequent topic items are the hex encoded values for indexed event arguments. In the above example, the second item ...
Russo's user avatar
  • 1,762
1 vote
1 answer
215 views

How to find all tokens that implements a specific contract

I'm trying to filter all the Tokens that implement a specific contract for a specific public address. I'm using web3 / metamask app. I'm trying to do it on via var options = { .... //address: ".......
Ziba Leah's user avatar
  • 203
2 votes
1 answer
234 views

Is it possible Filter events with wildcards based on recorded indexed parameters

Let's say I have a contract that fire an event PersonCreated(uint personId, bytes32 indexed name) every time a person is created. To query for all the past events with name equal to Jason, we can ...
loka's user avatar
  • 23
2 votes
2 answers
3k views

How to get only latest log from my event?

I currently am using Oraclize in my contract and I make a call to a contract function from my front-end and don't want to continue onto the next call until the Oraclize function has returned. So I ...
savard's user avatar
  • 418
5 votes
1 answer
1k views

Cannot create filter on Infura via web3.py

I have an Infura account and I have the following code: ... web3 = Web3(HTTPProvider("https://ropsten.infura.io/mytoken") ) web3_pending_filter = web3.eth.filter('pending') ... when line ...
Rafael Bogaveev's user avatar
4 votes
1 answer
3k views

web3.eth.getFilterChanges(web3_filter.filter_id) throws 'filter not found'

I am listening ethereum network through local geth node. I connected to geth through web3.py. I started a job in python code that periodically gets new blocks from filter. Here is the code: def main()...
Rafael Bogaveev's user avatar
3 votes
0 answers
691 views

Web3.js filtering on allEvents

I'm struggling to figure out how to add a filter to allEvents requests. My current code: const contract = getState().web3Reducer.get('contract'); contract.getPastEvents('allEvents', { ...
Dave's user avatar
  • 159
2 votes
1 answer
1k views

Should I use Infura with Web3j for Event filter?

I'm using Web3j with Infura for smart contract deployment, calling contract method and transactions. Now I want to use Filter contract event from log. Should I use Infura for this? Is Web3j filter ...
Adnan Rahman's user avatar