Questions tagged [python]

Python is a dynamic and strongly typed programming language designed to emphasize usability.

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

Python web3 UnicodeDecodeError getTransaction and get_code

I am trying to get a transaction from a transaction hashing using web3 in python web3_tx = web3.eth.getTransaction(hash) This produces can error UnicodeDecodeError: 'utf-8' codec can't decode byte ...
0
votes
0answers
12 views

Usable library for tokenizing crypto pairs (js, python?)

I am wondering if anyone knows of an existing (usable if not perfect) library that will help with the following common task: I sometimes get trading pairs described as a lumped-together string like ...
0
votes
0answers
632 views

How can I get pending transactions from Eth mempool using websockets RPC?

I am using Rivet WebSockets RPC call with web3.py to get pending transactions in Ethereum mempool. https://rivet.cloud/docs/topics/api/ws.html#newpendingtransactions This is the code I have used so ...
0
votes
0answers
196 views

error install eth-brownie by pipx because command returned non-zero exit status 1

I'm having problem on installing brownie for python. I've install latest python 3.9.6 and also install pipx. Any suggestion to solve this?thanks PS C:\Users\dohva\Documents\Github Repo\cointoken> ...
0
votes
0answers
42 views

Decode call data if i know the signature

If i have the call data of the internal transaction, for example: { "action": { "callType": "call", "from": "...
0
votes
1answer
133 views

Contract Event Filter returning empty array when using get_all_entries Web3.py

Python Version: 3.9.6 Web3.py Version: 5.21.0 Used Geth and Infura (HTTPS and Web Sockets) Tested on Ethereum Mainnet and Kovan I have tried this before about a month ago with the exact same code and ...
0
votes
1answer
2k views

Web3 Python token sell pancakeswap

I am trying to sell my tokens via python web3. But sometimes I get an error "execution reverted: Pancake: K". I researched this error and it has to do with the slippage but pancake swap docs ...
0
votes
1answer
173 views

Is there a way to poll totalSupply of an ERC20 token on a specific Block?

I am using web3.py, and i am trying to get block-specific data of some ERC20 token contracts. Also, i tried with Google's BigQuery, but both seem to give the totalSupply at the 'latest' block. Is ...
0
votes
0answers
374 views

brownie.exceptions.RPCRequestError when calling a function from contract using Brownie

Encountering the following issues calling a contract w/ Brownie v1.14.6 on mainnet-fork w/ infura. Note that pool_lens = interface.FusePoolLens("0x8dA38681826f4ABBe089643D2B3fE4C6e4730493"). ...
0
votes
1answer
222 views

How to get a token pair's entire uniswap trade history?

I'm trying to query the entire transaction history of a given pair (e.g. WETH/USDT). Hence, this question is similar to How to get a token pair's uniswap trade history? My approach is to use the ...
0
votes
1answer
156 views

Where can I find the polygon.curve.fi interfaces for solidity?

I am trying to interact with the aave curve pool. I have the interface for the curve polygon pools, but they are written in vyper not solidity. https://github.com/curvefi/curve-contract-polygon/blob/...
0
votes
0answers
44 views

How do I store an integer in solidity smart contract function using python

I am wanting to store a value in the smart contract function store with python. Box.sol contract Box { uint256 private _value; // Emitted when the stored value changes event ValueChanged(uint256 ...
0
votes
0answers
130 views

How to get ERC20 Token Transaction of a specific contract using Web3py

I'm using web3py and I want to get the transaction history of a specific contract. Here's my code sample eventSignatureHash = web3.keccak(text='Transfer(address,uint256)').hex() filter = web3.eth....
0
votes
0answers
23 views

Stream BSCscan API?

I'm using API of BSCscan to get some info about a coin. There is a way to get a "stream" of data from BSCscan ? to get some info faster. Because my main problem right now is i do one call, ...
0
votes
1answer
1k views

How to get a pending transaction? I am using python with web3py

I am using the URL "https://mainnet.infura.io/v3/key". But I can't get a pending transaction. This is my code. pendingTransaction = web3.eth.filter('pending') I had an error like this. The ...
0
votes
0answers
1k views

Pancakeswap Error when trying to swap token to BNB using Web3.js and Python

I have written a Swap in python using web3.js. I can't seem to get it to work when I try to buy BNB for tokens. The transaction is created, but the Pancakeswap router gives me the following error: ...
0
votes
0answers
28 views

GraphQL retrieves incorrect values reserveUSD, token0Price and token1Price

I am using the Uniswap API on graphQL to try to receive the reserve data for every token pair on Uniswap. Following the directions on their website am able to generate a list of all the correct pair ...
0
votes
2answers
30 views

How smart contract can PULL data from the outer world?

Sorry in advance if I do not make sense as I am a traditional developer now entering in Solidity/Smart Contract world. For learning purposes, I want to build a simple online commerce system where ...
0
votes
1answer
663 views

ModuleNotFoundError: No module named 'brownie._cli'

After installing python3, ganache-cli, upgrading pip to pipx and installing eth-brownie.. I am receiving errors when trying to use "brownie". I followed all of the steps in their docs ...
0
votes
1answer
290 views

when sending a str, it must be a hex string. Got: "'MY _PUBLIC _KEY'"

web3s.py from web3 import Web3 import json url = 'https://kovan.infura.io/v3/NODE' web3 = Web3(Web3.HTTPProvider(url)) abi = json.loads('[{"ABI"}]') Raw_ADDRESS = MY_ADDRESS address = ...
0
votes
1answer
1k views

How to use Web3.WebsocketProvider for continuously receiving the last block from own Node in Python

I use python 3.7 and own Node. So i want to receiving every last block from own Node immediately after it was mined. from web3 import Web3 WEB3_WS_URI = 'ws://node_url:8546' w3 = Web3(Web3....
0
votes
0answers
19 views

Cannot import 'VRFConsumer', 'PriceFeed', 'APIConsumer', and 'interface'

I'm new to brownie ( but not new to python) and am trying to get a basic project running to make sure everything works. I've been going off the Patrick Collins tutorial where uses the chainlink mix. ...
0
votes
1answer
3k views

PancakeSwap Execution Reverted

I've been tring to code a bot to run on pancakeSwap and for some reason, all the transactions I try with this script keep getting reverted. API_URL = 'https://data-seed-prebsc-1-s1.binance.org:8545/' #...
0
votes
0answers
111 views

Re-create raw transaction hash from transaction object

Is there a way to re-create the signed transaction hash from tx object. I found the How to construct a raw Ethereum transaction from transaction data answer helpful, but when I try to re-create the ...
0
votes
0answers
63 views

Blockchain. Using sub-wallets through the main wallet without any restrictions or commissions

What I mean: Alleged example: I have a wallet "A". This is the main wallet. I want to creat 5 sub-wallets (in real case it will be more than 10.000 sub-wallets) from the main wallet - "...
0
votes
0answers
153 views

How do I sign with web3.py?

Can I have some clarification on what is the first argument of web3.eth.sign. it says here that the first argument is a account-- What is an account? Is it my ethereum address or a private key. it ...
0
votes
0answers
66 views

Can you use Ganache to test create wallet using web3py?

I am using the web3.py library using the web3.eth.account.create () to create my own wallets, my question is if there is any way to use the Ganache services as Provider to be able to perform tests ...
0
votes
0answers
130 views

How to parse trace output using ABI & web3?

I am pulling a trace from a Parity node using the JSONRPC API. It looks like this: print(trace) { 'action': { 'callType': 'staticcall', 'from': '0xXXXXXXXXXXXXXXXXXXXXXXXXXXXX', ...
0
votes
0answers
80 views

Is Web3 on Python hosted on a Raspberry Pi possible?

I've created a Discord bot that allows users to calculate their net worth including altcoins and LP tokens, which I want to use web3 to determine the value of. I did the standard pip install web3 on ...
0
votes
0answers
32 views

Ethereum Input Data Decoding

I Have the following input: ...
0
votes
0answers
92 views

AttributeError: Module 'Users' Has No Method 'Main'

In Brownie I'm running a script which sends me this error "AttributeError: Module 'Users' Has No Method 'Main'. Do you have any suggestions on how I can fix this? import os from brownie import ...
0
votes
0answers
63 views

Why would Web3 return an empty array after calling the solidity function

So I want to interact with my Smart Contract from remix with python library called Web3. The problem is when I try to call the function from the smart contract it runs successfully but it only returns ...
0
votes
1answer
60 views

How to use smtp protocol in solidity smart contract via chainlink Oracle

i had developed a external adapter that make a http get request to cryptocompare api and get latest eth-usd price for me. from bridge import Bridge class Adapter: base_url = 'https://min-api....
0
votes
0answers
20 views

Event data has insufficient length | What does this mean?

I've seen this warning from time to time when working with Brownie Event data has insufficient length This is after I made a call to a Chainlink node, calling a function like: function requestUsers()...
0
votes
0answers
24 views

Geth python node no transactions / no data

I want to get transaction information on the blockchain ethereum using Go Ethereum (GETH) with web3 and python. I am running eth node on windows using the following command : geth --http --syncmode ...
0
votes
0answers
116 views

Get ALL Token transfers from Block using Web3.py

I am looking for a way to get all token transfers from the block using web3.py. I can now get the simple transfer or transferFrom data which was sent directly to token contract. But how can I parse a ...
0
votes
0answers
27 views

my python event listener create duplicates in case of multiple event in one transaction

I have an issue to manage with my listener in python, here is my code : def handle_event(event, log_index): receipt = w3.eth.waitForTransactionReceipt(event['transactionHash']) ...
0
votes
0answers
173 views

get "event name" using web3

I want to build a listener in python using web3 as usual. The issue is that I have a lot of event on my contract (let say 30), and depending the event I have an action to do. Here is my code, and I'll ...
0
votes
0answers
144 views

Programmatically convert log data (hexadecimal) into negative decimal value

I'm having some trouble converting negative numbers in the log data of an Ethereum transaction. In this transaction, log index 192, topic 3 is listed as "...
0
votes
0answers
654 views

Python Web3 Contract Filtering

I am trying to filter out transactions from BSC and read their input data (specifically borrows from venus), however I am having trouble getting my event filter to work properly. I have already tried ...
0
votes
0answers
9 views

How do I pass a dictionary for the in3_registry value for the Incubed Python API?

I am using Python 3. I have installed the in3 (Incubed) Python module. I want to invoke the ClientConfig of the in3 Python API in a specific way. There is an in3_registry argument that is part of ...
0
votes
0answers
507 views

Python Web3 get all events

I am using web3 5.14.0 and Infura I am trying to get all transfer event for link chain token like the following: from web3 import Web3 ABI_REQUEST_ENDPOINT = 'https://api.etherscan.io/api?module=...
0
votes
0answers
35 views

A python module equivalent to Nethereum codegen

Does anyone know a Python module that can help me convert an ABI for a contract to a python class automatically. Nethereum has Codegen for C#, is there anything like that for python ?
0
votes
0answers
38 views

Quorum: Sending Private Transaction With Python

I am trying to experiment with GoQuorum and Python. I have read the documentation about how privateTransactions work and I am trying to perform one. Since Python's web3py does not support the ...
0
votes
0answers
2k views

requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7545): Max retries exceeded with url

I created a blockchain app using Ethereum, I downloaded a virtual box. I activated the smart contract on the virtual box and connected it to the Python file on the original device. When the ...
0
votes
0answers
197 views

gas_estimate returning error for too man arguments

running Web3 5.13; python 3.9; Mac 10.15.7 Trying to run test on solidity contract based on the example provided in teh Web3.py docs. When running this I receive an error stating TypeError: ...
0
votes
0answers
1k views

Pass ADDRESS(string) as argument to contract function using web3.py

I've been stuck on this isseu for more then 24 hrs now. I have the following function in my solidity contract: function getBalance(address _addr) public view returns(uint256){ return userBalance[...
0
votes
3answers
904 views

Let's say I forgot first 2 words of the seed, how could I find an account with ether in it?

Let's say I forgot first 2 words of the seed. I want to write a program that brute-forces all possible bip-39 word combinations for the first 2 words, generate private/public keys, addresses, and go ...
0
votes
1answer
40 views

Invisible transaction

I work in a Ropsten testnet. I have a Python application that sends a transaction and returns the transaction's txHash. It is possible to send a maximum of 500 transactions in one request. The ...
0
votes
1answer
79 views

Issues with using/installing python solidity parser

I am trying to install and use python solidity parser by ConsenSys I keep on getting the following error File "<stdin>", line 1, in <module> File "/home/seed/.local/lib/python3.5/site-...

1
5 6 7
8
9