用于Etheroll智能合约的Python库
项目描述
pyetheroll
用于Etheroll智能合约的Python库
用法
在投掷之前,简单地设置投注大小、概率和钱包设置
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)
还可以设置不同的合约地址和链ID
from pyetheroll.constants import ChainID
from pyetheroll.etheroll import Etheroll
chain_id = ChainID.ROPSTEN
contract_address = '0xe12c6dEb59f37011d2D9FdeC77A6f1A8f3B8B1e8'
etheroll = Etheroll(chain_id, contract_address)
更多详情请参阅docs/Examples.md。
API密钥
Etherscan和Infura都要求API密钥,这些密钥可以从以下环境变量中检索
ETHERSCAN_API_KEY
(由pyetheroll直接消耗)WEB3_INFURA_PROJECT_ID
(由web3.py消耗)
安装
pip install pyetheroll
开发分支:
pip install --process-dependency-links \
https://github.com/AndreMiras/pyetheroll/archive/develop.zip
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码分发
pyetheroll-20200527.tar.gz (10.4 kB 查看哈希值)
构建分发
pyetheroll-20200527-py3-none-any.whl (12.4 kB 查看哈希值)
关闭
pyetheroll-20200527.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | af22bd99f6af81d86143a50c1b4ed984005ef8ea100a7851a65f810a975c835b |
|
MD5 | 70a7eb65063a67dc82003051b7657cbd |
|
BLAKE2b-256 | e18cee1a60f3bff3ec7d53c5e25191433fdc710f94126b7edf9fde8ec328914a |
关闭
pyetheroll-20200527-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6a785146361a4f1561827a64344c05a9999ac3092b181a4632babc945b2c9930 |
|
MD5 | cc17ca323bc7b9411bc6606eb1e9030c |
|
BLAKE2b-256 | 8fae39a01653065433baaefde0080c4013a1349f27c6a7e34fccd4596104dafd |