Skip to content

Question: transact() vs build_transaction()/sign_transaction() #1566

Answered by cromewar
fulltimecrypto asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @fulltimecrypto
Nice question, the answer you got on stack exchange is actually correct, but let me go in deep in to it.
Using buildTransaction is more a step to step process, Patrick used this approach to teach how all the process to create and sign transaction works, including you have direct control of the private_key, which is a variable you can use on the code or as an environment variable.

The transact function requires the private key to be handled differently, most likely by the rpc client (metamask, ganache and so on).

At the end both ways end up using send_raw_transaction, but transact does it more automatically.

So yes, the only difference here is how the private key is m…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fulltimecrypto
Comment options

Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants