Metadata-Version: 2.1
Name: xchainpy-ethereum
Version: 0.2.1
Summary: Custom Ethereum client and utilities used by XChainPY clients
Home-page: https://github.com/xchainjs/xchainpy-lib/tree/main/xchainpy/xchainpy_ethereum
Author: THORChain
Author-email: 
License: MIT
Keywords: ETH,Ethereum,XChainpy_ethereum,THORChain,web3
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python
Description-Content-Type: text/markdown
Requires-Dist: web3 (>=5.16.0)
Requires-Dist: websockets (>=8.1)
Requires-Dist: xchainpy-client (>=0.1.3)
Requires-Dist: xchainpy-crypto (>=0.1.3)
Requires-Dist: faster-than-requests (>=20.10.19)

# `xchainpy/xchainpy_ethereum`

Ethereum Module for XChainPy Clients

## Install
Python 3.8-3.9 tested
```angular2html
python setup.py install
```
you might need to include nimble in your path to install faster-than-requests, 
```angular2html
export PATH=/home/[username]/.nimble/bin:$PATH
pip install faster-than-requests --isolated --disable-pip-version-check --no-cache-dir --no-binary :all:
```
## Modules

- `client` - Custom client for communicating with ethereum-lib

Following dependencies have to be installed into your project

```
faster-than-requests==20.10.19
web3==5.16.0
websockets==8.1
```

## Service Providers

This package uses ``Infura WSS API``, head to https://infura.io/ to get your own websocket token.
In addition, if you want to interact with ``non-ERC20 token``, head to https://etherscan.io/ to get your
etherscan token.

Initialize mainnet client:

``
client = Client(phrase="mnemonimic", network="wss://mainnet.infura.io/ws/v3/...", network_type="mainnet",
                             ether_api="...")
``

Initialize ropsten(testnet) client:

``
client = Client(phrase="mnemonimic", network="wss://ropsten.infura.io/ws/v3/...", network_type="ropsten",
                             ether_api="...")
``

You can generate mnemonic phrase using ``crypto.py``, head to ``test/test_ropsten_client.py`` to see a
more comprehensive way to using this client.
## Tests

These packages needed to run tests:

- pytest `pip install pytest`
- pytest-asyncio `pip install pytest-asyncio`

How to run test ?

```angular2html
cd test/
```
``Ropsten``
```bash
$ pytest test_ropsten_client.py
```
``Mainnet``
```bash
$ pytest test_mainnet_client.py
```




