A python interface for interacting with the Ethereum blockchain and ecosystem.

Overview

Web3.py

Documentation Status Discord Build Status

A Python library for interacting with Ethereum, inspired by web3.js.

  • Python 3.6+ support

Quickstart

Get started in 5 minutes or take a tour of the library.

Documentation

For additional guides, examples, and APIs, see the documentation.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing, then check out issues that are labeled Good First Issue.


Questions on implementation or usage? Join the conversation on discord.

Comments
  • Python Modernization

    Python Modernization

    What was wrong?

    A lot of code cruft exists to support versions of Python before 3.5. It complicates the implementation, and requires more time to test.

    How can it be fixed?

    In v4, as part of dropping support for Python 2 and Python <=3.4, we can remove this cruft. Also, let's drop test environments for python 2.7 and 3.4, and add one for 3.6.

    • [x] Remove Python 2.7 and 3.4 tests #349
    • [x] Add Python 3.6 test environment
    • [x] Remove all sys.version_info checks, presuming Python 3.5+
    • [x] Remove all bytes == str checks, presuming Python 3.5+
    • [x] Remove the web3.utils.compat module, and replace all usages with native calls #251
    • [ ] Bonus: Convert logic, where appropriate, to use native methods in 3.5+ (like b'\xbe\xef'.hex(), etc.)
    opened by carver 47
  • Tuple ABI support

    Tuple ABI support

    What was wrong?

    Tuple types are not supported yet in Web3.py

    How can it be fixed?

    • Add tests for passing in & returning tuple values with contract functions
    • Figure out how to handle web3.utils.abi.is_encodable when elements of the tuple are handled as special cases, like what if the function accepts this tuple as an argument: (address, string, (bytes, bytes32)) and someone passes in ('myname.eth', b'already-encoded', ('0x0123', '0x4567'))

    One option to consider: write custom encoders for address, bytes*, and string, replacing the default ones. Then is_encodable would be replaced entirely with eth_abi.is_encodable

    opened by carver 45
  • Websocket provider

    Websocket provider

    What is wrong?

    Websocket have some nice benefits over HTTP based connections to a node.

    • web3.js v.1.0 deprecated HttpProvider in favor of WebsocketProvider
    • infura added public websocket endpoints
    • there is an excellent websockets library
    • websockets give 4-8x better performance compared to HTTP/IPC from my tests

    How it can be fixed.

    Whoever takes this on is going to be committing to dealing with figuring out some unknown unknowns. It's unclear at the time of writing this issue how much work adding this provider is going to require.

    The naive implementation plan is as follows:

    Implement a new class web3.providers.websocket.WebsocketProvider. This class should use the websockets library linked above to establish (or reuse an existing) websocket connection to send the JSON-RPC request and get the response.

    Definition of Done

    • Documentation on the constructor of WebsocketProvider alongside the other provider documentation.
    • Documentation on how to use the WebsocketProvider including a full working example of running the event loop in a small example app.
    • Provider level tests which test the basics of the provider connecting to a locally run websocket endpoint and sending/receiving basic requests/responses.
      • These should probably use pytest-asyncio
    Good For Bounty 
    opened by banteg 43
  • Optional compatibility with geth PoA dev chain, to fix: Error could not format value <long hex string> as field 'extraData'

    Optional compatibility with geth PoA dev chain, to fix: Error could not format value as field 'extraData'

    What's Wrong

    When using geth --dev, it uses a proof-of-authority chain for instant mining. Unfortunately, the mechanism for PoA is to add a bunch of bytes to extraData, which is not yellow-paper-compliant. We would like to have the default web3.py strictly reject non-compliant clients, but still enable people to use this popular development alternative.

    Proposed Solution

    Add a new middleware, called something like truncate_extra_data_middleware. It would trim the extraData field down to 32 bytes or fewer. Note that this would be best to go earlier in the middleware stack than the pythonic middleware, which raises the exception.

    To be complete:

    • [ ] A test showing that a long extradata does not raise an error, after adding the new middleware
    • [ ] A test showing that a long extradata does raise an error in the default configuration
    • [ ] A new middleware truncate_extra_data_middleware (probably constructed with a more general construct_truncate_result_middleware(whitelist_methods, field, truncate_to))
    • [ ] Add to the API for the middleware stack (probably). Either something like .bury(obj) which puts a new middleware to the bottom of the stack, or a more general .insert(pos, obj) which inserts middleware to an arbitrary location. Up for discussion.
    • [ ] Some basic documentation describing why and how to use the new middleware

    Original Issue

    Getting the following error message when trying to send a transaction via web3py:

    Error Could not format value '0xd783010800846765746887676f312e392e32856c696e7578000000000000000086ddf484c77c385bf8ec5c04427ccb3b2624efc39c966ae16858213df5f87ca453022c474a9346faec0be34f6ec2c16da2a987fd08670465c3b70bb361848a8a00' as field 'extraData'

    Here is the script im using

    https://gist.github.com/postables/8b634de55033c27a7d870aaeb5f02103

    opened by bonedaddy 41
  • API for re-sending transactions

    API for re-sending transactions

    What was wrong?

    There are a few legitimate use cases for wanting to re-submit a transaction that has already been sent with modified parameters.

    • Resending the same transaction with a higher gas price during times of network congestion.
    • Quickly overriding a transaction sent in error (also by using a higher gas price)
    • In a case where you know there is a signed transaction that was sent but never included in a block, ensuring that it will not be applied at some point in the future.

    How can it be fixed?

    Implement a new API web3.eth.overrideTransaction(txn_hash, txn_overrides)

    • txn_hash is the hash of the transaction you wish to override.
    • txn_overrides is a dictionary of transaction parameters which should be used in place of the existing transaction parameters.

    Behavior is as follows.

    • if no transaction can be found with the given hash an exception is thrown.
    • if the transaction has already been mined an exception is thrown.
    • The txn_overrides may contain any/all fields that are normally accepted as transaction params except nonce.
    • If gasPrice is included in the txn_overrides, it must be greater than the existing transaction gas price (TODO: should we allow a way to bypass this validation)
    • if gasPrice is not included in the txn_overrides we should ???? (TODO: how do we choose an appropriate gas price?).
    Feature 
    opened by pipermerriam 37
  • Flip the contract function calls

    Flip the contract function calls

    • Version: 4

    What was wrong?

    The order of calls (contract.call().doSomething()) could be more intuitive.

    How can it be fixed?

    Basic Approach

    web3.js seems to have a solid solution: contract.functions.method().call()

    Plus:

    • ..method().transact()
    • ..method().estimateGas()
    • etc

    This API can coexist alongside the old way of calling contract methods.

    API Naming

    functions is a little long, here are some other options:

    • contract.api.doSomething().call()
    • contract.public.doSomething().call()
    • contract.build.doSomething().call()
    • contract.make.doSomething().call()
    • contract.prep.doSomething().call()
    • contract.useabi.doSomething().call()
    • contract.go.doSomething().call()
    • contract.methods.doSomething().call() Added

    Also, think about how the name will sound when used with other execution options, like transact, estimateGas, and buildTransaction

    Requirements

    • [ ] add new API
    • [ ] document new API in docs/
    • [ ] add deprecation warning to old call/transact/etc methods
    • [ ] Bonus: Update ConciseContract to use the new Contract API under the hood (with no change to the external API)
    Good First Issue 
    opened by carver 37
  • Empty event log

    Empty event log

    • Version: 4.b13
    • Python: 3.6
    • OS: win
    • Geth
    • Rinkeby

    I have a simple contract that produces events. The events are registered on mist correctly. I can interact with the contract without problems but can't get the events. I am simply doing this:

    "RegisterCall" is the name of the event in the contract.

    event_filter = mycontract.events.RegisterCall.createFilter(fromBlock=1)
    event_filter.get_all_entries()
    >>>[]
    

    Any suggestion will be appreciated.

    opened by jfdelgad 35
  • [WIP] Middleware to sign transactions locally (continuation of #517)

    [WIP] Middleware to sign transactions locally (continuation of #517)

    What was wrong?

    See https://github.com/ethereum/web3.py/pull/517

    Finishing up work done in #517, by extending the tests and adding changes to conform to https://github.com/pipermerriam/ethereum-dev-tactical-manual.

    This is work in progress.

    Cute Animal Picture

    Cute animal picture

    opened by dylanjw 34
  • Invoke ambiguous contract functions

    Invoke ambiguous contract functions

    What was wrong?

    If a contract has multiple functions of the same name, and the arguments are ambiguous, say:

    contract AmbiguousDuo {
      function identity(uint256 input, bool uselessFlag) returns (uint256) {
        return input;
      }
      function identity(int256 input, bool uselessFlag) returns (int256) {
        return input;
      }
    

    It is currently impossible to call the identity function on that contract for positive numbers, because web3 cannot identify which one you want:

    contract.functions.identity(1).call()
    

    How can it be fixed?

    Add a way to unambiguously call a specific method (maybe by providing the function signature). Something like:

    identity_unsigned = contract.functions['identity(uint256,bool)']
    identity_unsigned(1, True).call()
    
    identity_signed = contract.functions['identity(int256,bool)']
    identity_signed(1, True).call()
    

    It should support all these options for identifying the function:

    • Full Signature: contract.functions['identity(int256,bool)']
    • Byte selector (first 4 bytes of the hash of the full signature), in the form of:
      • bytes -- contract.functions[b'\x8e\xab\x23\x03']
      • int (writable as a hex literal in python) -- contract.functions[0x8eab2303]
    opened by carver 32
  • eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes.  Only got 0 bytes

    eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes. Only got 0 bytes

    • Version: 3.8.1
    • Python: 3.5
    • OS: linux
    • Parity v1.7.0-unstable-b0e4c91-20170502/x86_64-linux-gnu/rustc1.17.0

    What was wrong?

    While trying to fix #181, I updated my toolchain and now I'm having problems interacting with my contract.

    Setting up web3 works fine

    # load contract ABI
    contractAbi = json.loads(open('../contracts/MeasPub.abi').read())
    measpub = web3.eth.contract(abi = contractAbi)
    f=open('MeasPub.address')
    measpub.address = f.read().strip()
    f.close()
    f=open('publisher.address') 
    publisher_addr = f.read().strip()
    f.close()
    
    web3.personal.unlockAccount(account = publisher_addr, passphrase='*******')
    

    but then I want to call a function

          N = measpub.call({'from':publisher_addr}).getSubscriberCount() 
    

    which fails with:

    Traceback (most recent call last):
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/web3/contract.py", line 767, in call_contract_function
        output_data = decode_abi(output_types, return_data)
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/eth_abi/abi.py", line 108, in decode_abi
        return decoder(stream)
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/eth_abi/decoding.py", line 102, in __call__
        return self.decode(stream)
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/eth_utils/functional.py", line 22, in inner
        return callback(fn(*args, **kwargs))
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/eth_abi/decoding.py", line 140, in decode
        yield decoder(stream)
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/eth_abi/decoding.py", line 102, in __call__
        return self.decode(stream)
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/eth_abi/decoding.py", line 165, in decode
        raw_data = cls.read_data_from_stream(stream)
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/eth_abi/decoding.py", line 247, in read_data_from_stream
        len(data),
    eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes.  Only got 0 bytes
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "publisher.py", line 96, in <module>
        main()
      File "publisher.py", line 62, in main
        N = measpub.call({'from':publisher_addr}).getSubscriberCount() 
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/eth_utils/string.py", line 85, in inner
        return force_obj_to_text(fn(*args, **kwargs))
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/web3/contract.py", line 779, in call_contract_function
        raise_from(BadFunctionCallOutput(msg), e)
      File "/home/ethadm/.virtualenvs/dapp/lib/python3.5/site-packages/web3/utils/exception_py3.py", line 2, in raise_from
        raise my_exception from other_exception
    web3.exceptions.BadFunctionCallOutput: Could not decode contract function call getSubscriberCount return data 0x for output_types ['uint256']
    

    And here's my contract, which I did successfully test with truffle/mocca//testRPC:

    pragma solidity ^0.4.6;
    contract MeasPub         
    {
    	address public publisher;
    	string public description;
    	uint public price_per_second; // [wei per second]
    
    
    	// dictionary that maps addresses to balances
    	// always be careful about overflow attacks with numbers
    	mapping (address => uint) private balances;
    
    	// dictionary that remebers the timestamp when the last measurement was published to that subscriber
    	mapping (address => uint) private last_publish_block;
    
    	// dictionary that provides an iterable list of subscribers
    	mapping (uint => address) private subscriber_index;
    	uint subscriber_count;
    
    	// dictionary for RSA public keys
    	mapping (address => string) private subscriber_pubkey;
    
    	event LogPublished(
    	address _subscriber,    // the subscriber
    	bytes _pwdenc,          // the encoded password needed for decryption of data stored in ipfs
    	bytes _ipfsaddr,        // the ipfs address where the encrypted measurement can be fetched by the subscriber
    	uint _cost		 // cost of single publishing item
    	);
    	
    	event LogDebug(
    	string _msg
    	);
    
    	// The constructor. It accepts a string input that describes the nature of this publishing.
    	function MeasPub() public
    	{
    		publisher = msg.sender;
    		price_per_second = 0; // Wei
    	}
    
    	// the publisher may change pricing anytime
    	function setPricePerSecond(uint _price) public
    	{
    		if (msg.sender == publisher)
    		price_per_second = _price;
    	}
    
    	function publish(address _subscriber, bytes _pwdenc, bytes _ipfsaddr) public returns (bool covered)
    	{
    		if (msg.sender == publisher)
    		{
    			uint cost;
    			cost = (now - last_publish_block[_subscriber]) * price_per_second;
    			if (balances[_subscriber] >= cost)
    			{
    				balances[_subscriber] -= cost;
    				// send money to publisher
    				if (!publisher.send(cost)) 
    				{
    					balances[_subscriber] += cost;	
    					return false;
    				}
    				last_publish_block[_subscriber] = now;
    				LogPublished(_subscriber, _pwdenc, _ipfsaddr, cost);
    				return true;
    			}
    			LogDebug("subscriber has insufficient funds");
    			return false;
    			
    		}
    		LogDebug("only publisher can publish");
    		return false;
    	}
    
    	function getSubscriberCount() public returns (uint count)
    	{
    		//if (msg.sender == publisher)
    		return subscriber_count;
    	}
    
    	function getSubscriber(uint _index) public returns (address _subscriber, string _pubkey)
    	{
    		if (msg.sender == publisher)
    		return (subscriber_index[_index],subscriber_pubkey[subscriber_index[_index]]);
    	}
    
    	function subscribe(string _pubkey) payable public returns (bool success) {
    		if (last_publish_block[msg.sender] == uint(0x0))
    		{
    			// subscriber is new to us
    			last_publish_block[msg.sender] = now;
    			subscriber_index[subscriber_count] = msg.sender;
    			subscriber_count += 1;
    		}
    		subscriber_pubkey[msg.sender] = _pubkey;
    		balances[msg.sender] += msg.value;
    		LogDebug("new subscription successful");
    		return true;
    	}
    	
    
    
    	/**********
    	Standard kill() function to recover funds
    	**********/
    	function kill()
    	{
    		if (msg.sender == publisher)
    		suicide(publisher);  // kills this contract and sends remaining funds back to creator
    	}
    
    }
    
    opened by brenzi 31
  • Bug: OverflowError: Python int too large to convert to C ssize_t

    Bug: OverflowError: Python int too large to convert to C ssize_t

    • Version: 5.8.0
    • Python: 3.7.6
    • OS: win
    • pip freeze output
    attrs==19.3.0
    base58==2.0.0
    certifi==2019.11.28
    cffi==1.13.2
    chardet==3.0.4
    Cython==0.29.14
    cytoolz==0.10.1
    eth-abi==2.1.0
    eth-account==0.4.0
    eth-hash==0.2.0
    eth-keyfile==0.5.1
    eth-keys==0.2.4
    eth-rlp==0.1.2
    eth-typing==2.2.1
    eth-utils==1.8.4
    gevent==1.4.0
    greenlet==0.4.15
    hexbytes==0.2.0
    idna==2.8
    importlib-metadata==1.5.0
    ipfshttpclient==0.4.12
    jsonschema==3.2.0
    lru-dict==1.1.6
    multiaddr==0.0.9
    mypy-extensions==0.4.3
    netaddr==0.7.19
    oauthlib==3.1.0
    parsimonious==0.8.1
    protobuf==3.11.2
    pycparser==2.19
    pycryptodome==3.9.4
    pypiwin32==223
    pyrsistent==0.15.7
    pywin32==227
    requests==2.22.0
    requests-oauthlib==1.3.0
    rlp==1.2.0
    six==1.13.0
    toolz==0.10.0
    typing-extensions==3.7.4.1
    uniswap-python==0.3.4
    urllib3==1.25.7
    varint==1.0.2
    web3==5.8.0
    websocket==0.2.1
    websocket-client==0.57.0
    websockets==8.1
    yappi==1.2.3
    zipp==2.1.0
    
    

    What was wrong?

    I get a overflow error when calling a specific view function which returns a int256[]; When i call te same function online using a site like https://justsmartcontracts.dev the function works fine

      File "C:/Users/*/PycharmProjects/UltraDex/View.py", line 27, in <module>
        ab = az.getreturn()
      File "C:/Users/*/PycharmProjects/UltraDex/View.py", line 21, in getreturn
        return viewinstance.functions.buysellmultiple(self.addresa,self.addresb,self.am,self.parts,self.flags).call()
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\web3\contract.py", line 959, in call
        **self.kwargs
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\web3\contract.py", line 1498, in call_contract_function
        output_data = web3.codec.decode_abi(output_types, return_data)
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\eth_abi\codec.py", line 181, in decode_abi
        return decoder(stream)
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\eth_abi\decoding.py", line 127, in __call__
        return self.decode(stream)
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\eth_utils\functional.py", line 45, in inner
        return callback(fn(*args, **kwargs))
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\eth_abi\decoding.py", line 173, in decode
        yield decoder(stream)
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\eth_abi\decoding.py", line 127, in __call__
        return self.decode(stream)
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\eth_abi\decoding.py", line 144, in decode
        stream.push_frame(start_pos)
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\eth_abi\decoding.py", line 95, in push_frame
        self.seek_in_frame(0)
      File "C:\Users\*\AppData\Local\Programs\Python\Python37\lib\site-packages\eth_abi\decoding.py", line 84, in seek_in_frame
        super().seek(self._total_offset + pos, *args, **kwargs)
    OverflowError: Python int too large to convert to C ssize_t
    
    

    I know this isn't enough information. If you tell me what else you need i will try to provide is as quickly as posible

    opened by zinootje 29
  • get_logs sporadically returns formatter conditions error

    get_logs sporadically returns formatter conditions error

    • Version: 5.31.3
    • Python: 3.10.6
    • OS: osx/linux

    I am connected to an Infura node.

    When I call w3.eth.get_logs({"fromBlock": x, "toBlock": y}) I very sporadically get this error. Calling the same get_logs call again with the same parameters resolves as expected. This is the error:

    ValueError: The provided value did not satisfy any of the formatter conditions File "run_radar.py", line 29, in main radar.start(scan_config) File "radar/radar.py", line 114, in start scan_output = _scan(scan_config, contracts) File "utils.py", line 20, in wrapper return cast(R, fn(*args, **kwargs)) File "newrelic/api/background_task.py", line 117, in wrapper return wrapped(*args, **kwargs) File "radar/radar.py", line 221, in _scan logs, start_block, end_block, is_caught_up = _get_logs( File "utils.py", line 20, in wrapper return cast(R, fn(*args, **kwargs)) File "newrelic/api/background_task.py", line 117, in wrapper return wrapped(*args, **kwargs) File "radar/radar.py", line 153, in _get_logs logs, adjusted_end_block = _get_logs_chunk( File "utils.py", line 20, in wrapper return cast(R, fn(*args, **kwargs)) File "newrelic/api/background_task.py", line 117, in wrapper return wrapped(*args, **kwargs) File "radar/radar.py", line 206, in _get_logs_chunk raise e File "radar/radar.py", line 178, in _get_logs_chunk return provider.get_logs(start_block, end_block), end_block File "radar/provider.py", line 20, in get_logs return w3.eth.get_logs( File "web3/module.py", line 57, in caller result = w3.manager.request_blocking(method_str, File "web3/manager.py", line 197, in request_blocking response = self._make_request(method, params) File "web3/manager.py", line 150, in _make_request return request_func(method, params) File "web3/middleware/formatting.py", line 94, in middleware response = make_request(method, params) File "web3/middleware/gas_price_strategy.py", line 90, in middleware return make_request(method, params) File "web3/middleware/formatting.py", line 94, in middleware response = make_request(method, params) File "web3/middleware/attrdict.py", line 33, in middleware response = make_request(method, params) File "web3/middleware/formatting.py", line 96, in middleware return _apply_response_formatters(method=method, response=response, **formatters) File "web3/middleware/formatting.py", line 51, in _apply_response_formatters return _format_response("result", result_formatters[method]) File "web3/middleware/formatting.py", line 47, in _format_response response, response_type, method_response_formatter(appropriate_response) File "cytoolz/functoolz.pyx", line 249, in cytoolz.functoolz.curry.call File "eth_utils/applicators.py", line 116, in apply_one_of_formatters raise ValueError(

    opened by dino-rodriguez 1
  • Option for turning off ```HTTPRequestRetry```

    Option for turning off ```HTTPRequestRetry```

    I would introduce an optional boolean parameter to turn off the HTTPRequestRetry middleware when creating a HTTPProvider. This would provide users with the possibility of implementing a custom retrial logic in their code.

    opened by chinefed 2
  • Importing web3 costs a lot of memory

    Importing web3 costs a lot of memory

    Hi! When I import some class from web3 lib I see that my script starting to use 25Mb. Is it possible to decrease this amount? Is it available light weighted version? Is it possible to import some class without importing all web3 module?

    opened by SerK0 0
  • Async name to address

    Async name to address

    What was wrong?

    closes #2583 closes #1990

    How was it fixed?

    • Import paco-inspired methods for async curry support and refactor code, removing deprecated asyncio.coroutine in place of async def + await usage.
    • Add similar tests as those within the paco library for the new async_curry method.
    • Add typing for the new methods introduced in web3._utils.async_functools.py
    • Begin async support for name_to_address_middleware

    Todo:

    • [ ] Add entry to the release notes
    • [ ] Add middleware tests and debug

    Cute Animal Picture

    Put a link to a cute animal picture inside the parenthesis-->

    opened by fselmo 0
  • ethPM example

    ethPM example "Unauthorized for url"

    • Version: 5.31.3
    • Python: 3.10.4
    • OS: Ubuntu 22.04
    `pip freeze` output
    aiohttp==3.8.3
    aiosignal==1.3.1
    asttokens==2.1.0
    async-timeout==4.0.2
    attrs==22.1.0
    backcall==0.2.0
    base58==2.1.1
    bitarray==2.6.0
    black==22.10.0
    certifi==2022.9.24
    charset-normalizer==2.1.1
    click==8.1.3
    cytoolz==0.12.0
    debugpy==1.6.3
    decorator==5.1.1
    entrypoints==0.4
    eth-abi==2.2.0
    eth-account==0.5.9
    eth-hash==0.5.1
    eth-keyfile==0.5.1
    eth-keys==0.3.4
    eth-rlp==0.2.1
    eth-tester==0.6.0b7
    eth-typing==2.3.0
    eth-utils==1.9.5
    executing==1.2.0
    frozenlist==1.3.3
    hexbytes==0.3.0
    idna==3.4
    ipfshttpclient==0.8.0a2
    ipykernel==6.17.1
    ipython==8.6.0
    jedi==0.18.2
    jsonschema==4.17.1
    jupyter_client==7.4.7
    jupyter_core==5.0.0
    lru-dict==1.1.8
    matplotlib-inline==0.1.6
    multiaddr==0.0.9
    multidict==6.0.2
    mypy-extensions==0.4.3
    nest-asyncio==1.5.6
    netaddr==0.8.0
    numpy==1.23.5
    packaging==21.3
    pandas==1.5.2
    parsimonious==0.8.1
    parso==0.8.3
    pathspec==0.10.2
    pexpect==4.8.0
    pickleshare==0.7.5
    platformdirs==2.5.4
    prompt-toolkit==3.0.33
    protobuf==3.19.5
    psutil==5.9.4
    ptyprocess==0.7.0
    pure-eval==0.2.2
    py-solc-x==1.1.1
    pycryptodome==3.15.0
    Pygments==2.13.0
    pyparsing==3.0.9
    pyrsistent==0.19.2
    python-dateutil==2.8.2
    pytz==2022.6
    pyzmq==24.0.1
    requests==2.28.1
    rlp==2.0.1
    semantic-version==2.10.0
    six==1.16.0
    stack-data==0.6.1
    tomli==2.0.1
    toolz==0.12.0
    tornado==6.2
    traitlets==5.5.0
    urllib3==1.26.13
    varint==1.0.2
    wcwidth==0.2.5
    web3==5.31.3
    websockets==10.4
    yarl==1.8.1
    

    What was wrong?

    I tried to recreate the ethPM example from the documentation:

    import os
    os.environ["WEB3_INFURA_PROJECT_ID"] = INFURA-KEY
    from web3.auto.infura import w3
    
    w3.enable_unstable_package_management_api()
    w3.pm.set_registry("ens.snakecharmers.eth")
    ens_package = w3.pm.get_package("ethregistrar", "3.0.0")
    
    I received the following error:
    ---------------------------------------------------------------------------
    HTTPError                                 Traceback (most recent call last)
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/http_requests.py:123, in ClientSync._do_raise_for_status(self, response)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/http_requests.py?line=121'>122</a> try:
    --> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/http_requests.py?line=122'>123</a> 	response.raise_for_status()
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/http_requests.py?line=123'>124</a> except requests.exceptions.HTTPError as error:  # type: ignore[attr-defined]
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/requests/models.py:1021, in Response.raise_for_status(self)
       <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/requests/models.py?line=1019'>1020</a> if http_error_msg:
    -> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/requests/models.py?line=1020'>1021</a>     raise HTTPError(http_error_msg, response=self)
    
    HTTPError: 401 Client Error: Unauthorized for url: https+ip4://ipfs.infura.io:5001/api/v0/version?stream-channels=true
    
    The above exception was the direct cause of the following exception:
    
    StatusError                               Traceback (most recent call last)
    /home/andras/Projects/Blockchain/scripts/web.py/web3.py-examples-ethPM.py in line 8
          <a href='file:///home/andras/Projects/Blockchain/scripts/web.py/web3.py-examples-ethPM.py?line=25'>26</a> w3.enable_unstable_package_management_api()
          <a href='file:///home/andras/Projects/Blockchain/scripts/web.py/web3.py-examples-ethPM.py?line=26'>27</a> w3.pm.set_registry("ens.snakecharmers.eth")
    ----> <a href='file:///home/andras/Projects/Blockchain/scripts/web.py/web3.py-examples-ethPM.py?line=27'>28</a> ens_package = w3.pm.get_package("ethregistrar", "3.0.0")
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py:537, in PM.get_package(self, package_name, version)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=534'>535</a> self._validate_set_registry()
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=535'>536</a> release_data = self.get_release_data(package_name, version)
    --> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=536'>537</a> return self.get_package_from_uri(URI(release_data.manifest_uri))
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py:342, in PM.get_package_from_uri(self, manifest_uri)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=331'>332</a> def get_package_from_uri(self, manifest_uri: URI) -> Package:
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=332'>333</a>     """
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=333'>334</a>     Returns a `Package <https://github.com/ethpm/py-ethpm/blob/master/ethpm/package.py>`__
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=334'>335</a>     instance built with the Manifest stored at the URI.
       (...)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=339'>340</a>         * ``uri``: Must be a valid content-addressed URI
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=340'>341</a>     """
    --> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/web3/pm.py?line=341'>342</a>     return Package.from_uri(manifest_uri, self.web3)
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py:238, in Package.from_uri(cls, uri, w3)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=220'>221</a> @classmethod
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=221'>222</a> def from_uri(cls, uri: URI, w3: "Web3") -> "Package":
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=222'>223</a>     """
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=223'>224</a>     Returns a Package object instantiated by a manifest located at a content-addressed URI.
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=224'>225</a>     A valid ``Web3`` instance is also required.
       (...)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=235'>236</a>        OwnedPackage = Package.from_uri('ipfs://QmbeVyFLSuEUxiXKwSsEjef7icpdTdA4kGG9BcrJXKNKUW', w3)  # noqa: E501
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=236'>237</a>     """
    --> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=237'>238</a>     contents = to_text(resolve_uri_contents(uri))
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=238'>239</a>     validate_raw_manifest_format(contents)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/package.py?line=239'>240</a>     manifest = json.loads(contents)
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/uri.py:50, in resolve_uri_contents(uri, fingerprint)
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/uri.py?line=48'>49</a> def resolve_uri_contents(uri: URI, fingerprint: bool = None) -> bytes:
    ---> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/uri.py?line=49'>50</a>     resolvable_backends = get_resolvable_backends_for_uri(uri)
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/uri.py?line=50'>51</a>     if resolvable_backends:
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/uri.py?line=51'>52</a>         for backend in resolvable_backends:
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/eth_utils/functional.py:45, in apply_to_return_value.<locals>.outer.<locals>.inner(*args, **kwargs)
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/eth_utils/functional.py?line=42'>43</a> @functools.wraps(fn)
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/eth_utils/functional.py?line=43'>44</a> def inner(*args, **kwargs) -> T:  # type: ignore
    ---> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/eth_utils/functional.py?line=44'>45</a>     return callback(fn(*args, **kwargs))
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py:63, in get_resolvable_backends_for_uri(uri)
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=56'>57</a> @to_tuple
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=57'>58</a> def get_resolvable_backends_for_uri(
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=58'>59</a>     uri: URI
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=59'>60</a> ) -> Generator[Type[BaseURIBackend], None, None]:
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=60'>61</a>     # special case the default IPFS backend to the first slot.
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=61'>62</a>     default_ipfs = get_ipfs_backend_class()
    ---> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=62'>63</a>     if default_ipfs in ALL_URI_BACKENDS and default_ipfs().can_resolve_uri(uri):
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=63'>64</a>         yield default_ipfs
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/_utils/backend.py?line=64'>65</a>     else:
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/backends/ipfs.py:78, in IPFSOverHTTPBackend.__init__(self)
         <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/backends/ipfs.py?line=76'>77</a> def __init__(self) -> None:
    ---> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ethpm/backends/ipfs.py?line=77'>78</a>     self.client = ipfshttpclient.connect(self.base_uri)
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py:124, in connect(addr, base, chunk_size, offline, session, auth, cookies, headers, timeout, username, password)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=115'>116</a> client = Client(
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=116'>117</a> 	addr, base,
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=117'>118</a> 	chunk_size=chunk_size, offline=offline, session=session,
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=118'>119</a> 	auth=auth, cookies=cookies, headers=headers, timeout=timeout,
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=119'>120</a> 	username=username, password=password,
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=120'>121</a> )
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=122'>123</a> # Query version number from daemon and validate it
    --> <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=123'>124</a> assert_version(client.apply_workarounds()["Version"])
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=125'>126</a> return client
    
    File ~/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py:233, in Client.apply_workarounds(self)
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=223'>224</a> def apply_workarounds(self):
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=224'>225</a> 	"""Query version information of the referenced daemon and enable any
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=225'>226</a> 	   workarounds known for the corresponding version
        <a href='file:///home/andras/.virtualenvs/blockchain-scripts/lib/python3.10/site-packages/ipfshttpclient/client/__init__.py?line=226'>227</a> 	
    ...
    
    StatusError: HTTPError: 401 Client Error: Unauthorized for url: https+ip4://ipfs.infura.io:5001/api/v0/version?stream-channels=true
    
    opened by nocibambi 0
  • Feature request: a new function in the ns module to return all associated ENS's with a given address

    Feature request: a new function in the ns module to return all associated ENS's with a given address

    I would like there to be a new function in the ns module to return all associated ENS's with a given address. Right now, the ns.name function only returns a single ENS but many wallets have multiple ENS's. I would be happy to give this a go. I wanted to see if others may be interested as well or if there may be some fundamental limitation/difficulty in implementing this that I am unaware of. Thanks!

    opened by cagostino 0
Releases(v3.11.1)
A QQ(Tencent) robot created by go-cqhttp & nonebot2

绘梨花(胶布)Bot|ErikaBot ✨ 基于NoneBot2的绘梨花多功能 Bot ,自用 ✨ 快速开始 参考go-cqhttp项目文档,配置好机器人的相关设置,以及反向ws客户端 参考nonebot2项目文档,添加必要的.env相关设置 安装本项目相关的依赖库(依赖清单) git clone本

10 Aug 09, 2022
A Wrapper for ScarletAPI

ScarletAPI A Wrapper for ScarletAPI still a work in progress Docs these are the

Amashi 0 Mar 24, 2022
Change Discord HypeSquad in few seconds!

a simple python script that change your hypesquad to what house you choose

Ho3ein 5 Nov 16, 2022
A simple, lightweight Discord bot running with only 512 MB memory on Heroku

Haruka This used to be a music bot, but people keep using it for NSFW content. Can't everyone be less horny? Bot commands See the built-in help comman

Haruka 4 Dec 26, 2022
Бот - Гуль для твоего телеграм аккаунта

Я - Гуль (бот), теперь работает в чатах Отблагодарить автора за проделанную работу можно здесь Помощь с установкой тут Установка на Андроид После уста

57 Nov 06, 2022
Telegram Bot to store Posts and Documents and it can Access by Special Links.

Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People..... 😇 . Features Fully cu

REX BOTZ 1 Dec 23, 2021
Drop-in Replacement of pychallonge

pychal Pychal is a drop-in replacement of pychallonge with some extra features and support for new Python versions. Pychal provides python bindings fo

ZED 29 Nov 28, 2022
A Telegram Bot to generate permanent Stream and Download links for any Telegram file

Telegram File To Stream Link This bot will give you permanent Stream and Download links for Telegram files Deploy the Bot Press the below button to de

Shadow 80 Dec 16, 2022
Reddit bot for r/khiphop

khiphop-bot Description This project is a collection of scripts that better the state of the r/khiphop subreddit, which represents Korean Hip-Hop and

1 Dec 21, 2021
Project for the discipline of Visual Data Analysis at EMAp FGV.

Analysis of the dissemination of fake news about COVID-19 on Twitter This project was the final work for the discipline of Visual Data Analysis of the

Giovani Valdrighi 2 Jan 17, 2022
Brute Force Attack On Facebook Accounts

Brute Force Attack On Facebook Accounts For Install: pkg install update && pkg upgrade -y pkg install python pip install requests pip install mechani

MK X Shaon 1 Oct 30, 2021
Repository for the Nexus Client software.

LinkScope Client Description This is the repository for the LinkScope Client Online Investigation software. LinkScope allows you to perform online inv

107 Dec 30, 2022
A simple google translator telegram bot version 2

Translator-Bot-V2 A simple google translator telegram bot version 2 Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License

Fayas Noushad 15 Oct 21, 2022
A Telegram bot for personal utilities

Aqua Aqua is a Telegram bot for personal utilities. Installation Prerequisites: Install Poetry for managing dependencies and fork/clone the repository

Guilherme Vasconcelos 2 Mar 30, 2022
Use Node JS Keywords In Python!!!

Use Node JS Keywords In Python!!!

Sancho Godinho 1 Oct 23, 2021
A Twitch bot to provide information from the WebNowPlayingCompanion extension

WebNowPlayingTwitch A Twitch bot made using TwitchIO which displays information obtained from the WebNowPlaying Compaion browser extension. Image is o

NiceAesth 1 Mar 21, 2022
Presentation and code files for the talk at PyCon Indonesia

pycon-indonesia Presentation and code files for the talk at PyCon Indonesia. Files used for the PyCon Indonesia presentation. [Directory Includes:] Be

Neeraj Pandey 2 Dec 04, 2021
A discord bot that send SMS spam!

bruh-bot send spam sms! send spam with email! it sends you spam via sms and Email using two tools, quack and impulse! if you have some problem contact

pai 32 Dec 25, 2022
Python wrapper for Xeno-canto API 2.0. Enables downloading bird data with one command line

Python wrapper for Xeno-canto API 2.0. Enables downloading bird data with one command line. Supports multithreading

_zza 9 Dec 10, 2022
Latest Open Source Code for Playing Music in Telegram Video Chat. Made with Pyrogram and Pytgcalls 💖

MusicPlayer_TG Latest Open Source Code for Playing Music in Telegram Video Chat. Made with Pyrogram and Pytgcalls 💖 Requirements 📝 FFmpeg NodeJS nod

Abhijith Sudhakaran 2 Feb 04, 2022