Python library to Etheroll smart contract
Project description
pyetheroll
Python library to Etheroll smart contract
Usage
Simply set bet size, chances and wallet settings before rolling:
from pyetheroll.etheroll import Etheroll
etheroll = Etheroll()
bet_size_ether = 0.1
bet_size_wei = int(bet_size_ether * 1e18)
chances = 50
wallet_path = 'wallet.json'
wallet_password = 'password'
transaction = etheroll.player_roll_dice(
bet_size_wei, chances, wallet_path, wallet_password)
It's also possible to set different contract address and chain ID:
from pyetheroll.constants import ChainID
from pyetheroll.etheroll import Etheroll
chain_id = ChainID.ROPSTEN
contract_address = '0xe12c6dEb59f37011d2D9FdeC77A6f1A8f3B8B1e8'
etheroll = Etheroll(chain_id, contract_address)
Find out more in docs/Examples.md.
API keys
Both Etherscan and Infura require API keys which are retrieved from the following environment variables:
ETHERSCAN_API_KEY
(consumed by pyetheroll directly)WEB3_INFURA_PROJECT_ID
(consumed by web3.py)
Install
pip install pyetheroll
pip install --process-dependency-links \
https://github.com/AndreMiras/pyetheroll/archive/develop.zip
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyetheroll-20200320.tar.gz
(10.3 kB
view details)
Built Distribution
File details
Details for the file pyetheroll-20200320.tar.gz
.
File metadata
- Download URL: pyetheroll-20200320.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2b77fd0a6afc24a9314859576d76c23f9db11f65549c6f1cd63f1a268426597 |
|
MD5 | 2e8d695bf2bf9150a002e259c40ee6b0 |
|
BLAKE2b-256 | 4e98ddb3b277c1131a0e3a77c246e765e2af40e3abce6b49edee769330c6f5b4 |
File details
Details for the file pyetheroll-20200320-py3-none-any.whl
.
File metadata
- Download URL: pyetheroll-20200320-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 989b9cfe2abf77bf3e6d915539baccde294193ad40aa75f3bd255402a077040a |
|
MD5 | c2217b054de3944ad09c7feac3798e06 |
|
BLAKE2b-256 | e67c441b48df7076b8860dde6c87086c4538ccc1ebeda8b5af0e4b32ecfa2e68 |