Questions tagged [web3py]

Web3.py is a library for interacting with EVM based blockchains and smart contracts in Python.

For more information see Web3.py documentation.

Web3.py is maintained by Ethereum Foundation.

578 questions
2
votes
0 answers

How to filter ETH transactions by address with web3.py

Is there a way to filter transactions by address? I have tried to do that with matching address with transaction dict key-value pairs ('from', 'to') but it takes too long. Is there a way to do that faster? For example it takes more than 1hour to…
taga
  • 3,537
  • 13
  • 53
  • 119
2
votes
1 answer

How to get the amount of ETH smart contract with Python and Web3.py?

I have started using Web3.py for ETH transaction analysis. I have crawled more than 10000 blocks and most of my transactions look like this: {'blockHash': HexBytes('0x439f47a300d021223aeee060c0daabc03bedb250600890faeea7b27c0d30e0e4'), 'blockNumber':…
taga
  • 3,537
  • 13
  • 53
  • 119
2
votes
0 answers

Why "web3.exceptions.ContractLogicError: execution reverted: VM Exception while processing transaction: revert" this error happened?

I'm making private blockchain using truffle, ganache, solidity 0.8.0 , web3.py(python) I'm trying to upload file information on blockchain. file information is filehash, filename, filesize tec. But there's something…
2
votes
1 answer

How to continuously keep track of balance of a particular token in my wallet

I'm trying to create a bot which keeps a track of a particular token in my wallet. As soon as it detects the token, it should send the token to another address. I've written the code but i don't know why my while loop doesn't work. The code kind of…
2
votes
2 answers

How do i use proxy in web3py?

I'm currently using this method to connect to web3py infura_url = "https://node.node/asdasdasdasdasd/bsc/mainnet/archive/" # fast web3 = Web3(Web3.HTTPProvider(infura_url)) How do I enable proxy? say i have proxy at '321.123.121.123:8081'
user40780
  • 1,828
  • 7
  • 29
  • 50
2
votes
1 answer

Error installing web3 using pip. Could not find a version that satisfies the requirement ipfshttpclient==0.7.0

I had trouble installing web3 using pip. I run 'pip install web3' and get the below error ERROR: Could not find a version that satisfies the requirement ipfshttpclient==0.7.0 (from web3) (from versions: 0.4.10, 0.4.11, 0.4.12, 0.4.13, 0.4.13.1,…
Sanguis
  • 113
  • 7
2
votes
0 answers

Transaction reverted when calling swapExactTokensForTokens function, web3py, Python

I'm trying to perform swap via Pancakeswap router contract. Here is my code: def swapTokens(): amountIn = (w3.toWei(0.00001,'ether')) amount1 = contractR.functions.getAmountsOut(amountIn, path).call() amountOutMin = int(amount1[1] *0.9)…
2
votes
1 answer

Why is my transaction not being found when running it through web3.py?

This is my first time trying anything with web3 and my transaction isn't sending I have checked the documentation and everything seems to be correct so i don't know why it isn't working.I have checked that I am connecting to my Ganache block chain…
2
votes
1 answer

execution reverted: SafeERC20: low-level call failed

I'm trying to get a flashloan using web3.py. I'm able to deploy the flashloan contract successfully but when I call the flashloan function it's giving me execution reverted: SafeERC20: low-level call failed' failed error. I have enough ether in my…
Rahulsinh
  • 41
  • 1
  • 6
2
votes
2 answers

Error when deploying a smart contract with w3.eth.contract(): "The method eth_sendTransaction is not supported"

I'm using Web3.py, and a permissioned Hyperledger Besu network. When trying to use w3.eth.contract(...) method to deploy a smart contract into the network, I get the following error: ValueError: {'code': -32604, 'message': 'The method…
2
votes
2 answers

Python Web3 connect to Ankr Binance Smart Chain API, through user and password

Maybe this is a dumb question but for web3.js there is the option to use another API service Ankr, instead of Infura. Ankr gives access to BSC network which has lower fees. I cannot seem to figure out how to connect to Ankr through python web3 as it…
Vic Rokx
  • 77
  • 1
  • 7
2
votes
0 answers

Can't connect to mainnet using web3.py and IPC provider

from web3 import Web3 web3 = Web3(Web3.IPCProvider()) print(web3.isConnected()) web3.eth.get_balance('some_adress') isConnected returns True but does not get my balance correctly(always returns 0). I'm using geth and also used the get attach…
2
votes
2 answers

Compute uniswap pair address via python

I`m trying to compute (off-line, i.e. without an http requests) address of an Uniswap pair, with python, web3 and eth-abi libraries, based on this solidity example. address factory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address token0 =…
freeearth
  • 91
  • 1
  • 10
2
votes
3 answers

How to get gas amount web3py?

I can get the gas price, but how do I even get the gas amount? I feel like this is something that is not covered properly in the docs. In order for me to send a transaction(contract call), I need to build it but when I build it I need to give it the…
randoTrack
  • 83
  • 1
  • 3
  • 6
2
votes
2 answers

ERROR installing web3[tester]: Failed building wheel for blake2b-py

I'm trying to install the web3 tester with pip install -U web3[tester] but always getting this error. Pip and setuptools are both on their current version. The complete error: Building wheels for collected packages: blake2b-py Building wheel for…