34 eth_private_key: Optional[str],
35 eth_addr: Optional[str],
38 Send Ether from the local eth-addr to a destination address.
46 if eth_private_key_data
is None:
47 raise ClickException(
"hosted accounts are not supported")
49 print(f
"eth_addr = {eth_addr}")
50 print(f
"dest_addr = {dest_addr}")
51 print(f
"amount = {amount}")
57 "value": EtherValue(amount).wei,
58 "gasPrice": web3.eth.gasPrice,
59 "nonce": web3.eth.getTransactionCount(eth_addr)
61 send_tx_desc[
"gas"] = web3.eth.estimateGas(send_tx_desc)
63 signed_tx = web3.eth.account.signTransaction(
64 send_tx_desc, eth_private_key_data)
66 tx_hash = web3.eth.sendRawTransaction(signed_tx.rawTransaction)