我对以太太陌生了。使用皮夹,在我的项目中,我在当地制作了电子钱包。Infura被用作我的提供者。
https://mainnet.infura.io/MYTOKEN因此,我可以使用web3.py获得钱包生成的地址余额。我想把以太寄给某个收件人(地址)。但我不能做交易,也找不到这方面的文件。帮帮我。
编辑添加问题,什么是默认的汽油价格?如何确定汽油价格和气量?谢谢。
发布于 2018-06-01 09:02:49
这在web3py文档中有描述。
一旦设置了提供程序并实例化了web3,就可以这样做:
signed_txn = w3.eth.account.signTransaction(dict(
nonce=w3.eth.getTransactionCount('yourAddress'),
gasPrice = w3.eth.gasPrice,
gas = 100000,
to='recipientAddress',
value=web3.toWei(12345,'ether')
),
'yourprivatekey')
w3.eth.sendRawTransaction(signed_txn.rawTransaction)它将给出事务的散列。如果你有你的密钥文件,但你不知道你的私钥,你可以使用这个工具包含在web3py中获得它
with open('path to your keyfile') as keyfile:
encrypted_key = keyfile.read()
private_key = w3.eth.account.decrypt(encrypted_key, 'thepasswordforyour_keyfile')希望这能有所帮助。
https://ethereum.stackexchange.com/questions/50159
复制相似问题