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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyetheroll-20200322.tar.gz
(10.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyetheroll-20200322.tar.gz.
File metadata
- Download URL: pyetheroll-20200322.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a999ec700ac18313d01a1bcfc4fc57f314dea882992d7f450f52a364d9193c9f
|
|
| MD5 |
13cecc529d0d431c9961abb56cbafa72
|
|
| BLAKE2b-256 |
bf240fe2096a144d8e711925242fbdf702cc8d267d117627a7bcf8a06fbded03
|
File details
Details for the file pyetheroll-20200322-py3-none-any.whl.
File metadata
- Download URL: pyetheroll-20200322-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c561b8a0dc254432f2ac080337ecc7d879fc340ee332d38554a2f3dddd4aa4b
|
|
| MD5 |
992756be64342061576e17beb4a0f0ad
|
|
| BLAKE2b-256 |
8a5dfea4d4356a3afbb5d7af6f5efc3979e14f91f787c174d4afe35102e822f4
|