2022 Developer Survey is open! Take survey.

Questions tagged [filters]

filter for the logs fired by contract's events

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

Filter Ethereum events by number range

Is it possible, using web3 or ethers to filter events by a number range, e.g. indexing the amount in an event and then filter events with amount > a number.
user avatar
  • 189
0 votes
0 answers
19 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 ...
user avatar
0 votes
1 answer
105 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?...
user avatar
0 votes
0 answers
48 views

Monitoring events on Binance Smart Chain

With Web3py, I know how to get events from a smart contract. However, I don't know how to do the same for the native token for which we dont have a contract? I would like to be alerted as soon as I ...
user avatar
0 votes
1 answer
195 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('...
user avatar
  • 1
1 vote
1 answer
279 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 ...
user avatar
  • 145
2 votes
1 answer
261 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....
user avatar
0 votes
0 answers
543 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 ...
user avatar
  • 111
0 votes
0 answers
118 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 ...
user avatar
  • 101
0 votes
0 answers
117 views

getPastEvents OR filter across two parameters

Web3 allows one to filter events by indexed parameters (see here). For example: {filter: {myNumber: [12,13]}} would pull only events where “myNumber” is 12 or 13. Is it possible to filter across two ...
user avatar
0 votes
1 answer
60 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 ...
user avatar
0 votes
1 answer
86 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?
user avatar
  • 1,243
0 votes
0 answers
181 views

How can I stream pending transactions (ideally including transaction details) of a specific contract with web3.py?

This link seems to answer a very similar question, but it is for web3.js and doesn't return transaction details: How to get a pending filter only for a contract Thanks
user avatar
3 votes
1 answer
3k 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 ...
user avatar
  • 31
0 votes
1 answer
972 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/...
user avatar
  • 11
0 votes
1 answer
664 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 ...
user avatar
  • 131
2 votes
0 answers
268 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 ...
user avatar
  • 21
1 vote
2 answers
1k 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: ...
user avatar
  • 760
1 vote
1 answer
439 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 ...
user avatar
  • 760
0 votes
1 answer
1k 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): ...
user avatar
  • 760
0 votes
0 answers
42 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 ...
user avatar
  • 760
0 votes
1 answer
646 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 ...
user avatar
1 vote
0 answers
236 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 ...
user avatar
  • 41
0 votes
2 answers
3k 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( "...
user avatar
  • 337
0 votes
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 ...
user avatar
2 votes
1 answer
373 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 ...
user avatar
0 votes
1 answer
551 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(...
user avatar
  • 318
2 votes
0 answers
94 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 ...
user avatar
1 vote
1 answer
161 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 ...
user avatar
1 vote
1 answer
77 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 ...
user avatar
  • 11
1 vote
0 answers
330 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....
user avatar
1 vote
0 answers
211 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. ...
user avatar
  • 188
4 votes
1 answer
685 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='...
user avatar
  • 7,599
3 votes
1 answer
642 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":["...
user avatar
  • 844
3 votes
1 answer
5k 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 Quote "event_filter = contract.events.myEvent.createFilter(fromBlock='latest', {'filter': {'arg1':10}})" ...
user avatar
  • 1,330
0 votes
1 answer
310 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 ...
user avatar
  • 1,330
1 vote
1 answer
188 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: ".......
user avatar
  • 183
2 votes
1 answer
178 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 ...
user avatar
  • 23
2 votes
2 answers
2k 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 ...
user avatar
  • 378
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 ...
user avatar
4 votes
1 answer
2k 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()...
user avatar
2 votes
0 answers
648 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', { ...
user avatar
  • 149
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 ...
user avatar
1 vote
0 answers
225 views

Why do null topics affect the output of filter logs in geth?

I'm connected to a private chain with geth and this is the output I get when trying to retreive logs (first topic is function signature): > eth.filter({'fromBlock': 0, 'toBlock': 'latest', address:...
user avatar
4 votes
2 answers
1k views

Web3 Event Filtering timeout

This is the code I use to get all events from a certain contract. Solidity: event NewEvent(address indexed contractAddress, address newBOPAddress, address payer, uint commitThreshold, bool ...
user avatar
  • 51
0 votes
2 answers
263 views

filter: logs.blockNumber = undefined

I have the following code: var filter = web3.eth.filter({ fromBlock:4076955, toBlock:"latest", address:"0x0123456789012345678901234567890123456789" }); filter.get(function(error,logs){ ...
user avatar
  • 855
1 vote
1 answer
3k views

Mistake when using web3.eth.filter() and filter.get()

I went to the website https://etherscan.io/txs?block=4067373 and with that information choose the following address (third in line) to test on: 0x25f000254108a104A7127B5a5697cb3C12643e62 And the ...
user avatar
  • 855
6 votes
1 answer
3k views

Understanding web3.eth.filter parameters

I have been looking through that web3.eth.filter function, and ran into a bit of a wall: var options = { fromBlock: "pending", toBlock: "latest", address: "...
user avatar
  • 855
1 vote
1 answer
10k views

Using web3.eth.filter

The following link describes some of how the function web3.eth.filter(...) works: https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethfilter What I would like to do is get a list of the ...
user avatar
  • 855
2 votes
1 answer
696 views

Events in failed transactions

Can anybody say for sure, if the events that occur in failed transactions (i.e. before "throw") will not be logged?
user avatar