There are three different ways to sign and send transactions:
w3.eth.sendTransaction, sign_and_send_middleware. It would be nice to detail the steps to use each one and list reasons for using it over the others
don't think I know when best to use each yet, but will take a stab at this.
This is by no means exhaustive but it should be an adequate starting point. I suspect there is a visualization that could make the data below easier to ingest and understand. Maybe something as simple as a table showing the various methods and their strengths/weaknesses
send_and_sign_middlewarew3.eth.sendTransaction(...)
contract.functions.myFunction().transact(...)
w3.eth.sendTransactionw3.eth.sendRawTransactionSpitballed a couple ideas (including a table view), but as a user, I think I most want to know when to reach for each. Looking for some clarity on the middleware, though. Current idea is to add something like this to the Examples page:
Making transactions
-------------------
There are a few options for making transactions, each with trade-offs.
1. ``w3.eth.sendTransaction``(docs link)
Use this method when:
- you want to send Ether from one account to another.
2. ``w3.eth.sendRawTransaction``(docs link)
Use this method when:
- you want to sign the transaction elsewhere, e.g., a hardware wallet.
- you want to broadcast a transaction through another provider, e.g., Infura.
- you have some other advanced use case that requires more flexibility.
3. ``send_and_sign_middleware``(docs link)
Use this method when:
- TODO
- <how often do you manually interact with this middleware?>
- <it gets applied to sendTransaction and contract method executions?>
I anticipate adding a note on each method about whether keys must be located locally or not.
Most helpful comment
This is by no means exhaustive but it should be an adequate starting point. I suspect there is a visualization that could make the data below easier to ingest and understand. Maybe something as simple as a table showing the various methods and their strengths/weaknesses
send_and_sign_middlewarew3.eth.sendTransactionw3.eth.sendRawTransaction